Tt_message ( *Ttdt_contract_cb) ( Tt_message msg, void * clientdata Tt_message contract ); Tt_pattern * ttdt_session_join( const char * sessid, Ttdt_session_cb cb, Widget shell, void * clientdata, int join );
The ttdt_session_join() function joins a ToolTalk session as a "good desktop citizen"; that is, it registers patterns and default callbacks for many standard desktop message interfaces when it joins the session sessid. Table A-16 lists the message interfaces for which this function currently registers.
Table A-16 Standard Messages for which the ttdt_session_join Registers
If the sessid parameter is null, the default session is joined.
If the join parameter is set, the specified session is joined.
A Ttdt_contract_cb message takes the parameters described in Table A-17. If the callback does not consume the message, it returns the message; if it consumes the message, it returns either zero or a error pointer cast to Tt_message.
Table A-17 Parameters taken by Ttdt_session_cb
Parameter |
Description |
---|---|
Tt_message msg |
The request in the sent state. The client program must either fail, reject, or reply to the message. Note - Note: Destroy the message msg after it is processed. |
void *clientdata |
The clientdata passed to either the ttdt_session_join() or ttdt_message_accept() function. |
Tt_messagecontract |
The contract passed to the ttdt_message_accept() function. If the callback is installed by the ttdt_session_join() function, the value for the contract parameter is always zero. |
The ttdt_session_join() function returns a null-terminated array of Tt_pattern, which can be passed to the ttdt_session_quit() function to be destroyed. If an error occurs, the returned array that is an error pointer. Use tt_ptr_error to find the Tt_status. Table A-18 lists the possible errors returned.
Table A-18 Possible Errors Returned by the ttdt_session_join
Error Returned |
Description |
---|---|
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. |
|
The process identifier specified is out of date or invalid. |
|
An out-of-date or invalid ToolTalk session was specified. |
|
The pointer passed does not point at an object of the correct type for this operation. For example, the pointer may point to an integer when a character string is needed. |
|
There is not enough memory available to perform the operation. |