src/irc_chan.c
changeset 87 f0db6ebf18b9
parent 83 c8e2dac08207
child 89 68345a9b99a3
equal deleted inserted replaced
86:5e7e64544cb7 87:f0db6ebf18b9
     8 
     8 
     9 const char* irc_chan_name (struct irc_chan *chan)
     9 const char* irc_chan_name (struct irc_chan *chan)
    10 {
    10 {
    11     return chan->info.channel;
    11     return chan->info.channel;
    12 }
    12 }
       
    13 
       
    14 /**
       
    15  * Invoke the named irc_chan_callbacks field with the given args
       
    16  */
       
    17 #define IRC_CHAN_INVOKE_CALLBACK(chan, _cb_name_, ...)          \
       
    18     do {                                                        \
       
    19         struct chain_head *head;                                \
       
    20                                                                 \
       
    21         CHAIN_FOREACH(&(chan)->callbacks, head) {               \
       
    22             const struct irc_chan_callbacks *callbacks = head->chain;       \
       
    23                                                                 \
       
    24             if (callbacks->_cb_name_)                           \
       
    25                 callbacks->_cb_name_((chan), ## __VA_ARGS__, head->arg);    \
       
    26         }                                                       \
       
    27     } while (0);
    13 
    28 
    14 /**
    29 /**
    15  * Add or update a nickname to the irc_chan.users list.
    30  * Add or update a nickname to the irc_chan.users list.
    16  *
    31  *
    17  * If the given nickname already exists in our users list, this does nothing. Otherwise, an irc_user is aquired using
    32  * If the given nickname already exists in our users list, this does nothing. Otherwise, an irc_user is aquired using