internal.h
Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _PURPLE_INTERNAL_H_
00027 #define _PURPLE_INTERNAL_H_
00028
00029 #ifdef HAVE_CONFIG_H
00030 # include <config.h>
00031 #endif
00032
00033
00034 #ifdef SKYOS
00035 #include <net/sockios.h>
00036 #endif
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifdef ENABLE_NLS
00049 # include <locale.h>
00050 # include <libintl.h>
00051 # define _(String) ((const char *)dgettext(PACKAGE, String))
00052 # ifdef gettext_noop
00053 # define N_(String) gettext_noop (String)
00054 # else
00055 # define N_(String) (String)
00056 # endif
00057 #else
00058 # include <locale.h>
00059 # define N_(String) (String)
00060 # ifndef _
00061 # define _(String) ((const char *)String)
00062 # endif
00063 # define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
00064 # define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
00065 #endif
00066
00067 #ifdef HAVE_ENDIAN_H
00068 # include <endian.h>
00069 #endif
00070
00071 #define MSG_LEN 2048
00072
00073
00074
00075 #define BUF_LEN MSG_LEN
00076 #define BUF_LONG BUF_LEN * 2
00077
00078 #include <sys/stat.h>
00079 #include <sys/types.h>
00080 #ifndef _WIN32
00081 #include <sys/time.h>
00082 #include <sys/wait.h>
00083 #include <sys/time.h>
00084 #endif
00085 #include <ctype.h>
00086 #include <errno.h>
00087 #include <fcntl.h>
00088 #include <math.h>
00089 #include <stdio.h>
00090 #include <stdlib.h>
00091 #include <string.h>
00092 #include <time.h>
00093
00094 #ifdef HAVE_ICONV
00095 #include <iconv.h>
00096 #endif
00097
00098 #ifdef HAVE_LANGINFO_CODESET
00099 #include <langinfo.h>
00100 #endif
00101
00102 #include <gmodule.h>
00103
00104 #ifdef PURPLE_PLUGINS
00105 # ifdef HAVE_DLFCN_H
00106 # include <dlfcn.h>
00107 # endif
00108 #endif
00109
00110 #ifndef _WIN32
00111 # include <netinet/in.h>
00112 # include <sys/socket.h>
00113 # include <arpa/inet.h>
00114 # include <sys/un.h>
00115 # include <sys/utsname.h>
00116 # include <netdb.h>
00117 # include <signal.h>
00118 # include <unistd.h>
00119 #endif
00120
00121 #ifndef HOST_NAME_MAX
00122 # define HOST_NAME_MAX 255
00123 #endif
00124
00125 #include <glib.h>
00126
00127
00128 #ifndef G_MAXSSIZE
00129 # if GLIB_SIZEOF_LONG == 8
00130 # define G_MAXSSIZE ((gssize) 0x7fffffffffffffff)
00131 # else
00132 # define G_MAXSSIZE ((gssize) 0x7fffffff)
00133 # endif
00134 #endif
00135
00136 #include <glib/gstdio.h>
00137
00138 #ifdef _WIN32
00139 #include "win32dep.h"
00140 #endif
00141
00142 #ifdef HAVE_CONFIG_H
00143 #if SIZEOF_TIME_T == 4
00144 # define PURPLE_TIME_T_MODIFIER "lu"
00145 #elif SIZEOF_TIME_T == 8
00146 # define PURPLE_TIME_T_MODIFIER "zu"
00147 #else
00148 #error Unknown size of time_t
00149 #endif
00150 #endif
00151
00152 #include <glib-object.h>
00153
00154 #if !GLIB_CHECK_VERSION(2, 32, 0)
00155
00156 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
00157 #define G_GNUC_END_IGNORE_DEPRECATIONS
00158
00159 #endif
00160
00161 #ifdef __clang__
00162
00163 #undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
00164 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
00165 _Pragma ("clang diagnostic push") \
00166 _Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"")
00167
00168 #undef G_GNUC_END_IGNORE_DEPRECATIONS
00169 #define G_GNUC_END_IGNORE_DEPRECATIONS \
00170 _Pragma ("clang diagnostic pop")
00171
00172 #endif
00173
00174 #ifdef __COVERITY__
00175
00176
00177 #undef g_utf8_next_char
00178 #define g_utf8_next_char(p) (char *)((p) + 1)
00179
00180 #endif
00181
00182
00183
00184
00185 #define purple_strlcpy(dest, src) g_strlcpy(dest, src, sizeof(dest))
00186 #define purple_strlcat(dest, src) g_strlcat(dest, src, sizeof(dest))
00187
00188 typedef union
00189 {
00190 struct sockaddr sa;
00191 struct sockaddr_in in;
00192 struct sockaddr_in6 in6;
00193 struct sockaddr_storage storage;
00194 } common_sockaddr_t;
00195
00196 #define PURPLE_WEBSITE "http://pidgin.im/"
00197 #define PURPLE_DEVEL_WEBSITE "http://developer.pidgin.im/"
00198
00199
00200
00201
00202 #include "account.h"
00203 #include "connection.h"
00204
00205
00206
00207 void
00208 _purple_buddy_icons_account_loaded_cb(void);
00209
00210
00211
00212 void
00213 _purple_buddy_icons_blist_loaded_cb(void);
00214
00215
00216
00217
00218 void
00219 _purple_buddy_icon_set_old_icons_dir(const char *dirname);
00220
00238 void _purple_connection_new(PurpleAccount *account, gboolean regist,
00239 const char *password);
00252 void _purple_connection_new_unregister(PurpleAccount *account, const char *password,
00253 PurpleAccountUnregistrationCb cb, void *user_data);
00263 void _purple_connection_destroy(PurpleConnection *gc);
00264
00272 gboolean
00273 _purple_network_set_common_socket_flags(int fd);
00274
00275 #endif