src/irc_net.c
branchnew-lib-errors
changeset 217 7728d6ec3abf
parent 180 22967b165692
equal deleted inserted replaced
216:a10ba529ae39 217:7728d6ec3abf
    37  */
    37  */
    38 static void irc_net_conn_registered (struct irc_conn *conn, void *arg)
    38 static void irc_net_conn_registered (struct irc_conn *conn, void *arg)
    39 {
    39 {
    40     struct irc_net *net = arg;
    40     struct irc_net *net = arg;
    41     struct irc_chan *chan = NULL;
    41     struct irc_chan *chan = NULL;
    42     struct error_info err;
    42     error_t err;
    43 
    43 
    44     (void) conn;
    44     (void) conn;
    45 
    45 
    46     // join our channels
    46     // join our channels
    47     TAILQ_FOREACH(chan, &net->channels, net_channels) {
    47     TAILQ_FOREACH(chan, &net->channels, net_channels) {
    53 }
    53 }
    54 
    54 
    55 /**
    55 /**
    56  * Our irc_conn has spontaneously failed, destroy it
    56  * Our irc_conn has spontaneously failed, destroy it
    57  */
    57  */
    58 static void irc_net_conn_error (struct irc_conn *conn, struct error_info *err, void *arg)
    58 static void irc_net_conn_error (struct irc_conn *conn, error_t *err, void *arg)
    59 {
    59 {
    60     struct irc_net *net = arg;
    60     struct irc_net *net = arg;
    61 
    61 
    62     (void) conn;
    62     (void) conn;
    63     
    63     
   248     {   "NOTICE",           &irc_net_on_msg         },
   248     {   "NOTICE",           &irc_net_on_msg         },
   249     
   249     
   250     {   NULL,               NULL                    }
   250     {   NULL,               NULL                    }
   251 };
   251 };
   252 
   252 
   253 err_t irc_net_create (struct irc_net **net_ptr, const struct irc_net_info *info, struct error_info *err)
   253 err_t irc_net_create (struct irc_net **net_ptr, const struct irc_net_info *info, error_t *err)
   254 {
   254 {
   255     struct irc_net *net;
   255     struct irc_net *net;
   256     
   256     
   257     // allocate
   257     // allocate
   258     if ((net = calloc(1, sizeof(*net))) == NULL)
   258     if ((net = calloc(1, sizeof(*net))) == NULL)
   317 
   317 
   318     // ourselves
   318     // ourselves
   319     free(net);
   319     free(net);
   320 }
   320 }
   321 
   321 
   322 err_t irc_net_add_chan (struct irc_net *net, struct irc_chan **chan_ptr, const struct irc_chan_info *info, struct error_info *err)
   322 err_t irc_net_add_chan (struct irc_net *net, struct irc_chan **chan_ptr, const struct irc_chan_info *info, error_t *err)
   323 {
   323 {
   324     struct irc_chan *chan;
   324     struct irc_chan *chan;
   325 
   325 
   326     // create the new irc_chan struct
   326     // create the new irc_chan struct
   327     if (irc_chan_create(&chan, net, info, err))
   327     if (irc_chan_create(&chan, net, info, err))