Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tttk_xt_input_handler(3) [hpux man page]

tttk_Xt_input_handler(library call)									       tttk_Xt_input_handler(library call)

NAME
tttk_Xt_input_handler -- Process ToolTalk events for Xt clients SYNOPSIS
#include <Tt/tttk.h> void tttk_Xt_input_handler( XtPointer procid, int *source, XtInputId *id); DESCRIPTION
If procid is not NULL, tttk_Xt_input_handler passes it to tt_default_procid_set(3). The tttk_Xt_input_handler function then calls tt_mes- sage_receive(3), which retrieves the next message available, if any, for the default procid. If tt_message_receive(3) returns TT_ERR_NOMP, then tttk_Xt_input_handler closes the default procid with ttdt_close(3), and removes the input source *id with XtRemoveInput(3) if id is not zero. If a message is available and tt_message_receive(3) returns it (indicating it was not consumed by any message or pattern call- back), then the ToolTalk service passes the message to tttk_message_abandon(3). RETURN VALUE
The tttk_Xt_input_handler function returns no value. APPLICATION USAGE
The application should use tttk_Xt_input_handler as its Xt input handler unless some messages are expected not to be consumed by callbacks. (The only messages that absolutely cannot be intercepted and consumed by callbacks are those that match observe signatures in a ptype or otype.) EXAMPLES
int myTtFd; char *myProcID; myProcID = ttdt_open(&myTtFd, "WhizzyCalc", "Acme", "1.0", 1); /* ... */ /* Process the message that started us, if any */ tttk_Xt_input_handler(myProcID, 0, 0); /* ... */ XtAppAddInput(myContext, myTtFd, (XtPointer)XtInputReadMask, tttk_Xt_input_handler, myProcID); SEE ALSO
Tt/tttk.h - Tttttk(5), ttdt_close(3), tttk_message_abandon(3), tt_default_procid_set(3), tt_message_receive(3), XtAppAddInput(3), XtRemoveInput(3). tttk_Xt_input_handler(library call)

Check Out this Related Man Page

tt_message_callback_add(library call)									     tt_message_callback_add(library call)

NAME
tt_message_callback_add -- register a callback function SYNOPSIS
#include <Tt/tt_c.h> Tt_status tt_message_callback_add( Tt_message m, Tt_message_callback f); DESCRIPTION
The tt_message_callback_add function registers a callback function to be automatically invoked by tt_message_receive(3) whenever a reply or other state-change to this message is returned. The callback is defined in Tt/tt_c.h - Tttt_c(5). If the callback returns TT_CALLBACK_CONTINUE, other callbacks will be run; if no callback returns TT_CALLBACK_PROCESSED, tt_message_receive returns the message. If the callback returns TT_CALLBACK_PROCESSED, no further callbacks are invoked for this event; tt_message_receive does not return the message. The m argument is the opaque handle for the message involved in this operation. The f argument is the message callback to be run. The pattern handle will be NULL if the message did not match a dynamic pattern. This is usually the case for message callbacks. RETURN VALUE
Upon successful completion, the tt_message_callback_add function returns the status of the operation as one of the following Tt_status val- ues: TT_OK The operation completed successfully. TT_ERR_NOMP The ttsession(1) process is not running and the ToolTalk service cannot restart it. TT_ERR_POINTER The pointer passed does not point to an object of the correct type for this operation. APPLICATION USAGE
These callbacks are invoked from tt_message_receive; the program must, therefore, call tt_message_receive when the file descriptor returned by tt_fd becomes active. The application can use tt_message_callback_add to create wrappers for ToolTalk messages. For example, a library routine can construct a request, attach a callback to the message, send the message, and process the reply in the callback. When the callback returns TT_CALL- BACK_PROCESSED, the message reply is not returned to the main program; the message and reply are, therefore, completely hidden. SEE ALSO
Tt/tt_c.h - Tttt_c(5), tt_message_receive(3). tt_message_callback_add(library call)
Man Page