home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / pascal / finkxu < prev    next >
Encoding:
Text File  |  1988-08-11  |  4.3 KB  |  97 lines

  1. {MS-Pascal / MS-FORTRAN FCB Declaration Include File}
  2.  
  3. INTERFACE;  UNIT 
  4.   FILKQQ (FCBFQQ,
  5.       FILEMODES, SEQUENTIAL, TERMINAL, DIRECT,
  6.       fm_sequential, fm_terminal, fm_direct,
  7.       accessmodes,
  8.       am_read,
  9.       am_readwrite,
  10.       am_write,
  11.       am_default,
  12.       SHAREMODES,
  13.       sm_compat,
  14.       sm_denyrw,
  15.       sm_denywr,
  16.       sm_denyrd,
  17.       sm_denynone,
  18.       BUFFER_SIZE,
  19.       ADRFIELDS);
  20.  
  21. const
  22.    BUFFER_SIZE  = 512;
  23.    ADRFIELDS    = 2;                {* Two ADR fields in the FCB, see NEWUQQ. *}
  24.  
  25. TYPE
  26. FILEMODES = (SEQUENTIAL, TERMINAL, DIRECT);
  27. SHAREMODES = (sm_compat, sm_denyrw, sm_denywr, sm_denyrd, sm_denynone);
  28. accessmodes = (am_read, am_write, am_readwrite, am_default);
  29. FCBFQQ = RECORD     {byte offsets start every field comment}
  30. {fields accessible by Pascal user as <file variable>.<field>}
  31. TRAP: BOOLEAN;      {00 Pascal user trapping errors if true}
  32. ERRS: WRD(0)..18;   {01 error status, set only by all units}
  33. MODE: FILEMODES;    {02 user file mode;  not used in unit U}
  34. SHARE:SHAREMODES;   {03 pad to word bound, special user use}
  35. {fields shared by units F, V, U;  ERRC / ESTS are write-only}
  36. ERRC: WORD;         {04 error code, error exists if nonzero}
  37.             {1000..1099:  set for unit U errors}
  38.             {1100..1199:  set for unit F errors}
  39.             {1200..1299:  set for unit V errors}
  40. ESTS: WORD;         {06 error specific data usually from OS}
  41. CMOD: FILEMODES;    {08 system file mode;  copied from MODE}
  42. {fields set / used by units F and V, and read-only in unit U}
  43. TXTF: BOOLEAN;      {09 true: formatted / ASCII / TEXT file}
  44.             {false: not formatted / binary file}
  45. SIZE: WORD;         {10 record size set when file is opened}
  46.             {DIRECT: always fixed record length}
  47.             {others: max buffer variable length}
  48. IERF: BOOLEAN;      {12 Unit U Incomplete End Of Record    }
  49.             {Kluge. Set false by opnuqq and    }
  50.             {pccuqq, and true by peruqq. Thus  }
  51.             {if true in wefuqq, it means that  }
  52.             {there is an incomplete line, and  }
  53.             {pccuqq should be called to flush  }
  54.             {it. Only applies to terminal files}
  55. access: accessmodes;{13 Controls actual open mode          }
  56. OLDF: boolean;      {14 true :must exist before open; RESET}
  57.             {false :can create on open; REWRITE}
  58. INPT: BOOLEAN;      {15 true: user is now reading from file}
  59.             {false: user is now writing to file}
  60. RECL: WORD;         {16 DIRECT record number, lo order word}
  61. RECH: WORD;         {18 DIRECT record number, hi order word}
  62. USED: WORD;         {20 number bytes used in current record}
  63. {fields used internally by units F or V not needed by unit U}
  64. LINK: ADR OF FCBFQQ;{22 DS offset address of next open file}
  65. BADR: ADRMEM;       {24 F: DS offset address for buffer var}
  66. TMPF: BOOLEAN;      {26 F: is a temp file;  delete on CLOSE}
  67. FULL: BOOLEAN;      {27 F: buffer variable lazy eval status}
  68. UNFM: BOOLEAN;      {28 V: for unformatted binary file mode}
  69. OPEN: BOOLEAN;      {29 F: file opened (by RESET / REWRITE)}
  70. FUNT: INTEGER;      {30 V: FORTRAN unit number (1 to 32767)}
  71. ENDF: BOOLEAN;      {32 V: last I/O statement was a ENDFILE}
  72. {fields set / used by unit U, and read-only in units F and V}
  73. REDY: BOOLEAN;      {33 buffer ready if true;  set by F / U}
  74. BCNT: WORD;         {34 number of data bytes actually moved}
  75. EORF: BOOLEAN;      {36 true if end of record read, written}
  76. EOFF: BOOLEAN;      {37 end of file flag set after EOF read}
  77.      {unit U (operating system) information starts here}
  78. {**********************************************************}
  79.  
  80.     FILE_NAME       : ^STRING;      {* 38 points to file name *}
  81.     FDSCP           : INTEGER;      {* 42 actual ZEUS file number *}
  82.     PREDEFINED      : BOOLEAN;      {* 44 True if file is a device. *}
  83.     FNER            : BOOLEAN;      {* 45 True if File name error. *}
  84.     BEGIN_BUFFER    : INTEGER;      {* 46 Start loc of buffer. *}
  85.     END_BUFFER      : INTEGER;      {* 48 top loc of buffer. *}
  86.     IEOF            : BOOLEAN;      {* 50 Flag if EOF ever seen. For ^Zs. *}
  87.     BUFFER          : STRING(512);  {* 52 Internal buffering. *}
  88.     PADBUF          : STRING(65);   {*564 Make same size as MS-Dos. *}
  89.                     {*630 + 4 = 634, see newuqq *}
  90. {**********************************************************}
  91.      {end of section for unit U specific OS information}
  92. END;
  93. const fm_sequential = sequential;
  94.       fm_direct = direct;
  95.       fm_terminal = terminal;
  96. END;
  97.