Mercurial > pidgin.yaz
comparison libpurple/win32/libc_interface.h @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | 23367ba62f59 |
comparison
equal
deleted
inserted
replaced
15822:84b0f9b23ede | 15823:32c366eeeb99 |
---|---|
1 /* | 1 /* |
2 * gaim | 2 * purple |
3 * | 3 * |
4 * File: libc_interface.h | 4 * File: libc_interface.h |
5 * | 5 * |
6 * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> | 6 * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> |
7 * | 7 * |
28 #include <errno.h> | 28 #include <errno.h> |
29 #include "libc_internal.h" | 29 #include "libc_internal.h" |
30 #include <glib.h> | 30 #include <glib.h> |
31 | 31 |
32 /* sys/socket.h */ | 32 /* sys/socket.h */ |
33 int wgaim_socket(int namespace, int style, int protocol); | 33 int wpurple_socket(int namespace, int style, int protocol); |
34 #define socket( namespace, style, protocol ) \ | 34 #define socket( namespace, style, protocol ) \ |
35 wgaim_socket( namespace, style, protocol ) | 35 wpurple_socket( namespace, style, protocol ) |
36 | 36 |
37 int wgaim_connect(int socket, struct sockaddr *addr, u_long length); | 37 int wpurple_connect(int socket, struct sockaddr *addr, u_long length); |
38 #define connect( socket, addr, length ) \ | 38 #define connect( socket, addr, length ) \ |
39 wgaim_connect( socket, addr, length ) | 39 wpurple_connect( socket, addr, length ) |
40 | 40 |
41 int wgaim_getsockopt(int socket, int level, int optname, void *optval, socklen_t *optlenptr); | 41 int wpurple_getsockopt(int socket, int level, int optname, void *optval, socklen_t *optlenptr); |
42 #define getsockopt( args... ) \ | 42 #define getsockopt( args... ) \ |
43 wgaim_getsockopt( args ) | 43 wpurple_getsockopt( args ) |
44 | 44 |
45 int wgaim_setsockopt(int socket, int level, int optname, const void *optval, socklen_t optlen); | 45 int wpurple_setsockopt(int socket, int level, int optname, const void *optval, socklen_t optlen); |
46 #define setsockopt( args... ) \ | 46 #define setsockopt( args... ) \ |
47 wgaim_setsockopt( args ) | 47 wpurple_setsockopt( args ) |
48 | 48 |
49 int wgaim_getsockname (int socket, struct sockaddr *addr, socklen_t *lenptr); | 49 int wpurple_getsockname (int socket, struct sockaddr *addr, socklen_t *lenptr); |
50 #define getsockname( socket, addr, lenptr ) \ | 50 #define getsockname( socket, addr, lenptr ) \ |
51 wgaim_getsockname( socket, addr, lenptr ) | 51 wpurple_getsockname( socket, addr, lenptr ) |
52 | 52 |
53 int wgaim_bind(int socket, struct sockaddr *addr, socklen_t length); | 53 int wpurple_bind(int socket, struct sockaddr *addr, socklen_t length); |
54 #define bind( socket, addr, length ) \ | 54 #define bind( socket, addr, length ) \ |
55 wgaim_bind( socket, addr, length ) | 55 wpurple_bind( socket, addr, length ) |
56 | 56 |
57 int wgaim_listen(int socket, unsigned int n); | 57 int wpurple_listen(int socket, unsigned int n); |
58 #define listen( socket, n ) \ | 58 #define listen( socket, n ) \ |
59 wgaim_listen( socket, n ) | 59 wpurple_listen( socket, n ) |
60 | 60 |
61 int wgaim_sendto(int socket, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); | 61 int wpurple_sendto(int socket, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); |
62 #define sendto(socket, buf, len, flags, to, tolen) \ | 62 #define sendto(socket, buf, len, flags, to, tolen) \ |
63 wgaim_sendto(socket, buf, len, flags, to, tolen) | 63 wpurple_sendto(socket, buf, len, flags, to, tolen) |
64 | 64 |
65 /* sys/ioctl.h */ | 65 /* sys/ioctl.h */ |
66 int wgaim_ioctl(int fd, int command, void* opt); | 66 int wpurple_ioctl(int fd, int command, void* opt); |
67 #define ioctl( fd, command, val ) \ | 67 #define ioctl( fd, command, val ) \ |
68 wgaim_ioctl( fd, command, val ) | 68 wpurple_ioctl( fd, command, val ) |
69 | 69 |
70 /* fcntl.h */ | 70 /* fcntl.h */ |
71 int wgaim_fcntl(int socket, int command, int val); | 71 int wpurple_fcntl(int socket, int command, int val); |
72 #define fcntl( fd, command, val ) \ | 72 #define fcntl( fd, command, val ) \ |
73 wgaim_fcntl( fd, command, val ) | 73 wpurple_fcntl( fd, command, val ) |
74 | 74 |
75 /* arpa/inet.h */ | 75 /* arpa/inet.h */ |
76 int wgaim_inet_aton(const char *name, struct in_addr *addr); | 76 int wpurple_inet_aton(const char *name, struct in_addr *addr); |
77 #define inet_aton( name, addr ) \ | 77 #define inet_aton( name, addr ) \ |
78 wgaim_inet_aton( name, addr ) | 78 wpurple_inet_aton( name, addr ) |
79 | 79 |
80 const char * | 80 const char * |
81 wgaim_inet_ntop (int af, const void *src, char *dst, socklen_t cnt); | 81 wpurple_inet_ntop (int af, const void *src, char *dst, socklen_t cnt); |
82 #define inet_ntop( af, src, dst, cnt ) \ | 82 #define inet_ntop( af, src, dst, cnt ) \ |
83 wgaim_inet_ntop( af, src, dst, cnt ) | 83 wpurple_inet_ntop( af, src, dst, cnt ) |
84 | 84 |
85 /* netdb.h */ | 85 /* netdb.h */ |
86 struct hostent* wgaim_gethostbyname(const char *name); | 86 struct hostent* wpurple_gethostbyname(const char *name); |
87 #define gethostbyname( name ) \ | 87 #define gethostbyname( name ) \ |
88 wgaim_gethostbyname( name ) | 88 wpurple_gethostbyname( name ) |
89 | 89 |
90 /* netinet/in.h */ | 90 /* netinet/in.h */ |
91 #define ntohl( netlong ) \ | 91 #define ntohl( netlong ) \ |
92 (unsigned int)ntohl( netlong ) | 92 (unsigned int)ntohl( netlong ) |
93 | 93 |
94 /* string.h */ | 94 /* string.h */ |
95 char* wgaim_strerror( int errornum ); | 95 char* wpurple_strerror( int errornum ); |
96 #define hstrerror( herror ) \ | 96 #define hstrerror( herror ) \ |
97 wgaim_strerror( errno ) | 97 wpurple_strerror( errno ) |
98 #define strerror( errornum ) \ | 98 #define strerror( errornum ) \ |
99 wgaim_strerror( errornum ) | 99 wpurple_strerror( errornum ) |
100 | 100 |
101 #define bzero( dest, size ) memset( dest, 0, size ) | 101 #define bzero( dest, size ) memset( dest, 0, size ) |
102 | 102 |
103 /* unistd.h */ | 103 /* unistd.h */ |
104 int wgaim_read(int fd, void *buf, unsigned int size); | 104 int wpurple_read(int fd, void *buf, unsigned int size); |
105 #define read( fd, buf, buflen ) \ | 105 #define read( fd, buf, buflen ) \ |
106 wgaim_read( fd, buf, buflen ) | 106 wpurple_read( fd, buf, buflen ) |
107 | 107 |
108 int wgaim_write(int fd, const void *buf, unsigned int size); | 108 int wpurple_write(int fd, const void *buf, unsigned int size); |
109 #define write( socket, buf, buflen ) \ | 109 #define write( socket, buf, buflen ) \ |
110 wgaim_write( socket, buf, buflen ) | 110 wpurple_write( socket, buf, buflen ) |
111 | 111 |
112 int wgaim_recv(int fd, void *buf, size_t len, int flags); | 112 int wpurple_recv(int fd, void *buf, size_t len, int flags); |
113 #define recv(fd, buf, len, flags) \ | 113 #define recv(fd, buf, len, flags) \ |
114 wgaim_recv(fd, buf, len, flags) | 114 wpurple_recv(fd, buf, len, flags) |
115 | 115 |
116 int wgaim_send(int fd, const void *buf, unsigned int size, int flags); | 116 int wpurple_send(int fd, const void *buf, unsigned int size, int flags); |
117 #define send(socket, buf, buflen, flags) \ | 117 #define send(socket, buf, buflen, flags) \ |
118 wgaim_send(socket, buf, buflen, flags) | 118 wpurple_send(socket, buf, buflen, flags) |
119 | 119 |
120 int wgaim_close(int fd); | 120 int wpurple_close(int fd); |
121 #define close( fd ) \ | 121 #define close( fd ) \ |
122 wgaim_close( fd ) | 122 wpurple_close( fd ) |
123 | 123 |
124 #if !GLIB_CHECK_VERSION(2,8,0) | 124 #if !GLIB_CHECK_VERSION(2,8,0) |
125 int wgaim_g_access(const gchar *filename, int mode); | 125 int wpurple_g_access(const gchar *filename, int mode); |
126 #define g_access( filename, mode) \ | 126 #define g_access( filename, mode) \ |
127 wgaim_g_access( filename, mode ) | 127 wpurple_g_access( filename, mode ) |
128 #endif | 128 #endif |
129 | 129 |
130 #ifndef sleep | 130 #ifndef sleep |
131 #define sleep(x) Sleep((x)*1000) | 131 #define sleep(x) Sleep((x)*1000) |
132 #endif | 132 #endif |
133 | 133 |
134 int wgaim_gethostname(char *name, size_t size); | 134 int wpurple_gethostname(char *name, size_t size); |
135 #define gethostname( name, size ) \ | 135 #define gethostname( name, size ) \ |
136 wgaim_gethostname( name, size ) | 136 wpurple_gethostname( name, size ) |
137 | 137 |
138 /* sys/time.h */ | 138 /* sys/time.h */ |
139 int wgaim_gettimeofday(struct timeval *p, struct timezone *z); | 139 int wpurple_gettimeofday(struct timeval *p, struct timezone *z); |
140 #define gettimeofday( timeval, timezone ) \ | 140 #define gettimeofday( timeval, timezone ) \ |
141 wgaim_gettimeofday( timeval, timezone ) | 141 wpurple_gettimeofday( timeval, timezone ) |
142 | 142 |
143 /* stdio.h */ | 143 /* stdio.h */ |
144 #define snprintf _snprintf | 144 #define snprintf _snprintf |
145 #define vsnprintf _vsnprintf | 145 #define vsnprintf _vsnprintf |
146 | 146 |
147 int wgaim_rename(const char *oldname, const char *newname); | 147 int wpurple_rename(const char *oldname, const char *newname); |
148 #define rename( oldname, newname ) \ | 148 #define rename( oldname, newname ) \ |
149 wgaim_rename( oldname, newname ) | 149 wpurple_rename( oldname, newname ) |
150 | 150 |
151 #if GLIB_CHECK_VERSION(2,6,0) | 151 #if GLIB_CHECK_VERSION(2,6,0) |
152 #ifdef g_rename | 152 #ifdef g_rename |
153 # undef g_rename | 153 # undef g_rename |
154 #endif | 154 #endif |
155 /* This is necessary because we want rename on win32 to be able to overwrite an existing file, it is done in internal.h if GLib < 2.6*/ | 155 /* This is necessary because we want rename on win32 to be able to overwrite an existing file, it is done in internal.h if GLib < 2.6*/ |
156 #define g_rename(oldname, newname) \ | 156 #define g_rename(oldname, newname) \ |
157 wgaim_rename(oldname, newname) | 157 wpurple_rename(oldname, newname) |
158 #endif | 158 #endif |
159 | 159 |
160 | 160 |
161 /* sys/stat.h */ | 161 /* sys/stat.h */ |
162 | 162 |
163 #define fchmod(a,b) | 163 #define fchmod(a,b) |
164 | 164 |
165 /* time.h */ | 165 /* time.h */ |
166 struct tm *wgaim_localtime_r(const time_t *time, struct tm *resultp); | 166 struct tm *wpurple_localtime_r(const time_t *time, struct tm *resultp); |
167 #define localtime_r( time, resultp ) \ | 167 #define localtime_r( time, resultp ) \ |
168 wgaim_localtime_r( time, resultp ) | 168 wpurple_localtime_r( time, resultp ) |
169 | 169 |
170 /* helper for gaim_utf8_strftime() by way of gaim_internal_strftime() in src/util.c */ | 170 /* helper for purple_utf8_strftime() by way of purple_internal_strftime() in src/util.c */ |
171 const char *wgaim_get_timezone_abbreviation(const struct tm *tm); | 171 const char *wpurple_get_timezone_abbreviation(const struct tm *tm); |
172 | 172 |
173 #endif /* _LIBC_INTERFACE_H_ */ | 173 #endif /* _LIBC_INTERFACE_H_ */ |