! Interface routines to file systems.  File system redirection (optionally,
! not external redirection) is performed transparently to the caller.


%externalintegerspec F external redirect off
! Set to non-zero to inhibit external redirect processing

%externalintegerspec F old style handling
! Set to non-zero to enable "Directory", etc

%externalintegerspec F no explicit device
! Set to non-zero to inhibit explicit device-name stripping

%externalintegerspec F validate pathnames
! Set to non-zero to inhibit pathname component checking

%externalintegerspec F enable dot dot
! Set to non-zero to allow ".." in pathnames

! Flags, from FacMess.Inc

%constinteger read       file                mode = 16_0001
%constinteger modify     file                mode = 16_0002
%constinteger append  to file                mode = 16_0004

%constinteger create if                      flag = 16_0001
%constinteger create                         flag = 16_0002
%constinteger temporary                      flag = 16_0004
%constinteger unique name                    flag = 16_0008
%constinteger no inherit                     flag = 16_0010


! File access routines

%externalintegerfnspec F open file %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integer mode, compatible,
                               %integer partition, request flags,
                               %integername token, size, flags,
                               %string(*)%name textual response)
%externalroutinespec   L open file %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integer mode, compatible,
                               %integer partition, request flags,
                               %integername token, size, flags)

%externalintegerfnspec F close file %c
                              (%record(*)%name access,
                               %integer token, flags,
                               %string(*)%name textual response)
%externalroutinespec   L close file %c
                              (%record(*)%name access,
                               %integer token, flags)

%externalintegerfnspec F truncate file %c
                              (%record(*)%name access,
                               %integer token, bytes,
                               %string(*)%name textual response)
%externalroutinespec   L truncate file %c
                              (%record(*)%name access,
                               %integer token, bytes)

%externalintegerfnspec F read block %c
                              (%record(*)%name access,
                               %integer token, block,
                               %integername bytes,
                               %record(*)%name buffer,
                               %string(*)%name textual response)
%externalroutinespec   L read block %c
                              (%record(*)%name access,
                               %integer token, block,
                               %integername bytes,
                               %record(*)%name buffer)

%externalintegerfnspec F write block %c
                              (%record(*)%name access,
                               %integer token, block, bytes,
                               %record(*)%name buffer,
                               %string(*)%name textual response)
%externalroutinespec   L write block %c
                              (%record(*)%name access,
                               %integer token, block, bytes,
                               %record(*)%name buffer)


! Directory and file manipulation routines

%externalintegerfnspec F create directory P %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integer partition, flags,
                               %string(*)%name textual response)
%externalroutinespec   L create directory P %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integer partition)
%externalroutinespec   L create directory %c
                              (%record(*)%name access,
                               %string(255) filename)

%externalintegerfnspec F remove entry %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %string(*)%name textual response)
%externalroutinespec   L remove entry %c
                              (%record(*)%name access,
                               %string(255) filename)

%externalintegerfnspec F rename file %c
                              (%record(*)%name access,
                               %string(255) from, to,
                               %string(*)%name textual response)
%externalroutinespec   L rename file %c
                              (%record(*)%name access,
                               %string(255) from, to)

%externalintegerfnspec F initiate copy %c
                              (%record(*)%name access,
                               %string(255) from, to,
                               %integername copy token,
                               %string(*)%name textual response)
%externalintegerfnspec F complete copy %c
                              (%integer copy token,
                               %string(*)%name textual response)
%externalintegerfnspec F copy file %c
                              (%record(*)%name access,
                               %string(255) from, to,
                               %string(*)%name textual response)
%externalroutinespec   L copy file %c
                              (%record(*)%name access,
                               %string(255) from, to)

%externalintegerfnspec F delete file %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %string(*)%name textual response)
%externalroutinespec   L delete file %c
                              (%record(*)%name access,
                               %string(255) filename)

%externalintegerfnspec F insert textual translation %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %string(255) translation,
                               %integer type,
                               %string(*)%name textual response)
%externalroutinespec   L insert textual translation %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %string(255) translation,
                               %integer type)

%externalintegerfnspec F get header %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %record(*)%name header,
                               %string(*)%name textual response)
%externalroutinespec   L get header %c
                              (%record(*)%name access, %string(255) filename,
                               %record(*)%name header)

%externalintegerfnspec F short form attributes %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %string(*)%name information,
                               %string(*)%name textual response)
%externalroutinespec   L short form attributes %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %string(*)%name information)

%externalintegerfnspec F obtain attributes %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %record(*)%name attributes,
                               %string(*)%name textual response)
%externalroutinespec   L obtain attributes %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %record(*)%name attributes)

%externalintegerfnspec F modify attributes %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %record(*)%name attributes,
                               %string(*)%name textual response)
%externalroutinespec   L modify attributes %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %record(*)%name attributes)

%externalintegerfnspec F enquire nth directory entry %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integer which,
                               %string(*)%name information,
                               %string(*)%name textual response)

%externalintegerfnspec F translate path %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integername translation,
                               %string(*)%name textual response)
%externalroutinespec   L translate path %c
                              (%record(*)%name access,
                               %string(255) filename,
                               %integername translation)

! Miscellaneous stuff

%externalroutinespec   X logon %c
                              (%integer filestore, %string(255) user, pass)
%externalroutinespec   X logoff %c
                              (%integer filestore)

%end %of %file
