Managing contexts.(3)

NAME
Managing contexts. -

  Functions
void irc_set_ctx (irc_session_t *session, void *ctx)
Sets the IRC session context.
void * irc_get_ctx (irc_session_t *session)
Returns the IRC session context.

Function Documentation

  void * irc_get_ctx (irc_session_t * session)

Returns the IRC session context.

Parameters:
    session An initiated session.

This function returns the IRC session context, which was set by irc_set_ctx(). If no context was set, this function returns NULL.

See also:
    irc_set_ctx

  void irc_set_ctx (irc_session_t * session, void * ctx)

Sets the IRC session context.

Parameters:
    session An initiated session.
    ctx A context.

This function sets the user-defined context for this IRC session. This context is not used by libircclient. Its purpose is to store session-specific user data, which may be obtained later by calling irc_get_ctx(). Note that libircclient just 'carries out' this pointer. If you allocate some memory, and store its address in ctx (most common usage), it is your responsibility to free it before calling irc_destroy_session().

See also:
    irc_get_ctx