source: irc.h @ 903a2fc

Last change on this file since 903a2fc was dc9797f, checked in by Sven Moritz Hallberg <sm@…>, at 2008-02-16T13:24:44Z

keep track of which keys are queued for generation

  • Property mode set to 100644
File size: 4.2 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
[764c7d1]29#include "otr.h"
30
[b7d3cc34]31#define IRC_MAX_LINE 512
[5a71d9c]32#define IRC_MAX_ARGS 16
[b7d3cc34]33
34#define IRC_LOGIN_TIMEOUT 60
35#define IRC_PING_STRING "PinglBee"
36
[aefa533e]37#define UMODES "abisw"
[238f828]38#define UMODES_PRIV "Ro"
[b7d3cc34]39#define CMODES "nt"
40#define CMODE "t"
41#define UMODE "s"
42
43typedef enum
44{
[bd9b00f]45        USTATUS_OFFLINE = 0,
[79e826a]46        USTATUS_AUTHORIZED = 1,
47        USTATUS_LOGGED_IN = 2,
48        USTATUS_IDENTIFIED = 4,
49        USTATUS_SHUTDOWN = 8
[b7d3cc34]50} irc_status_t;
51
52typedef struct channel
53{
54        char *name;
55} channel_t;
56
57typedef struct irc
58{
59        int fd;
60        irc_status_t status;
61        double last_pong;
62        int pinging;
63        char *sendbuffer;
64        char *readbuffer;
65
66        int sentbytes;
67        time_t oldtime;
68
69        char *nick;
70        char *user;
71        char *host;
72        char *realname;
73        char *password;
74
75        char umode[8];
76       
77        char *myhost;
78        char *mynick;
79
80        char *channel;
81        int c_id;
82
83        char is_private;                /* Not too nice... */
84        char *last_target;
85       
86        struct query *queries;
87        struct account *accounts;
88       
89        struct __USER *users;
90        GHashTable *userhash;
91        GHashTable *watches;
92        struct __NICK *nicks;
93        struct help *help;
94        struct set *set;
95
96        gint r_watch_source_id;
97        gint w_watch_source_id;
98        gint ping_source_id;
[764c7d1]99       
[dc9797f]100        otr_t *otr;            /* OTR state and book keeping */
[b7d3cc34]101} irc_t;
102
103#include "user.h"
[5b52a48]104// #include "nick.h"
[b7d3cc34]105
106extern GSList *irc_connection_list;
107
108irc_t *irc_new( int fd );
[a9ca7dd]109void irc_abort( irc_t *irc, int immed, char *format, ... ) G_GNUC_PRINTF( 3, 4 );
[b7d3cc34]110void irc_free( irc_t *irc );
111
[f73b969]112void irc_exec( irc_t *irc, char **cmd );
113void irc_process( irc_t *irc );
[0431ea1]114char **irc_parse_line( char *line );
[74c119d]115char *irc_build_line( char **cmd );
[b7d3cc34]116
117void irc_vawrite( irc_t *irc, char *format, va_list params );
[a9ca7dd]118void irc_write( irc_t *irc, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
119void irc_write_all( int now, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
120void irc_reply( irc_t *irc, int code, char *format, ... ) G_GNUC_PRINTF( 3, 4 );
121G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
[b7d3cc34]122char **irc_tokenize( char *buffer );
123
124void irc_login( irc_t *irc );
[edf9657]125int irc_check_login( irc_t *irc );
[b7d3cc34]126void irc_motd( irc_t *irc );
127void irc_names( irc_t *irc, char *channel );
128void irc_topic( irc_t *irc, char *channel );
[238f828]129void irc_umode_set( irc_t *irc, char *s, int allow_priv );
[b7d3cc34]130void irc_who( irc_t *irc, char *channel );
131void irc_spawn( irc_t *irc, user_t *u );
132void irc_join( irc_t *irc, user_t *u, char *channel );
133void irc_part( irc_t *irc, user_t *u, char *channel );
134void irc_kick( irc_t *irc, user_t *u, char *channel, user_t *kicker );
135void irc_kill( irc_t *irc, user_t *u );
136void irc_invite( irc_t *irc, char *nick, char *channel );
137void irc_whois( irc_t *irc, char *nick );
[7cad7b4]138void irc_setpass( irc_t *irc, const char *pass ); /* USE WITH CAUTION! */
[b7d3cc34]139
140int irc_send( irc_t *irc, char *nick, char *s, int flags );
141int irc_privmsg( irc_t *irc, user_t *u, char *type, char *to, char *prefix, char *msg );
142int irc_msgfrom( irc_t *irc, char *nick, char *msg );
143int irc_noticefrom( irc_t *irc, char *nick, char *msg );
144
[f73b969]145void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags );
[0e7ab64]146struct groupchat *irc_chat_by_channel( irc_t *irc, char *channel );
[b7d3cc34]147
148#endif
Note: See TracBrowser for help on using the repository browser.