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 # ifndef __APPLE_CC__
00051 # define __APPLE_CC__ 0
00052 # endif
00053 # include <libintl.h>
00054 # define _(String) ((const char *)dgettext(PACKAGE, String))
00055 # ifdef gettext_noop
00056 # define N_(String) gettext_noop (String)
00057 # else
00058 # define N_(String) (String)
00059 # endif
00060 #else
00061 # include <locale.h>
00062 # define N_(String) (String)
00063 # ifndef _
00064 # define _(String) ((const char *)String)
00065 # endif
00066 # define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
00067 # define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
00068 #endif
00069
00070 #ifdef HAVE_ENDIAN_H
00071 # include <endian.h>
00072 #endif
00073
00074 #define MSG_LEN 2048
00075
00076
00077
00078 #define BUF_LEN MSG_LEN
00079 #define BUF_LONG BUF_LEN * 2
00080
00081 #include <sys/stat.h>
00082 #include <sys/types.h>
00083 #ifndef _WIN32
00084 #include <sys/time.h>
00085 #include <sys/wait.h>
00086 #include <sys/time.h>
00087 #endif
00088 #include <ctype.h>
00089 #include <errno.h>
00090 #include <fcntl.h>
00091 #include <math.h>
00092 #include <stdio.h>
00093 #include <stdlib.h>
00094 #include <string.h>
00095 #include <time.h>
00096
00097 #ifdef HAVE_ICONV
00098 #include <iconv.h>
00099 #endif
00100
00101 #ifdef HAVE_LANGINFO_CODESET
00102 #include <langinfo.h>
00103 #endif
00104
00105 #include <gmodule.h>
00106
00107 #ifdef PURPLE_PLUGINS
00108 # ifdef HAVE_DLFCN_H
00109 # include <dlfcn.h>
00110 # endif
00111 #endif
00112
00113 #ifndef _WIN32
00114 # include <netinet/in.h>
00115 # include <sys/socket.h>
00116 # include <arpa/inet.h>
00117 # include <sys/un.h>
00118 # include <sys/utsname.h>
00119 # include <netdb.h>
00120 # include <signal.h>
00121 # include <unistd.h>
00122 #endif
00123
00124 #ifndef HOST_NAME_MAX
00125 # define HOST_NAME_MAX 255
00126 #endif
00127
00128 #include <glib.h>
00129
00130
00131 #ifndef G_MAXSSIZE
00132 # if GLIB_SIZEOF_LONG == 8
00133 # define G_MAXSSIZE ((gssize) 0x7fffffffffffffff)
00134 # else
00135 # define G_MAXSSIZE ((gssize) 0x7fffffff)
00136 # endif
00137 #endif
00138
00139 #include <glib/gstdio.h>
00140
00141 #ifdef _WIN32
00142 #include "win32dep.h"
00143 #endif
00144
00145 #ifdef HAVE_CONFIG_H
00146 #if SIZEOF_TIME_T == 4
00147 # define PURPLE_TIME_T_MODIFIER "lu"
00148 #elif SIZEOF_TIME_T == 8
00149 # define PURPLE_TIME_T_MODIFIER "zu"
00150 #else
00151 #error Unknown size of time_t
00152 #endif
00153 #endif
00154
00155 #include <glib-object.h>
00156
00157 #if !GLIB_CHECK_VERSION(2, 32, 0)
00158
00159 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
00160 #define G_GNUC_END_IGNORE_DEPRECATIONS
00161
00162 #endif
00163
00164 #ifdef __clang__
00165
00166 #undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
00167 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
00168 _Pragma ("clang diagnostic push") \
00169 _Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"")
00170
00171 #undef G_GNUC_END_IGNORE_DEPRECATIONS
00172 #define G_GNUC_END_IGNORE_DEPRECATIONS \
00173 _Pragma ("clang diagnostic pop")
00174
00175 #endif
00176
00177 #ifdef __COVERITY__
00178
00179
00180 #undef g_utf8_next_char
00181 #define g_utf8_next_char(p) (char *)((p) + 1)
00182
00183 #endif
00184
00185
00186
00187
00188 #define purple_strlcpy(dest, src) g_strlcpy(dest, src, sizeof(dest))
00189 #define purple_strlcat(dest, src) g_strlcat(dest, src, sizeof(dest))
00190
00191 typedef union
00192 {
00193 struct sockaddr sa;
00194 struct sockaddr_in in;
00195 struct sockaddr_in6 in6;
00196 struct sockaddr_storage storage;
00197 } common_sockaddr_t;
00198
00199 #define PURPLE_WEBSITE "http://pidgin.im/"
00200 #define PURPLE_DEVEL_WEBSITE "http://developer.pidgin.im/"
00201
00202
00203
00204
00205 #include "account.h"
00206 #include "connection.h"
00207
00208
00209
00210 void
00211 _purple_buddy_icons_account_loaded_cb(void);
00212
00213
00214
00215 void
00216 _purple_buddy_icons_blist_loaded_cb(void);
00217
00218
00219
00220
00221 void
00222 _purple_buddy_icon_set_old_icons_dir(const char *dirname);
00223
00241 void _purple_connection_new(PurpleAccount *account, gboolean regist,
00242 const char *password);
00255 void _purple_connection_new_unregister(PurpleAccount *account, const char *password,
00256 PurpleAccountUnregistrationCb cb, void *user_data);
00266 void _purple_connection_destroy(PurpleConnection *gc);
00267
00275 gboolean
00276 _purple_network_set_common_socket_flags(int fd);
00277
00278 #endif