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

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