[gaim-migrate @ 3063]
[pidgin-git.git] / src / protocols / icq / icqlib.h
blob44286e85b4fe11aae1aeceeafaed937b7451a9c0
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /*
4 * $Id: icqlib.h 2096 2001-07-31 01:00:39Z warmenhoven $
6 * Copyright (C) 1998-2001, Denis V. Dmitrienko <denis@null.net> and
7 * Bill Soudan <soudan@kde.org>
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.
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.
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.
25 #ifndef _ICQLIB_H_
26 #define _ICQLIB_H_
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
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
43 #include "icq.h"
44 #include "util.h"
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);
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 */
66 /** Private ICQLINK data. These are members that are internal to
67 * icqlib, but must be contained in the per-connection ICQLINK
68 * struct.
70 struct icq_LinkPrivate_s
72 icq_List *icq_ContactList;
74 /* 65536 seqs max, 1 bit per seq -> 65536/8 = 8192 */
75 unsigned char icq_UDPServMess[8192];
77 unsigned short icq_UDPSeqNum1, icq_UDPSeqNum2;
78 unsigned long icq_UDPSession;
80 icq_List *icq_UDPQueue;
82 int icq_TCPSequence;
83 icq_List *icq_TCPLinks;
84 icq_List *icq_ChatSessions;
85 icq_List *icq_FileSessions;
88 #define invoke_callback(plink, callback) \
89 if (plink->callback) (*(plink->callback))
91 #endif /* _ICQLIB_H_ */