Mercurial > pidgin
annotate src/core.h @ 3414:4149e5e36eb9
[gaim-migrate @ 3433]
This is easier to maintain, cleaner, and you can take the script with you.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 20 Aug 2002 08:54:56 +0000 |
parents | eb7b398051f2 |
children | c11960537fee |
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 | |
3370 | 29 #ifdef HAVE_ICONV |
3367 | 30 #include <iconv.h> |
3370 | 31 #endif |
32 | |
33 #ifdef HAVE_LANGINFO_CODESET | |
3367 | 34 #include <langinfo.h> |
3370 | 35 #endif |
36 | |
2417 | 37 #include <stdio.h> |
38 #include <time.h> | |
39 #include <glib.h> | |
40 #ifdef GAIM_PLUGINS | |
41 #include <gmodule.h> | |
42 #endif | |
43 | |
44 #include "multi.h" | |
45 | |
2501
227cc42ffa6e
[gaim-migrate @ 2514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2447
diff
changeset
|
46 /* 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
|
47 #define UC_UNAVAILABLE 1 |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
48 |
3205 | 49 /* This is far too long to be practical, but MSN users are probably used to long aliases */ |
50 #define SELF_ALIAS_LEN 400 | |
51 | |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
52 struct aim_user { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
53 char username[64]; |
3205 | 54 char alias[SELF_ALIAS_LEN]; |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
55 char password[32]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
56 char user_info[2048]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
57 int options; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
58 int protocol; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
59 /* prpls can use this to save information about the user, |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
60 * like which server to connect to, etc */ |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
61 char proto_opt[7][256]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
62 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
63 /* buddy icon file */ |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
64 char iconfile[256]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
65 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
66 struct gaim_connection *gc; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
67 }; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
68 |
2417 | 69 enum gaim_event { |
70 event_signon = 0, | |
71 event_signoff, | |
72 event_away, | |
73 event_back, | |
74 event_im_recv, | |
75 event_im_send, | |
76 event_buddy_signon, | |
77 event_buddy_signoff, | |
78 event_buddy_away, | |
79 event_buddy_back, | |
80 event_buddy_idle, | |
81 event_buddy_unidle, | |
82 event_blist_update, | |
83 event_chat_invited, | |
84 event_chat_join, | |
85 event_chat_leave, | |
86 event_chat_buddy_join, | |
87 event_chat_buddy_leave, | |
88 event_chat_recv, | |
89 event_chat_send, | |
90 event_warned, | |
91 event_error, | |
92 event_quit, | |
93 event_new_conversation, | |
94 event_set_info, | |
95 event_draw_menu, | |
96 event_im_displayed_sent, | |
97 event_im_displayed_rcvd, | |
98 event_chat_send_invite, | |
2993 | 99 event_got_typing, |
2417 | 100 /* any others? it's easy to add... */ |
101 }; | |
102 | |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
103 struct UI { |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
104 GIOChannel *channel; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
105 guint inpa; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
106 }; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
107 |
2417 | 108 #ifdef GAIM_PLUGINS |
109 | |
110 struct gaim_plugin { | |
111 GModule *handle; | |
112 char *name; | |
113 char *description; | |
114 }; | |
115 | |
116 struct gaim_callback { | |
117 GModule *handle; | |
118 enum gaim_event event; | |
119 void *function; | |
120 void *data; | |
121 }; | |
122 | |
123 #endif | |
124 | |
3136 | 125 #define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */ |
126 | |
2417 | 127 struct buddy { |
2438
5cbe86a444d9
[gaim-migrate @ 2451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2435
diff
changeset
|
128 int edittype; /* XXX CUI: this is really a GUI function and we need to put this in ui.h */ |
2417 | 129 char name[80]; |
3136 | 130 char show[BUDDY_ALIAS_MAXLEN]; |
2417 | 131 int present; |
132 int evil; | |
133 time_t signon; | |
134 time_t idle; | |
135 int uc; | |
2920 | 136 guint caps; /* woohoo! */ |
2417 | 137 void *proto_data; /* what a hack */ |
138 struct gaim_connection *gc; /* the connection it belongs to */ | |
139 }; | |
140 | |
141 struct group { | |
2438
5cbe86a444d9
[gaim-migrate @ 2451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2435
diff
changeset
|
142 int edittype; /* XXX CUI: this is really a GUI function and we need to put this in ui.h */ |
2417 | 143 char name[80]; |
144 GSList *members; | |
145 struct gaim_connection *gc; /* the connection it belongs to */ | |
146 }; | |
147 | |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
148 /* Globals in core.c */ |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
149 extern GSList *uis; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
150 |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
151 /* Globals in plugins.c */ |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
152 extern GList *plugins; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
153 extern GList *callbacks; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
154 |
2417 | 155 /* Functions in buddy.c */ |
156 extern struct buddy *find_buddy(struct gaim_connection *, char *); | |
157 extern struct group *find_group(struct gaim_connection *, char *); | |
158 extern struct group *find_group_by_buddy(struct gaim_connection *, char *); | |
159 extern struct buddy *add_buddy(struct gaim_connection *, char *, char *, char *); | |
160 extern void remove_buddy(struct gaim_connection *, struct group *, struct buddy *); | |
161 extern struct group *add_group(struct gaim_connection *, char *); | |
162 extern void remove_group(struct gaim_connection *, struct group *); | |
163 extern void do_export(struct gaim_connection *); | |
164 extern void do_import(struct gaim_connection *, char *); | |
165 extern int bud_list_cache_exists(struct gaim_connection *); | |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
166 extern void toc_build_config(struct gaim_connection *, char *, int len, gboolean); |
2526
413a81136e3a
[gaim-migrate @ 2539]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2511
diff
changeset
|
167 extern void parse_toc_buddy_list(struct gaim_connection *, char *); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2526
diff
changeset
|
168 extern void signoff_blocked(struct gaim_connection *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
169 |
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_autoload(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
187 extern void perl_end(); |
2511
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2501
diff
changeset
|
188 extern int perl_event(enum gaim_event, void *, void *, void *, void *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
189 extern int perl_load_file(char *); |
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(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
192 #endif |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
193 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
194 /* Functions in plugins.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
195 #ifdef GAIM_PLUGINS |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
196 extern struct gaim_plugin *load_plugin(char *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
197 extern void unload_plugin(struct gaim_plugin *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
198 extern struct gaim_plugin *reload_plugin(struct gaim_plugin *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
199 extern void gaim_signal_connect(GModule *, enum gaim_event, void *, void *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
200 extern void gaim_signal_disconnect(GModule *, enum gaim_event, void *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
201 extern void gaim_plugin_unload(GModule *); |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
202 extern void remove_all_plugins(); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
203 #endif |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
204 extern int plugin_event(enum gaim_event, void *, void *, void *, void *); |
2511
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2501
diff
changeset
|
205 extern char *event_name(enum gaim_event); |
2417 | 206 |
207 /* Functions in server.c */ | |
2920 | 208 extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, guint); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2753
diff
changeset
|
209 extern void serv_got_im(struct gaim_connection *, char *, char *, guint32, time_t, gint); |
2993 | 210 extern void serv_got_typing(struct gaim_connection *, char *, int); |
211 extern void serv_got_typing_stopped(struct gaim_connection *, char *); | |
2417 | 212 extern void serv_got_eviled(struct gaim_connection *, char *, int); |
213 extern void serv_got_chat_invite(struct gaim_connection *, char *, char *, char *, GList *); | |
214 extern struct conversation *serv_got_joined_chat(struct gaim_connection *, int, char *); | |
215 extern void serv_got_chat_left(struct gaim_connection *, int); | |
216 extern void serv_got_chat_in(struct gaim_connection *, int, char *, int, char *, time_t); | |
217 extern void serv_finish_login(); | |
218 | |
219 #endif /* _CORE_H_ */ |