| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- Listing:
- 1 (* Release 3.00 *)
- 2 (* Copyright (C) 1987..1991 Jensen & Partners International *)
- 3
- 4 (*# call(seg_name => null) *)
- 5 (*# module(implementation=>off) *)
- 6 (*# data(seg_name => null, near_ptr=>off) *)
- 7 (*# call(o_a_copy => off, ds_eq_ss=>off, near_call=>off) *)
- 8 (*# check(stack=>off,
- 9 index=>off,
- 10 range=>off,
- 11 overflow=>off,
- 12 nil_ptr=>off) *)
- 13
- 14
- 15 IMPLEMENTATION MODULE WinFIO;
- 16
- 17 IMPORT Lib, SYSTEM, CoreIO, CoreFile, CoreSig, CoreMain, Windows;
- 18
- 19 VAR
- 20 (* CoreFile.BufInf : ARRAY[0..MaxHandle] OF FileInf; *) (* NB in CoreFile *)
- 21 IOR: CARDINAL;
- 22
- 23 TYPE
- 24 Str80 = ARRAY[0..79] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 25 PathStr = ARRAY [0..128] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 26
- 27
- 28 PROCEDURE ErrorCheck(Code: CARDINAL; ErrNum: CARDINAL; Msg, Name: ARRAY OF CHAR);
- ***** ^ not supported yet
- 29
- 30 VAR
- 31 ErrMsg: ARRAY [0..119] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 32 NumStr: ARRAY [0..19] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 33 OK: BOOLEAN;
- 34 BEGIN
- 35 IF ErrNum = 0 THEN
- 36 ErrNum := Lib.SysErrno();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 37 END;
- 38 IF IOcheck THEN
- ***** ^ undeclared identifier
- 39 Str.Copy(ErrMsg, Msg);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 40 Str.Append(ErrMsg, Name);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 41 Str.Append(ErrMsg, '. Dos Error Code ');
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 42 Str.CardToStr(LONGCARD(ErrNum), NumStr, 10, OK);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 43 Str.Append(ErrMsg, NumStr);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 44 (* Lib.WrDosError(SHORTCARD(ErrNum)); *)
- 45 Lib.RunTimeError(CoreSig._FatalErrorPos(), Code+0A0H, ErrMsg);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 END;
- 47 IOR := ErrNum;
- 48 END ErrorCheck;
- ***** ^ not supported yet
- 49
- 50 PROCEDURE IOresult () : CARDINAL;
- 51 BEGIN
- 52 RETURN IOR;
- 53 END IOresult;
- ***** ^ not supported yet
- 54
- 55
- 56 PROCEDURE WrBin(F: File; Buf: ARRAY OF BYTE; Count: CARDINAL);
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 57
- 58 VAR
- 59 NumWrit : CARDINAL;
- 60 BEGIN
- 61 IOR := 0;
- 62 OK := TRUE;
- ***** ^ undeclared identifier
- 63 IF Count = 0 THEN RETURN END;
- 64 NumWrit := Windows._lwrite(F, Buf, Count);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 65 IF NumWrit # Count THEN
- 66 ErrorCheck(6, 0, 'WrBin : ', Lib.NilStr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 67 OK := FALSE;
- ***** ^ undeclared identifier
- 68 END;
- 69 END WrBin;
- ***** ^ not supported yet
- 70
- 71 PROCEDURE RdBin(F: File; VAR Buf: ARRAY OF BYTE; Count: CARDINAL) : CARDINAL;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 72 VAR
- 73 NumRead: CARDINAL;
- 74 BEGIN
- 75 IOR := 0;
- 76 OK := TRUE;
- ***** ^ undeclared identifier
- 77 EOF := FALSE;
- ***** ^ undeclared identifier
- 78 IF Count = 0 THEN RETURN 0 END;
- 79 NumRead := Windows._lread(F, Buf, Count);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 80 IF NumRead # Count THEN
- 81 OK := FALSE;
- ***** ^ undeclared identifier
- 82 IF NumRead < 0 THEN
- 83 ErrorCheck(7, 0, 'RbBin : ', Lib.NilStr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 84 ELSE
- 85 EOF := TRUE;
- ***** ^ undeclared identifier
- 86 END;
- 87 END;
- 88 RETURN NumRead;
- 89 END RdBin;
- ***** ^ not supported yet
- 90
- 91
- 92 PROCEDURE GetName(name: ARRAY OF CHAR; VAR fn: PathStr);
- ***** ^ not supported yet
- 93 (* Makes Null terminated filename, also sets IOR to 0 *)
- 94 BEGIN
- 95 Str.Copy(fn,name);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 96 fn[HIGH(fn)] := CHR(0);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 97 IOR := 0;
- 98 END GetName;
- ***** ^ not supported yet
- 99
- 100 PROCEDURE Open(Name: ARRAY OF CHAR) : File;
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 101 VAR
- 102 fn: PathStr;
- ***** ^ not supported yet
- 103 H: File;
- ***** ^ undeclared identifier
- 104 BEGIN
- 105 GetName(Name,fn);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 106 H := Windows._lopen(fn, Windows.READ_WRITE + INTEGER(ShareMode));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 107 IF H <> MAX(CARDINAL) THEN
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 108 CoreFile._openfd[H] := (CoreIO.O_RDWR+CoreIO.O_BINARY);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 109 IF CoreIO.isatty(H) # 0 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 110 CoreFile._openfd[H] := CoreFile._openfd[H] + CoreIO.O_DEVICE;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 111 END;
- 112 ELSE
- 113 ErrorCheck(2, 0, 'Open : ', fn);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 114 END;
- 115 RETURN H;
- ***** ^ not supported yet
- 116 END Open;
- ***** ^ not supported yet
- 117
- 118 PROCEDURE OpenRead( Name: ARRAY OF CHAR) : File;
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 119 VAR
- 120 fn: PathStr;
- ***** ^ not supported yet
- 121 H: File;
- ***** ^ undeclared identifier
- 122 BEGIN
- 123 GetName(Name,fn);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 124 H := Windows._lopen(fn, Windows.READ + INTEGER(ShareMode));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 125 IF H <> MAX(CARDINAL) THEN
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 126 CoreFile._openfd[H] := (CoreIO.O_RDONLY+CoreIO.O_BINARY);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 127 IF CoreIO.isatty(H) # 0 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 128 CoreFile._openfd[H] := CoreFile._openfd[H] + CoreIO.O_DEVICE;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 129 END;
- 130 ELSE
- 131 ErrorCheck(3, 0, 'OpenRead : ', fn);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 132 END;
- 133 RETURN H;
- ***** ^ not supported yet
- 134 END OpenRead;
- ***** ^ not supported yet
- 135
- 136 PROCEDURE Exists(Name: ARRAY OF CHAR) : BOOLEAN;
- ***** ^ not supported yet
- 137 VAR
- 138 fn : PathStr ;
- ***** ^ not supported yet
- 139 BEGIN
- 140 GetName(Name,fn);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 141 IF CoreIO._exists(fn) # 0 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 142 RETURN TRUE;
- 143 END;
- 144 RETURN FALSE;
- 145 END Exists;
- ***** ^ not supported yet
- 146
- 147 PROCEDURE Create(Name: ARRAY OF CHAR) : File;
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 148 VAR
- 149 fn: PathStr;
- ***** ^ not supported yet
- 150 H: File;
- ***** ^ undeclared identifier
- 151 BEGIN
- 152 GetName(Name,fn);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 153 H := Windows._lcreat(fn, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 154 IF H <> MAX(CARDINAL) THEN
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 155 CoreFile._openfd[H] := (CoreIO.O_RDWR+CoreIO.O_BINARY);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 156 ELSE
- 157 ErrorCheck(5, 0, 'Create : ', Name);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 158 END;
- 159 RETURN H;
- ***** ^ not supported yet
- 160 END Create;
- ***** ^ not supported yet
- 161
- 162 PROCEDURE Close(F: File);
- ***** ^ undeclared identifier
- 163 BEGIN
- 164 IOR := 0;
- 165 IF F < CoreFile._open_max THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 166 CoreFile._openfd[F] := {};
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 167 END;
- 168 IF Windows._lclose(F) = -1 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 169 ErrorCheck(0, 0, 'Close : ', Lib.NilStr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 170 END;
- 171 RETURN;
- 172 END Close;
- ***** ^ not supported yet
- 173
- 174 BEGIN
- 175 IOR := 0;
- 176 OK := TRUE;
- ***** ^ undeclared identifier
- 177 EOF := FALSE;
- ***** ^ undeclared identifier
- 178 ShareMode := ShareCompat;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 179 END WinFIO.
- ***** ^ not supported yet
- 180
- 221 errors
|