home *** CD-ROM | disk | FTP | other *** search
- (**********************************************************************)
- (** Structure definitions for FMail v0.96Γ **)
- (** **)
- (** /* **)
- (** FMSTRUCT.H **)
- (** **)
- (** File structures for FMail 0.96Γ **)
- (** Copyright (C) 1993 Folkert J. Wijnstra. All rights reserved. **)
- (** **)
- (** All information in this document is subject to change at any **)
- (** time without prior notice! **)
- (** **)
- (** Strings are NUL terminated arrays of char type. **)
- (** Path names are \ terminated. **)
- (** */ **)
- (** **)
- (** Based on the C structures as published by Folkert Wijnstra. **)
- (** Converted to TurboPascal by Jan Hoolwerf. **)
- (** **)
- (** Last update: 11 August 1993 **)
- (**********************************************************************)
-
- UNIT FmStr96G;
-
- INTERFACE
-
- (****************************************************************************************************)
- (** General constants and structures **)
- (****************************************************************************************************)
-
- CONST
- _ARC : Word = 0; { used in the conversion }
- _ZIP : Word = 1; { from FMail to GEcho }
- _LZH : Word = 2;
- _PAK : Word = 3;
- _ZOO : Word = 4;
- _ARJ : Word = 5;
- _SQZ : Word = 6;
- {}
- _Comment_len = 51; { these constants are defined here because they are }
- _Path_len = 48; { necessary in more than one section of these structures }
- _OrgLine_len = 59;
- _ProgramName_len = 46;
- _MaxAKAs = 11; { including main address }
- _MaxUplinkReq = 16;
- _MaxUsers = 16;
- _MaxMatch = 16;
- {}
- _LOG_INBOUND = $0001;
- _LOG_OUTBOUND = $0002;
- _LOG_PKTINFO = $0004;
- _LOG_XPKTINFO = $0008;
- _LOG_UNEXPPWD = $0010;
- _LOG_SENTRCVD = $0020;
- _LOG_STATS = $0040;
- _LOG_MSGBASE = $8000;
- _LOG_ECHOEXP = $8000;
- _LOG_NETIMP = $8000;
- _LOG_NETEXP = $8000;
- _LOG_WARNINGS = $8000;
- _LOG_ALWAYS = $8000;
- _LOG_DEBUG = $8000;
-
- TYPE
- _FlagsType = ARRAY[1..4] OF Char; { for the RemoteAccess flags }
- _CommentType = ARRAY[1.._Comment_len] OF Char; { echo comment }
- _OriginlineType = ARRAY[1.._OrgLine_len] OF Char; { the origin line }
- _PathType = ARRAY[1.._Path_len] OF Char; { DOS pathnames }
- _ProgramName = ARRAY[1.._ProgramName_len] OF Char;
- _ArchiverInfo = RECORD { archiver program name and command line parameters }
- _ProgramName : ARRAY[1.._ProgramName_len] OF Char;
- _MemRequired : Word;
- END;
- _NodenumType = RECORD
- _Zone,
- _Net,
- _Node,
- _Point : Word;
- END;
- _NodeFakeType = RECORD
- _NodeNum : _NodenumType;
- _FakeNet : Word;
- END;
- _AKAlistType = ARRAY[1.._MaxAKAs] OF _NodeFakeType;
-
- GenOptionsBits = (
- _GO_UseEMS, { bit 0 from GenOptionsType }
- _GO_CheckBreak, { bit 1 from GenOptionsType }
- _GO_Swap, { bit 2 from GenOptionsType }
- _GO_SwapEMS, { bit 3 from GenOptionsType }
- _GO_SwapXMS, { bit 4 from GenOptionsType }
- _GO_bit5, { unused bit }
- _GO_Monochrome, { bit 6 from GenOptionsType }
- _GO_CommentFFD, { bit 7 from GenOptionsType }
- _GO_PtAreasBBS, { bit 8 from GenOptionsType }
- _GO_CommentFRA, { bit 9 from GenOptionsType }
- _GO_bit10, { unused bit }
- _GO_IncBDRRA, { bit 11 from GenOptionsType }
- _GO_bit12, _GO_b13, _GO_bit14, { unused bits }
- _GO_RA2); { bit 15 from GenOptionsType }
- _GenOptionsType = SET OF GenOptionsBits;
-
- MailOptionsBits = (
- _MO_RemoveNetKludges, { bit 0 from MailOptionsType }
- _MO_bit1, { unused bit }
- _MO_CheckPktDest, { bit 2 from MailOptionsType }
- _MO_bit3, { unused bits }
- _MO_CreateSema, { bit 4 from MailOptionsType }
- _MO_bit5, _MO_bit6, _MO_bit7, { unused bits }
- _MO_DupDetection, { bit 8 from MailOptionsType }
- _MO_IgnoreMSGID, { bit 9 from MailOptionsType }
- _MO_ARCmail060, { bit 10 from MailOptionsType }
- _MO_bit11, { unused bit }
- _MO_PersNetmail, { bit 12 from MailOptionsType }
- _MO_PrivateImport, { bit 13 from MailOptionsType }
- _MO_KeepExpMail, { bit 14 from MailOptionsType }
- _MO_KillEmptyNetmail); { bit 15 from MailOptionsType }
- _MailOptionsType = SET OF MailOptionsBits;
-
- MBoptionsBits = (
- _MB_SortNew, { bit 0 from MBoptionsType }
- _MB_SortSubject, { bit 1 from MBoptionsType }
- _MB_UdateChains, { bit 2 from MBoptionsType }
- _MB_Retear, { bit 3 from MBoptionsType }
- _MB_bit4, _MB_bit5, { unused bits }
- _MB_RemoveRE, { bit 6 from MBoptionsType }
- _MB_RemoveLfSr, { bit 7 from MBoptionsType }
- _MB_ScanAlways, { bit 8 from MBoptionsType }
- _MB_ScanUpdate, { bit 9 from MBoptionsType }
- _MB_MultiLine, { bit 10 from MBoptionsType }
- _MB_bit11, { unused bit }
- _MB_QuickToss, { bit 12 from MBoptionsType }
- _MB_bit13, _MB_bit14, { unused bits }
- _MB_SysopImport); { bit 15 from MBoptionsType }
- _MBoptionsType = SET OF MBoptionsBits; { various options FOR an area }
-
- MGRoptionsBits = (
- _MGR_KeepRequest, { bit 0 from MGRoptionsType }
- _MGR_KeepReceipt, { bit 1 from MGRoptionsType }
- _MGR_bit2, _MGR_bit3, { unused bits }
- _MGR_AutoDiscArea, { bit 4 from MGRoptionsType }
- _MGR_bit5, _MGR_bit6, _MGR_bit7, _MGR_bit8, { unused bits }
- _MGR_AllowAddAll, { bit 9 from MGRoptionsType }
- _MGR_AllowActive, { bit 10 from MGRoptionsType }
- _MGR_bit11, { unused bit }
- _MGR_AllowPassword, { bit 12 from MGRoptionsType }
- _MGR_AllowPktPwd, { bit 13 from MGRoptionsType }
- _MGR_AllowNotify, { bit 14 from MGRoptionsType }
- _MGR_AllowCompr); { bit 15 from MGRoptionsType }
- _MGRoptionsType = SET OF MGRoptionsBits;
-
- DefaultOptionsBits = (
- _DO_Active, { bit 0 from DefOptionsType }
- _DO_TinySeenby, { bit 1 from DefOptionsType }
- _DO_Security, { bit 2 from DefOptionsType }
- _DO_bit3, { unused bit }
- _DO_Private, { bit 4 from DefOptionsType }
- _DO_ImpSeenby, { bit 5 from DefOptionsType }
- _DO_CheckSeenby, { bit 6 from DefOptionsType }
- _DO_bit7, { unused bit }
- _DO_Local, { bit 8 from DefOptionsType }
- _DO_b9, { unused bit }
- _DO_PassThrough, { bit 10 from DefOptionsType }
- _DO_b11, _DO_b12, _DO_b13, { unused bits }
- _DO_ArrivalDate, { bit 14 from DefOptionsType }
- _DO_SysopRead); { bit 15 from DefOptionsType }
- _DefaultOptionsType = SET OF DefaultOptionsBits;
-
- UplinkOptionsBits = (
- _UO_AddPlusPrefix, { bit 0 of UplinlOptionsType }
- _UO_b1, _UO_b2, _UO_b3, { unused bits }
- _UO_unconditional, { bit 4 of UplinlOptionsType }
- _UO_b5, _UO_b6, _UO_b7, _UO_b8, _UO_b9, { unused bits }
- _UO_b10, _UO_b11, _UO_b12, _UO_b13, _UO_b14, _UO_b15); { unused bits }
- _UplinkOptionsType = SET OF UplinkOptionsBits;
-
- _UplinkReqType = RECORD
- _Node : _NodenumType;
- _program : ARRAY[1..9] OF Char;
- _password : ARRAY[1..17] OF Char;
- _fileName : ARRAY[1..13] OF Char;
- _fileType : Char;
- _groups : LongInt;
- _originAka : Char;
- _options : _UplinkOptionsType;
- _reserved : ARRAY[1..9] OF Char;
- END;
-
- _UserType = RECORD
- _UserName : ARRAY[1..36] OF Char;
- _reserved : ARRAY[1..28] OF Char;
- END;
-
-
- (****************************************************************************************************)
- (** FMAIL.CFG **)
- (****************************************************************************************************)
-
- TYPE
- _AkaMatchNodeType = RECORD
- _Valid,
- _Zone,
- _Net,
- _Node : Word;
- END;
- _AkamatchType = RECORD
- _AmNode : _AkaMatchNodeType;
- _Aka : Word;
- END;
- _ConfigType = RECORD
- _VersionMinor,
- _VersionMajor : Char;
- _CreationDate : LongInt;
- _Key,
- _ReservedKey,
- _RelKey1,
- _RelKey2 : LongInt;
- _reserved1 : ARRAY[1..22] OF Char;
- _MgrOptions : _MGRoptionsType;
- _AKAlist : _AKAlistType;
- _ReservedAKA : ARRAY[1..16 - _MaxAKAs] OF _NodeFakeType;
- _NetmailBoard : ARRAY[1.._MaxAKAs] OF Word;
- _ReservedNet : ARRAY[1..16 - _MaxAKAs] OF Word;
- _GenOptions : _GenOptionsType;
- _MBoptions : _MBoptionsType;
- _MailOptions : _MailOptionsType;
- _MaxPktSize,
- _reserved2,
- _Mailer,
- _BBSprogram,
- _MaxBundleSize,
- _ExtraHandles, { valid range: 0-235 }
- _AutoRenumber,
- _BufSize,
- _FtBufSize,
- _AllowedNumNetmail,
- _LogInfo,
- _LogStyle : Word;
- _reserved3 : ARRAY[1..68] OF Char;
- _ColorSet : Word;
- _SysopName : ARRAY[1..36] OF Char;
- _DefArc : Word;
- _reserved4 : ARRAY[1..24] OF Char;
- _TearType : Char;
- _TearLine : ARRAY[1..25] OF Char;
- _SummaryLogName : _PathType;
- _RecBoard,
- _BadBoard,
- _DupBoard : Word;
- _Topic1,
- _Topic2 : ARRAY[1..16] OF Char;
- _BbsPath,
- _NetPath,
- _SentPath,
- _RcvdPath,
- _InPath,
- _OutPath,
- _SecurePath,
- _LogName,
- _SwapPath,
- _SemaphorePath,
- _PmailPath,
- _AreaMgrLogName,
- _AutoRApath,
- _AutoFolderFDpath,
- _AutoAreasBBSpath,
- _AutoGoldEDareasPath : _PathType;
- _UnArc,
- _UnZip,
- _UnLzh,
- _UnPak,
- _UnZoo,
- _UnArj,
- _UnSqz,
- _GUS,
- _ARC,
- _ZIP,
- _LZH,
- _PAK,
- _ZOO,
- _ARJ,
- _SQZ,
- _CustomArc : _ArchiverInfo;
- _reserved5 : ARRAY[1..105] OF Char;
- _GroupsQBBS : ARRAY[1.._MaxAKAs] OF Char;
- _TemplateSecQBBS : ARRAY[1.._MaxAKAs] OF Word;
- _TemplateFlagsQBBS : ARRAY[1.._MaxAKAs] OF _FlagsType;
- _Attr2RA : ARRAY[1.._MaxAKAs] OF Char;
- _AliasesQBBS : ARRAY[1.._MaxAKAs] OF Char;
- _GroupRA : ARRAY[1.._MaxAKAs] OF Word;
- _AltGroupRA : ARRAY[1.._MaxAKAs, 1..3] OF Word;
- _QwkNameSBBS : ARRAY[1.._MaxAKAs, 1..13] OF Char;
- _MinAgeSBBS,
- _DaysRcvdAKA : ARRAY[1.._MaxAKAs] OF Word;
- _ReplyStatSBBS : ARRAY[1.._MaxAKAs] OF Char;
- _AttrSBBS : ARRAY[1.._MaxAKAs] OF Word;
- _GroupDescr : ARRAY[1..26, 1..27] OF Char;
- _reserved6 : ARRAY[1..9] OF Char;
- _MsgKindsRA : ARRAY[1.._MaxAKAs] OF Char;
- _AttrRA : ARRAY[1.._MaxAKAs] OF Char;
- _ReadSecRA : ARRAY[1.._MaxAKAs] OF Word;
- _ReadFlagsRA : ARRAY[1.._MaxAKAs] OF _FlagsType;
- _WriteSecRA : ARRAY[1.._MaxAKAs] OF Word;
- _WriteFlagsRA : ARRAY[1.._MaxAKAs] OF _FlagsType;
- _SysopSecRA : ARRAY[1.._MaxAKAs] OF Word;
- _SysOpFlagsRA : ARRAY[1.._MaxAKAs] OF _FlagsType;
- _DaysAKA,
- _MsgsAKA : ARRAY[1.._MaxAKAs] OF Word;
- _DescrAKA : ARRAY[1.._MaxAKAs] OF _CommentType;
- _Users : ARRAY[1.._MaxUsers] OF _UserType;
- _AkaMatch : ARRAY[1.._MaxMatch] OF _AkamatchType;
- _reserved7 : ARRAY[1..2048 - 10 * _MaxMatch] OF Char;
- _uplinkReq : ARRAY[1.._MaxUplinkReq] OF _UplinkReqType;
- END;
-
-
- (****************************************************************************************************)
- (** Node manager **)
- (****************************************************************************************************)
-
- CONST
- MaxNodeMgr = 256;
- PktType2plus = 1;
-
- TYPE
- _NodeOptionsBits = (
- _NO_FixDate, { bit 0 from _NodeOptionsType }
- _NO_TinySeenby, { bit 1 from _NodeOptionsType }
- _NO_b2, { unused bit }
- _NO_IgnorePwd, { bit 3 from _NodeOptionsType }
- _NO_Active, { bit 4 from _NodeOptionsType }
- _NO_b5, _NO_b6, _NO_b7, { unused bits }
- _NO_b8, { unused bit }
- _NO_b9, _NO_b10, _NO_b11, { unused bits }
- _NO_ForwardReq, { bit 12 from _NodeOptionsType }
- _NO_RemMaint, { bit 13 from _NodeOptionsType }
- _NO_AllowRescan, { bit 14 from _NodeOptionsType }
- _NO_Notify); { bit 15 from _NodeOptionsType }
- _NodeOptionsType = SET OF _NodeOptionsBits;
-
- _NodeInfoType = RECORD
- _Node : _NodenumType;
- _reserved1 : ARRAY[1..2] OF Char;
- _capability, { 0=Stone Age 1=Type2+ }
- _archiver : Word; { 0=ARC 1=ZIP etc. }
- _options : _NodeOptionsType;
- _groups : LongInt;
- _OutStatus : Word; { 0=none 1=hold 2=crash etc. }
- _reserved2 : ARRAY[1..32] OF Char;
- _password : ARRAY[1..18] OF Char; { AreaMgr password }
- _PacketPwd : ARRAY[1..10] OF Char; { password for packets }
- _reserved3 : ARRAY[1..2] OF Char;
- _ViaNode : _NodenumType;
- _SysopName : ARRAY[1..36] OF Char;
- END;
-
-
- (****************************************************************************************************)
- (** Area Manager **)
- (****************************************************************************************************)
-
- CONST
- _MaxAreas = 512; { may be bigger (not related to message base) }
- _MaxForward = 64; { max. # of nodes in forward table }
- _EchoName_len = 51;
- _MBpath_len = 19;
-
- TYPE
- _ExportType = ARRAY[1.._MaxForward] OF _NodenumType; { list of export systems }
- _EchoNameType = ARRAY[1.._EchoName_len] OF Char; { echotag }
- AreaOptionsBits = (
- _AO_Active, { bit 0 from AreaOptionsType }
- _AO_TinySeenby, { bit 1 from AreaOptionsType }
- _AO_Security, { bit 2 from AreaOptionsType }
- _AO_bit3, { unused bit }
- _AO_Private, { bit 4 from AreaOptionsType }
- _AO_ImportSeenby, { bit 5 from AreaOptionsType }
- _AO_CheckSeenby, { bit 6 from AreaOptionsType }
- _AO_bit7, { unused bit }
- _AO_local, { bit 8 from AreaOptionsType }
- _AO_Disconnected, { bit 9 from AreaOptionsType }
- _AO_reserved, { bit 10 from AreaOptionsType }
- _AO_b11, _AO_b12, _AO_b13, { unused bits }
- _AO_ArrivalDate, { bit 14 from AreaOptionsType }
- _AO_SysopRead); { bit 15 from AreaOptionsType }
- _AreaOptionsType = SET OF AreaOptionsBits;
-
- _RawEchoType = RECORD { the structure of FMAIL.AR }
- _Zero : Char; { !! should always be zero !! }
- _AreaNameOld : ARRAY[1.._MBpath_len] OF Char;
- _GroupQBBS : Char;
- _FlagsTemplateQBBS : _FlagsType;
- _Comment : _CommentType;
- _Group : LongInt;
- _Board,
- _Address,
- _AlsoSeenBy,
- _GroupRA : Word;
- _AltGroupRA : ARRAY[1..3] OF Word;
- _options : _AreaOptionsType;
- _OutStatus,
- _Days,
- _Msgs,
- _DaysRcvd,
- _TemplateSecQBBS,
- _ReadSecRA : Word;
- _FlagsRdRA : _FlagsType;
- _WriteSecRA : Word;
- _FlagsWrRA : _FlagsType;
- _SysopSecRA : Word;
- _FlagsSysRA : _FlagsType;
- _AttrRA,
- _MsgKindsRA : Char;
- _AttrSBBS : Word;
- _ReplyStatSBBS : Char;
- _AreaName : _EchoNameType;
- _QwkName : ARRAY[1..13] OF Char;
- _MinAgeSBBS : Word;
- _Attr2RA,
- _AliasesQBBS : Char;
- _OriginLine : _OriginlineType;
- _Export : _ExportType;
- END;
-
-
- (****************************************************************************************************)
- (** Pack Manager **)
- (****************************************************************************************************)
-
- CONST
- _MaxPack = 64;
- _PackStringSize = 64;
-
- TYPE
- _PackEntryType = ARRAY[1.._PackStringSize] OF Char;
- _PackType = ARRAY[1.._MaxPack] OF _PackEntryType;
-
-
- (****************************************************************************************************)
- (** FMAIL.BDE **)
- (****************************************************************************************************)
-
- CONST
- _MaxBadEchos = 50;
-
- TYPE
- _BadEchoType = RECORD
- _BadEchoName : _EchoNameType;
- _SourceNode : _NodenumType;
- _DestinationAKA : Integer;
- END;
-
-
- (****************************************************************************************************)
- (** some usefull functions and procedures **)
- (****************************************************************************************************)
-
- FUNCTION C2P(VAR S; Max : Byte) : String; { convert a C string to the Pascal equivalent }
- FUNCTION BitIsSet(Arg, Bitmask : Word) : Boolean; { checks if a bit is set }
- PROCEDURE SetBit(VAR Arg : Word; Bitmask : Word); { sets a bit iin a word }
- PROCEDURE ResetBit(VAR Arg : Word; Bitmask : Word); { resets a bit in a word }
- FUNCTION Group2Letter(Arg : LongInt) : Char; { convert the group definition from 'longint' to 'char' }
- FUNCTION Letter2Group(Arg : Char) : LongInt; { convert the group definition from 'char' to 'longint' }
- FUNCTION NodeNumStr(Arg : _NodenumType) : String; { make a readable nodenumber }
-
-
-
- IMPLEMENTATION
-
- FUNCTION C2P(VAR S; Max : Byte) : String;
- { Converts an ASCIIZ string to a Turbo Pascal string }
- { with a maximum length of max. }
- VAR
- starray : ARRAY[1..255] OF Char ABSOLUTE S;
- len : Integer;
- BEGIN { C2P begin }
- len := Pos(#0, starray) - 1; { Get the length }
- IF (len > Max) OR(len < 0) THEN { length exceeds maximum }
- len := Max; { so set to maximum }
- C2P := starray;
- C2P[0] := Chr(len); { Set length }
- END; { C2P end } { Asc2Str }
-
-
- FUNCTION BitIsSet(Arg, Bitmask : Word) : Boolean;
- BEGIN { BitSet begin }
- BitIsSet := (Arg AND Bitmask) = Bitmask;
- END; { BitSet end }
-
-
- PROCEDURE SetBit(VAR Arg : Word; Bitmask : Word);
- BEGIN { BitSet begin }
- Arg := Arg OR Bitmask;
- END; { BitSet end }
-
-
- PROCEDURE ResetBit(VAR Arg : Word; Bitmask : Word);
- BEGIN { BitSet begin }
- Arg := Arg AND NOT Bitmask;
- END; { BitSet end }
-
-
- FUNCTION Group2Letter(Arg : LongInt) : Char;
- VAR
- count : Byte;
- BEGIN { Group begin }
- count := 1;
- WHILE Arg > 1 DO
- BEGIN
- Arg := Arg SHR 1;
- Inc(count);
- END;
- Group2Letter := Chr(count + 64);
- END; { Group end }
-
-
- FUNCTION Letter2Group(Arg : Char) : LongInt;
- VAR
- count : Byte;
- BEGIN { Group begin }
- count := Ord(Arg) - 65;
- Letter2Group := LongInt(1) SHL count;
- END; { Group end }
-
-
- FUNCTION NodeNumStr(Arg : _NodenumType) : String;
- VAR
- I : Byte;
- S : String;
- FUNCTION Int2Str(L, F : LongInt) : String;
- VAR
- Si : String;
- BEGIN
- Str(L, Si);
- Int2Str := Si;
- END; { Int2Str }
- BEGIN { NodeNumStr begin }
- S := Int2Str(Arg._Zone, 6) + ':';
- S := S + Int2Str(Arg._Net, 6) + '/';
- S := S + Int2Str(Arg._Node, 6);
- IF Arg._Point <> 0 THEN
- S := S + '.' + Int2Str(Arg._Point, 6);
- NodeNumStr := S;
- END; { NodeNumStr end }
-
- END. { end of unit }