-
Notifications
You must be signed in to change notification settings - Fork 3
Custom context
Julien edited this page Mar 17, 2020
·
2 revisions
Sometimes you want to associate some information with a twirc state, so that you can later refer to it again in your callback functions. This can be achieved with the twirc_set_context()
and twirc_get_context()
functions.
This functions allows you to store a pointer in the twirc state and retrieve it later. Its signature is as follows:
void twirc_set_context(twirc_state_t *s, void *ctx);
This function allows you to retrieve the pointer that you stored in the state with twirc_set_context()
earlier. Here is its signature:
void *twirc_get_context(twirc_state_t *s);