Common Desktop Environment: ToolTalk Messaging Overview

tttk_message_create

Tt_message  tttk_message_create(	Tt_message       context,
           Tt_class           the_class,
           Tt_scope           the_scope,
           const char *       handler,
           const char *       op,
           Tt_message_callback     callback
);

The tttk_message_create() function creates a message that conforms to the conventions. This function provides a simple way to create a message that propagates inherited contexts from one message to another.

The tttk_message_create() function creates a message and copies onto it all the context slots from context whose slot name begins with ENV_. The created message is given a Tt_class value of the_class and a Tt_scope value of the_scope.

If the handler parameter is null, the message is given a Tt_address of TT_PROCEDURE; otherwise, the message is TT_HANDLER-addressed to that procid.

If the op argument is not null, the message's op argument is set to that value.

If the callback argument is not null, it is added to the message as a message callback.

If successful, the tttk_message_create() function returns the created Tt_message, which can be modified, sent, and destroyed in the same way as any other Tt_message.

If an error occurs, an error pointer is returned. Use tt_ptr_error to find the Tt_status. Table A-28 lists the possible errors returned.

Table A-28 Possible Errors Returned by the tttk_message_create

Error Returned 

Description 

TT_ERR_NOMP

The ttsession process is not available. The ToolTalk service tries to restart ttsession if it is not running. This error indicates that the ToolTalk service is either not installed or not installed correctly. 

TT_ERR_PROCID

The process identifier specified is out of date or invalid. 

TT_ERR_NOMEM

There is not enough memory available to perform the operation.