libpurple/internal.h

Tue, 06 Apr 2021 03:35:20 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 06 Apr 2021 03:35:20 -0500
changeset 40840
b5f355f90ab0
parent 40677
da66e75a4221
child 40996
ea1c2cf86b55
permissions
-rw-r--r--

Port the updates from 2.14.2 and the upcoming 2.14.3 to 3.0.0

* Use the unicode version of the System and UserInfo plugins to fix
non-english languages in the Windows installer.
* Update the installer to use the inetc plugin so that https downloads will
work. This became necessary because Sourceforge now redirects http to
https.
* Standardize everything in pidgin/win32/winpidgin.c to use `wprintf`.

Testing Done:
Compiled and ran on windows 10.

Reviewed at https://reviews.imfreedom.org/r/595/

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
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
31 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
32 # error "only <purple.h> may be included directly"
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
33 #endif
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
34
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
35 #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
36 #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
37 #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
38
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 #ifdef HAVE_CONFIG_H
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
40 # ifdef GETTEXT_PACKAGE
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
41 # undef GETTEXT_PACKAGE
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
42 # endif
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6170
diff changeset
43 # include <config.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 #endif
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>
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
58
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
59 #ifndef _WIN32
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
60 # include <sys/time.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
61 # include <sys/wait.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
62 # include <sys/time.h>
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
63 #endif
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
64
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 #include <ctype.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 #include <errno.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 #include <fcntl.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 #include <math.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 #include <stdio.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 #include <stdlib.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 #include <string.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 #include <time.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 #ifdef HAVE_ICONV
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
75 # include <iconv.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 #endif
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 #ifdef HAVE_LANGINFO_CODESET
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
79 # include <langinfo.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 #endif
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81
5912
32619a71edd2 [gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents: 5872
diff changeset
82 #ifndef _WIN32
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 # include <netinet/in.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 # include <sys/socket.h>
6170
19976e14da97 [gaim-migrate @ 6655]
Matthew Luckie
parents: 5976
diff changeset
85 # include <arpa/inet.h>
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 # include <sys/un.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 # include <sys/utsname.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 # include <netdb.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 # include <signal.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 # include <unistd.h>
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 #endif
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 #ifndef HOST_NAME_MAX
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 # define HOST_NAME_MAX 255
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
14974
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
97 #ifdef _WIN32
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40307
diff changeset
98 # include "win32/win32dep.h"
14974
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
99 #endif
8180f0f2e20c [gaim-migrate @ 17684]
Daniel Atallah <datallah@pidgin.im>
parents: 14707
diff changeset
100
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
101 #ifdef HAVE_CONFIG_H
27705
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
102 #if SIZEOF_TIME_T == 4
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
103 # define PURPLE_TIME_T_MODIFIER "lu"
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
104 #elif SIZEOF_TIME_T == 8
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
105 # define PURPLE_TIME_T_MODIFIER "zu"
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
106 #else
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
107 #error Unknown size of time_t
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
108 #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
109 #endif
27705
06cdb9c6366f Fix this compiler warning:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 27539
diff changeset
110
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
111 #ifdef __clang__
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
112
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
113 #define PURPLE_BEGIN_IGNORE_CAST_ALIGN \
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
114 _Pragma ("clang diagnostic push") \
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
115 _Pragma ("clang diagnostic ignored \"-Wcast-align\"")
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
116
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
117 #define PURPLE_END_IGNORE_CAST_ALIGN \
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
118 _Pragma ("clang diagnostic pop")
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
119
36024
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
120 #else
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
121
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
122 #define PURPLE_BEGIN_IGNORE_CAST_ALIGN
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
123 #define PURPLE_END_IGNORE_CAST_ALIGN
27580a47ae28 Oops, bad merge
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36023
diff changeset
124
35977
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
125 #endif /* __clang__ */
9b7b48f446f4 Backport warning fixes from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35660
diff changeset
126
26615
2171a9101814 Add G_DEFINE_TYPE compatibility define from gobjectification branch.
Michael Ruprecht <maiku@pidgin.im>
parents: 25888
diff changeset
127 #include <glib-object.h>
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 11677
diff changeset
128
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39433
diff changeset
129 #endif /* PURPLE_INTERNAL_H */

mercurial