! File system directory formats .....

! Directory header format
%recordformat header fm    (%integer      owner,
                            %integer      password,
                            (%short       perms %c
                             %or %short   files),
                            %short        quota left,
                            %short        spare,
                            %short        directory size)
%constinteger header size = 16

! File header format
%recordformat entry fm     (%integer      name1,
                                          name2,
                            (%short       perms %c
                             %or %short   bytes),
                            (%short       status %c
                             %or %short   time),
                            %short        date,
                            %short        extents)
%constinteger entry size  = 16

! Extent header format
%recordformat extent fm    (%short     start,
                            %short     size)
%constinteger extent size = 4

%constinteger directory size  = 2048 { Bytes }
%constinteger file limit      = (directory size - header size) // entry size
%constinteger extent limit    = (directory size - header size) // extent size

%recordformat directory fm (%record(header fm) header,
                            (%record(entry fm)%array file(1 : file limit) %c
                         %or %record(extent fm)%array extent(1 : extent limit)))


! Various masks

!                                  OO PP A L . ---size----
%constinteger files       mask = 2_00 00 0 0 0 0 1111 1111
%constinteger bytes       mask = 2_00 00 0 0 0 1 1111 1111
%constinteger permissions mask = 2_11 11 1 1 0 0 0000 0000 ! 16_FFFF0000
%constinteger FRA              = 2_11 10 1 0 0 0 0000 0000 ! 16_FFFF0000
                                                             {** FRIG **}
%constinteger time        mask = 2_0000 0 111 1111 1111

%constinteger transient file   = 16_8000 ! 16_FFFF0000       {** FRIG **}
%constinteger dud       file   = 16_4000

! Inter-filestore message formats

%recordformat message fm(%integer code, sequence,
                         ((%integer partition, %record(header fm) new user) %c
                      %or %record(entry fm) new file %c
                      %or (%integer block, bytes, %bytearray data(0 : 511))))
%constinteger message size = 512 + 8 + 8

! Requests

%constinteger create user = 1
%constinteger create file = 2
%constinteger write block = 3

! Miscellaneous

%constinteger hh = 16_0000FFFF;  ! Unsigned %short

%end %of %file
