Fill in any arguments specific to the operation. Use the function that best suits your argument's data type:
tt_message_arg_add()
Adds an argument whose value is a zero-terminated character string.
tt_message_barg_add()
Adds an argument whose value is a byte string.
tt_message_iarg_add()
Adds an argument whose value is an integer.
For each argument you add (regardless of the value type), specify:
Tt_mode
Specify TT_IN
or TT_INOUT
. TT_IN
indicates that the argument is written by the sender and can be read by the handler and any observers. TT_INOUT
indicates that the argument is written by the sender and the handler and can be read by all. If you are sending a request that requires the handler to provide an argument in return, use TT_INOUT.
Value Type
The value type (vtype) describes the type of argument data that is to be added. The ToolTalk service uses the vtype name when it compares a message to registered patterns to determine a message's recipients. The ToolTalk service does not use the vtype to process a message or pattern argument value.
The vtype name helps the message receiver interpret data. For example, if a word processor rendered a paragraph into a PostScript representation in memory, it could call tt_message_arg_add with the following arguments:
tt_message_arg_add (m, "PostScript", buf);
In this case, the ToolTalk service would assume buf pointed to a zero-terminated string and send it.
Similarly, an application could send an enum value in a ToolTalk message; for example, an element of Tt_status:
tt_message_iarg_add(m, "Tt_status", (int) TT_OK);
The ToolTalk service sends the value as an integer but the Tt_status vtype tells the recipient what the value means.
It is very important that senders and receivers define particular vtype names so that a receiver does not attempt to retrieve a value that was stored in another fashion; for example, a value stored as an integer but retrieved as a string.