libpurple/internal.h

Fri, 13 Mar 2020 05:09:40 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 13 Mar 2020 05:09:40 -0500
changeset 40307
507f9d1dae10
parent 39659
e4dfb99b0cef
child 40439
e9838d634d5e
permissions
-rw-r--r--

Set our minimum glib version which turns off deprecation warnings for anything that's been deprecated after that version

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
1 /* purple
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
3 * 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
4 * 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
5 * source distribution.
11137
cf40226ddff7 [gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents: 10589
diff changeset
6 *
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * 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
9 * the Free Software Foundation; either version 2 of the License, or
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * (at your option) any later version.
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 *
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * GNU General Public License for more details.
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 * You should have received a copy of the GNU General Public License
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * 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
19 * 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
20 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35469
diff changeset
21
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39433
diff changeset
22 #ifndef PURPLE_INTERNAL_H
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39433
diff changeset
23 #define PURPLE_INTERNAL_H
35462
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
24 /*
35440
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
25 * SECTION:internal
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
26 * @section_id: libpurple-internal
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
27 * @short_description: <filename>internal.h</filename>
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
28 * @title: Internal definitions and includes
467bb21b82a1 Add section blocks for debug.h to prpl.h
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
29 */
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
40307
507f9d1dae10 Set our minimum glib version which turns off deprecation warnings for anything that's been deprecated after that version
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
31 #ifndef GLIB_VERSION_MIN_REQUIRED
507f9d1dae10 Set our minimum glib version which turns off deprecation warnings for anything that's been deprecated after that version
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
32 #define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_2_28)
507f9d1dae10 Set our minimum glib version which turns off deprecation warnings for anything that's been deprecated after that version
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
33 #endif
507f9d1dae10 Set our minimum glib version which turns off deprecation warnings for anything that's been deprecated after that version
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
34
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 #ifdef HAVE_CONFIG_H
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
36 # include <config.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
19742
4e76841db5c0 Fix compilation on SkyOS. This patch is from Peter Speybrouk, a.k.a.
Ethan Blanton <elb@pidgin.im>
parents: 18609
diff changeset
39 /* 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
40 #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
41 #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
42 #endif
39373
47667f5c6696 libpurple: Include 'glib/gi18n-lib.h' instead of 'libintl.h'
Mike Ruprecht <cmaiku@gmail.com>
parents: 38140
diff changeset
43
47667f5c6696 libpurple: Include 'glib/gi18n-lib.h' instead of 'libintl.h'
Mike Ruprecht <cmaiku@gmail.com>
parents: 38140
diff changeset
44 #include <glib/gi18n-lib.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 #ifdef HAVE_ENDIAN_H
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 # include <endian.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 #define MSG_LEN 2048
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 /* 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
52 * but just so we're explicitly asking for the max message
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 * length. */
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 #define BUF_LEN MSG_LEN
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 #define BUF_LONG BUF_LEN * 2
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 #include <sys/types.h>
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
58 #ifndef _WIN32
14333
13d7807ae88c [gaim-migrate @ 16954]
Daniel Atallah <datallah@pidgin.im>
parents: 14254
diff changeset
59 #include <sys/time.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 #include <sys/wait.h>
13875
d5a63223f03e [gaim-migrate @ 16840]
Ma Yuan <mayuan2006@gmail.com>
parents: 13623
diff changeset
61 #include <sys/time.h>
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
62 #endif
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 #include <ctype.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 #include <errno.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 #include <fcntl.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 #include <math.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 #include <stdio.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 #include <stdlib.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 #include <string.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 #include <time.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 #ifdef HAVE_ICONV
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 #include <iconv.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 #ifdef HAVE_LANGINFO_CODESET
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 #include <langinfo.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
80 #ifndef _WIN32
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 # include <netinet/in.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 # include <sys/socket.h>
6170
19976e14da97 [gaim-migrate @ 6655]
Matthew Luckie
parents: 5976
diff changeset
83 # include <arpa/inet.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 # include <sys/un.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 # include <sys/utsname.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 # include <netdb.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 # include <signal.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 # include <unistd.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 #ifndef HOST_NAME_MAX
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 # define HOST_NAME_MAX 255
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 #include <glib.h>
29491
31c1d615772e Kill off unneeded GLIB_CHECK_VERSION checks in libpurple. Refs #10024.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27708
diff changeset
96 #include <glib/gstdio.h>
10589
4e10236e06d4 [gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents: 10588
diff changeset
97
14974
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
98 #ifdef _WIN32
35849
77efee65c5f4 cross-win32: fix socklen_t check, win32dep.h include, undef pthread's localtime_r
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35686
diff changeset
99 #include "win32/win32dep.h"
14974
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
100 #endif
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
101
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
102 #ifdef HAVE_CONFIG_H
27705
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
103 #if SIZEOF_TIME_T == 4
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
104 # define PURPLE_TIME_T_MODIFIER "lu"
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
105 #elif SIZEOF_TIME_T == 8
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
106 # define PURPLE_TIME_T_MODIFIER "zu"
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
107 #else
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
108 #error Unknown size of time_t
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
109 #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
110 #endif
27705
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
111
35965
65d585472765 Fix perl warnings or break the build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35961
diff changeset
112 #define PURPLE_STATIC_ASSERT(condition, message) \
65d585472765 Fix perl warnings or break the build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35961
diff changeset
113 { typedef char static_assertion_failed_ ## message \
65d585472765 Fix perl warnings or break the build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35961
diff changeset
114 [(condition) ? 1 : -1]; static_assertion_failed_ ## message dummy; \
65d585472765 Fix perl warnings or break the build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35961
diff changeset
115 (void)dummy; }
36021
61e8e081e93c Fix build for glib < 2.32
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35977
diff changeset
116
36068
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
117 /* This is meant to track use-after-free errors.
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
118 * TODO: it should be disabled in released code. */
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
119 #define PURPLE_ASSERT_CONNECTION_IS_VALID(gc) \
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
120 _purple_assert_connection_is_valid(gc, __FILE__, __LINE__)
36021
61e8e081e93c Fix build for glib < 2.32
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35977
diff changeset
121
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
122 #ifdef __clang__
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
123
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
124 #define PURPLE_BEGIN_IGNORE_CAST_ALIGN \
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
125 _Pragma ("clang diagnostic push") \
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
126 _Pragma ("clang diagnostic ignored \"-Wcast-align\"")
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
127
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
128 #define PURPLE_END_IGNORE_CAST_ALIGN \
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
129 _Pragma ("clang diagnostic pop")
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
130
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
131 #else
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
132
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
133 #define PURPLE_BEGIN_IGNORE_CAST_ALIGN
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
134 #define PURPLE_END_IGNORE_CAST_ALIGN
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
135
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
136 #endif /* __clang__ */
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
137
26615
2171a9101814 Add G_DEFINE_TYPE compatibility define from gobjectification branch.
Michael Ruprecht <maiku@pidgin.im>
parents: 25888
diff changeset
138 #include <glib-object.h>
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 11677
diff changeset
139
36025
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
140 #ifdef __COVERITY__
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
141
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
142 /* avoid TAINTED_SCALAR warning */
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
143 #undef g_utf8_next_char
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
144 #define g_utf8_next_char(p) (char *)((p) + 1)
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
145
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
146 #endif
2897add11757 Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36021
diff changeset
147
35556
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
148 typedef union
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
149 {
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
150 struct sockaddr sa;
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
151 struct sockaddr_in in;
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
152 struct sockaddr_in6 in6;
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
153 struct sockaddr_storage storage;
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
154 } common_sockaddr_t;
eeb82d3d33b1 Add missing typedef
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 29491
diff changeset
155
33955
55aa58076485 Use https URLs for pidgin.im and developer.pidgin.im.
Mark Doliner <mark@kingant.net>
parents: 33940
diff changeset
156 #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
157 #define PURPLE_DEVEL_WEBSITE "https://developer.pidgin.im/"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
159
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
160 /* INTERNAL FUNCTIONS */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
161
34575
e08f2d070470 Refactored libpurple/plugins according to changes to PurpleAccount
Ankit Vani <a@nevitus.org>
parents: 33955
diff changeset
162 #include "accounts.h"
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
163 #include "connection.h"
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
164
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
165 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
166 * _purple_account_set_current_error:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
167 * @account: The account to set the error for.
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
168 * @new_err: The #PurpleConnectionErrorInfo instance representing the
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
169 * error.
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
170 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
171 * Sets an error for an account.
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
172 */
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
173 void _purple_account_set_current_error(PurpleAccount *account,
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
174 PurpleConnectionErrorInfo *new_err);
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
175
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
176 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
177 * _purple_account_to_xmlnode:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
178 * @account: The account
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
179 *
35178
7c775624f964 Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents: 35139
diff changeset
180 * Get an XML description of an account.
7c775624f964 Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents: 35139
diff changeset
181 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
182 * Returns: The XML description of the account.
35178
7c775624f964 Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents: 35139
diff changeset
183 */
7c775624f964 Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents: 35139
diff changeset
184 PurpleXmlNode *_purple_account_to_xmlnode(PurpleAccount *account);
7c775624f964 Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents: 35139
diff changeset
185
7c775624f964 Move (_)purple_account_to_xmlnode to internal.h
Ankit Vani <a@nevitus.org>
parents: 35139
diff changeset
186 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
187 * _purple_blist_get_last_child:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
188 * @node: The node whose last child is to be retrieved.
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
189 *
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
190 * Returns the last child of a particular node.
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
191 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
192 * Returns: The last child of the node.
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
193 */
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
194 PurpleBlistNode *_purple_blist_get_last_child(PurpleBlistNode *node);
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
195
16565
f5cd28cc7367 Ref the filenames for account buddy icons on load.
Richard Laager <rlaager@pidgin.im>
parents: 16421
diff changeset
196 /* 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
197 * 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
198 void
16696
450ba3bd5b63 The GNOME coding guidelines recommend prefixing internal symbols with an underscore.
Richard Laager <rlaager@pidgin.im>
parents: 16565
diff changeset
199 _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
200
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
201 /* 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
202 * 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
203 void
16696
450ba3bd5b63 The GNOME coding guidelines recommend prefixing internal symbols with an underscore.
Richard Laager <rlaager@pidgin.im>
parents: 16565
diff changeset
204 _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
205
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
206 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
207 * _purple_connection_new:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
208 * @account: The account the connection should be connecting to.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
209 * @regist: Whether we are registering a new account or just
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
210 * trying to do a normal signon.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
211 * @password: The password to use.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
212 *
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
213 * 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
214 * 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
215 * 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
216 * 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
217 * 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
218 * (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
219 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
220 * Note: This function should only be called by purple_account_connect()
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
221 * 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
222 * function instead.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
223 */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
224 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
225 const char *password);
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
226 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
227 * _purple_connection_new_unregister:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
228 * @account: The account to unregister
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
229 * @password: The password to use.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
230 * @cb: Optional callback to be called when unregistration is complete
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
231 * @user_data: user data to pass to the callback
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
232 *
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
233 * 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
234 * 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
235 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
236 * Note: This function should only be called by purple_account_unregister()
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
237 * in account.c.
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
238 */
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
239 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
240 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
241 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
242 * _purple_connection_wants_to_die:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
243 * @gc: The connection to check
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
244 *
34751
374a9500c430 Added _purple_connection_wants_to_die() to internal.h to be used by account.c. Removed _purple_connection_destroy().
Ankit Vani <a@nevitus.org>
parents: 34575
diff changeset
245 * Checks if a connection is disconnecting, and should not attempt to reconnect.
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
246 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
247 * Note: This function should only be called by purple_account_set_enabled()
34751
374a9500c430 Added _purple_connection_wants_to_die() to internal.h to be used by account.c. Removed _purple_connection_destroy().
Ankit Vani <a@nevitus.org>
parents: 34575
diff changeset
248 * in account.c.
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
249 */
39433
f033955d125a Use G_DEFINE_TYPE_WITH_PRIVATE for PurpleConnection.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39373
diff changeset
250 gboolean _purple_connection_wants_to_die(PurpleConnection *gc);
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
251
34755
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
252 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
253 * _purple_connection_add_active_chat:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
254 * @gc: The connection
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
255 * @chat: The chat conversation to add
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
256 *
34755
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
257 * Adds a chat to the active chats list of a connection
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
258 *
35499
c4c5e0a670b1 Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
259 * Note: This function should only be called by purple_serv_got_joined_chat()
34755
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
260 * in server.c.
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
261 */
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
262 void _purple_connection_add_active_chat(PurpleConnection *gc,
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
263 PurpleChatConversation *chat);
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
264 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
265 * _purple_connection_remove_active_chat:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
266 * @gc: The connection
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
267 * @chat: The chat conversation to remove
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
268 *
34755
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
269 * Removes a chat from the active chats list of a connection
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
270 *
35499
c4c5e0a670b1 Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
271 * Note: This function should only be called by purple_serv_got_chat_left()
34755
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
272 * in server.c.
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
273 */
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
274 void _purple_connection_remove_active_chat(PurpleConnection *gc,
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
275 PurpleChatConversation *chat);
9336815f86b6 Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents: 34751
diff changeset
276
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
277 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
278 * _purple_conversations_update_cache:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
279 * @conv: The conversation.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
280 * @name: The new name. If no change, use %NULL.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
281 * @account: The new account. If no change, use %NULL.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
282 *
35307
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
283 * Updates the conversation cache to use a new conversation name and/or
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
284 * account. This function only updates the conversation cache. It is the
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
285 * caller's responsibility to actually update the conversation.
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
286 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
287 * Note: This function should only be called by purple_conversation_set_name()
35307
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
288 * and purple_conversation_set_account() in conversation.c.
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
289 */
35307
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
290 void _purple_conversations_update_cache(PurpleConversation *conv,
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
291 const char *name, PurpleAccount *account);
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
292
2af82f31e6a8 Move (_)purple_conversations_update_cache to internal.h
Ankit Vani <a@nevitus.org>
parents: 35178
diff changeset
293 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
294 * _purple_statuses_get_primitive_scores:
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
295 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35307
diff changeset
296 * Note: This function should only be called by
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
297 * purple_buddy_presence_compute_score() in presence.c.
35462
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
298 *
901dfa763f15 Fix some gtk-doc warnings till proxy.c
Ankit Vani <a@nevitus.org>
parents: 35440
diff changeset
299 * Returns: The primitive scores array from status.c.
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
300 */
35091
cb6e94789b5a Moved declaerations of shared private functions to internal.h
Ankit Vani <a@nevitus.org>
parents: 34755
diff changeset
301 int *_purple_statuses_get_primitive_scores(void);
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
302
35961
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
303 /**
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
304 * _purple_blist_get_localized_default_group_name:
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
305 *
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
306 * Returns the name of default group for previously used non-English
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
307 * localization. It's used for merging default group, in case when roster
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
308 * contains localized name.
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
309 *
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
310 * Please note, prpls shouldn't save default group name depending on current
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
311 * locale. So, this function is mostly for libpurple2 compatibility. And for
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
312 * improperly written prpls.
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
313 */
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
314 const gchar *
87fd9126902a blist: store localized name of default group to avoid contact splitting
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35849
diff changeset
315 _purple_blist_get_localized_default_group_name(void);
24569
5dbd0617a27d Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents: 23542
diff changeset
316
36028
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
317 /**
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
318 * Sets most commonly used socket flags: O_NONBLOCK and FD_CLOEXEC.
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
319 *
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
320 * @param fd The file descriptor for the socket.
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
321 *
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
322 * @return TRUE if succeeded, FALSE otherwise.
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
323 */
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
324 gboolean
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
325 _purple_network_set_common_socket_flags(int fd);
fc5300cb3617 Get rid of fair amount of copy-pasta and coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36025
diff changeset
326
36034
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
327 /**
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
328 * A fstat alternative, like g_stat for stat.
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
329 *
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
330 * @param fd The file descriptor.
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
331 * @param st The stat buffer.
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
332 *
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
333 * @return the result just like for fstat.
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
334 */
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
335 int
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
336 _purple_fstat(int fd, GStatBuf *st);
4bba5ea5d08a Provide a portable alternative for fstat
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36031
diff changeset
337
36067
df9f5de00ea2 PurpleSocket: fix a crash
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36034
diff changeset
338 /**
36116
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
339 * _purple_message_init: (skip)
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
340 *
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
341 * Initializes the #PurpleMessage subsystem.
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
342 */
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
343 void
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
344 _purple_message_init(void);
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
345
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
346 /**
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
347 * _purple_message_uninit: (skip)
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
348 *
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
349 * Uninitializes the #PurpleMessage subsystem.
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
350 */
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
351 void
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
352 _purple_message_uninit(void);
e1f9a50effbc Fill comments for PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
353
36068
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
354 void
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
355 _purple_assert_connection_is_valid(PurpleConnection *gc,
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
356 const gchar *file, int line);
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36067
diff changeset
357
36100
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
358 /**
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
359 * _purple_conversation_write_common:
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
360 * @conv: The conversation.
36108
69b4fce85ffa Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36100
diff changeset
361 * @msg: The message.
36100
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
362 *
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
363 * Writes to a conversation window.
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
364 *
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
365 * This function should not be used to write IM or chat messages. Use
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
366 * purple_conversation_write_message() instead. This function will
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
367 * most likely call this anyway, but it may do it's own formatting,
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
368 * sound playback, etc. depending on whether the conversation is a chat or an
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
369 * IM.
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
370 *
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
371 * See purple_conversation_write_message().
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
372 */
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
373 void
36108
69b4fce85ffa Switch _purple_conversation_write_common and (writing|wrote)-(chat|im)-msg to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36100
diff changeset
374 _purple_conversation_write_common(PurpleConversation *conv, PurpleMessage *msg);
36100
720a07f05cae Hide purple_conversation_write, use purple_conversation_write_message or purple_conversation_write_system_message instead
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
375
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39433
diff changeset
376 #endif /* PURPLE_INTERNAL_H */

mercurial