
// I/O Manifests

MANIFEST
$(
   scb.pos      = 0
   scb.end      = 1
   scb.id       = 2
   scb.fildes   = 3
   scb.buff     = 4
   scb.buffsize = 512 >> 2  // 512 byte buffer

   scb.upb      = scb.buff + scb.buffsize - 1

   id.inscb     = -1
   id.outscb    = -2

$<UNIX4
   FNDELAY      = #O0004
   FAPPEND      = #O0010
   FCREAT       = #O01000
   FTRUNC       = #O02000
   FEXCL        = #O04000

   o.rdonly     = #O000          // Open for reading
   o.wronly     = #O001          // Open for writing
   o.rdwr       = #O002          // Open for Read & Write
   o.ndelay     = FNDELAY        // non-blocking open
   o.append     = FAPPEND        // append on each write
   o.creat      = FCREAT         // open with file create
   o.trunc      = FTRUNC         // open with truncation
   o.excl       = FEXCL          // error on create if file exists
$>UNIX4

$<UNIX5
   o.rdonly     = #O000          // Open for reading
   o.wronly     = #O001          // Open for writing
   o.rdwr       = #O002          // Open for Read & Write
   o.ndelay     = #O004          // non-blocking open
   o.append     = #O010          // append on each write
   o.creat      = #O00400        // open with file create
   o.trunc      = #O01000        // open with truncation
   o.excl       = #O02000        // error on create if file exists
$>UNIX5

   o.findinput  = o.rdonly
   o.findoutput = o.wronly | o.creat | o.trunc | o.ndelay

   // UNIX return codes
   EPERM    =  1
   ENOENT   =  2
   ENXIO    =  6
   EBADF    =  9
   ENOMEM   = 12
   EACCESS  = 13
   EFAULT   = 14
   EBUSY    = 16
   EEXIST   = 17
   ENOTDIR  = 20
   EISDIR   = 21
   EINVAL   = 22
   EMFILE   = 24
   ETXTBSY  = 26
   EFBIG    = 27
   EROFS    = 30
   EPIPE    = 32

   // Other Return codes
   err.BadInStream  = 150
   err.BadOutStream = 151
   err.BadStream    = 152
   err.WriteFailed  = 153
$)

