source: irc.h @ 2b7d2d1

Last change on this file since 2b7d2d1 was a0d04d6, checked in by Wilmer van der Gaast <wilmer@…>, at 2006-05-07T18:07:43Z

Got rid of all GLib GIOChannel-related calls outside proxy.c

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[b7d3cc34]1  /********************************************************************\
2  * BitlBee -- An IRC to other IM-networks gateway                     *
3  *                                                                    *
4  * Copyright 2002-2004 Wilmer van der Gaast and others                *
5  \********************************************************************/
6
7/* The big hairy IRCd part of the project                               */
8
9/*
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19
20  You should have received a copy of the GNU General Public License with
21  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
22  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23  Suite 330, Boston, MA  02111-1307  USA
24*/
25
26#ifndef _IRC_H
27#define _IRC_H
28
29#define IRC_MAX_LINE 512
30#define IRC_MAX_ARGS 8
31
32#define IRC_LOGIN_TIMEOUT 60
33#define IRC_PING_STRING "PinglBee"
34
[aefa533e]35#define UMODES "abisw"
[238f828]36#define UMODES_PRIV "Ro"
[b7d3cc34]37#define CMODES "nt"
38#define CMODE "t"
39#define UMODE "s"
40
41typedef enum
42{
[bd9b00f]43        USTATUS_OFFLINE = 0,
[b7d3cc34]44        USTATUS_AUTHORIZED,
45        USTATUS_LOGGED_IN,
[c1826c6]46        USTATUS_IDENTIFIED,
[bd9b00f]47        USTATUS_SHUTDOWN = -1
[b7d3cc34]48} irc_status_t;
49
50typedef struct channel
51{
52        char *name;
53} channel_t;
54
55typedef struct irc
56{
57        int fd;
58        irc_status_t status;
59        double last_pong;
60        int pinging;
61        char *sendbuffer;
62        char *readbuffer;
63        int quit;
64
65        int sentbytes;
66        time_t oldtime;
67
68        char *nick;
69        char *user;
70        char *host;
71        char *realname;
72        char *password;
73
74        char umode[8];
75       
76        char *myhost;
77        char *mynick;
78
79        char *channel;
80        int c_id;
81
82        char is_private;                /* Not too nice... */
83        char *last_target;
84       
85        struct query *queries;
86        struct account *accounts;
87       
88        struct __USER *users;
89        GHashTable *userhash;
90        GHashTable *watches;
91        struct __NICK *nicks;
92        struct help *help;
93        struct set *set;
94
95        gint r_watch_source_id;
96        gint w_watch_source_id;
97        gint ping_source_id;
98} irc_t;
99
100#include "user.h"
101#include "nick.h"
102
103extern GSList *irc_connection_list;
104
105irc_t *irc_new( int fd );
[fc50d48]106void irc_abort( irc_t *irc, int immed, char *format, ... );
[b7d3cc34]107void irc_free( irc_t *irc );
108
[f73b969]109void irc_exec( irc_t *irc, char **cmd );
110void irc_process( irc_t *irc );
[0431ea1]111char **irc_parse_line( char *line );
[74c119d]112char *irc_build_line( char **cmd );
[b7d3cc34]113
114void irc_vawrite( irc_t *irc, char *format, va_list params );
115void irc_write( irc_t *irc, char *format, ... );
[22d41a2]116void irc_write_all( int now, char *format, ... );
[b7d3cc34]117void irc_reply( irc_t *irc, int code, char *format, ... );
118G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... );
119char **irc_tokenize( char *buffer );
120
121void irc_login( irc_t *irc );
[edf9657]122int irc_check_login( irc_t *irc );
[b7d3cc34]123void irc_motd( irc_t *irc );
124void irc_names( irc_t *irc, char *channel );
125void irc_topic( irc_t *irc, char *channel );
[238f828]126void irc_umode_set( irc_t *irc, char *s, int allow_priv );
[b7d3cc34]127void irc_who( irc_t *irc, char *channel );
128void irc_spawn( irc_t *irc, user_t *u );
129void irc_join( irc_t *irc, user_t *u, char *channel );
130void irc_part( irc_t *irc, user_t *u, char *channel );
131void irc_kick( irc_t *irc, user_t *u, char *channel, user_t *kicker );
132void irc_kill( irc_t *irc, user_t *u );
133void irc_invite( irc_t *irc, char *nick, char *channel );
134void irc_whois( irc_t *irc, char *nick );
[7cad7b4]135void irc_setpass( irc_t *irc, const char *pass ); /* USE WITH CAUTION! */
[b7d3cc34]136
137int irc_send( irc_t *irc, char *nick, char *s, int flags );
138int irc_privmsg( irc_t *irc, user_t *u, char *type, char *to, char *prefix, char *msg );
139int irc_msgfrom( irc_t *irc, char *nick, char *msg );
140int irc_noticefrom( irc_t *irc, char *nick, char *msg );
141
[f73b969]142void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags );
[b7d3cc34]143
144#endif
Note: See TracBrowser for help on using the repository browser.