!Revision history:

! 25-Jun-87 PSR Changed FCBfm field EXISTS into IsFile (currently unused)

%constinteger Ptr Off = 0,
              Lim Off = 0
!
! Buffer format
!
! BASE        start of the space allocated to the buffer
! SIZE        size  of the space allocated to the buffer
!
%record %format Buff Fm ( %integer Base, Size )

%const %integer Buff Base        = 0,
                Buff Size        = 4

%const %integer Max Handlers = 10

!
! Handler calling information
!
! BUFFER   HANDLER: CXP with pars (); R1 = SCB {must be preserved}
! BREAK    HANDLER: -- Special call
! CLOSE    HANDLER: CXP with pars ( SCB, Flag )
! RESET    HANDLER: CXP with pars ( SCB )
! POSITION HANDLER: CXP with pars ( SCB, Position )
! COMPLETE HANDLER: CXP with pars ( SCB )
!
%record %format SCB Fm (
{ 0}  %integer Next,                              {address of NEXT SYMBOL}
{ 4}           Limit,                             {next >= limit => none there}
{ 8}           Buffer   Handler,                  {special call}
{12}           Breaks,                            {chars less than this break}
{16}           Break    Handler,                  {special call}
{20}           Close    Handler,                  {(scb,cl/ab)}
{24}           Reset    Handler,                  {(scb)}
               Position Handler,                  {(scb,position)}
               Complete Handler,                  {(scb)}
               Ref Count,
    ( %integer User1 %or %integer Handle %or %record(*)%name Fab), {file handle if any}
    ( %integer User2 %or %integer Flags  %or %record(*)%name Rab), {32 flag bits, most unused...}
    ( %integer User3 ),
      %integer Position,                          {unused at present}
      %record(Buff Fm) ThisB,                     {buffer being used at present}
                       AllocB,                    {buffer allocated if any}
                       NameB ,                    {holds object name if given}
      %integername Pseudo Next)

!
! Flags for SCBs
!
%const %integer SCB Flag Abandoned      = 1<<0,   {at least one ABANDON call}
                SCB EOF Pending         = 1<<1    {another read will FAIL!!!}

!
! FileV -- Pascal file variable
!
%recordformatspec Filefm
!
! PFCB  -- Pascal File Control Block
!
%recordformat FCBfm(%integer              InLim,     {known by pass2 at  0}
                                         OutLim,     {known by pass2 at  4}
                                           Size,     {known by pass2 at  8}
                     %byte                  EOF,     {known by pass2 at 12}
                                           EOLN,     {known by pass2 at 13}
                                      Parameter,
                                           Mode,
                                           Text,
                                         IsFile,
                         %string(127) File Name,
                     %record(Filefm)%name FileV,
                      %record(SCBfm)  %name SCB,
                   %record(FCBfm)%name Next FCB)

%constrecord(FCBfm)%name FCBfmType == 0

%recordformat Filefm(%integer P, %record(FCBfm)%name PFCB)
