home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 3
/
Meeting_Pearls_III.iso
/
Pearls
/
comm
/
Mail+News
/
UMS11
/
Doc
/
english
/
RexxUMS.doc
< prev
next >
Wrap
Text File
|
1995-05-13
|
12KB
|
269 lines
///////////////////////////////////////////
/// UMS - Universal Message System ///
/// Documentation of the ARexx Inteface ///
///////////////////////////////////////////
ums.library is a ARexx function library. The query function is at
offset -210. Use addlib() or RXLIB to install it in the global library
list of ARexx.
Please refer the autodoc of ums.library and the supplied sample scrips
("ReadMessage.rexx", "WriteMessage.rexx", "GroupContents.rexx" and
"ShowGroups.rexx") to get a general understanding of the functions.
Most functions have slightly other parameters than their counterparts in
ums.library. These changes were necessary in order to get a useful
interface. They should be easy to understand.
Unfortunately the API changed with the different versions of ums.library.
See changes at the end of the file.
Datatypes:
==========
string - a string (e.g. "Hello!")
account - abstract handle returned by Login()
number - a cardinal number
boolean - "0" (FALSE) or "1" (TRUE)
flags - a bitfield (e.g. '00110111 10101001 10100110 10100101'b)
stem - a stem variable used to hold all fields of a message
kind - kind of ums flags ("User"="U" / "Global"="G" / "Local"="L")
userkind - kind of user to be crated ("User" = "U" / "Sysop" = "S" /
"Exporter" = "E")
action - Action for ServerControl (CLEANUP/FLUSH/QUIT/QUITFORCE/
PING/LOCKCFG/UNLOCKCFG)
Special STEM compounds for UMSReadMsgInfo():
============================================
HDRLEN, TXTLEN, DATE, UP, DN, LT, RT, GLOBALSTAT, USERSTAT, LOGINSTAT,
SOFTLINK, HARDLINK
Special STEM compounds for UMSWriteMsg():
=========================================
MSGNUM, HARDLINK, SOFTLINK, CHAINUP, MSGDATE, HDRFILL, TXTFILL,
AUTOBOUNCE, NOUPDATE, HIDE
Functions:
==========
These three functions are used to login and logout.
account = UMSLogin(user: string; password: string; [server: string])
account = UMSDupAccount(account: account)
UMSLogout(account: account)
This function is used to control server activities:
number = UMSServerControl(action: action; [server: string])
Use these functions to find out if an error and it's reason:
number = UMSErrNum(account: account)
string = UMSErrTxt(account: account)
string = UMSErrTxtFromNum(error: number)
Writes a log message to ums' logfile:
UMSLog(account: account; level: number; text: string)
This one writes a new message to the message base. The field of the message
must be in the stem. The meaning of the fields numbered from 0 to 127 is
defined by the constants (UMSCODE_MsgText etc.) preset by InitUMSContst().
Look at the description of the msg-format in ums.doc. Instead of reading
a field from an ARexx string this function will read from a file if
specifieng the filename in the stem by setting UMSCODE_MsgText_FILE etc.
There are some additional special fields, too: MSGNUM, HARDLINK, SOFTLINK,
CHAINUP, MSGDATE, HDRFILL, TXTFILL, AUTOBOUNCE, NOUPDATE, HIDE. Please take
a look at ums.doc to find out their meaning:
number = UMSWriteMsg(account: account; fields: stem)
These are used by exportes to indicate the success of exporting a message
(see ums.doc):
UMSExportedMsg (account: account; message: number)
UMSCannotExport(account: account; message: number; error: string)
Deleting a message:
boolean = UMSDeleteMsg(account: account; message: number)
These functions read a message from the message base and put it's fields
into the stem. The first function reads all fields, the second just header
fields and the last only one field. _IMPORTANT_NOTE_: These functions do
not drop empty fields. Please ensure that you drop the stem before calling
one of those funktions! If you set stem copounds like UMSCODE_MsgText_FILE
to a filename the funktions will not create and store the corresponding ARexx
string but will write the field to the file. This is useful to circumvent
the limitation of ARexx string which have a maximum length of 68kB which
may result in "errTooBig" for some messages:
booelan = UMSReadMsgAll (account: account; message: number;
fields: stem; [noupdate: boolean])
booelan = UMSReadMsgHeader(account: account; message: number;
fields: stem; [noupdate: boolean])
booelan = UMSReadMsgField (account: account; message: number;
fields: stem; field: number;
[noupdate: boolean])
These reads the binary data associated with a message. It is put into the
following fields of the stem: HDRLEN, TXTLEN, DATE, UP, DN, LT, RT,
GLOBALSTAT, USERSTAT, LOGINSTAT, SOFTLINK, HARDLINK:
booelan = UMSReadMsgInfo (account: account; message: number; info: stem)
Sets all "set" flags and clears all "clear" flags for all messages between
"start" and "stop" which fulfill bitand(status,"mask")="match". You can
examine the flags of the parent message by setting "parent" to TRUE.
Selects and reads the flags of "user". Selects a maximum of "maxcount"
messages with a maximal added size of "maxsize":
number = UMSSelectFlags(account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
[kind: kind]; [mask: flags]; [match: flags]
[parent: boolean];
[maxcount: number]; [maxsize: number];
[user: string])
Selects the message(s) if a certain field has a certain value. "quick"
enables CRC checking which is fast:
number = UMSSelectField(account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
field: number; string: string;
[quick: BOOLEAN])
Selects one message by number:
number = UMSSelectMsg (account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
message: number)
All messages in the reply tree will be selected:
number = UMSSelectTree (account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
message: number;
[quick: BOOLEAN]; [sub: BOOLEAN])
Selects Messages younger than "receivedate":
number = UMSSelectDate (account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
receivedate: number)
Selects Messages younger than "creationdate":
number = UMSSelectCDate (account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
creationdate: number)
Selects Messages larger than "size":
number = UMSSelectSize (account: account;
[kind: kind]; [set: flags]; [unset: flags];
[start: nuber]; [stop: number];
size: number)
Finds the next message starting with "last" with fullfills
bitand(status,"mask")="match" (for "user"):
number = UMSSearchFlags(account: account;
[kind: kind]; [mask: flags]; [match: flags];
last: number; [user: string])
Search for the next message (for "user") fith a certain field:
number = UMSSearchField (account: account; field: number;
string: string; last: number;
[direction: number]; [quick: boolean];
[user: string])
number = UMSSearchPattern(account: account; field: number;
pattern: string; last: number;
[direction: number]; [user: string])
These are used to get configuration variables from ums.config.
string = UMSReadConfig(account: account; name: string; [user: string];
[globalonly: boolean])
string = UMSReadConfigUserName(account: account; alias: string)
string = UMSNextVar(account: account; last: string; user: string;
[globalonly: boolean])
boolean = UMSMatchConfig(account: account; name: string; string: string;
[default: string]; [user: string];
[globalonly: boolean])
string = UMSNextAlias(account: account; name: string; [alias: string])
string = UMSNextUser(account: account; [user: string])
string = UMSNextExporter(account: account; [exporter: string])
string = UMSNextNetGroup(account: account; [netgroup: string])
string = UMSNextNetGroupMember(account: account; [netgroupmember: string])
Write a variable to ums.config. In order do delete the Variable just pass
no "data":
boolean = UMSWriteConfig(account: account; name: string; [data: string];
[user: string]; [global: boolean])
Change ums.config:
boolean = UMSCreateUser(account: account; user: string; [kind: userkind])
boolean = UMSDeleteUser(account: account; user: string)
boolean = UMSCreateAlias(account: account; user: string; alias: string)
boolean = UMSDeleteAlias(account: account; alias: string)
boolean = UMSAddNetGroup(account: account; netgroup: string; newnetgroup: string)
boolean = UMSDeleteNetGroup(account: account; netgroup: string)
In order to create bitfields for flags use this funktion:
flags = UMSMakeFlags([flag: number; ...])
In order to preset variables like UMSCODE_MsgText with useful values call:
boolean = UMSInitConsts()
Changes:
========
The ARexx API of UMS v8 and v9 were not commonly used. UMS v10 introduced a
powerful API which is used by a lot of scripts.
UMS v11 introduces a new API for ARexx. It is not backward compatible.
You'll have to change all old ARexx scripts in order to work with v11. If
the scripts are changed they won't work with v10 any more. I'm sorry for
that. Here's a list of what's to do:
- New functions:
UMSDupAccount, UMSServerControl, UMSErrTxtFromNum, UMSMatchConfig,
UMSInitConsts, UMSSelectCDate, UMSSelectSize, UMSNextAlias,
UMSNextUser, UMSNextExporter, UMSNextNetGroup, UMSNextNetGroupMember,
UMSCreateUser, UMSDeleteUser, UMSCreateAlias, UMSDeleteAlias,
UMSAddNetGroup, UMSDeleteNetGroup
UMSDupAccount() is extremely useful for ARexx scripts launchend from a
program which is already logged in.
UMSServerControl() replaces a lot of old functions (see below)
UMSInitConsts() removes the need for an UMS include file. It predefines a
lot of useful constants formerly defined in UMSConsts.rexx
The new select functions were introduced with UMS 11 Server Beta 23
Library Beta 13.
The new configuration funktions, new parameters for UMSSelect(), the
"user" parameter for UMSSearch() and file support for UMSWriteMsg() and
UMSReadMsg() were introduced with UMS 11 Library Beta 17.
- Removed functions:
CleanUMS, FlushUMS, QuitUMS, LockUMSConfig, UnlockUMSConfig,
DumpUMSConfig
DumpConfig() is not useful. You can substitute all other functions by
UMSServerControl()
- Renamed funtions:
LogUMS() -> UMSLog()
WriteUMSMsg() -> UMSWriteMsg()
ExportedUMSMsg() -> UMSExportedMsg()
DeleteUMSMsg() -> UMSDeleteMsg()
ReadUMSMsgAll() -> UMSReadMsgAll()
ReadUMSMsgHeader() -> UMSReadMsgHeader()
ReadUMSMsgField() -> UMSReadMsgField()
ReadUMSMsgInfo() -> UMSReadMsgInfo()
ReadUMSConfig() -> UMSReadConfig()
ReadUMSConfigUserName() -> UMSReadConfigUserName()
NextUMSVar() -> UMSNextVar()
WriteUMSConfig() -> UMSWriteConfig()
- other changes:
UMSSelectTree()'s parameters changed.