Mercurial > pidgin.yaz
annotate plugins/icq/icq.h @ 1427:28278bd61403
[gaim-migrate @ 1437]
Basic search support. This will continue to improve.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Thu, 25 Jan 2001 20:31:12 +0000 |
parents | 0a766047b4fd |
children | 4c510ca3563f |
rev | line source |
---|---|
1152 | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 #ifndef _ICQ_H_ | |
3 #define _ICQ_H_ | |
4 | |
5 #ifdef HAVE_CONFIG_H | |
6 #include <config.h> | |
7 #endif | |
8 | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
9 #define ICQLIBVER 0x010100 |
1152 | 10 #define ICQLIBMAJOR 1 |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
11 #define ICQLIBMINOR 1 |
1152 | 12 #define ICQLIBMICRO 0 |
13 | |
14 #include <time.h> | |
15 | |
16 #ifndef _WIN32 | |
17 #include <sys/time.h> | |
18 #include <sys/types.h> | |
19 #include <unistd.h> | |
20 #endif | |
21 | |
22 #ifdef _WIN32 | |
23 #include <winsock.h> | |
24 #endif | |
25 | |
26 #define ICQ_LOG_OFF 0 | |
27 #define ICQ_LOG_FATAL 1 | |
28 #define ICQ_LOG_ERROR 2 | |
29 #define ICQ_LOG_WARNING 3 | |
30 #define ICQ_LOG_MESSAGE 4 | |
31 | |
32 #define STATUS_OFFLINE (-1L) | |
33 #define STATUS_ONLINE 0x0000L | |
34 #define STATUS_AWAY 0x0001L | |
35 #define STATUS_DND 0x0002L /* 0x13L */ | |
36 #define STATUS_NA 0x0004L /* 0x05L */ | |
37 #define STATUS_OCCUPIED 0x0010L /* 0x11L */ | |
38 #define STATUS_FREE_CHAT 0x0020L | |
39 #define STATUS_INVISIBLE 0x0100L | |
40 | |
41 #define ICQ_SEND_THRUSERVER 0 | |
42 #define ICQ_SEND_DIRECT 1 | |
43 #define ICQ_SEND_BESTWAY 2 | |
44 | |
45 #define ICQ_NOTIFY_SUCCESS 0 | |
46 #define ICQ_NOTIFY_FAILED 1 | |
47 #define ICQ_NOTIFY_CONNECTING 2 | |
48 #define ICQ_NOTIFY_CONNECTED 3 | |
49 #define ICQ_NOTIFY_SENT 4 | |
50 #define ICQ_NOTIFY_ACK 5 | |
51 | |
52 #define ICQ_NOTIFY_CHAT 6 | |
53 #define ICQ_NOTIFY_CHATDATA 7 | |
54 | |
55 #define ICQ_NOTIFY_FILE 10 | |
56 #define ICQ_NOTIFY_FILESESSION 11 | |
57 #define ICQ_NOTIFY_FILEDATA 12 | |
58 | |
59 #ifdef __cplusplus | |
60 extern "C" { | |
61 #endif /* __cplusplus */ | |
62 | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
63 typedef struct |
1152 | 64 { |
65 const char *name; | |
66 unsigned short code; | |
67 } icq_ArrayType; | |
68 | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
69 struct icq_link_private; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
70 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
71 /** |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
72 * The ICQLINK structure represents a single connection to the ICQ servers. |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
73 * It is returned as the result of an icq_ICQLINKNew function, and contains |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
74 * connection-specific parameters such as uin, sockets, current status, etc. |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
75 * |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
76 * This structure should be considered read-only. Modifying it will cause |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
77 * undefined results. |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
78 */ |
1152 | 79 typedef struct icq_link |
80 { | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
81 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
82 /* General parameters */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
83 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
84 /** User Identification Number. This is your ICQ 'account' number. */ |
1152 | 85 unsigned long icq_Uin; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
86 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
87 /** Our IP as understood by the ICQ server. This will be set once an |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
88 * UDP_SRV_LOGIN_REPLY has been received from the ICQ servers, in host |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
89 * byteorder. Note this may be different from the actual IP in cases |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
90 * such as firewalls, ip masquerading, etc. */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
91 unsigned long icq_OurIP; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
92 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
93 /** The UDP port used to connect to the ICQ server, in host byteorder. */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
94 unsigned short icq_OurPort; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
95 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
96 /** Our current ICQ status: one of the STATUS_* defines. |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
97 * @see icq_StatusUpdate */ |
1152 | 98 unsigned long icq_Status; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
99 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
100 /** The password used to log into the ICQ server. */ |
1152 | 101 char *icq_Password; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
102 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
103 /** The user's desired nickname. */ |
1152 | 104 char *icq_Nick; |
105 | |
106 /* UDP stuff */ | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
107 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
108 /** socket used to send and received UDP messages */ |
1152 | 109 int icq_UDPSok; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
110 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
111 /** Time, in seconds, that a sent UDP message can go without an ACK from the |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
112 * server before being retransmitted. */ |
1152 | 113 int icq_UDPExpireInterval; |
114 | |
115 /* TCP stuff */ | |
116 | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
117 /** TCP listen port, in host byte order. The TCP implementation will listen |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
118 * here for new connections from other clients. This is transmitted as |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
119 * part of the ICQ login process. */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
120 unsigned short icq_TCPSrvPort; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
121 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
122 /** Has TCP been enabled for this connection? |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
123 * @see icq_NewICQLINK */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
124 unsigned char icq_UseTCP; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
125 |
1152 | 126 /* SOCKS5 Proxy stuff */ |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
127 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
128 /** Should all network traffic be redirected through a proxy? |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
129 * @see icq_SetProxy */ |
1152 | 130 unsigned char icq_UseProxy; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
131 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
132 /** Hostname of the SOCKS5 proxy to use. */ |
1152 | 133 char *icq_ProxyHost; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
134 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
135 /** IP Address of the SOCKS5 proxy after DNS resolution, in host byteorder. */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
136 unsigned long icq_ProxyIP; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
137 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
138 /** Port of the SOCKS5 proxy to use, in host byteorder. */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
139 unsigned short icq_ProxyPort; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
140 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
141 /** What's this? :) */ |
1152 | 142 int icq_ProxyAuth; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
143 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
144 /** Username used when logging into the proxy. */ |
1152 | 145 char *icq_ProxyName; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
146 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
147 /** Password used when logging into the proxy. */ |
1152 | 148 char *icq_ProxyPass; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
149 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
150 /** TCP socket used to communicate with the proxy. */ |
1152 | 151 int icq_ProxySok; |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
152 |
1152 | 153 unsigned short icq_ProxyOurPort; /* HOST byteorder */ |
154 unsigned long icq_ProxyDestIP; /* HOST byteorder */ | |
155 unsigned short icq_ProxyDestPort; /* HOST byteorder */ | |
156 | |
157 /*** Callbacks ***/ | |
158 void (*icq_Logged)(struct icq_link *link); | |
159 void (*icq_Disconnected)(struct icq_link *link); | |
160 void (*icq_RecvMessage)(struct icq_link *link, unsigned long uin, | |
161 unsigned char hour, unsigned char minute, unsigned char day, | |
162 unsigned char month, unsigned short year, const char *msg); | |
163 void (*icq_RecvURL)(struct icq_link *link, unsigned long uin, | |
164 unsigned char hour, unsigned char minute, unsigned char day, | |
165 unsigned char month, unsigned short year, const char *url, | |
166 const char *descr); | |
167 void (*icq_RecvWebPager)(struct icq_link *link,unsigned char hour, | |
168 unsigned char minute, unsigned char day, unsigned char month, | |
169 unsigned short year, const char *nick, const char *email, | |
170 const char *msg); | |
171 void (*icq_RecvMailExpress)(struct icq_link *link,unsigned char hour, | |
172 unsigned char minute, unsigned char day, unsigned char month, | |
173 unsigned short year, const char *nick, const char *email, | |
174 const char *msg); | |
175 void (*icq_RecvChatReq)(struct icq_link *link, unsigned long uin, | |
176 unsigned char hour, unsigned char minute, unsigned char day, | |
177 unsigned char month, unsigned short year, const char *descr, | |
178 unsigned long seq); | |
179 void (*icq_RecvFileReq)(struct icq_link *link, unsigned long uin, | |
180 unsigned char hour, unsigned char minute, unsigned char day, | |
181 unsigned char month, unsigned short year, const char *descr, | |
182 const char *filename, unsigned long filesize, unsigned long seq); | |
183 void (*icq_RecvAdded)(struct icq_link *link, unsigned long uin, | |
184 unsigned char hour, unsigned char minute, unsigned char day, | |
185 unsigned char month, unsigned short year, const char *nick, | |
186 const char *first, const char *last, const char *email); | |
187 void (*icq_RecvAuthReq)(struct icq_link *link, unsigned long uin, | |
188 unsigned char hour, unsigned char minute, unsigned char day, | |
189 unsigned char month, unsigned short year, const char *nick, | |
190 const char *first, const char *last, const char *email, | |
191 const char *reason); | |
192 void (*icq_UserFound)(struct icq_link *link, unsigned long uin, | |
193 const char *nick, const char *first, const char *last, | |
194 const char *email, char auth); | |
195 void (*icq_SearchDone)(struct icq_link *link); | |
196 void (*icq_UserOnline)(struct icq_link *link, unsigned long uin, | |
197 unsigned long status, unsigned long ip, unsigned short port, | |
198 unsigned long real_ip, unsigned char tcp_flag ); | |
199 void (*icq_UserOffline)(struct icq_link *link, unsigned long uin); | |
200 void (*icq_UserStatusUpdate)(struct icq_link *link, unsigned long uin, | |
201 unsigned long status); | |
202 void (*icq_InfoReply)(struct icq_link *link, unsigned long uin, | |
203 const char *nick, const char *first, const char *last, | |
204 const char *email, char auth); | |
205 void (*icq_ExtInfoReply)(struct icq_link *link, unsigned long uin, | |
206 const char *city, unsigned short country_code, char country_stat, | |
207 const char *state, unsigned short age, char gender, | |
208 const char *phone, const char *hp, const char *about); | |
209 void (*icq_WrongPassword)(struct icq_link *link); | |
210 void (*icq_InvalidUIN)(struct icq_link *link); | |
211 void (*icq_Log)(struct icq_link *link, time_t time, unsigned char level, | |
212 const char *str); | |
213 void (*icq_SrvAck)(struct icq_link *link, unsigned short seq); | |
214 void (*icq_RequestNotify)(struct icq_link *link, unsigned long id, int result, | |
215 unsigned int length, void *data); | |
216 void (*icq_NewUIN)(struct icq_link *link, unsigned long uin); | |
217 void (*icq_SetTimeout)(struct icq_link *link, long interval); | |
218 void (*icq_MetaUserFound)(struct icq_link *link, unsigned short seq2, | |
219 unsigned long uin, const char *nick, const char *first, | |
220 const char *last, const char *email, char auth); | |
221 void (*icq_MetaUserInfo)(struct icq_link *link, unsigned short seq2, | |
222 const char *nick, const char *first, const char *last, | |
223 const char *pri_eml, const char *sec_eml, const char *old_eml, | |
224 const char *city, const char *state, const char *phone, const char *fax, | |
225 const char *street, const char *cellular, unsigned long zip, | |
226 unsigned short country, unsigned char timezone, unsigned char auth, | |
227 unsigned char webaware, unsigned char hideip); | |
228 void (*icq_MetaUserWork)(struct icq_link *link, unsigned short seq2, | |
229 const char *wcity, const char *wstate, const char *wphone, | |
230 const char *wfax, const char *waddress, unsigned long wzip, | |
231 unsigned short wcountry, const char *company, const char *department, | |
232 const char *job, unsigned short occupation, const char *whomepage); | |
233 void (*icq_MetaUserMore)(struct icq_link *link, unsigned short seq2, | |
234 unsigned short age, unsigned char gender, const char *homepage, | |
235 unsigned char byear, unsigned char bmonth, unsigned char bday, | |
236 unsigned char lang1, unsigned char lang2, unsigned char lang3); | |
237 void (*icq_MetaUserAbout)(struct icq_link *link, unsigned short seq2, | |
238 const char *about); | |
239 void (*icq_MetaUserInterests)(struct icq_link *link, unsigned short seq2, | |
240 unsigned char num, unsigned short icat1, const char *int1, | |
241 unsigned short icat2, const char *int2, unsigned short icat3, | |
242 const char *int3, unsigned short icat4, const char *int4); | |
243 void (*icq_MetaUserAffiliations)(struct icq_link *link, unsigned short seq2, | |
244 unsigned char anum, unsigned short acat1, const char *aff1, | |
245 unsigned short acat2, const char *aff2, unsigned short acat3, | |
246 const char *aff3, unsigned short acat4, const char *aff4, | |
247 unsigned char bnum, unsigned short bcat1, const char *back1, | |
248 unsigned short bcat2, const char *back2, unsigned short bcat3, | |
249 const char *back3, unsigned short bcat4, const char *back4); | |
250 void (*icq_MetaUserHomePageCategory)(struct icq_link *link, | |
251 unsigned short seq2, unsigned char num, unsigned short hcat1, | |
252 const char *htext1); | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
253 |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
254 /** Private data pointer. */ |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
255 struct icq_link_private *d; |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
256 |
1152 | 257 } ICQLINK; |
258 | |
259 extern int icq_Russian; | |
260 extern unsigned char icq_LogLevel; | |
261 extern icq_ArrayType icq_Countries[]; | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
262 extern icq_ArrayType icq_Genders[]; |
1152 | 263 |
264 void icq_SetProxy(ICQLINK *link, const char *phost, unsigned short pport, | |
265 int pauth, const char *pname, const char *ppass); | |
266 void icq_UnsetProxy(ICQLINK *link); | |
267 | |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
268 ICQLINK *icq_ICQLINKNew(unsigned long uin, const char *password, |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
269 const char *nick, unsigned char useTCP); |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
270 void icq_ICQLINKDelete(ICQLINK *link); |
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
271 |
1152 | 272 void icq_Init(ICQLINK *link, unsigned long uin, const char *password, |
1309
0a766047b4fd
[gaim-migrate @ 1319]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
273 const char *nick, unsigned char useTCP); |
1152 | 274 void icq_Done(ICQLINK *link); |
275 int icq_Connect(ICQLINK *link, const char *hostname, int port); | |
276 void icq_Disconnect(ICQLINK *link); | |
277 int icq_GetSok(ICQLINK *link); | |
278 int icq_GetProxySok(ICQLINK *link); | |
279 void icq_HandleServerResponse(ICQLINK *link); | |
280 void icq_HandleProxyResponse(ICQLINK *link); | |
281 void icq_HandleTimeout(ICQLINK *link); | |
282 void icq_Main(ICQLINK *link); | |
283 unsigned short icq_KeepAlive(ICQLINK *link); | |
284 void icq_Login(ICQLINK *link, unsigned long status); | |
285 void icq_Logout(ICQLINK *link); | |
286 void icq_SendContactList(ICQLINK *link); | |
287 void icq_SendVisibleList(ICQLINK *link); | |
288 void icq_SendNewUser(ICQLINK * link, unsigned long uin); | |
289 unsigned long icq_SendMessage(ICQLINK *link, unsigned long uin, | |
290 const char *text, unsigned char thruSrv); | |
291 unsigned long icq_SendURL(ICQLINK *link, unsigned long uin, const char *url, | |
292 const char *descr, unsigned char thruSrv); | |
293 void icq_ChangeStatus(ICQLINK *link, unsigned long status); | |
294 unsigned short icq_SendInfoReq(ICQLINK *link, unsigned long uin); | |
295 unsigned short icq_SendExtInfoReq(ICQLINK *link, unsigned long uin); | |
296 unsigned short icq_SendAuthMsg(ICQLINK *link, unsigned long uin); | |
297 void icq_SendSearchReq(ICQLINK *link, const char *email, const char *nick, | |
298 const char* first, const char* last); | |
299 void icq_SendSearchUINReq(ICQLINK *link, unsigned long uin); | |
300 | |
301 const char *icq_GetCountryName(unsigned short code); | |
302 const char *icq_GetMetaOccupationName(unsigned short code); | |
303 const char *icq_GetMetaBackgroundName(unsigned short code); | |
304 const char *icq_GetMetaAffiliationName(unsigned short code); | |
305 const char *icq_GetMetaLanguageName(unsigned short code); | |
306 void icq_RegNewUser(ICQLINK *link, const char *pass); | |
307 unsigned short icq_UpdateUserInfo(ICQLINK *link, const char *nick, | |
308 const char *first, const char *last, const char *email); | |
309 unsigned short icq_UpdateAuthInfo(ICQLINK *link, unsigned long auth); | |
310 unsigned short icq_UpdateMetaInfoSet(ICQLINK *link, const char *nick, | |
311 const char *first, const char *last, const char *email, | |
312 const char *email2, const char *email3, const char *city, | |
313 const char *state, const char *phone, const char *fax, const char *street, | |
314 const char *cellular, unsigned long zip, unsigned short cnt_code, | |
315 unsigned char cnt_stat, unsigned char emailhide); | |
316 unsigned short icq_UpdateMetaInfoHomepage(ICQLINK *link, unsigned char age, | |
317 const char *homepage, unsigned char year, unsigned char month, | |
318 unsigned char day, unsigned char lang1, unsigned char lang2, | |
319 unsigned char lang3); | |
320 unsigned short icq_UpdateMetaInfoAbout(ICQLINK *link, const char *about); | |
321 unsigned short icq_UpdateMetaInfoSecurity(ICQLINK *link, unsigned char reqauth, | |
322 unsigned char webpresence, unsigned char pubip); | |
323 unsigned short icq_UpdateNewUserInfo(ICQLINK *link, const char *nick, | |
324 const char *first, const char *last, const char *email); | |
325 unsigned short icq_SendMetaInfoReq(ICQLINK *link, unsigned long uin); | |
326 | |
327 void icq_FmtLog(ICQLINK *link, int level, const char *fmt, ...); | |
328 | |
329 void icq_ContactAdd(ICQLINK *link, unsigned long cuin); | |
330 void icq_ContactRemove(ICQLINK *link, unsigned long cuin); | |
331 void icq_ContactClear(ICQLINK *link ); | |
332 void icq_ContactSetVis(ICQLINK *link, unsigned long cuin, unsigned char vu); | |
333 | |
334 /*** TCP ***/ | |
335 void icq_TCPMain(ICQLINK *link); | |
336 | |
337 void icq_TCPProcessReceived(ICQLINK *link); | |
338 | |
339 unsigned long icq_TCPSendMessage(ICQLINK *link, unsigned long uin, | |
340 const char *message); | |
341 unsigned long icq_TCPSendURL(ICQLINK *link, unsigned long uin, | |
342 const char *message, const char *url); | |
343 unsigned long icq_SendChatRequest(ICQLINK *link, unsigned long uin, | |
344 const char *message); | |
345 void icq_AcceptChatRequest(ICQLINK *link, unsigned long uin, unsigned long seq); | |
346 | |
347 void icq_TCPSendChatData(ICQLINK *link, unsigned long uin, const char *data); | |
348 void icq_TCPSendChatData_n(ICQLINK *link, unsigned long uin, const char *data, int len); | |
349 void icq_TCPCloseChat(ICQLINK *link, unsigned long uin); | |
350 | |
351 void icq_CancelChatRequest(ICQLINK *link, unsigned long uin, | |
352 unsigned long sequence); | |
353 void icq_RefuseChatRequest(ICQLINK *link, unsigned long uin, | |
354 unsigned long sequence, const char *reason); | |
355 | |
356 /*** TCP ***/ | |
357 | |
358 /* file session statuses- request receiver */ | |
359 #define FILE_STATUS_LISTENING 1 | |
360 #define FILE_STATUS_CONNECTED 3 | |
361 | |
362 /* file session statuses- request sender */ | |
363 #define FILE_STATUS_CONNECTING 2 | |
364 | |
365 #define FILE_STATUS_INITIALIZED 4 | |
366 #define FILE_STATUS_NEXT_FILE 5 | |
367 #define FILE_STATUS_STOP_FILE 6 | |
368 #define FILE_STATUS_NEW_SPEED 7 | |
369 | |
370 /* once negotiation is complete, file session enters proper state */ | |
371 #define FILE_STATUS_READY 8 | |
372 #define FILE_STATUS_SENDING 8 | |
373 #define FILE_STATUS_RECEIVING 9 | |
374 | |
375 struct icq_TCPLink_s; | |
376 | |
377 typedef struct icq_FileSession_s { | |
378 | |
379 unsigned long id; | |
380 int status; | |
381 ICQLINK *icqlink; | |
382 struct icq_TCPLink_s *tcplink; | |
383 | |
384 int direction; | |
385 | |
386 unsigned long remote_uin; | |
387 char remote_handle[64]; | |
388 | |
389 char **files; | |
390 int total_files; | |
391 int current_file_num; | |
392 unsigned long total_bytes; | |
393 unsigned long total_transferred_bytes; | |
394 | |
395 char working_dir[512]; | |
396 char current_file[64]; | |
397 int current_fd; | |
398 unsigned long current_file_size; | |
399 unsigned long current_file_progress; | |
400 | |
401 int current_speed; | |
402 | |
403 } icq_FileSession; | |
404 | |
405 icq_FileSession *icq_AcceptFileRequest(ICQLINK *link, unsigned long uin, | |
406 unsigned long sequence); | |
407 unsigned long icq_SendFileRequest(ICQLINK *link, unsigned long uin, | |
408 const char *message, char **files); | |
409 void icq_CancelFileRequest(ICQLINK *link, unsigned long uin, | |
410 unsigned long sequence); | |
411 void icq_RefuseFileRequest(ICQLINK *link, unsigned long uin, | |
412 unsigned long sequence, const char *reason); | |
413 | |
414 void icq_FileSessionSetSpeed(icq_FileSession *p, int speed); | |
415 void icq_FileSessionClose(icq_FileSession *p); | |
416 void icq_FileSessionSetWorkingDir(icq_FileSession *p, const char *dir); | |
417 void icq_FileSessionSetFiles(icq_FileSession *p, char **files); | |
418 | |
419 #ifdef __cplusplus | |
420 } | |
421 #endif /* __cplusplus */ | |
422 | |
423 #endif /* _ICQ_H_ */ |