FILESYST.DEF 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. (* Release 3.10 *)
  2. (*-------------------------------------------------------------------------*
  3. * *
  4. * FILESYST.DEF *
  5. * *
  6. * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
  7. * All Rights Reserved *
  8. * *
  9. *--------------------------------------------------------------------------*)
  10. (*# call(o_a_copy => off,
  11. o_a_size => on) *)
  12. (*# module(init_code => on) *)
  13. (*%F _fdata *)
  14. (*# call(seg_name => null) *)
  15. (*%E *)
  16. (*# data(seg_name => null) *)
  17. DEFINITION MODULE FileSystem;
  18. IMPORT FIO;
  19. CONST
  20. BufferSize = 512;
  21. EOL = CHAR(0AH);
  22. TYPE
  23. FileNameType = ARRAY [0..80] OF CHAR;
  24. BufferPtr = POINTER TO ARRAY [0..BufferSize-1] OF BYTE;
  25. TYPE
  26. Response = (done, notdone, notsupported, callerror, unknownmedium,
  27. unknownfile, paramerror, toomanyfiles, eom, deviceoff,
  28. softparityerror, softprotected, softerror, hardparityerror,
  29. hardprotected, timeout, harderror, unknownpath);
  30. Command = (create, open, close, lookup, rename, setread, setwrite,
  31. setmodify, setopen, doio, setpos, getpos, length, reset, again,
  32. readword, writeword, readchar, writechar);
  33. Flag = (ag, rd, wr, mo, tf, er, pi);
  34. FlagSet = SET OF Flag;
  35. File = RECORD
  36. res: Response;
  37. flags: FlagSet;
  38. eof: BOOLEAN;
  39. fileno: FIO.File;
  40. again: WORD;
  41. name: FileNameType;
  42. buffer: BufferPtr;
  43. END;
  44. PROCEDURE Create(VAR f: File; Device: ARRAY OF CHAR);
  45. PROCEDURE Close(VAR f: File);
  46. PROCEDURE Lookup(VAR f: File; Filename: ARRAY OF CHAR; New: BOOLEAN);
  47. PROCEDURE Rename(VAR f: File; Filename: ARRAY OF CHAR);
  48. PROCEDURE SetRead(VAR f: File);
  49. PROCEDURE SetWrite(VAR f: File);
  50. PROCEDURE SetModify(VAR f: File);
  51. PROCEDURE SetOpen(VAR f: File);
  52. PROCEDURE Doio(VAR f: File);
  53. PROCEDURE SetPos(VAR f: File; HighPos, LowPos: CARDINAL);
  54. PROCEDURE GetPos(VAR f: File; VAR HighPos, LowPos: CARDINAL);
  55. PROCEDURE Length(VAR f: File; VAR HighPos, LowPos: CARDINAL);
  56. PROCEDURE Reset(VAR f: File);
  57. PROCEDURE Again(VAR f: File);
  58. PROCEDURE ReadWord(VAR f: File; VAR w: WORD);
  59. PROCEDURE WriteWord(VAR f: File; w: WORD);
  60. PROCEDURE ReadChar(VAR f: File; VAR ch: CHAR);
  61. PROCEDURE WriteChar(VAR f: File; ch: CHAR);
  62. END FileSystem.
  63.