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 ofmodandmsgDatadepend on the message sent.
IDis the PSYX to which the message is being sent. IfIDis'????', the message is sent to each loaded PSYX inclassuntil one accepts to the message. IfIDis'****', the message is sent to all PSYXs inclass. Ifclassis 0, the call will apply to all classes.If
mustBeLoadedisTRUE, the message will only be sent to PSYX(s) which are loaded. IfmustBeLoadedisFALSEwithID=='????', 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.
PSYXerroris set tope_unknownif the PSYX ID is bad. If the PSYX was not loaded andmustBeLoadedisTRUE,PSYXerroris set tope_not_loaded. If the specified PSYX is not in the specified class,PSYXerroris set tope_wrong_group. If the PSYX does not know the message,PSYXerroris 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 sendingpGetMsgCodeto 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
modare 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
modare 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.
PSYXerroris set tope_unknownif the PSYX ID is bad. If the PSYX does not know the message,PSYXerroris set tope_bad_message.
long GetPSYXInGroupMessageCode(long ID, long class, char *stringMsg, long *msgCode);
Sends a thepGetMsgCodemessage to the PSYX so it can convert the message string into a message code.
IDandclassare as withSendPSYXInGroup(), except that an ID of'****'is converted to'????'.If a PSYX knows the string message, the resulting code is put into
*msgCodeand 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 andPSYXerroris set tope_bad_message, but the process continues to the end ofmsgCodesanyway. count is the length of themsgCodesarray.The function returns
TRUEif the whole table was filled in, orFALSEif any error occurred.
PSYXerroris set tope_unknownif the PSYX ID is bad.
Generated with CERN WebMaker