Mon, 17 Oct 2005 05:50:30 +0000
[gaim-migrate @ 13963]
Remove some things from the public namespace by making them static
|
8790
3d6d2e2f6296
[gaim-migrate @ 9552]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8737
diff
changeset
|
1 | /** |
| 5872 | 2 | * @file internal.h Internal definitions and includes |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6170
diff
changeset
|
3 | * @ingroup core |
| 5872 | 4 | * |
| 5 | * gaim | |
| 6 | * | |
| 8046 | 7 | * Gaim is the legal property of its developers, whose names are too numerous |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
10589
diff
changeset
|
10 | * |
| 5872 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 25 | #ifndef _GAIM_INTERNAL_H_ | |
| 26 | #define _GAIM_INTERNAL_H_ | |
| 27 | ||
| 28 | #ifdef HAVE_CONFIG_H | |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6170
diff
changeset
|
29 | # include <config.h> |
| 5872 | 30 | #endif |
| 31 | ||
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
32 | /* |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
33 | * If we're using NLS, make sure gettext works. If not, then define |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
34 | * dummy macros in place of the normal gettext macros. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
35 | * |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
36 | * Also, the perl XS config.h file sometimes defines _ So we need to |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
37 | * make sure _ isn't already defined before trying to define it. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
38 | * |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
39 | * The Singular/Plural/Number ngettext dummy definition below was |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
40 | * taken from an email to the texinfo mailing list by Manuel Guerrero. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
41 | * Thank you Manuel, and thank you Alex's good friend Google. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
42 | */ |
| 5872 | 43 | #ifdef ENABLE_NLS |
|
8737
b9f8de95d6bb
[gaim-migrate @ 9492]
Mark Doliner <markdoliner@pidgin.im>
parents:
8735
diff
changeset
|
44 | # include <locale.h> |
| 5872 | 45 | # include <libintl.h> |
| 46 | # define _(x) gettext(x) | |
| 47 | # ifdef gettext_noop | |
| 48 | # define N_(String) gettext_noop (String) | |
| 49 | # else | |
| 50 | # define N_(String) (String) | |
| 51 | # endif | |
| 52 | #else | |
| 8730 | 53 | # include <locale.h> |
| 5872 | 54 | # define N_(String) (String) |
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
55 | # ifndef _ |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
56 | # define _(x) (x) |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
8793
diff
changeset
|
57 | # endif |
|
5976
1b3c677b3d0a
[gaim-migrate @ 6423]
Mark Doliner <markdoliner@pidgin.im>
parents:
5912
diff
changeset
|
58 | # define ngettext(Singular, Plural, Number) ((Number == 1) ? (Singular) : (Plural)) |
| 5872 | 59 | #endif |
| 60 | ||
| 61 | #ifdef HAVE_ENDIAN_H | |
| 62 | # include <endian.h> | |
| 63 | #endif | |
| 64 | ||
| 65 | #define MSG_LEN 2048 | |
| 66 | /* 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
|
67 | * but just so we're explicitly asking for the max message |
| 5872 | 68 | * length. */ |
| 69 | #define BUF_LEN MSG_LEN | |
| 70 | #define BUF_LONG BUF_LEN * 2 | |
| 71 | ||
| 72 | #include <sys/stat.h> | |
| 73 | #include <sys/time.h> | |
| 74 | #include <sys/types.h> | |
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
75 | #ifndef _WIN32 |
| 5872 | 76 | #include <sys/wait.h> |
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
77 | #endif |
| 5872 | 78 | #include <ctype.h> |
| 79 | #include <errno.h> | |
| 80 | #include <fcntl.h> | |
| 81 | #include <math.h> | |
| 82 | #include <stdio.h> | |
| 83 | #include <stdlib.h> | |
| 84 | #include <string.h> | |
| 85 | #include <time.h> | |
| 86 | ||
| 87 | #ifdef HAVE_ICONV | |
| 88 | #include <iconv.h> | |
| 89 | #endif | |
| 90 | ||
| 91 | #ifdef HAVE_LANGINFO_CODESET | |
| 92 | #include <langinfo.h> | |
| 93 | #endif | |
| 94 | ||
| 95 | #ifdef GAIM_PLUGINS | |
| 96 | # include <gmodule.h> | |
| 97 | # ifndef _WIN32 | |
| 98 | # include <dlfcn.h> | |
| 99 | # endif | |
| 100 | #endif | |
| 101 | ||
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
102 | #ifndef _WIN32 |
| 5872 | 103 | # include <netinet/in.h> |
| 104 | # include <sys/socket.h> | |
| 6170 | 105 | # include <arpa/inet.h> |
| 5872 | 106 | # include <sys/un.h> |
| 107 | # include <sys/utsname.h> | |
| 108 | # include <netdb.h> | |
| 109 | # include <signal.h> | |
| 110 | # include <unistd.h> | |
| 111 | #endif | |
| 112 | ||
| 113 | #ifndef MAXPATHLEN | |
| 114 | # define MAXPATHLEN 1024 | |
| 115 | #endif | |
| 116 | ||
| 117 | #ifndef HOST_NAME_MAX | |
| 118 | # define HOST_NAME_MAX 255 | |
| 119 | #endif | |
| 120 | ||
| 121 | #define PATHSIZE 1024 | |
| 122 | ||
| 123 | #include <glib.h> | |
|
10589
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
124 | #if GLIB_CHECK_VERSION(2,6,0) |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
125 | # include <glib/gstdio.h> |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
126 | #endif |
| 5872 | 127 | |
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
128 | #ifdef _WIN32 |
|
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
129 | #include "win32dep.h" |
|
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
130 | #endif |
|
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
131 | |
|
10589
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
132 | #if !GLIB_CHECK_VERSION(2,6,0) |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
133 | # define g_freopen freopen |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
134 | # define g_fopen fopen |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
135 | # define g_rmdir rmdir |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
136 | # define g_remove remove |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
137 | # define g_unlink unlink |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
138 | # define g_lstat lstat |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
139 | # define g_stat stat |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
140 | # define g_mkdir mkdir |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
141 | # define g_rename rename |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
142 | # define g_open open |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
143 | #endif |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
144 | |
|
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10588
diff
changeset
|
145 | |
|
10114
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
146 | /* ugly ugly ugly */ |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
147 | /* This is a workaround for the fact that G_GINT64_MODIFIER and G_GSIZE_FORMAT |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
148 | * are only defined in Glib >= 2.4 */ |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
149 | #ifndef G_GINT64_MODIFIER |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
150 | # if GLIB_SIZEOF_LONG == 8 |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
151 | # define G_GINT64_MODIFIER "l" |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
152 | # else |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
153 | # define G_GINT64_MODIFIER "ll" |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
154 | # endif |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
155 | #endif |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
156 | |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
157 | #ifndef G_GSIZE_FORMAT |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
158 | # if GLIB_SIZEOF_LONG == 8 |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
159 | # define G_GSIZE_FORMAT "lu" |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
160 | # else |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
161 | # define G_GSIZE_FORMAT "u" |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
162 | # endif |
|
7da34f030459
[gaim-migrate @ 11148]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9999
diff
changeset
|
163 | #endif |
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5872
diff
changeset
|
164 | |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6170
diff
changeset
|
165 | #define GAIM_WEBSITE "http://gaim.sourceforge.net/" |
| 5872 | 166 | |
| 10245 | 167 | #ifndef _WIN32 |
| 168 | /* Everything needs to include this, because | |
| 169 | * everything gets the autoconf macros */ | |
| 170 | #include "prefix.h" | |
| 171 | #endif /* _WIN32 */ | |
| 172 | ||
| 5872 | 173 | #endif /* _GAIM_INTERNAL_H_ */ |