Mercurial > pidgin.yaz
comparison libpurple/win32/libc_interface.c @ 30959:8648453adb22
propagate from branch 'im.pidgin.pidgin' (head 96b27a20c7250b87761a8bd4f5540bf1fa32b6f4)
to branch 'im.pidgin.cpw.malu.xmpp.google_relay' (head 303f4072d75faa7770a5339dbfea05da7cee30a4)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Tue, 09 Mar 2010 21:41:41 +0000 |
parents | 4dc99186a03a |
children | 47ea27481972 |
comparison
equal
deleted
inserted
replaced
30958:3d08b59ebf59 | 30959:8648453adb22 |
---|---|
31 #include "config.h" | 31 #include "config.h" |
32 #include "debug.h" | 32 #include "debug.h" |
33 #include "libc_internal.h" | 33 #include "libc_internal.h" |
34 #include <glib/gstdio.h> | 34 #include <glib/gstdio.h> |
35 | 35 |
36 /** This is redefined here because we can't include internal.h */ | |
36 #ifdef ENABLE_NLS | 37 #ifdef ENABLE_NLS |
37 # include <locale.h> | 38 # include <locale.h> |
38 # include <libintl.h> | 39 # include <libintl.h> |
39 # define _(String) ((const char *)dgettext(PACKAGE, String)) | 40 # define _(String) ((const char *)dgettext(PACKAGE, String)) |
40 # ifdef gettext_noop | 41 # ifdef gettext_noop |
59 static char errbuf[1024]; | 60 static char errbuf[1024]; |
60 | 61 |
61 /* helpers */ | 62 /* helpers */ |
62 static int wpurple_is_socket( int fd ) { | 63 static int wpurple_is_socket( int fd ) { |
63 int optval; | 64 int optval; |
64 unsigned int optlen = sizeof(int); | 65 int optlen = sizeof(int); |
65 | 66 |
66 if( (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&optval, &optlen)) == SOCKET_ERROR ) { | 67 if( (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&optval, &optlen)) == SOCKET_ERROR ) { |
67 int error = WSAGetLastError(); | 68 int error = WSAGetLastError(); |
68 if( error == WSAENOTSOCK ) | 69 if( error == WSAENOTSOCK ) |
69 return FALSE; | 70 return FALSE; |
970 break; | 971 break; |
971 } | 972 } |
972 | 973 |
973 memset(zonename, 0, sizeof(zonename)); | 974 memset(zonename, 0, sizeof(zonename)); |
974 namesize = sizeof(zonename); | 975 namesize = sizeof(zonename); |
975 if ((r = RegQueryValueEx(key, "Std", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) | 976 if ((r = RegQueryValueEx(key, "Std", NULL, NULL, (LPBYTE)zonename, &namesize)) != ERROR_SUCCESS) |
976 { | 977 { |
977 purple_debug_warning("wpurple", "could not query value for 'std' to identify Windows timezone: %i\n", (int) r); | 978 purple_debug_warning("wpurple", "could not query value for 'std' to identify Windows timezone: %i\n", (int) r); |
978 RegCloseKey(key); | 979 RegCloseKey(key); |
979 break; | 980 break; |
980 } | 981 } |
985 RegCloseKey(key); | 986 RegCloseKey(key); |
986 break; | 987 break; |
987 } | 988 } |
988 memset(zonename, 0, sizeof(zonename)); | 989 memset(zonename, 0, sizeof(zonename)); |
989 namesize = sizeof(zonename); | 990 namesize = sizeof(zonename); |
990 if ((r = RegQueryValueEx(key, "Dlt", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) | 991 if ((r = RegQueryValueEx(key, "Dlt", NULL, NULL, (LPBYTE)zonename, &namesize)) != ERROR_SUCCESS) |
991 { | 992 { |
992 purple_debug_warning("wpurple", "could not query value for 'dlt' to identify Windows timezone: %i\n", (int) r); | 993 purple_debug_warning("wpurple", "could not query value for 'dlt' to identify Windows timezone: %i\n", (int) r); |
993 RegCloseKey(key); | 994 RegCloseKey(key); |
994 break; | 995 break; |
995 } | 996 } |
1045 | 1046 |
1046 purple_debug_warning("wpurple", "could not find a match for Windows timezone \"%s\"\n", tzname); | 1047 purple_debug_warning("wpurple", "could not find a match for Windows timezone \"%s\"\n", tzname); |
1047 return ""; | 1048 return ""; |
1048 } | 1049 } |
1049 | 1050 |
1051 int wpurple_g_access (const gchar *filename, int mode); | |
1050 /** | 1052 /** |
1051 * g_access: | 1053 * @deprecated - remove for 3.0.0 |
1052 * @filename: a pathname in the GLib file name encoding (UTF-8 on Windows) | |
1053 * @mode: as in access() | |
1054 * | |
1055 * A wrapper for the POSIX access() function. This function is used to | |
1056 * test a pathname for one or several of read, write or execute | |
1057 * permissions, or just existence. On Windows, the underlying access() | |
1058 * function in the C library only checks the READONLY attribute, and | |
1059 * does not look at the ACL at all. Software that needs to handle file | |
1060 * permissions on Windows more exactly should use the Win32 API. | |
1061 * | |
1062 * See the C library manual for more details about access(). | |
1063 * | |
1064 * Returns: zero if the pathname refers to an existing file system | |
1065 * object that has all the tested permissions, or -1 otherwise or on | |
1066 * error. | |
1067 * | |
1068 * Since: 2.8 | |
1069 */ | 1054 */ |
1070 int | 1055 int |
1071 wpurple_g_access (const gchar *filename, | 1056 wpurple_g_access (const gchar *filename, int mode) |
1072 int mode) | |
1073 { | 1057 { |
1074 return g_access(filename, mode); | 1058 return g_access(filename, mode); |
1075 } | 1059 } |
1076 | 1060 |
1077 | 1061 |