Mercurial > pidgin.yaz
annotate src/protocols/irc/irc.h @ 9030:7ab20f829190
[gaim-migrate @ 9806]
Siege updated the code for creating right-click menu's for
buddies, chats, groups, etc. It uses more stuff from the blist
API and less stuff from multi.h. It also combines the code
for right-click menus for chats, buddies, etc. (all types of
blist nodes). So PRPLs and plugins can easily add right-click
menu options to anything in the buddy list in a clean way.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 23 May 2004 17:27:45 +0000 |
parents | 2f505651ac03 |
children | 933a19e3a6b3 |
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 | |
8114 | 28 #include "roomlist.h" |
6333 | 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 | |
8351 | 38 |
6333 | 39 enum { IRC_USEROPT_SERVER, IRC_USEROPT_PORT, IRC_USEROPT_CHARSET }; |
40 enum irc_state { IRC_STATE_NEW, IRC_STATE_ESTABLISHED }; | |
41 | |
42 struct irc_conn { | |
43 GaimAccount *account; | |
44 GHashTable *msgs; | |
45 GHashTable *cmds; | |
46 char *server; | |
47 int fd; | |
48 guint timer; | |
49 GHashTable *buddies; | |
50 | |
51 char *inbuf; | |
52 int inbuflen; | |
53 int inbufused; | |
54 | |
55 GString *motd; | |
56 GString *names; | |
57 char *nameconv; | |
58 struct _whois { | |
59 char *nick; | |
60 char *away; | |
61 char *userhost; | |
62 char *name; | |
63 char *server; | |
64 char *serverinfo; | |
65 char *channels; | |
66 int ircop; | |
67 int identified; | |
68 int idle; | |
69 time_t signon; | |
70 } whois; | |
8114 | 71 GaimRoomlist *roomlist; |
6333 | 72 }; |
73 | |
74 struct irc_buddy { | |
75 char *name; | |
76 gboolean online; | |
77 gboolean flag; | |
78 }; | |
79 | |
80 typedef int (*IRCCmdCallback) (struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
81 | |
82 int irc_send(struct irc_conn *irc, const char *buf); | |
83 gboolean irc_blist_timeout(struct irc_conn *irc); | |
84 | |
85 char *irc_mirc2html(const char *string); | |
8529 | 86 char *irc_mirc2txt(const char *string); |
6333 | 87 |
88 void irc_msg_table_build(struct irc_conn *irc); | |
89 void irc_parse_msg(struct irc_conn *irc, char *input); | |
90 int irc_parse_cmd(struct irc_conn *irc, const char *target, const char *cmdstr); | |
91 char *irc_parse_ctcp(struct irc_conn *irc, const char *from, const char *to, const char *msg, int notice); | |
92 char *irc_format(struct irc_conn *irc, const char *format, ...); | |
93 | |
94 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args); | |
95 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args); | |
96 void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
97 void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, char **args); | |
98 void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args); | |
99 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args); | |
100 void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args); | |
101 void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args); | |
102 void irc_msg_inviteonly(struct irc_conn *irc, const char *name, const char *from, char **args); | |
103 void irc_msg_ison(struct irc_conn *irc, const char *name, const char *from, char **args); | |
104 void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args); | |
105 void irc_msg_kick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
8114 | 106 void irc_msg_list(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 107 void irc_msg_mode(struct irc_conn *irc, const char *name, const char *from, char **args); |
108 void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char **args); | |
109 void irc_msg_names(struct irc_conn *irc, const char *name, const char *from, char **args); | |
110 void irc_msg_nick(struct irc_conn *irc, const char *name, const char *from, char **args); | |
111 void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, char **args); | |
7877 | 112 void irc_msg_nochan(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 113 void irc_msg_nonick(struct irc_conn *irc, const char *name, const char *from, char **args); |
6718 | 114 void irc_msg_nochangenick(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 115 void irc_msg_nosend(struct irc_conn *irc, const char *name, const char *from, char **args); |
116 void irc_msg_notice(struct irc_conn *irc, const char *name, const char *from, char **args); | |
117 void irc_msg_notinchan(struct irc_conn *irc, const char *name, const char *from, char **args); | |
118 void irc_msg_notop(struct irc_conn *irc, const char *name, const char *from, char **args); | |
119 void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args); | |
120 void irc_msg_ping(struct irc_conn *irc, const char *name, const char *from, char **args); | |
121 void irc_msg_pong(struct irc_conn *irc, const char *name, const char *from, char **args); | |
122 void irc_msg_privmsg(struct irc_conn *irc, const char *name, const char *from, char **args); | |
6714 | 123 void irc_msg_regonly(struct irc_conn *irc, const char *name, const char *from, char **args); |
6333 | 124 void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args); |
125 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args); | |
126 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args); | |
127 void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args); | |
128 void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args); | |
129 | |
130 void irc_msg_ignore(struct irc_conn *irc, const char *name, const char *from, char **args); | |
131 | |
132 void irc_cmd_table_build(struct irc_conn *irc); | |
133 | |
134 int irc_cmd_default(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
135 int irc_cmd_away(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
136 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
|
137 int irc_cmd_help(struct irc_conn *irc, const char *cmd, const char *target, const char **args); |
6333 | 138 int irc_cmd_invite(struct irc_conn *irc, const char *cmd, const char *target, const char **args); |
139 int irc_cmd_join(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
140 int irc_cmd_kick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
8114 | 141 int irc_cmd_list(struct irc_conn *irc, const char *cmd, const char *target, const char **args); |
6333 | 142 int irc_cmd_mode(struct irc_conn *irc, const char *cmd, const char *target, const char **args); |
143 int irc_cmd_names(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
144 int irc_cmd_nick(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
145 int irc_cmd_op(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
146 int irc_cmd_privmsg(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
147 int irc_cmd_part(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
148 int irc_cmd_ping(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
149 int irc_cmd_quit(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
150 int irc_cmd_quote(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
151 int irc_cmd_query(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
152 int irc_cmd_remove(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
153 int irc_cmd_topic(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
154 int irc_cmd_wallops(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
155 int irc_cmd_whois(struct irc_conn *irc, const char *cmd, const char *target, const char **args); | |
156 | |
8351 | 157 void irc_dccsend_send_ask(GaimConnection *gc, const char *dst); |
158 void irc_dccsend_recv(struct irc_conn *irc, const char *from, const char *msg); | |
6333 | 159 #endif /* _GAIM_IRC_H */ |