ToolTalk User's Guide

Can I pass my own data to a function registered by tt_message_callback_add?

To pass your own data to a function registered by tt_message_callback_add, use the user data cells on the message; for example:

       x = tt_message_create();
       tt_message_callback_add(x,my_callback);
       tt_message_user_set(x, 1, (void *)my_data);

....

Tt_callback_action
Tt_message_callback(Tt_message m, Tt_pattern p)
{
	struct my_data_t *my_data;
	my data = (struct my_data_t *)tt_message_user(m, 1);

        ...

}


Note -

User data can only be seen in the client where the data is sent.