src/irc_client.h
changeset 53 12d806823775
child 55 6f7f6ae729d0
equal deleted inserted replaced
52:97604efda1ce 53:12d806823775
       
     1 #ifndef IRC_CLIENT_H
       
     2 #define IRC_CLIENT_H
       
     3 
       
     4 /**
       
     5  * @file
       
     6  * 
       
     7  * Defines the high-level, full-featured IRC 'client' state, which essentially manipulates a set of irc_net's
       
     8  */
       
     9 #include "irc_net.h"
       
    10 #include <sys/queue.h>
       
    11 
       
    12 /**
       
    13  * The IRC client
       
    14  */
       
    15 struct irc_client {
       
    16     /** Our set of configured IRC networks */
       
    17     TAILQ_HEAD(irc_client_networks, irc_net) networks;
       
    18 
       
    19     /** Are we in the process of quitting all networks? */
       
    20     bool quitting;
       
    21 
       
    22     /** Have we quit all networks? */
       
    23     bool quit;
       
    24 };
       
    25 
       
    26 /**
       
    27  * Construct a new irc_client
       
    28  */
       
    29 err_t irc_client_create (struct irc_client **client_ptr, struct error_info *err);
       
    30 
       
    31 /**
       
    32  * Destroy the irc_client, also destroying all networks
       
    33  */
       
    34 void irc_client_destroy (struct irc_client *client);
       
    35 
       
    36 /**
       
    37  * Add a new IRC network
       
    38  */
       
    39 err_t irc_client_add_net (struct irc_client *client, struct irc_net **net_ptr, struct irc_net_info *net_info);
       
    40 
       
    41 /**
       
    42  * Get a pre-existing IRC network by name
       
    43  */
       
    44 struct irc_net* irc_client_get_net (struct irc_client *client, const char *network);
       
    45 
       
    46 /**
       
    47  * Quit cleanly from all our IRC networks.
       
    48  *
       
    49  * XXX: currently no way to indicate once we've quit all of them
       
    50  */
       
    51 err_t irc_client_quit (struct irc_client *client, const char *message);
       
    52 
       
    53 #endif