| |
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| |
2 |
| |
3 /* |
| |
4 * $Id: icqlib.h 2096 2001-07-31 01:00:39Z warmenhoven $ |
| |
5 * |
| |
6 * Copyright (C) 1998-2001, Denis V. Dmitrienko <denis@null.net> and |
| |
7 * Bill Soudan <soudan@kde.org> |
| |
8 * |
| |
9 * This program is free software; you can redistribute it and/or modify |
| |
10 * it under the terms of the GNU General Public License as published by |
| |
11 * the Free Software Foundation; either version 2 of the License, or |
| |
12 * (at your option) any later version. |
| |
13 * |
| |
14 * This program is distributed in the hope that it will be useful, |
| |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
17 * GNU General Public License for more details. |
| |
18 * |
| |
19 * You should have received a copy of the GNU General Public License |
| |
20 * along with this program; if not, write to the Free Software |
| |
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
22 * |
| |
23 */ |
| |
24 |
| |
25 #ifndef _ICQLIB_H_ |
| |
26 #define _ICQLIB_H_ |
| |
27 |
| |
28 #ifdef HAVE_CONFIG_H |
| |
29 #include <config.h> |
| |
30 #endif |
| |
31 |
| |
32 /* for strdup(), bzero() and snprintf() declarations */ |
| |
33 #ifndef __USE_BSD |
| |
34 #define __USE_BSD 1 |
| |
35 #define __need_bsd_undef 1 |
| |
36 #endif |
| |
37 #include <string.h> |
| |
38 #include <stdio.h> |
| |
39 #ifdef __need_bsd_undef |
| |
40 #undef __USE_BSD |
| |
41 #endif |
| |
42 |
| |
43 #include "icq.h" |
| |
44 #include "util.h" |
| |
45 |
| |
46 BOOL icq_GetServMess(icq_Link *icqlink, WORD num); |
| |
47 void icq_SetServMess(icq_Link *icqlink, WORD num); |
| |
48 void icq_RusConv(const char to[4], char *t_in); |
| |
49 void icq_RusConv_n(const char to[4], char *t_in, int len); |
| |
50 |
| |
51 #ifndef _WIN32 |
| |
52 #ifndef inet_addr |
| |
53 extern unsigned long inet_addr(const char *cp); |
| |
54 #endif /* inet_addr */ |
| |
55 #ifndef inet_aton |
| |
56 extern int inet_aton(const char *cp, struct in_addr *inp); |
| |
57 #endif /* inet_aton */ |
| |
58 #ifndef inet_ntoa |
| |
59 extern char *inet_ntoa(struct in_addr in); |
| |
60 #endif /* inet_ntoa */ |
| |
61 #ifndef strdup |
| |
62 extern char *strdup(const char *s); |
| |
63 #endif /* strdup */ |
| |
64 #endif /* _WIN32 */ |
| |
65 |
| |
66 /** Private ICQLINK data. These are members that are internal to |
| |
67 * icqlib, but must be contained in the per-connection ICQLINK |
| |
68 * struct. |
| |
69 */ |
| |
70 struct icq_LinkPrivate_s |
| |
71 { |
| |
72 icq_List *icq_ContactList; |
| |
73 |
| |
74 /* 65536 seqs max, 1 bit per seq -> 65536/8 = 8192 */ |
| |
75 unsigned char icq_UDPServMess[8192]; |
| |
76 |
| |
77 unsigned short icq_UDPSeqNum1, icq_UDPSeqNum2; |
| |
78 unsigned long icq_UDPSession; |
| |
79 |
| |
80 icq_List *icq_UDPQueue; |
| |
81 |
| |
82 int icq_TCPSequence; |
| |
83 icq_List *icq_TCPLinks; |
| |
84 icq_List *icq_ChatSessions; |
| |
85 icq_List *icq_FileSessions; |
| |
86 }; |
| |
87 |
| |
88 #define invoke_callback(plink, callback) \ |
| |
89 if (plink->callback) (*(plink->callback)) |
| |
90 |
| |
91 #endif /* _ICQLIB_H_ */ |