libpurple/internal.h

Sun, 02 Jun 2013 23:59:55 -0700

author
Mark Doliner <mark@kingant.net>
date
Sun, 02 Jun 2013 23:59:55 -0700
changeset 33955
55aa58076485
parent 33940
b44d15793c83
child 34575
e08f2d070470
permissions
-rw-r--r--

Use https URLs for pidgin.im and developer.pidgin.im.

This should slightly reduce the opportunity for a malicious
person to perform a MITM attack.

8790
3d6d2e2f6296 [gaim-migrate @ 9552]
Jonathan Champ <royanee@users.sourceforge.net>
parents: 8737
diff changeset
1 /**
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file internal.h Internal definitions and includes
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
3 * @ingroup core
20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
4 */
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
5
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
6 /* purple
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 6371
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 6371
diff changeset
10 * source distribution.
11137
cf40226ddff7 [gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents: 10589
diff changeset
11 *
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * (at your option) any later version.
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 *
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * GNU General Public License for more details.
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 *
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19742
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
26 #ifndef _PURPLE_INTERNAL_H_
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
27 #define _PURPLE_INTERNAL_H_
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 #ifdef HAVE_CONFIG_H
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
30 # include <config.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32
19742
4e76841db5c0 Fix compilation on SkyOS. This patch is from Peter Speybrouk, a.k.a.
Ethan Blanton <elb@pidgin.im>
parents: 18609
diff changeset
33 /* for SIOCGIFCONF in SKYOS */
4e76841db5c0 Fix compilation on SkyOS. This patch is from Peter Speybrouk, a.k.a.
Ethan Blanton <elb@pidgin.im>
parents: 18609
diff changeset
34 #ifdef SKYOS
4e76841db5c0 Fix compilation on SkyOS. This patch is from Peter Speybrouk, a.k.a.
Ethan Blanton <elb@pidgin.im>
parents: 18609
diff changeset
35 #include <net/sockios.h>
4e76841db5c0 Fix compilation on SkyOS. This patch is from Peter Speybrouk, a.k.a.
Ethan Blanton <elb@pidgin.im>
parents: 18609
diff changeset
36 #endif
9999
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
37 /*
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
38 * If we're using NLS, make sure gettext works. If not, then define
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
39 * dummy macros in place of the normal gettext macros.
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
40 *
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
41 * Also, the perl XS config.h file sometimes defines _ So we need to
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
42 * make sure _ isn't already defined before trying to define it.
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
43 *
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
44 * The Singular/Plural/Number ngettext dummy definition below was
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
45 * taken from an email to the texinfo mailing list by Manuel Guerrero.
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
46 * Thank you Manuel, and thank you Alex's good friend Google.
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
47 */
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 #ifdef ENABLE_NLS
8737
b9f8de95d6bb [gaim-migrate @ 9492]
Mark Doliner <markdoliner@pidgin.im>
parents: 8735
diff changeset
49 # include <locale.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 # include <libintl.h>
16124
8e5e3e9ada60 Hopefully prevent libpurple causing problems for 3rd party UIs if they also
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15929
diff changeset
51 # define _(String) ((const char *)dgettext(PACKAGE, String))
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 # ifdef gettext_noop
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 # define N_(String) gettext_noop (String)
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 # else
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 # define N_(String) (String)
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 # endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 #else
8730
9533a7bcbedb [gaim-migrate @ 9485]
Etan Reisner <deryni@pidgin.im>
parents: 8046
diff changeset
58 # include <locale.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 # define N_(String) (String)
9999
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
60 # ifndef _
14342
9059c7771ef1 [gaim-migrate @ 16965]
Mark Doliner <markdoliner@pidgin.im>
parents: 14333
diff changeset
61 # define _(String) ((const char *)String)
9999
86e89e1dee10 [gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents: 8793
diff changeset
62 # endif
13107
704041197f4d [gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
63 # define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
16124
8e5e3e9ada60 Hopefully prevent libpurple causing problems for 3rd party UIs if they also
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 15929
diff changeset
64 # define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 #ifdef HAVE_ENDIAN_H
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 # include <endian.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 #define MSG_LEN 2048
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 /* The above should normally be the same as BUF_LEN,
8735
01248ea222d3 [gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents: 8730
diff changeset
73 * but just so we're explicitly asking for the max message
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 * length. */
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 #define BUF_LEN MSG_LEN
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 #define BUF_LONG BUF_LEN * 2
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 #include <sys/types.h>
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
79 #ifndef _WIN32
14333
13d7807ae88c [gaim-migrate @ 16954]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
80 #include <sys/time.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 #include <sys/wait.h>
13875
d5a63223f03e [gaim-migrate @ 16840]
Ma Yuan <mayuan2006@gmail.com>
parents: 13623
diff changeset
82 #include <sys/time.h>
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
83 #endif
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 #include <ctype.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 #include <errno.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 #include <fcntl.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 #include <math.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 #include <stdio.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 #include <stdlib.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 #include <string.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 #include <time.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 #ifdef HAVE_ICONV
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 #include <iconv.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 #ifdef HAVE_LANGINFO_CODESET
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 #include <langinfo.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100
18609
3512a0bda029 gmodule.h is needed in internal.h for GLIB_CHECK_VERSION() to be defined; this is independent of whether PURPLE_PLUGINS is defined.
Evan Schoenberg <evands@pidgin.im>
parents: 18549
diff changeset
101 #include <gmodule.h>
3512a0bda029 gmodule.h is needed in internal.h for GLIB_CHECK_VERSION() to be defined; this is independent of whether PURPLE_PLUGINS is defined.
Evan Schoenberg <evands@pidgin.im>
parents: 18549
diff changeset
102
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
103 #ifdef PURPLE_PLUGINS
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 24569
diff changeset
104 # ifdef HAVE_DLFCN_H
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 # include <dlfcn.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 # endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
109 #ifndef _WIN32
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 # include <netinet/in.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 # include <sys/socket.h>
6170
19976e14da97 [gaim-migrate @ 6655]
Matthew Luckie
parents: 5976
diff changeset
112 # include <arpa/inet.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 # include <sys/un.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 # include <sys/utsname.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 # include <netdb.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116 # include <signal.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 # include <unistd.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 #ifndef HOST_NAME_MAX
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 # define HOST_NAME_MAX 255
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 #include <glib.h>
14707
3753832fd0de [gaim-migrate @ 17391]
Mark Doliner <markdoliner@pidgin.im>
parents: 14342
diff changeset
125
29491
31c1d615772e Kill off unneeded GLIB_CHECK_VERSION checks in libpurple. Refs #10024.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27708
diff changeset
126 /* This wasn't introduced until Glib 2.14 :( */
27539
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
127 #ifndef G_MAXSSIZE
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
128 # if GLIB_SIZEOF_LONG == 8
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
129 # define G_MAXSSIZE ((gssize) 0x7fffffffffffffff)
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
130 # else
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
131 # define G_MAXSSIZE ((gssize) 0x7fffffff)
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
132 # endif
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
133 #endif
e94b84b12eb6 Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents: 26726
diff changeset
134
29491
31c1d615772e Kill off unneeded GLIB_CHECK_VERSION checks in libpurple. Refs #10024.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27708
diff changeset
135 #include <glib/gstdio.h>
10589
4e10236e06d4 [gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents: 10588
diff changeset
136
14974
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
137 #ifdef _WIN32
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
138 #include "win32dep.h"
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
139 #endif
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
140
27708
5dc9e57a6685 HAVE_CONFIG_H is not defined when building the perl plugin, so work around
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27705
diff changeset
141 #ifdef HAVE_CONFIG_H
27705
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
142 #if SIZEOF_TIME_T == 4
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
143 # define PURPLE_TIME_T_MODIFIER "lu"
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
144 #elif SIZEOF_TIME_T == 8
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
145 # define PURPLE_TIME_T_MODIFIER "zu"
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
146 #else
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
147 #error Unknown size of time_t
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
148 #endif
27708
5dc9e57a6685 HAVE_CONFIG_H is not defined when building the perl plugin, so work around
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27705
diff changeset
149 #endif
27705
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
150
26615
2171a9101814 Add G_DEFINE_TYPE compatibility define from gobjectification branch.
Michael Ruprecht <maiku@pidgin.im>
parents: 25888
diff changeset
151 #include <glib-object.h>
2171a9101814 Add G_DEFINE_TYPE compatibility define from gobjectification branch.
Michael Ruprecht <maiku@pidgin.im>
parents: 25888
diff changeset
152
33955
55aa58076485 Use https URLs for pidgin.im and developer.pidgin.im.
Mark Doliner <mark@kingant.net>
parents: 33940
diff changeset
153 #define PURPLE_WEBSITE "https://pidgin.im/"
55aa58076485 Use https URLs for pidgin.im and developer.pidgin.im.
Mark Doliner <mark@kingant.net>
parents: 33940
diff changeset
154 #define PURPLE_DEVEL_WEBSITE "https://developer.pidgin.im/"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
156
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
157 /* INTERNAL FUNCTIONS */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
158
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
159 #include "account.h"
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
160 #include "connection.h"
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
161
16565
f5cd28cc7367 Ref the filenames for account buddy icons on load.
Richard Laager <rlaager@pidgin.im>
parents: 16421
diff changeset
162 /* This is for the accounts code to notify the buddy icon code that
f5cd28cc7367 Ref the filenames for account buddy icons on load.
Richard Laager <rlaager@pidgin.im>
parents: 16421
diff changeset
163 * it's done loading. We may want to replace this with a signal. */
f5cd28cc7367 Ref the filenames for account buddy icons on load.
Richard Laager <rlaager@pidgin.im>
parents: 16421
diff changeset
164 void
16696
450ba3bd5b63 The GNOME coding guidelines recommend prefixing internal symbols with an underscore.
Richard Laager <rlaager@pidgin.im>
parents: 16565
diff changeset
165 _purple_buddy_icons_account_loaded_cb(void);
16565
f5cd28cc7367 Ref the filenames for account buddy icons on load.
Richard Laager <rlaager@pidgin.im>
parents: 16421
diff changeset
166
16421
f9218e1c4703 The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents: 16158
diff changeset
167 /* This is for the buddy list to notify the buddy icon code that
f9218e1c4703 The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents: 16158
diff changeset
168 * it's done loading. We may want to replace this with a signal. */
f9218e1c4703 The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents: 16158
diff changeset
169 void
16696
450ba3bd5b63 The GNOME coding guidelines recommend prefixing internal symbols with an underscore.
Richard Laager <rlaager@pidgin.im>
parents: 16565
diff changeset
170 _purple_buddy_icons_blist_loaded_cb(void);
16421
f9218e1c4703 The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents: 16158
diff changeset
171
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
172 /**
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
173 * Creates a connection to the specified account and either connects
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
174 * or attempts to register a new account. If you are logging in,
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
175 * the connection uses the current active status for this account.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
176 * So if you want to sign on as "away," for example, you need to
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
177 * have called purple_account_set_status(account, "away").
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
178 * (And this will call purple_account_connect() automatically).
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
179 *
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
180 * @note This function should only be called by purple_account_connect()
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
181 * in account.c. If you're trying to sign on an account, use that
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
182 * function instead.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
183 *
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
184 * @param account The account the connection should be connecting to.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
185 * @param regist Whether we are registering a new account or just
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
186 * trying to do a normal signon.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
187 * @param password The password to use.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
188 */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
189 void _purple_connection_new(PurpleAccount *account, gboolean regist,
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
190 const char *password);
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
191 /**
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
192 * Tries to unregister the account on the server. If the account is not
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
193 * connected, also creates a new connection.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
194 *
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
195 * @note This function should only be called by purple_account_unregister()
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
196 * in account.c.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
197 *
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
198 * @param account The account to unregister
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
199 * @param password The password to use.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
200 * @param cb Optional callback to be called when unregistration is complete
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
201 * @param user_data user data to pass to the callback
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
202 */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
203 void _purple_connection_new_unregister(PurpleAccount *account, const char *password,
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
204 PurpleAccountUnregistrationCb cb, void *user_data);
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
205 /**
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
206 * Disconnects and destroys a PurpleConnection.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
207 *
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
208 * @note This function should only be called by purple_account_disconnect()
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
209 * in account.c. If you're trying to sign off an account, use that
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
210 * function instead.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
211 *
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
212 * @param gc The purple connection to destroy.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
213 */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
214 void _purple_connection_destroy(PurpleConnection *gc);
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
215
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
216 #endif /* _PURPLE_INTERNAL_H_ */

mercurial