Mercurial > pidgin
annotate src/core.h @ 2784:49b0cff16e3f
[gaim-migrate @ 2797]
A Lee (Ho-seok Lee)'s updated translation
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 20 Nov 2001 21:13:46 +0000 |
parents | 9ed09c48131b |
children | b1e300a85678 |
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 | |
29 #include <stdio.h> | |
30 #include <time.h> | |
31 #include <glib.h> | |
32 #ifdef GAIM_PLUGINS | |
33 #include <gmodule.h> | |
34 #endif | |
35 | |
36 #include "multi.h" | |
37 | |
2501
227cc42ffa6e
[gaim-migrate @ 2514]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2447
diff
changeset
|
38 /* 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
|
39 #define UC_UNAVAILABLE 1 |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
40 |
2442
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
41 struct aim_user { |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
42 char username[64]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
43 char password[32]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
44 char user_info[2048]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
45 int options; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
46 int protocol; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
47 /* prpls can use this to save information about the user, |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
48 * like which server to connect to, etc */ |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
49 char proto_opt[7][256]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
50 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
51 /* buddy icon file */ |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
52 char iconfile[256]; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
53 |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
54 struct gaim_connection *gc; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
55 }; |
895e2469cb3a
[gaim-migrate @ 2455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2440
diff
changeset
|
56 |
2417 | 57 enum gaim_event { |
58 event_signon = 0, | |
59 event_signoff, | |
60 event_away, | |
61 event_back, | |
62 event_im_recv, | |
63 event_im_send, | |
64 event_buddy_signon, | |
65 event_buddy_signoff, | |
66 event_buddy_away, | |
67 event_buddy_back, | |
68 event_buddy_idle, | |
69 event_buddy_unidle, | |
70 event_blist_update, | |
71 event_chat_invited, | |
72 event_chat_join, | |
73 event_chat_leave, | |
74 event_chat_buddy_join, | |
75 event_chat_buddy_leave, | |
76 event_chat_recv, | |
77 event_chat_send, | |
78 event_warned, | |
79 event_error, | |
80 event_quit, | |
81 event_new_conversation, | |
82 event_set_info, | |
83 event_draw_menu, | |
84 event_im_displayed_sent, | |
85 event_im_displayed_rcvd, | |
86 event_chat_send_invite, | |
87 /* any others? it's easy to add... */ | |
88 }; | |
89 | |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
90 struct UI { |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
91 GIOChannel *channel; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
92 guint inpa; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
93 }; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
94 |
2417 | 95 #ifdef GAIM_PLUGINS |
96 | |
97 struct gaim_plugin { | |
98 GModule *handle; | |
99 char *name; | |
100 char *description; | |
101 }; | |
102 | |
103 struct gaim_callback { | |
104 GModule *handle; | |
105 enum gaim_event event; | |
106 void *function; | |
107 void *data; | |
108 }; | |
109 | |
110 #endif | |
111 | |
112 struct buddy { | |
2438
5cbe86a444d9
[gaim-migrate @ 2451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2435
diff
changeset
|
113 int edittype; /* XXX CUI: this is really a GUI function and we need to put this in ui.h */ |
2417 | 114 char name[80]; |
2753
9ed09c48131b
[gaim-migrate @ 2766]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2752
diff
changeset
|
115 char show[388]; /* because MSN names can be 387 characters */ |
2417 | 116 int present; |
117 int evil; | |
118 time_t signon; | |
119 time_t idle; | |
120 int uc; | |
121 gushort caps; /* woohoo! */ | |
122 void *proto_data; /* what a hack */ | |
123 struct gaim_connection *gc; /* the connection it belongs to */ | |
124 }; | |
125 | |
126 struct group { | |
2438
5cbe86a444d9
[gaim-migrate @ 2451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2435
diff
changeset
|
127 int edittype; /* XXX CUI: this is really a GUI function and we need to put this in ui.h */ |
2417 | 128 char name[80]; |
129 GSList *members; | |
130 struct gaim_connection *gc; /* the connection it belongs to */ | |
131 }; | |
132 | |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
133 /* Globals in core.c */ |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
134 extern GSList *uis; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
135 |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
136 /* Globals in plugins.c */ |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
137 extern GList *plugins; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
138 extern GList *callbacks; |
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
139 |
2417 | 140 /* Functions in buddy.c */ |
141 extern struct buddy *find_buddy(struct gaim_connection *, char *); | |
142 extern struct group *find_group(struct gaim_connection *, char *); | |
143 extern struct group *find_group_by_buddy(struct gaim_connection *, char *); | |
144 extern struct buddy *add_buddy(struct gaim_connection *, char *, char *, char *); | |
145 extern void remove_buddy(struct gaim_connection *, struct group *, struct buddy *); | |
146 extern struct group *add_group(struct gaim_connection *, char *); | |
147 extern void remove_group(struct gaim_connection *, struct group *); | |
148 extern void do_export(struct gaim_connection *); | |
149 extern void do_import(struct gaim_connection *, char *); | |
150 extern int bud_list_cache_exists(struct gaim_connection *); | |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
151 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
|
152 extern void parse_toc_buddy_list(struct gaim_connection *, char *); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2526
diff
changeset
|
153 extern void signoff_blocked(struct gaim_connection *); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
154 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
155 /* Functions in core.c */ |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
156 extern gint UI_write(struct UI *, guchar *, int); |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2443
diff
changeset
|
157 extern void UI_build_write(struct UI *, guchar, guchar, ...); |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
158 extern void UI_broadcast(guchar *data, int); |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2443
diff
changeset
|
159 extern void UI_build_broadcast(guchar, guchar, ...); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
160 /* 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
|
161 * 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
|
162 extern int core_main(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
163 extern void core_quit(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
164 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
165 /* Functions in gaimrc.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
166 extern void load_prefs(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
167 extern void save_prefs(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
168 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
169 /* Functions in perl.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
170 #ifdef USE_PERL |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
171 extern void perl_autoload(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
172 extern void perl_end(); |
2511
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2501
diff
changeset
|
173 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
|
174 extern int perl_load_file(char *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
175 extern void unload_perl_scripts(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
176 extern void list_perl_scripts(); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
177 #endif |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
178 |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
179 /* Functions in plugins.c */ |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
180 #ifdef GAIM_PLUGINS |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
181 extern struct gaim_plugin *load_plugin(char *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
182 extern void unload_plugin(struct gaim_plugin *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
183 extern struct gaim_plugin *reload_plugin(struct gaim_plugin *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
184 extern void gaim_signal_connect(GModule *, enum gaim_event, void *, void *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
185 extern void gaim_signal_disconnect(GModule *, enum gaim_event, void *); |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
186 extern void gaim_plugin_unload(GModule *); |
2440
8306c042bac7
[gaim-migrate @ 2453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2438
diff
changeset
|
187 extern void remove_all_plugins(); |
2435
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
188 #endif |
b4f2a53c0ee5
[gaim-migrate @ 2448]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2417
diff
changeset
|
189 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
|
190 extern char *event_name(enum gaim_event); |
2417 | 191 |
192 /* Functions in server.c */ | |
193 extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, gushort); | |
194 extern void serv_got_im(struct gaim_connection *, char *, char *, guint32, time_t); | |
195 extern void serv_got_eviled(struct gaim_connection *, char *, int); | |
196 extern void serv_got_chat_invite(struct gaim_connection *, char *, char *, char *, GList *); | |
197 extern struct conversation *serv_got_joined_chat(struct gaim_connection *, int, char *); | |
198 extern void serv_got_chat_left(struct gaim_connection *, int); | |
199 extern void serv_got_chat_in(struct gaim_connection *, int, char *, int, char *, time_t); | |
200 extern void serv_finish_login(); | |
201 | |
202 #endif /* _CORE_H_ */ |