libsrsirc
0.0.14
Lightweight, cross-platform IRC library
|
Data Structures | |
struct | chanrep |
Object representation of an IRC channel. More... | |
struct | userrep |
Object representation of an IRC user. More... | |
Typedefs | |
typedef struct chanrep | chanrep |
Convenience typedef for struct chanrep. Probably a bad idea. | |
typedef struct userrep | userrep |
Convenience typedef for struct userrep. Probably a bad idea. | |
Functions | |
size_t | irc_num_chans (irc *ctx) |
Count the channels we are currently in. More... | |
size_t | irc_all_chans (irc *ctx, chanrep *chanarr, size_t chanarr_cnt) |
Retrieve representations of all channels we're currently in. More... | |
chanrep * | irc_chan (irc *ctx, chanrep *dest, const char *name) |
Retrieve one channel representation by channel name. More... | |
bool | irc_tag_chan (irc *ctx, const char *chnam, void *tag, bool autofree) |
Associate opaque user data with a channel. More... | |
size_t | irc_num_users (irc *ctx) |
Count the users we are currently seeing. More... | |
size_t | irc_all_users (irc *ctx, userrep *userarr, size_t userarr_cnt) |
Retrieve representations of all users we're currently seeing. More... | |
userrep * | irc_user (irc *ctx, userrep *dest, const char *ident) |
Retrieve one user representation by nickname. More... | |
bool | irc_tag_user (irc *ctx, const char *ident, void *tag, bool autofree) |
Associate opaque user data with a user. More... | |
size_t | irc_num_members (irc *ctx, const char *chnam) |
Count number of users in a given channel. More... | |
size_t | irc_all_members (irc *ctx, const char *chnam, userrep *userarr, size_t userarr_cnt) |
Retrieve representations of all members of a channel. More... | |
userrep * | irc_member (irc *ctx, userrep *dest, const char *chnam, const char *ident) |
Retrieve one member representation by nickname and channel. More... | |
void | lsi_trk_dump (irc *ctx, bool full) |
Dump tracking state for debugging purposes. More... | |
size_t irc_num_chans | ( | irc * | ctx | ) |
Count the channels we are currently in.
Retrieve representations of all channels we're currently in.
chanarr | Pointer into an array of at least chanarr_cnt elements. The array is populated with the retrieved channel representations. |
chanarr_cnt | Maximum number of channels to retrieve |
chanarr
NOTE: The information contained in the retrieved chanrep structures is only valid until the next call to irc_read()
Retrieve one channel representation by channel name.
dest | Pointer to a chanrep where we put the result |
name | Name of the channel to retrieve |
name
, or NULL if we don't know it.NOTE: The information contained in the retrieved chanrep structure is only valid until the next call to irc_read()
bool irc_tag_chan | ( | irc * | ctx, |
const char * | chnam, | ||
void * | tag, | ||
bool | autofree | ||
) |
Associate opaque user data with a channel.
This is a general-purpose mechanism to associate a piece of user-defined information with a channel, called a "tag". The tag is persistent and can later be accessed using the tag
member of struct chanrep.
chnam | Name of the channel to tag |
tag | The tag. libsrsirc does not care what exactly this is. |
autofree | If true, call free(3) on the tag when the channel is deallocated (e.g. by PARTing it) |
size_t irc_num_users | ( | irc * | ctx | ) |
Count the users we are currently seeing.
Retrieve representations of all users we're currently seeing.
userarr | Pointer into an array of at least userarr_cnt elements. The array is populated with the retrieved user representations. |
userarr_cnt | Maximum number of users to retrieve |
userarr
NOTE: The information contained in the retrieved userrep structures is only valid until the next call to irc_read()
Retrieve one user representation by nickname.
dest | Pointer to a userrep where we put the result |
ident | Name of the user. This can be just a nickname, or a nick!user@host-style identity. |
ident
, or NULL if we don't know them.NOTE: The information contained in the retrieved userrep structure is only valid until the next call to irc_read()
bool irc_tag_user | ( | irc * | ctx, |
const char * | ident, | ||
void * | tag, | ||
bool | autofree | ||
) |
Associate opaque user data with a user.
This is a general-purpose mechanism to associate a piece of user-defined information with a user, called a "tag". The tag is persistent and can later be accessed using the tag
member of struct userrep.
ident | Name of the user to tag. This can be just a nickname, or a nick!user@host-style identity. |
tag | The tag. libsrsirc does not care what exactly this is. |
autofree | If true, call free(3) on the tag when the user is deallocated (e.g. by them leaving our last common channel) |
size_t irc_num_members | ( | irc * | ctx, |
const char * | chnam | ||
) |
Count number of users in a given channel.
chnam | Name of the channel |
chnam
Retrieve representations of all members of a channel.
chnam | Name of the channel |
userarr | Pointer into an array of at least userarr_cnt elements. The array is populated with the retrieved user representations. |
userarr_cnt | Maximum number of users to retrieve |
userarr
NOTE: The information contained in the retrieved userrep structures is only valid until the next call to irc_read()
Retrieve one member representation by nickname and channel.
dest | Pointer to a userrep where we put the result |
chnam | Name of the channel |
ident | Name of the user. This can be just a nickname, or a nick!user@host-style identity. |
ident
in channel chnam
, or NULL if we don't know the user, the channel, or the user isn't in that channel.NOTE: The information contained in the retrieved userrep structure is only valid until the next call to irc_read()
void lsi_trk_dump | ( | irc * | ctx, |
bool | full | ||
) |
Dump tracking state for debugging purposes.
This function is intended for debugging and will puke out a dump of all tracking-related state associated with the given context
full | Do a full dump |