{*****************************************************************************} {* *} {* O p u s I n t e r f a c e V e r 1.03 *} {* *} {* Opus V 1.0x Interface for Turbo Pascal Ver 4.0, 5.0 and 5.5 *} {* *} {* (C) COPYRIGHT Per Holm & Bifrost Unlimited - 1988, 1989 *} {* *} {* FidoNet: Per Holm - Asgaard BBS 2:230/22.0 *} {* Internet: perholm@daimi.DK *} {* *} {*****************************************************************************} FUNCTION OpIntERROR: Integer; { ERROR Variable Check this Allways } {*************************************************************************} {* ERROR Returns *} {* *} {* 0 = Everything is Bright and Sunny, Just go on *} {* 2 = File not found, Check your filename *} {* 3 = Path not found, Check your pathname *} {* 4 = Too many open files, We need one extra file. *} {* 5 = Fileaccess denied, Check file status. *} {* 12 = Invalid file acces code. *} {* 100 = Disk read error. *} {* 101 = Disk write error. *} {* 190 = Fossil is not loaded. *} {* 191 = Unable to find carrier. *} {* 192 = Carrier on current port has changed. *} {* 193 = Timeout reading port. *} {* 194 = Timeout writing port. *} {* 200 = .PRM file is to big ( > 8 KB ) *} {* 201 = Wrong CTL file version, You need another OPUS_CTL *} {* 202 = To much data for the .PRM file ( > 8 KB ) *} {* 210 = .MSG file is to big ( > 8 KB ) *} {* 211 = To many lines in message *} {* 212 = To many charecters to write message *} {* 220 = Cannot find User record *} {* 221 = To Many Records In UserFile *} {* 222 = Not Room For Extra User Record in The Structure *} {* 230 = Cannot find Nodelist Record *} {* 231 = Cannot find Nodelist Index Record *} {* 250 = Illegal Date / Time specified. *} {*************************************************************************} FUNCTION IOResult: INTEGER; {***************************************************************************} {* Return First OpInt Or I/O Error that occured.. look at OpIntERROR and *} {* TPAS Manual for error description *} {***************************************************************************} PROCEDURE Delay(MS: Word); {***************************************************************************} {* Delay for MS milliseconds *} {***************************************************************************} PROCEDURE Sound(Hz: Word); {***************************************************************************} {* Enable the sound generator. *} {***************************************************************************} PROCEDURE NoSound; {***************************************************************************} {* Disable the sound generator. *} {***************************************************************************} FUNCTION KeyPressed: Boolean; {***************************************************************************} {* Return true if a key has been pressed *} {***************************************************************************} FUNCTION ReadKey: Char; {***************************************************************************} {* Read a Character from standard input *} {***************************************************************************} PROCEDURE GotoXY(x,y: Byte); {***************************************************************************} {* Move cursor to new location (The user must use ANSI). *} {***************************************************************************} FUNCTION UpperCase(S: String):String; {***************************************************************************} {* Converts Strings to uppercase... *} {***************************************************************************} FUNCTION LowerCase(S: String):String; {***************************************************************************} {* Converts strings to lovercase... *} {***************************************************************************} FUNCTION SmartCase(S: String):String; {***************************************************************************} {* Converts string to First letter in word to Uppercase, rest to lovercase *} {***************************************************************************} FUNCTION GetEnvStr(S:String):String; {***************************************************************************} {* Return the EnvironMent String for the the Variabel S *} {* S Must be in Uppercase. *} {***************************************************************************} FUNCTION GMT_Difference:Integer; {***************************************************************************} {* Return an integer value of the difference from GMT (Uses TZ env var.) *} {***************************************************************************} PROCEDURE GetDateTime(VAR DT:DateTime); {***************************************************************************} {* Return a DateTime structure containing the current Date and Time. *} {***************************************************************************} FUNCTION DaysThisYear(DT: DateTime):Integer; {***************************************************************************} {* Give day number for the date specified in DT. (Note Year >= 1980) *} {***************************************************************************} FUNCTION PackUnixDate(DT:DateTime):LongInt; {***************************************************************************} {* Return number of Seconds since 1/1-1970 *} {***************************************************************************} PROCEDURE UnpackUnixDate(Date:LongInt; Var DT:DateTime); {***************************************************************************} {* Convert number of Seconds since 1/1-1970 to DateTime type. *} {***************************************************************************} FUNCTION PackDateString(DT:DateTime): String; {***************************************************************************} {* Return a string containing Time and Date from DT *} {* The format of the Date/Time string will be: *} {* 'dd-mon-yy hh:mm:ss' *} {* Ex. '24-May-88 12:22:21' *} {***************************************************************************} PROCEDURE UnpackDateString(S:_String20; Var DT:DateTime); {***************************************************************************} {* This Procedure will return the contents of a Date/time string in DT. *} {* The format of the Date/Time string Must be: *} {* 'dd-mon-yy hh:mm:ss' *} {* Ex. '24-May-88 12:22:21' *} {***************************************************************************} FUNCTION PackDateStrLog(DT:DateTime): String; {***************************************************************************} {* Return a string containing Time and Date from DT In LOG file Format *} {***************************************************************************} PROCEDURE AddLog(name:STRING; Flag: _StrSys; Subject: STRING); {***************************************************************************} { Add String in S to LogFile. With Date And Time Flag will contain prefix *} {***************************************************************************} PROCEDURE SetAttrib(Var Attribute; Flag: Word; Status:Boolean); {***************************************************************************} {* This procedure will change an attribute flag. *} {* WARNING: 'Attribute' MUST be of type 'Word' or of Type 'Integer'... *} {***************************************************************************} PROCEDURE ReadPrm(name:String; VAR Prm:_Prm); {***************************************************************************} {* ReadPrm reads the PRM file 'name' to the Variable 'Prm' *} {***************************************************************************} PROCEDURE WritePrm(name:String; VAR Prm:_Prm); {***************************************************************************} {* WritePrm writes the PRM file 'name' with the contents of 'Prm' *} {***************************************************************************} PROCEDURE ReadScheds(name:String; VAR Scheds:_Scheds); {***************************************************************************} {* ReadScheds reads the SCHEDULE file 'name' to the Vaiable 'Scheds' *} {***************************************************************************} PROCEDURE WriteScheds(name:String; VAR Scheds:_Scheds); {***************************************************************************} {* WriteScheds Rewrites the SCHEDULE file 'name' with the Vaiable 'Scheds' *} {***************************************************************************} PROCEDURE ReadSys(name:String; VAR Sys:_Sys); {***************************************************************************} {* ReadSys reads the SYSTEM??.BBS file 'name' to the Vaiable 'Sys' *} {***************************************************************************} PROCEDURE WriteSys(name:String; VAR Sys:_Sys); {***************************************************************************} {* WriteSys Rewrites the SYSTEM*.BBS file 'name' with the contents of 'Sys'*} {***************************************************************************} PROCEDURE ReadUser(name:String; VAR Usr:_Usr;Rec: WORD); {***************************************************************************} {* This procedure will read a user record from the file 'name' to the *} {* structure Usr, it will return the user record number 'rec' *} {***************************************************************************} PROCEDURE WriteUser(name:String; VAR Usr:_Usr;Rec: WORD); {***************************************************************************} {* This procedure will write a user record to the file 'name'. *} {* the variable Usr will be written to the user record number 'rec'. *} {***************************************************************************} FUNCTION NumberOfUsers(Name:String):Word; {***************************************************************************} {* Will return the number of users in the DiskFile 'Name' *} {***************************************************************************} PROCEDURE InitUserPtr(VAR UsrPtr:_UsrPtr); {***************************************************************************} {* Initialise the UsrPointer.. Must be called if you create a new userfile *} {* Using the followin User Management Procedures and functions. *} {***************************************************************************} PROCEDURE ReadUserFast(VAR UsrPtr:_UsrPtr; VAR Usr:_Usr; Recs: INTEGER); {***************************************************************************} {* This procedure will read a user records from the menory pool of _UsrPtr *} {***************************************************************************} PROCEDURE WriteUserFast(VAR UsrPtr:_UsrPtr;VAR Usr:_Usr; Recs: INTEGER); {***************************************************************************} {* This procedure will write one of the user records into menory *} {***************************************************************************} PROCEDURE ReleaseUserPtr(VAR UsrPtr:_UsrPtr); {***************************************************************************} {* Release the Heap space used by the UsrPointer variable. *} {***************************************************************************} PROCEDURE DelUserPtr(VAR UsrPtr:_UsrPtr; Rec:Integer); {***************************************************************************} {* Delete Single UserRecord From Memory and Release The Space Too *} {***************************************************************************} PROCEDURE InsUserPtr(VAR UsrPtr:_UsrPtr; VAR Usr:_Usr; Rec:Integer); {***************************************************************************} {* Insert New UserRecord In Heap as Number Rec. *} {***************************************************************************} PROCEDURE ReadUserFile(name:String; VAR UsrPtr:_UsrPtr; VAR Recs: INTEGER); {***************************************************************************} {* This procedure will read all the user records from the file 'name' into *} {* memory *} {***************************************************************************} PROCEDURE WriteUserFile(name:String; VAR UsrPtr:_UsrPtr); {***************************************************************************} {* This procedure will write all users in the memory pool wich is used by *} {* UsrPtr. It will be written to the file 'Name'. *} {***************************************************************************} PROCEDURE ReadNode(name:String; VAR Node:_Node;Rec: LongInt); {***************************************************************************} {* This procedure will read a Node record from the file 'name' to the *} {* structure Node, it will return the user record number 'rec' *} {***************************************************************************} PROCEDURE WriteNode(name:String; VAR Node:_Node;Rec: LongInt); {***************************************************************************} {* This procedure will write a Node record to a version 5 nodelist file *} {***************************************************************************} PROCEDURE ReadNewNode(name:String; VAR NewNode:_NewNode;Rec: LongInt); {***************************************************************************} {* This procedure will read a Node record from the file 'name' to the *} {* structure Node, it will return the user record number 'rec' *} {* For Use with nodelist version 6. *} {***************************************************************************} PROCEDURE WriteNewNode(name:String; VAR NewNode:_NewNode;Rec: LongInt); {***************************************************************************} {* This procedure will write a Node record from the file 'name' from the *} {* structure Node, it will write the user record number 'rec' *} {* For Use with nodelist version 6. *} {***************************************************************************} FUNCTION NumberOfNodes(Name:String):LongInt; {***************************************************************************} {* Will return the number of users in the Nodelist.IDX file 'Name' *} {***************************************************************************} FUNCTION FindNode(name:String;Net,Node: Integer):LongInt; {***************************************************************************} {* FIND Nodelist Entry number *} {* name : Name of Nodelist Index file *} {* Net,Node : Net and Nodenumber *} {***************************************************************************} PROCEDURE ReadNdi(name:String; VAR Ndi:_Ndi;Rec: LongInt); {***************************************************************************} {* This procedure will read a Ndi record from the file 'name' to the *} {* structure Ndi, it will return the user record number 'rec' *} {***************************************************************************} PROCEDURE WriteNdi(name:String; VAR Ndi:_Ndi;Rec: LongInt); {***************************************************************************} {* This procedure will write a Node record to a nodeliste index file. The *} {* record number written is 'rec' *} {***************************************************************************} FUNCTION MsgLength(VAR Msg:_Msg):LongInt; {***************************************************************************} {* This function will return the number of charecters in the Message Msg *} {***************************************************************************} PROCEDURE ReadMsg(name:String; VAR Msg:_Msg); {***************************************************************************} {* This procedure will read a message with file name 'name' and return *} {* the header and Text in the structure Msg *} {***************************************************************************} PROCEDURE WriteMsg(name:String; VAR Msg:_Msg); {***************************************************************************} {* This procedure will write a message to a file name 'name' from the *} {* variable Msg. *} {***************************************************************************} PROCEDURE ReadMsgHead(name:String; VAR Msg:_Msg); {***************************************************************************} {* This procedure will read a message with file name 'name' and return *} {* the header in the structure Msg, The Msg body will not be read *} {***************************************************************************} PROCEDURE WriteMsgHead(name:String; VAR Msg:_Msg); {***************************************************************************} {* This procedure will write a message in the file named 'name'. *} {* The Msg body will not be changed. *} {***************************************************************************} PROCEDURE ReadMsgHeadNew(name:String; VAR MsgHead:_MsgHead); {***************************************************************************} {* This procedure will read a message with file name 'name' and return *} {* the header in the structure MsgHead, The Msg body will not be read. *} {***************************************************************************} PROCEDURE WriteMsgHeadNew(name:String; VAR MsgHead:_MsgHead); {***************************************************************************} {* This procedure will write a message in the file named 'name'. *} {* The Msg body will not be changed. *} {***************************************************************************} PROCEDURE ReadMsgRaw(name:String; VAR Msg:_MsgRaw); {***************************************************************************} {* This procedure will read a message with file name 'name' and return *} {* the header and Text in the structure Msg *} {***************************************************************************} PROCEDURE WriteMsgRaw(name:String; VAR Msg:_MsgRaw); {***************************************************************************} {* This procedure will write a message to a file name 'name' from the *} {* structure Msg. *} {***************************************************************************} FUNCTION FirstFreeMsg(Path:String):String; {***************************************************************************} {* This function will return the first free message number in the area *} {* described by path. *} {***************************************************************************}