/* ------------------------------------------------------------------------ :Program. UMSInit.rexx :Contents. constant definitions and initialisations for ums.library :Author. Martin Horneffer :History. v1.0 [mh] 26-Sep-93 :History. v1.1 [hG] 23-Jan-94 added default parameter parsing, :History. incl. of RexxDosSupport.library etc. :Version. $VER: UMSInit 1.1 (22.1.94) :Copyright. Freely Distributable :Language. ARexx ------------------------------------------------------------------------ */ FALSE = 0 TRUE = 1 /* enumeration of fields in an UMS-message */ UMSCODE_MsgText = 0 UMSCODE_FromName = 1 UMSCODE_FromAddr = 2 UMSCODE_ToName = 3 UMSCODE_ToAddr = 4 UMSCODE_MsgID = 5 UMSCODE_CreationDate = 6 UMSCODE_ReceiveDate = 7 UMSCODE_RefID = 8 UMSCODE_Group = 9 UMSCODE_Subject = 10 UMSCODE_Attributes = 11 UMSCODE_Comments = 12 UMSCODE_Organization = 13 UMSCODE_Distribution = 14 UMSCODE_Folder = 15 UMSCODE_FidoID = 16 UMSCODE_MausID = 17 UMSCODE_ReplyGroup = 18 UMSCODE_ReplyName = 19 UMSCODE_ReplyAddr = 20 UMSCODE_FidoText = 32 UMSCODE_ErrorText = 33 UMSCODE_Newsreader = 34 UMSNUMFIELDS = 128 /* user status-bits */ UMSUSTAT_Archive = 4 /* msg should be archived, don't delete */ UMSUSTAT_Junk = 5 /* negative selection, inheritance suggested */ UMSUSTAT_PostPoned = 6 /* to be read again, (but not now) */ UMSUSTAT_Selected = 7 /* positive selection, inheritance suggested */ UMSUSTAT_Old = 8 /* user has already read this Message */ UMSUSTAT_Read = Old UMSUSTAT_WriteAccess = 9 /* user may change or delete this message */ UMSUSTAT_ReadAccess = 10 /* user may read this message */ UMSUSTAT_ViewAccess = 11 /* user may read the header of this message */ UMSUSTAT_Owner = 12 /* user 'owns' (wrote) this message */ UMSUFLAGS_Protected = '00001E00'x /* WriteAccess, ReadAccess, ViewAccess, Owner */ /* global status-bits */ UMSGSTAT_Deleted = 0 /* msg is really deleted */ UMSGSTAT_Expired = 1 /* msg has expired and may be deleted */ UMSGSTAT_Exported = 2 /* msg has been exported */ UMSGSTAT_Orphan = 3 /* msg could not be exported */ UMSGSTAT_Link = 4 /* within a ring of linked msgs */ UMSGSTAT_HardLink = 5 /* link is hardLink */ UMSGFLAGS_Protected = '0000003D'x /* Deleted, Exported, Orphan, Link, HardLink */ /* Errors */ UMSERR_ok = 0 UMSERR_unknown = 1 UMSERR_codeMissing = 100 UMSERR_forbiddenCode = 101 UMSERR_noWriteAccess = 102 UMSERR_noReader = 103 UMSERR_noExporter = 104 UMSERR_badLink = 105 UMSERR_noWork = 106 UMSERR_noSysop = 107 UMSERR_badChange = 108 UMSERR_dupe = 200 UMSERR_noReadAccess = 201 UMSERR_noViewAccess = 202 UMSERR_msgCorrupted = 203 UMSERR_noHdrSpace = 204 UMSERR_noSuchMsg = 205 UMSERR_badName = 206 UMSERR_badTag = 207 UMSERR_missingTag = 208 UMSERR_noSuchUser = 209 UMSERR_notFound = 210 UMSERR_autoBounce = 211 UMSERR_msgDeleted = 212 UMSERR_noNetAccess = 213 UMSERR_badPattern = 214 UMSERR_badVarname = 215 UMSERR_fsFull = 216 UMSERR_noMsgMem = 217 UMSERR_missingIndex = 218 UMSERR_serverTerminated = 300 UMSERR_cantWrite = 301 UMSERR_cantRead = 302 UMSERR_wrongMsgPtr = 303 UMSERR_serverNotFree = 304 UMSERR_idCountProb = 305 UMSERR_noLogin = 306 UMSERR_wrongServer = 307 UMSERR_noMem = 308 /*** Startup ***/ options results RC = 0 signal on BREAK_C signal on BREAK_D signal on BREAK_E signal on BREAK_F signal on ERROR signal on HALT signal on IOERR signal on SYNTAX /*** Open ums.library ***/ /* result is ignored since AddLib() does not check whether the lib * exists but only whether the name is already in the list */ call addlib('ums.library', 0, -210, 8) call addlib('RexxDosSupport.library', 0, -30, 1) /* get default values, parse arguments */ server = GetVar('UMSServer') name = GetVar('username') parse arg arguments if strip(arguments) = '?' then do address command 'echo noline "' ArgsTemplate ': "' pull arguments end; else nop if ~ ReadArgs(arguments,ArgsTemplate) then do say Fault(RC,ProgramName) exit 10 end; else nop drop arguments /* Login is not done here to give the the chance to overwrite * the arguments/env-vars during test phase of skripts. */