11.4 PSYX Manager
long SendPSYXInGroup(long ID, long class, int mustBeLoaded, long msg, int mod, void *msgData); #define SendPSYX(ID, msg, mod, data) \ SendPSYXInGroup(ID, EveryPSYXGroup, TRUE, msg, mod, data) #define SendPSYXGroup(class, msg, mod, data) \ SendPSYXInGroup('****', class, TRUE, msg, mod, data)
Sends the given PSYX a message. The use ofmod
andmsgData
depend on the message sent.
ID
is the PSYX to which the message is being sent. IfID
is'????'
, the message is sent to each loaded PSYX inclass
until one accepts to the message. IfID
is'****'
, the message is sent to all PSYXs inclass
. Ifclass
is 0, the call will apply to all classes.If
mustBeLoaded
isTRUE
, the message will only be sent to PSYX(s) which are loaded. IfmustBeLoaded
isFALSE
withID
=='????'
, the call will be attempted first with loaded PSYXs.The return value is the PSYX which received the message, or 0 if the message failed. If
ID
=='****'
, the return value is the last PSYX to receive the message.
PSYXerror
is set tope_unknown
if the PSYX ID is bad. If the PSYX was not loaded andmustBeLoaded
isTRUE
,PSYXerror
is set tope_not_loaded
. If the specified PSYX is not in the specified class,PSYXerror
is set tope_wrong_group
. If the PSYX does not know the message,PSYXerror
is set tope_bad_message
.
long SendPSYXInGroupString(long ID, long class, char *stringMsg, int mod, void *msgData); #define SendPSYXString(ID, str, spec, data) \ SendPSYXInGroupString(ID, str, spec, data)
LikeSendPSYXInGroup()
, except that a string message is accepted. This string message is converted to a message ID by sendingpGetMsgCode
to the PSYX.The errors are the same as for
SendPSYXInGroup()
.
long CallPSYX(long ID, long msg, int mod, ...); #define GetPSYXMessageCode(ID, str, code) \ GetPSYXInGroupMessageCode(ID, EveryPSYXGroup, str, code) #define GetPSYXGroupMessageCode(class, str, code) \ GetPSYXInGroupMessageCode('????', class, str, code)
This function acts differently, depending on whether the message for the PSYX is in a message table or not.If the message is not in the PSYX's message table, then all of the extra parameters after
mod
are bundled together as a data block and the pointer to the block is passed in as themsgData
.If the message is in the PSYX's message table, the parameters specified after
mod
are all passed directly to the function.Due to this difference in definition,
CallPSYX()
should used if and only if the message is required to be in the message table.
PSYXerror
is set tope_unknown
if the PSYX ID is bad. If the PSYX does not know the message,PSYXerror
is set tope_bad_message
.
long GetPSYXInGroupMessageCode(long ID, long class, char *stringMsg, long *msgCode);
Sends a thepGetMsgCode
message to the PSYX so it can convert the message string into a message code.
ID
andclass
are as withSendPSYXInGroup()
, except that an ID of'****'
is converted to'????'
.If a PSYX knows the string message, the resulting code is put into
*msgCode
and the responding PSYX ID is returned.Errors are as with
SendPSYXInGroup()
.
int FillInFunctionList(long ID, long *msgCodes, int count);
Checks the PSYX's message table for each of the codes in themsgCode
; if a function is found for the message, the message is replaced in the array by the address of the function; if a function is not found, the message is replaced by 0 andPSYXerror
is set tope_bad_message
, but the process continues to the end ofmsgCodes
anyway. count is the length of themsgCodes
array.The function returns
TRUE
if the whole table was filled in, orFALSE
if any error occurred.
PSYXerror
is set tope_unknown
if the PSYX ID is bad.
Generated with CERN WebMaker