Sun, 21 Jun 2020 04:16:15 -0500
Make it so only libpurple can directly include libpurple header files.
This is part of our on going effort to make it easier to develop against libpurple as well as making our filenames not part of our api.
Make it so only libpurple can directly include libpurple header files.
Testing Done:
Just a normal compile to make sure everything builds again.
Reviewed at https://reviews.imfreedom.org/r/8/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* purple |
| 5872 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
10589
diff
changeset
|
6 | * |
| 5872 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 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 | 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 | 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 | 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 | 44 | #endif |
| 45 | ||
| 46 | #ifdef HAVE_ENDIAN_H | |
| 47 | # include <endian.h> | |
| 48 | #endif | |
| 49 | ||
| 50 | #define MSG_LEN 2048 | |
| 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 | 53 | * length. */ |
| 54 | #define BUF_LEN MSG_LEN | |
| 55 | #define BUF_LONG BUF_LEN * 2 | |
| 56 | ||
| 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 | 65 | #include <ctype.h> |
| 66 | #include <errno.h> | |
| 67 | #include <fcntl.h> | |
| 68 | #include <math.h> | |
| 69 | #include <stdio.h> | |
| 70 | #include <stdlib.h> | |
| 71 | #include <string.h> | |
| 72 | #include <time.h> | |
| 73 | ||
| 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 | 76 | #endif |
| 77 | ||
| 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 | 80 | #endif |
| 81 | ||
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
82 | #ifndef _WIN32 |
| 5872 | 83 | # include <netinet/in.h> |
| 84 | # include <sys/socket.h> | |
| 6170 | 85 | # include <arpa/inet.h> |
| 5872 | 86 | # include <sys/un.h> |
| 87 | # include <sys/utsname.h> | |
| 88 | # include <netdb.h> | |
| 89 | # include <signal.h> | |
| 90 | # include <unistd.h> | |
| 91 | #endif | |
| 92 | ||
| 93 | #ifndef HOST_NAME_MAX | |
| 94 | # define HOST_NAME_MAX 255 | |
| 95 | #endif | |
| 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 | 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 | 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 | 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 | 120 | #else |
| 121 | ||
| 122 | #define PURPLE_BEGIN_IGNORE_CAST_ALIGN | |
| 123 | #define PURPLE_END_IGNORE_CAST_ALIGN | |
| 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 | |
|
36025
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
129 | #ifdef __COVERITY__ |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
130 | |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
131 | /* avoid TAINTED_SCALAR warning */ |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
132 | #undef g_utf8_next_char |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
133 | #define g_utf8_next_char(p) (char *)((p) + 1) |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
134 | |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
135 | #endif |
|
2897add11757
Silence some coverity false positives
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36021
diff
changeset
|
136 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39433
diff
changeset
|
137 | #endif /* PURPLE_INTERNAL_H */ |