Mercurial > pidgin.yaz
annotate src/protocols/irc/irc.h @ 7877:828856b7fe30
[gaim-migrate @ 8531]
I suppose IRC should handle 403 (no such channel)
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 14 Dec 2003 23:20:41 +0000 |
parents | 37af5dea14d1 |
children | 7a6e30eb7aad |
rev | line source |
---|---|
6333 | 1 /** |
2 * @file irc.h | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2003, Ethan Blanton <eblanton@cs.purdue.edu> | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 */ | |
22 | |
23 #ifndef _GAIM_IRC_H | |
24 #define _GAIM_IRC_H | |
25 | |
26 #include <glib.h> | |
27 | |
28 #include "multi.h" | |
29 | |
30 #define IRC_DEFAULT_SERVER "irc.freenode.net" | |
31 #define IRC_DEFAULT_PORT 6667 | |
32 | |
33 #define IRC_DEFAULT_CHARSET "UTF-8" | |
34 #define IRC_DEFAULT_ALIAS "gaim" | |
35 | |
36 #define IRC_INITIAL_BUFSIZE 1024 | |
37 | |
38 enum { IRC_USEROPT_SERVER, IRC_USEROPT_PORT, IRC_USEROPT_CHARSET }; | |
39 enum irc_state { IRC_STATE_NEW, IRC_STATE_ESTABLISHED }; | |
40 | |
41 struct irc_conn { | |
42 GaimAccount *account; | |
43 GHashTable *msgs; | |
44 GHashTable *cmds; | |
45 char *server; | |
46 int fd; | |
47 guint timer; | |
48 GHashTable *buddies; | |
49 | |
50 char *inbuf; | |
51 int inbuflen; | |
52 int inbufused; | |
53 | |
54 GString *motd; | |
55 GString *names; | |
56 char *nameconv; | |
57 struct _whois { | |
58 char *nick; | |
59 char *away; | |
60 char *userhost; | |
61 char *name; | |
62 char *server; | |
63 char *serverinfo; | |
64 char *channels; | |
65 int ircop; | |
66 int identified; | |
67 int idle; | |
68 time_t signon; | |
69 } whois; | |
70 }; | |
71 | |
72 struct irc_buddy { | |
73 char *name; | |
74 gboolean online; | |
75 gboolean flag; | |
76 }; | |
77 | |
78 typedef int (*IRCCmdCallback) (struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
79 | |
80 int irc_send(struct irc_conn *irc, const char *buf); | |
81 gboolean irc_blist_timeout(struct irc_conn *irc); | |
82 | |
83 char *irc_mirc2html(const char *string); | |
84 | |
85 void irc_msg_table_build(struct irc_conn *irc); | |
86 void irc_parse_msg(struct irc_conn *irc, char *input); | |
87 int irc_parse_cmd(struct irc_conn *irc, const char *target, const char *cmdstr); | |
88 char *irc_parse_ctcp(struct irc_conn *irc, const char *from, const char *to, const char *msg, int notice); | |
89 char *irc_format(struct irc_conn *irc, const char *format, ...); | |
90 | |
91 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args); | |
92 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args); | |
93 void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
94 void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, char **args); | |
95 void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
96 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args); | |
97 void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args); | |
98 void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args); | |
99 void irc_msg_inviteonly(struct irc_conn *irc, const char *name, const char *from, char **args); | |
100 void irc_msg_ison(struct irc_conn *irc, const char *name, const char *from, char **args); | |
101 void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args); | |
102 void irc_msg_kick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
103 void irc_msg_mode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
104 void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char **args); | |
105 void irc_msg_names(struct irc_conn *irc, const char *name, const char *from, char **args); | |
106 void irc_msg_nick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
107 void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, char **args); | |
7877 | 108 void irc_msg_nochan(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 109 void irc_msg_nonick(struct irc_conn *irc, const char *name, const char *from, char **args); |
6718 | 110 void irc_msg_nochangenick(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 111 void irc_msg_nosend(struct irc_conn *irc, const char *name, const char *from, char **args); |
112 void irc_msg_notice(struct irc_conn *irc, const char *name, const char *from, char **args); | |
113 void irc_msg_notinchan(struct irc_conn *irc, const char *name, const char *from, char **args); | |
114 void irc_msg_notop(struct irc_conn *irc, const char *name, const char *from, char **args); | |
115 void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args); | |
116 void irc_msg_ping(struct irc_conn *irc, const char *name, const char *from, char **args); | |
117 void irc_msg_pong(struct irc_conn *irc, const char *name, const char *from, char **args); | |
118 void irc_msg_privmsg(struct irc_conn *irc, const char *name, const char *from, char **args); | |
6714 | 119 void irc_msg_regonly(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 120 void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args); |
121 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args); | |
122 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args); | |
123 void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args); | |
124 void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args); | |
125 | |
126 void irc_msg_ignore(struct irc_conn *irc, const char *name, const char *from, char **args); | |
127 | |
128 void irc_cmd_table_build(struct irc_conn *irc); | |
129 | |
130 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
131 int irc_cmd_away(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
132 int irc_cmd_ctcp_action(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
6415
e3be6b9744b7
[gaim-migrate @ 6922]
Christian Hammond <chipx86@chipx86.com>
parents:
6333
diff
changeset
|
133 int irc_cmd_help(struct irc_conn *irc, const char *cmd, const char *target, const char **args); |
6333 | 134 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args); |
135 int irc_cmd_join(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
136 int irc_cmd_kick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
137 int irc_cmd_mode(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
138 int irc_cmd_names(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
139 int irc_cmd_nick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
140 int irc_cmd_op(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
141 int irc_cmd_privmsg(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
142 int irc_cmd_part(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
143 int irc_cmd_ping(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
144 int irc_cmd_quit(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
145 int irc_cmd_quote(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
146 int irc_cmd_query(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
147 int irc_cmd_remove(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
148 int irc_cmd_topic(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
149 int irc_cmd_wallops(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
150 int irc_cmd_whois(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
151 | |
152 #endif /* _GAIM_IRC_H */ |