Mercurial > pidgin
annotate src/core.h @ 4784:b1365291f002
[gaim-migrate @ 5104]
This makes the whole get-icq-nick-on-add-buddy thing work correctly.
When I'm around Gaim... I can never think of anything to say
I can feel my heart beating
My breathing gets shallow
I'm afraid to look her in the eyes
Then she puts her hand on my arm
And I stop breathing
And I look up
And I remember why
Hmm, are we still talking about Gaim?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 15 Mar 2003 01:07:08 +0000 |
parents | c4c28874ecd3 |
children | cb700c07ee07 |
rev | line source |
---|---|
2417 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
22 #ifndef _CORE_H_ | |
23 #define _CORE_H_ | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
26 #include <config.h> | |
27 #endif | |
28 | |
3517 | 29 #include <sys/types.h> |
3370 | 30 #ifdef HAVE_ICONV |
3367 | 31 #include <iconv.h> |
3370 | 32 #endif |
33 | |
34 #ifdef HAVE_LANGINFO_CODESET | |
3367 | 35 #include <langinfo.h> |
3370 | 36 #endif |
37 | |
2417 | 38 #include <stdio.h> |
39 #include <time.h> | |
40 #include <glib.h> | |
41 #ifdef GAIM_PLUGINS | |
42 #include <gmodule.h> | |
43 #endif | |
44 | |
4491 | 45 struct gaim_account; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
46 struct group; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
47 struct buddy; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
48 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
49 |
2417 | 50 #include "multi.h" |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
51 #include "conversation.h" |
4514
7521e29658bc
[gaim-migrate @ 4792]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
52 #include "ft.h" |
4687 | 53 #include "privacy.h" |
2417 | 54 |
2501
227cc42ffa6e
[gaim-migrate @ 2514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2447
diff
changeset
|
55 /* Really user states are controlled by the PRPLs now. We just use this for event_away */ |
227cc42ffa6e
[gaim-migrate @ 2514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2447
diff
changeset
|
56 #define UC_UNAVAILABLE 1 |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
57 |
3205 | 58 /* This is far too long to be practical, but MSN users are probably used to long aliases */ |
59 #define SELF_ALIAS_LEN 400 | |
60 | |
4491 | 61 struct gaim_account { |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
62 char username[64]; |
3205 | 63 char alias[SELF_ALIAS_LEN]; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
64 char password[32]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
65 char user_info[2048]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
66 int options; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
67 int protocol; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
68 /* prpls can use this to save information about the user, |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
69 * like which server to connect to, etc */ |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
70 char proto_opt[7][256]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
71 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
72 /* buddy icon file */ |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
73 char iconfile[256]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
74 |
4634 | 75 struct gaim_proxy_info *gpi; |
76 | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
77 struct gaim_connection *gc; |
3510 | 78 gboolean connecting; |
4349 | 79 |
80 GSList *permit; | |
81 GSList *deny; | |
82 int permdeny; | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
83 }; |
4349 | 84 |
2417 | 85 enum gaim_event { |
86 event_signon = 0, | |
87 event_signoff, | |
88 event_away, | |
89 event_back, | |
90 event_im_recv, | |
91 event_im_send, | |
92 event_buddy_signon, | |
93 event_buddy_signoff, | |
94 event_buddy_away, | |
95 event_buddy_back, | |
96 event_buddy_idle, | |
97 event_buddy_unidle, | |
98 event_blist_update, | |
99 event_chat_invited, | |
100 event_chat_join, | |
101 event_chat_leave, | |
102 event_chat_buddy_join, | |
103 event_chat_buddy_leave, | |
104 event_chat_recv, | |
105 event_chat_send, | |
106 event_warned, | |
107 event_error, | |
108 event_quit, | |
109 event_new_conversation, | |
110 event_set_info, | |
111 event_draw_menu, | |
112 event_im_displayed_sent, | |
113 event_im_displayed_rcvd, | |
114 event_chat_send_invite, | |
2993 | 115 event_got_typing, |
3461 | 116 event_del_conversation, |
3510 | 117 event_connecting, |
2417 | 118 /* any others? it's easy to add... */ |
119 }; | |
120 | |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
121 struct UI { |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
122 GIOChannel *channel; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
123 guint inpa; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
124 }; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
125 |
3551 | 126 #define USE_PLUGINS GAIM_PLUGINS || USE_PERL |
127 #define PLUGIN_API_VERSION 1 | |
128 enum gaim_plugin_type { | |
129 perl_script, | |
130 plugin | |
131 }; | |
132 | |
133 struct gaim_plugin_description { | |
134 int api_version; | |
135 gchar *name; | |
136 gchar *version; | |
137 gchar *description; | |
138 gchar *authors; | |
139 gchar *url; | |
140 gchar *iconfile; | |
141 }; | |
2417 | 142 |
143 struct gaim_plugin { | |
3551 | 144 enum gaim_plugin_type type; |
145 void *handle; | |
146 gchar path[128]; | |
147 struct gaim_plugin_description desc; | |
3563 | 148 gchar error[128]; |
3565 | 149 void *iter; |
2417 | 150 }; |
151 | |
3551 | 152 #ifdef GAIM_PLUGINS |
2417 | 153 struct gaim_callback { |
154 GModule *handle; | |
155 enum gaim_event event; | |
156 void *function; | |
157 void *data; | |
158 }; | |
159 #endif | |
160 | |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
161 /* Globals in core.c */ |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
162 extern GSList *uis; |
3484 | 163 extern int gaim_session; |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
164 |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
165 /* Globals in plugins.c */ |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
166 extern GList *plugins; |
3551 | 167 extern GList *probed_plugins; |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
168 extern GList *callbacks; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
169 |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
170 /* Functions in core.c */ |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
171 extern gint UI_write(struct UI *, guchar *, int); |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2443
diff
changeset
|
172 extern void UI_build_write(struct UI *, guchar, guchar, ...); |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
173 extern void UI_broadcast(guchar *data, int); |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2443
diff
changeset
|
174 extern void UI_build_broadcast(guchar, guchar, ...); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
175 /* Don't ever use these; when gaim-core is done these will be |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
176 * merged into the core's main() and won't be called directly */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
177 extern int core_main(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
178 extern void core_quit(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
179 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
180 /* Functions in gaimrc.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
181 extern void load_prefs(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
182 extern void save_prefs(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
183 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
184 /* Functions in perl.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
185 #ifdef USE_PERL |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
186 extern void perl_end(); |
3517 | 187 extern int perl_event(enum gaim_event, void *, void *, void *, void *, void *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
188 extern int perl_load_file(char *); |
3551 | 189 extern void perl_unload_file(struct gaim_plugin *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
190 extern void unload_perl_scripts(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
191 extern void list_perl_scripts(); |
4298 | 192 extern struct gaim_plugin *probe_perl(char *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
193 #endif |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
194 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
195 /* Functions in plugins.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
196 #ifdef GAIM_PLUGINS |
3466 | 197 extern struct gaim_plugin *load_plugin(const char *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
198 extern void unload_plugin(struct gaim_plugin *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
199 extern struct gaim_plugin *reload_plugin(struct gaim_plugin *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
200 extern void gaim_signal_connect(GModule *, enum gaim_event, void *, void *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
201 extern void gaim_signal_disconnect(GModule *, enum gaim_event, void *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
202 extern void gaim_plugin_unload(GModule *); |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
203 extern void remove_all_plugins(); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
204 #endif |
3551 | 205 extern void gaim_probe_plugins(); |
3517 | 206 extern int plugin_event(enum gaim_event, ...); |
2511
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2501
diff
changeset
|
207 extern char *event_name(enum gaim_event); |
2417 | 208 |
209 /* Functions in server.c */ | |
4732 | 210 extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2753
diff
changeset
|
211 extern void serv_got_im(struct gaim_connection *, char *, char *, guint32, time_t, gint); |
3768 | 212 extern void serv_got_typing(struct gaim_connection *, char *, int, int); |
2993 | 213 extern void serv_got_typing_stopped(struct gaim_connection *, char *); |
2417 | 214 extern void serv_got_eviled(struct gaim_connection *, char *, int); |
215 extern void serv_got_chat_invite(struct gaim_connection *, char *, char *, char *, GList *); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
216 extern struct gaim_conversation *serv_got_joined_chat(struct gaim_connection *, int, char *); |
2417 | 217 extern void serv_got_chat_left(struct gaim_connection *, int); |
218 extern void serv_got_chat_in(struct gaim_connection *, int, char *, int, char *, time_t); | |
4227 | 219 extern void serv_got_alias(struct gaim_connection *, char *, char *); |
2417 | 220 extern void serv_finish_login(); |
221 | |
222 #endif /* _CORE_H_ */ |