Category : Modula II Source Code
Archive   : MODULA-2.ZIP
Filename : NETWORK.DEF

 
Output of file : NETWORK.DEF contained in archive : MODULA-2.ZIP
DEFINITION MODULE Network;


(* provides file support on a PC network.
can be used without a PC network if DOS 3.1 is used.

Commands here emulate/duplicate those in FileSystem.

This module is a replacement for FileSystem and cannot be
used in combination with it or DiskFiles.

Work begun: 02/12/1986 Last Edit: 02/28/1986
Author: J. Tal
*)


FROM SYSTEM IMPORT AX,BX,CX,DX,SETREG,CODE,SWI,WORD,BYTE,ADDRESS,DOSCALL;


EXPORT QUALIFIED

File,
Response,
Close, Lookup, Rename, Delete, WriteChar, ReadChar,
ReadNBytes, WriteNBytes, SetRead, SetWrite, SetModify,
Reset, SetPos, GetPos, Length;


TYPE

Response = (done,
notdone, notsupported, callerror,
unknownmedium, unknownfile, paramerror,
toomanyfiles, eom, userdeverror);


File = RECORD
name : ARRAY [0..64] OF CHAR;
handle : WORD;
pointHigh : CARDINAL;
pointLow : CARDINAL;
read : BOOLEAN;
write : BOOLEAN;
inuse : BOOLEAN;
eof : BOOLEAN;
res : Response;
END;


PROCEDURE Close ( f : File );

PROCEDURE Lookup (VAR f : File; fileName : ARRAY OF CHAR;
mode,shar : ARRAY OF CHAR);

(*
Heavily influenced by file sharing setup of IBM Datamaster S/23


mode = O or I or R or RI

O = Output/Create File
I = Input
R = Read/Write
RI = Read input

shar = S or N or I or X

S = Share Other processes can read or write
N = Noshare Other processes not permitted
I = shareInput Other processes may read only - Opened w/mode = RI
X = denyWrite Other processes may write only

*)


PROCEDURE Rename ( VAR f: File; newname : ARRAY OF CHAR );

PROCEDURE Delete ( name : ARRAY OF CHAR; VAR f : File );

PROCEDURE WriteChar( VAR f: File; VAR ch : CHAR);

PROCEDURE ReadChar( VAR f: File; VAR ch : CHAR);

PROCEDURE ReadNBytes( VAR f: File; bufPtr : ADDRESS;
requestedBytes : CARDINAL;
VAR read : CARDINAL );

PROCEDURE WriteNBytes( VAR f: File; bufPtr : ADDRESS;
requestedBytes : CARDINAL;
VAR written : CARDINAL );

PROCEDURE SetRead ( VAR f: File );

PROCEDURE SetWrite ( VAR f: File );

PROCEDURE SetModify ( VAR f: File );

PROCEDURE SetOpen ( VAR f: File );

PROCEDURE Reset ( VAR f: File);

PROCEDURE SetPos( VAR f: File; high,low: CARDINAL);

PROCEDURE GetPos( VAR f: File; VAR high,low: CARDINAL);

PROCEDURE Length( VAR f: File; VAR high,low: CARDINAL);

END Network.


  3 Responses to “Category : Modula II Source Code
Archive   : MODULA-2.ZIP
Filename : NETWORK.DEF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/