Common Desktop Environment: ToolTalk Messaging Overview

ttdt_file_request

Tt_message					  ttdt_file_request(
			Tt_message			  context,
			Tttk_op			     op,
			Tt_scope			     scope,
 		const char         pathname,
			Ttdt_file_cb	     cb,
 		void               client_data,
 		int			        send_and_destroy
			);

The ttdt_file_request() function creates, and optionally sends, any standard Desktop file-scoped request (such as Get_Modified, Save, and Revert).


Note -

This function is a lower-level interface than the ttdt_Get_Modified(), ttdt_Save(), and ttdt_Revert() functions, which create and send the request and then block on its reply.


The ttdt_file_request() function creates a request with the specified op and scope, and sets its file attribute to pathname. Per Desktop messaging conventions, an unset Tt_mode argument of TT_IN and the vtype File is added to the request; and if the specified operation is ttdt_Get_Modified(), an unset Tt_mode argument of TT_OUT and the vtype Boolean is also added to the request.

If context is not zero, the request created by this routine inherits from context all contexts whose slot name are prefixed with ENV_.

This function installs cb as a message callback for the created request, and ensures that client data will be passed into the callback. If send is true, this function sends the request before returning the handle to it.

This function returns the created Tt_message when successful. If an error occurs, an error pointer is returned. Use tt_ptr_error to find out the Tt_status. Table A-9 lists the possible errors returned by this function.

Table A-9 Possible Errors Returned by ttdt_file_request

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 available memory to perform the operation. 

TT_ERR_OVERFLOW

The ToolTalk service has received the maximum amount of active messages (2000) it can properly handle. 

TT_ERR_DBAVAIL

The ToolTalk service could not access the ToolTalk database needed for this operation. 

TT_ERR_DBEXIST

The ToolTalk service did not find the specified ToolTalk database in the expected place. 

TT_ERR_POINTER

The path name was null or otherwise invalid.