[Next] [Previous] [Up] [Top] [Contents] [Index]

1.3 PSYX Calling Conventions

1.3.2 The main() function

When a message is sent to a PSYX, execution usually jumps to the beginning of the `PSYX' code resource (see " Stand-alone code resources"). Parameters to the main() function are placed on the stack using C-style calling conventions.

The parameters are a four-character (long word) message type, a short word modifier (which is rarely useful), a pointer to message-specific data, and the (long word) ID by which the PSYX was called. The return value should be a short word boolean value: TRUE (i.e. non-zero) if the PSYX knows and accepts the message, FALSE otherwise.

Here is an example prototype:

	short main(long msg, short mod, void *msgData, long id);

Note: Since C-style calling conventions are used, you may omit the id parameter if it is irrelevant to your PSYX implementation.

PSYX Programmer's Manual - 24 AUG 95
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with CERN WebMaker