home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 3
/
Meeting_Pearls_III.iso
/
Pearls
/
comm
/
Mail+News
/
UMS11
/
Developer
/
m2
/
UmsD.def
next >
Wrap
Text File
|
1995-04-26
|
25KB
|
595 lines
(* --------------------------------------------------------------------------
:Program. ums
:Contents. Interfaces for ums.library
:Author. Martin Koyro [mk]
:Address. SnailMail: EMail:
:Address. Salzmannstr. 12 MAUS: MS3
:Address. 48147 Muenster INET: mk@ms3.maus.westfalen.de
:Address. GERMANY
:Author. Martin Loos [ml]
:Address. SnailMail: EMail:
:Address. Im Scheidt 25 MAUS: UN
:Address. 58640 Iserlohn-Kalthof INET: mattin@unicorn.sauerland.de
:Address. GERMANY FIDO: 2:243/4504.2 (GCC)
:Author. Kai Bolay [kb]
:Address. SnailMail: EMail:
:Address. Hoffmannstraße 168 FIDO: 2:246/1216.3
:Address. 71229 Leonberg UUCP: kai@amokle.stgt.sub.org
:Author. Martin Horneffer [mh]
:Address. MAUS: AC2
:Address. FIDO: 2:242/7.9 (Classic)
:Address. USENET: mh@umshq.dfv.rwth.aachen.de
:Address. ADSP: mh@umshq.adsp.sub.org
:Author. Olaf Peters [olf] EMail:
:Address. Kulmer Str. 7 MAUS: HB2
:Address. 28237 Bremen INET: op@hb2.maus.de
:Address. GERMANY INET: olf@informatik.uni-bremen.de
:History. [ml] 19-Jan-93: Conversion from Oberon to Modula-2
:History. [kb] 28-Mar-93: New Consts added
:History. [ml] 20-May-93: New Consts and Tags added
:History. [mh] 2-Jun-93: changed and added some Consts
:History. [mh] 29-Jun-93: added some Consts
:History. [mh] 26-Aug-93: added tagHide
:History. [mk] 24-Okt-93: Setstructure revised
:History. [mk] 24-Apr-94: Changes for UMSLib V11
:History. [mh] 28-Apr-94: tagCfgLockVar, tagCfgUnlockVar
:History. [mk] 14-May-94: a few bugs removed
:History. [mk] 17-May-94: changed Error to LONGINT
:History. [olf] 01-Sep-94: added new tags for server v11.6
:History. [olf] 17-Oct-94: added the global 'Parked' flag
:History. [olf] 07-Nov-94: added new, netspecific attribute tags
:History. [olf] 25-Feb-95: selCDate & selSize tags, HasFile flag
:History. [olf] 27-Mar-95: noHardlinks
:History. [olf] 26-Apr-95: SelMaxCount und SelMaxSize (thx [mk])
:Language. Modula II
:Translator. M2Amiga v4.301
:Version. $VER: UMSM2Interfaces 11.14a (27.3.95)
-------------------------------------------------------------------------- *)
DEFINITION MODULE UmsD;
(*$ Implementation:=FALSE LargeVars:=FALSE *)
IMPORT u:UtilityD,s:SYSTEM;
TYPE
(* user status-bits *)
UserStatusFlags = (us0,us1,us2,us3,
archive, (* msg should be archived, don't delete *)
junk, (* negative selection, inheritance suggested *)
postPoned, (* to be read again, (but not now) *)
selected, (* positive selection, inheritance suggested *)
Old, (* user has already read this Message *)
WriteAccess, (* user may change or delete this message *)
ReadAccess, (* user may read this message *)
ViewAccess, (* user may read the header of this message *)
Owner, (* user 'owns' (wrote) this message *)
us13,us14,
filtered, (* msg has been processed by filter,
'selected' and 'junk' have been properly set *)
us16,us17,us18,us19,us20,us21,us22,us23,
us24,us25,us26,us27,us28,us29,us30,us31);
UserStatusFlagSet = SET OF UserStatusFlags;
(* global status-bits *)
GlobalStatusFlags = (
Deleted, (* msg is really deleted *)
Expired, (* msg has expired and may be deleted *)
Exported, (* msg has been exported *)
Orphan, (* msg could not be exported *)
Link, (* within a ring of linked msgs *)
HardLink, (* link is hardLink *)
Parked, (* msg is "parked", i.e. must not (yet) be exported *)
HasFile, (* msg has an attached file (tempFilename) *)
gs8,gs9,gs10,gs11,gs12,gs13,gs14,gs15,gs16,gs17,gs18,gs19,
gs20,gs21,gs22,gs23,gs24,gs25,gs26,gs27,gs28,gs29,gs30,gs31);
GlobalStatusFlagSet = SET OF GlobalStatusFlags;
CONST
umsName = "ums.library";
NumFields = 128;
(* actions for ServerControl() *)
CleanUp = 1;
Flush = 2;
Quit = 3;
QuitForce = 4;
Ping = 5;
LockCfg = 6;
UnlockCfg = 7;
ProtectedUserFlags = UserStatusFlagSet{WriteAccess,ReadAccess,
ViewAccess,Owner};
ProtectedGlobalFlags = GlobalStatusFlagSet{Deleted,Exported,Orphan,
Link,HardLink,HasFile};
Read = UserStatusFlagSet{Old};
TYPE
Account = LONGINT;
MsgNum = LONGINT;
Error = LONGINT;
STRPTR = POINTER TO ARRAY[0..MAX(LONGINT) - 1] OF CHAR;
MsgTextFields = ARRAY[0..NumFields - 1] OF STRPTR;
MessageInfo = RECORD
hdrLen : LONGINT;
txtLen : LONGINT;
date : LONGINT;
up, dn,
lt, rt : MsgNum;
globalStat : GlobalStatusFlagSet;
userStat : UserStatusFlagSet;
loginStat : s.LONGSET;
hardLink : MsgNum;
softLink : MsgNum;
(* V11 extension, only filled by tagRExtMsgInfo *)
cDate : LONGINT;
reserved : ARRAY[0..2] OF LONGINT;
END; (*of RECORD*)
CONST
(* enumeration of fields in an UMS-message *)
msgText = 0;
fromName = 1;
fromAddr = 2;
toName = 3;
toAddr = 4;
msgID = 5;
creationDate = 6;
receiveDate = 7;
refID = 8;
group = 9;
subject = 10;
attributes = 11;
comments = 12;
organization = 13;
distribution = 14;
folder = 15;
fidoID = 16;
mausID = 17;
replyGroup = 18;
replyName = 19;
replyAddr = 20;
logicalToName = 21;
logicalToAddr = 22;
fileName = 23;
rfcMsgNum = 24;
fidoText = 32;
errorText = 33;
newsreader = 34;
rfcAttr = 35;
ftnAttr = 36;
zerAttr = 37;
mausAttr = 38;
tempFileName = 127;
(*** Errors ***)
CONST
ok = 0;
unknown = 1;
noSubject = 100;
forbiddenCode = 101;
noWriteAccess = 102;
noReader = 103;
noExporter = 104;
badLink = 105;
noWork = 106;
noSysop = 107;
badChange = 108;
groupForm = 109;
tooBig = 110;
notRunning = 111;
noImportAcc = 112;
noFromName = 113;
noToName = 114;
cfgLocked = 115;
noHardlinks = 116;
dupe = 200;
noReadAccess = 201;
noViewAccess = 202;
msgCorrupted = 203;
noHdrSpace = 204;
noSuchMsg = 205;
badName = 206;
badTag = 207;
missingTag = 208;
noSuchUser = 209;
notFound = 210;
autoBounce = 211;
msgDeleted = 212;
noNetAccess = 213;
badPattern = 214;
badVarname = 215;
fsFull = 216;
noMsgMem = 217;
missingIndex = 218;
mxTags = 219;
userExists = 220;
noSuchAlias = 221;
suicide = 222;
exeErr = 223;
serverTerminated = 300;
cantWrite = 301;
cantRead = 302;
wrongMsgPtr = 303;
serverNotFree = 304;
idCountProb = 305;
noLogin = 306;
wrongServer = 307;
noMem = 308;
wrongTask = 309;
tcpError = 400;
(* tag-values *)
typeSTRPTR = 2000H;
typeVARPAR = 4000H;
(** tags for WriteMsg() **)
(* add 'typeVARPAR' for ReadMsg() *)
(* no 'typeVARPAR' for WriteMsg() *)
tagMsgNum = 1 + u.tagUser;
tagMsgDate = 4 + u.tagUser;
(* don't usually use when writing! *)
(* Using tagMsgDate with WriteUMSMsg() *)
(* has a very special meaning. *)
tagChainUp = 7 + u.tagUser;
tagHardLink = 14 + u.tagUser;
tagSoftLink = 15 + u.tagUser;
tagMsgCDate = 16 + u.tagUser;
tagAutoBounce = 65 + u.tagUser;
(* when writing: *)
(* data # 0: server returns error 'autoBounce', *)
(* but still keeps the Msg and sends *)
(* it to the sysops. *)
tagHdrFill = 66 + u.tagUser;
(* when writing: how much bytes to be reserved *)
tagTxtFill = 67 + u.tagUser;
(* for header and text *)
tagNoUpdate = 69 + u.tagUser;
(* data = 0: (default) set 'Old'-Flag when *)
(* reading or writing *)
(* data = 1: don't touch 'Old'-Flag *)
tagHide = 70 + u.tagUser;
(* for writing: *)
(* data = 0: default *)
(* data = 1: msg only accessible by exporters *)
(* data = 2: msg only accessible by users *)
tagCheckHeader = 71 + u.tagUser;
(* data = 0: default *)
(* data = 1: don't write msg, only check access *)
tagMsgText = 256 + typeSTRPTR;
tagFromName = tagMsgText + fromName;
tagFromAddr = tagMsgText + fromAddr;
tagToName = tagMsgText + toName;
tagToAddr = tagMsgText + toAddr;
tagMsgID = tagMsgText + msgID;
tagCreationDate = tagMsgText + creationDate;
tagReceiveDate = tagMsgText + receiveDate;
tagRefID = tagMsgText + refID;
tagGroup = tagMsgText + group;
tagSubject = tagMsgText + subject;
tagAttributes = tagMsgText + attributes;
tagComments = tagMsgText + comments;
tagOrganization = tagMsgText + organization;
tagDistribution = tagMsgText + distribution;
tagFolder = tagMsgText + folder;
tagFidoID = tagMsgText + fidoID;
tagMausID = tagMsgText + mausID;
tagReplyGroup = tagMsgText + replyGroup;
tagReplyName = tagMsgText + replyName;
tagReplyAddr = tagMsgText + replyAddr;
tagLogicalToName = tagMsgText + logicalToName;
tagLogicalToAddr = tagMsgText + logicalToAddr;
tagFileName = tagMsgText + fileName;
tagRFCMsgNum = tagMsgText + rfcMsgNum;
tagFidoText = tagMsgText + fidoText;
tagErrorText = tagMsgText + errorText;
tagNewsreader = tagMsgText + newsreader;
tagRfcAttr = tagMsgText + rfcAttr;
tagFtnAttr = tagMsgText + ftnAttr;
tagZerAttr = tagMsgText + zerAttr;
tagMausAttr = tagMsgText + mausAttr;
tagTempFileName = tagMsgText + tempFileName;
tagTextFields = 513 + u.tagUser;
(* datatype: POINTER TO MsgTextFields *)
(** tags for ReadMsg() **)
(* add 'typeVARPAR' for ReadMsg() *)
(* no 'typeVARPAR' for WriteMsg() *)
tagRMsgNum = 1 + u.tagUser;
tagRHdrLength = 2 + u.tagUser + typeVARPAR;
tagRTxtLength = 3 + u.tagUser + typeVARPAR;
tagRMsgDate = 4 + u.tagUser + typeVARPAR;
tagRChainUp = 7 + u.tagUser + typeVARPAR;
tagRChainDn = 8 + u.tagUser + typeVARPAR;
tagRChainLt = 9 + u.tagUser + typeVARPAR;
tagRChainRt = 10 + u.tagUser + typeVARPAR;
tagRGlobalFlags = 11 + u.tagUser + typeVARPAR;
tagRUserFlags = 12 + u.tagUser + typeVARPAR;
tagRLoginFlags = 13 + u.tagUser + typeVARPAR;
tagRHardLink = 14 + u.tagUser + typeVARPAR;
tagRSoftLink = 15 + u.tagUser + typeVARPAR;
tagRMsgCDate = 16 + u.tagUser + typeVARPAR;
tagRDateStyle = 64 + u.tagUser;
(* style for receiveDate when reading: *)
(* data = 0: no receiveDate *)
(* data = 1: emulate old-style receiveDate *)
tagRIDStyle = 68 + u.tagUser;
(* style for Message-ID *)
(* data = 0: real Message-ID *)
(* data = 1: old style dec-number *)
tagRNoUpdate = 69 + u.tagUser;
(* data = 0: (default) set 'Old'-Flag when *)
(* reading or writing *)
(* data = 1: don't touch 'Old'-Flag *)
tagRMsgText = 256 + typeSTRPTR + typeVARPAR + u.tagUser;
tagRFromName = tagRMsgText + fromName;
tagRFromAddr = tagRMsgText + fromAddr;
tagRToName = tagRMsgText + toName;
tagRToAddr = tagRMsgText + toAddr;
tagRMsgID = tagRMsgText + msgID;
tagRCreationDate = tagRMsgText + creationDate;
tagRReceiveDate = tagRMsgText + receiveDate;
tagRRefID = tagRMsgText + refID;
tagRGroup = tagRMsgText + group;
tagRSubject = tagRMsgText + subject;
tagRAttributes = tagRMsgText + attributes;
tagRComments = tagRMsgText + comments;
tagROrganization = tagRMsgText + organization;
tagRDistribution = tagRMsgText + distribution;
tagRFolder = tagRMsgText + folder;
tagRFidoID = tagRMsgText + fidoID;
tagRMausID = tagRMsgText + mausID;
tagRReplyGroup = tagRMsgText + replyGroup;
tagRReplyName = tagRMsgText + replyName;
tagRReplyAddr = tagRMsgText + replyAddr;
tagRLogicalToName = tagRMsgText + logicalToName;
tagRLogicalToAddr = tagRMsgText + logicalToAddr;
tagRFileName = tagRMsgText + fileName;
tagRRFCMsgNum = tagRMsgText + rfcMsgNum;
tagRFidoText = tagRMsgText + fidoText;
tagRErrorText = tagRMsgText + errorText;
tagRNewsreader = tagRMsgText + newsreader;
tagRRfcAttr = tagRMsgText + rfcAttr;
tagRFtnAttr = tagRMsgText + ftnAttr;
tagRZerAttr = tagRMsgText + zerAttr;
tagRMausAttr = tagRMsgText + mausAttr;
tagRTempFileName = tagRMsgText + tempFileName;
tagRMsgInfo = 512 + u.tagUser;
(* datatype: POINTER TO MessageInfo *)
tagRTextFields = tagRMsgInfo + 1;
(* datatype: POINTER TO MsgTextFields *)
tagRReadHeader = tagRMsgInfo + 2;
(* read all header-fields *)
tagRReadAll = tagRMsgInfo + 3;
(* read all text-fields *)
tagRExtMsgInfo = tagRMsgInfo + 4;
(* read extended MessageInfo*)
(** tags for Select() **)
tagSelSet = 1024 + u.tagUser;
(* flags to set on selected msgs *)
tagSelUnset = tagSelSet + 1;
(* flags to clear *)
tagSelWriteGlobal = tagSelSet + 2;
(* change global flags, not user-flags *)
tagSelWriteLocal = tagSelSet + 3;
(* change login-local flags, not user-flags *)
tagSelWriteUser = tagSelSet + 4+typeSTRPTR;
(* change other user's flags *)
tagSelStart = tagSelSet + 8;
(* process only msgs AFTER this one *)
tagSelStop = tagSelSet + 9;
(* process only msgs BEFORE this one *)
(* the following are mutual-exclusiv *)
(* use only one of the following operations, *)
(* otherwise unpredictable things may happen! *)
tagSelReadGlobal = tagSelSet + 10;
(* examine global flags, not user-flags *)
tagSelReadLocal = tagSelSet + 11;
(* examine login-local flags, not user-flags *)
tagSelReadUser = tagSelSet + 12+typeSTRPTR;
(* examine other user's flags *)
tagSelMask = tagSelSet + 16;
(* select msgs, that's flags *)
tagSelMatch = tagSelSet + 17;
(* ANDed with mask equal match *)
tagSelParent = tagSelSet + 18;
(* examine parent's flags *)
tagSelDate = tagSelSet + 19;
(* select msgs younger than this date *)
tagSelTree = tagSelSet + 20;
(* select whole tree this msg is in *)
tagSelSubTree = tagSelSet + 21;
(* select sub-tree this msg is root of *)
tagSelMsg = tagSelSet + 22;
(* select a msg specified by number *)
tagSelQuick = tagSelSet + 23;
(* quick select enabled *)
tagSelLink = tagSelSet + 24;
(* 0: don't select links *)
(* 1: also select hard links *)
tagSelCDate = tagSelSet + 25;
(* select msgs younger than this cDate *)
tagSelSize = tagSelSet + 26;
(* select msgs with more bytes *)
(* more modifiers for status-selects *)
tagSelMaxCount = tagSelSet + 27;
(* select at most N msgs *)
(* (backwards) *)
tagSelMaxSize = tagSelSet + 28;
(* sum up msgs' sizes and stop *)
(* before the sum exceeds N bytes *)
(* (backwards) *)
(** tags for Search() **)
tagSearchLast = 2048 + u.tagUser;
(* number of LAST msg not to search *)
tagSearchQuick = tagSearchLast+ 1;
(* quick searches enabled *)
tagSearchGlobal = tagSearchLast+ 2;
(* examine global flags instead of user-flags*)
tagSearchLocal = tagSearchLast+ 3;
(* examine login-local flags, not user-flags *)
tagSearchUser = tagSearchLast+ 4+typeSTRPTR;
(* examine other user's flags *)
tagSearchDirection = tagSearchLast+ 5;
(* set search direction *)
(* 0 = default *)
(* 1 = forward *)
(* -1 = backward *)
tagSearchPattern = tagSearchLast + 6;
(* string in tagMsgText .. tagMsgText+127 is: *)
(* 0: no pattern, just a plain string *)
(* 1: an AmigaDOS style pattern *)
(* 2: a pattern, only if it contains *)
(* wildcards ('auto-detect patterns') *)
tagSearchMask = tagSearchLast+16;
(* search a msg, that's flags *)
tagSearchMatch = tagSearchLast+17;
(* ANDed with mask equal match *)
(* tagMsgText .. tagMsgText+127 are also allowed for searching *)
(** tags for ReadConfig(), WriteConfig() **)
tagCfgGlobalOnly = 3072 + u.tagUser;
(* read or write only global config, *)
(* thus must not be combined with tagCfgUser *)
tagCfgName = tagCfgGlobalOnly+ 1 + typeSTRPTR;
(* name of config var to read or write *)
tagCfgUser = tagCfgGlobalOnly+ 2 + typeSTRPTR;
(* name of user to read/write locals from/to *)
(** tags for ReadConfig() **)
tagCfgUserName = tagCfgGlobalOnly+ 3 + typeSTRPTR;
(* alias to get realname from *)
tagCfgNextVar = tagCfgGlobalOnly+ 4 + typeSTRPTR;
(* get name of next var *)
tagCfgNextAlias = tagCfgGlobalOnly+ 5 + typeSTRPTR;
(* get name of next Alias *)
tagCfgNextUser = tagCfgGlobalOnly+ 6 + typeSTRPTR;
(* get name of next User *)
tagCfgNextExporter = tagCfgGlobalOnly+ 7 + typeSTRPTR;
(* get name of next Exporter *)
tagCfgNextGroup = tagCfgGlobalOnly+ 8 + typeSTRPTR;
(* get name of next Netgroup *)
tagCfgNextGroupMember = tagCfgGlobalOnly+ 9 + typeSTRPTR;
(* get name of next Groupmember *)
tagCfgLockVar = tagCfgGlobalOnly+10;
(* 0: no locking *)
(* 1: lock and read config var *)
(** tags for ReadConfig(), WriteConfig() **)
tagCfgQuoted = tagCfgGlobalOnly +11;
(* 0: no quoting *)
(* 1: read/write var in quoted format *)
(* (as used in "ums.config") *)
(** tags for WriteConfig() **)
tagCfgDump = tagCfgGlobalOnly+16 + typeSTRPTR;
(* write current settings to a file *)
tagCfgData = tagCfgGlobalOnly+17 + typeSTRPTR;
(* data to write to specified var *)
tagCfgCreateUser = tagCfgGlobalOnly+18 + typeSTRPTR;
(* create new User *)
tagCfgDeleteUser = tagCfgGlobalOnly+19 + typeSTRPTR;
(* delete user *)
tagCfgCreateAlias = tagCfgGlobalOnly+20 + typeSTRPTR;
(* create new alias *)
tagCfgDeleteAlias = tagCfgGlobalOnly+21 + typeSTRPTR;
(* delete alias *)
tagCfgNetGroup = tagCfgGlobalOnly+22 + typeSTRPTR;
(* create a netgroup *)
tagCfgAddNetGroup = tagCfgGlobalOnly+23 + typeSTRPTR;
(* create/add netgroups *)
tagCfgDeleteNetGroup = tagCfgGlobalOnly+24 + typeSTRPTR;
(* remove a group from a netgroup *)
tagCfgUnlockVar = tagCfgGlobalOnly+25;
(* 0: no locking *)
(* 1: unlock and write config var *)
(* 2: unlock but don't write *)
tagCfgLocal = tagCfgGlobalOnly + 26;
(* create/delete login-local variable *)
tagCfgCreateSysop = tagCfgGlobalOnly + 27 + typeSTRPTR;
(* create a new sysop *)
tagCfgCreateExporter = tagCfgGlobalOnly + 28 + typeSTRPTR;
(* create a new exporter *)
(** tags for MatchConfig() **)
tagMatchGlobalOnly = 4096 + u.tagUser;
tagMatchVarname = tagMatchGlobalOnly+ 1 + typeSTRPTR;
tagMatchUser = tagMatchGlobalOnly+ 2 + typeSTRPTR;
tagMatchString = tagMatchGlobalOnly+ 3 + typeSTRPTR;
tagMatchDefault = tagMatchGlobalOnly+ 4;
END UmsD.Lib11