Mercurial > pidgin
annotate src/win32/libc_interface.h @ 4891:cfa045006bec
[gaim-migrate @ 5221]
this saves the blist.xml file to an alternate name, and then moves it, that
way we don't lose your precious buddies if gaim crashes.
Of course, if gaim were to crash, it wouldn't be gaim's fault, it would be
the fault of some external force. This is because gaim is perfect, and
Sean is perfect. Yeah.
This should be done for .gaimrc too, but i'm too tired to do that right now.
committer: Tailor Script <tailor@pidgin.im>
| author | Nathan Walp <nwalp@pidgin.im> |
|---|---|
| date | Tue, 25 Mar 2003 06:35:45 +0000 |
| parents | 51ce3eb7e0bf |
| children | 86037d6bf80f |
| rev | line source |
|---|---|
|
3776
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
1 /* |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
2 * libc_interface.h |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
3 */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
4 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
5 #ifndef _LIBC_INTERFACE_H_ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
6 #define _LIBC_INTERFACE_H_ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
7 #include <winsock.h> |
|
4714
51ce3eb7e0bf
[gaim-migrate @ 5025]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4373
diff
changeset
|
8 #include <io.h> |
|
3776
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
9 #include <errno.h> |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
10 #include "libc_internal.h" |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
11 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
12 /* sys/socket.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
13 extern int wgaim_socket(int namespace, int style, int protocol); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
14 #define socket( namespace, style, protocol ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
15 wgaim_socket( ## namespace ##, ## style ##, ## protocol ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
16 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
17 extern int wgaim_connect(int socket, struct sockaddr *addr, u_long length); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
18 #define connect( socket, addr, length ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
19 wgaim_connect( ## socket ##, ## addr ##, ## length ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
20 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
21 extern int wgaim_getsockopt(int socket, int level, int optname, void *optval, unsigned int *optlenptr); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
22 #define getsockopt( args... ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
23 wgaim_getsockopt( ## args ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
24 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
25 /* sys/ioctl.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
26 extern int wgaim_ioctl(int fd, int command, void* opt); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
27 #define ioctl( fd, command, val ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
28 wgaim_ioctl( ## fd ##, ## command ##, ## val ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
29 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
30 /* fcntl.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
31 extern int wgaim_fcntl(int socket, int command, int val); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
32 #define fcntl( fd, command, val ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
33 wgaim_fcntl( ## fd ##, ## command ##, ## val ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
34 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
35 #define open( args... ) _open( ## args ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
36 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
37 /* arpa/inet.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
38 extern int wgaim_inet_aton(const char *name, struct in_addr *addr); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
39 #define inet_aton( name, addr ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
40 wgaim_inet_aton( ## name ##, ## addr ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
41 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
42 /* netdb.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
43 extern struct hostent* wgaim_gethostbyname(const char *name); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
44 #define gethostbyname( name ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
45 wgaim_gethostbyname( ## name ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
46 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
47 /* string.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
48 extern char* wgaim_strerror( int errornum ); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
49 #define hstrerror( herror ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
50 wgaim_strerror( errno ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
51 #define strerror( errornum ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
52 wgaim_strerror( ## errornum ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
53 |
|
4193
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
54 extern char* wgaim_strsep(char **stringp, const char *delim); |
|
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
55 #define strsep( stringp, delim ) \ |
|
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
56 wgaim_strsep( ## stringp ##, ## delim ## ) |
|
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
57 |
|
3776
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
58 #define bzero( dest, size ) memset( ## dest ##, 0, ## size ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
59 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
60 /* unistd.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
61 extern int wgaim_read(int fd, void *buf, unsigned int size); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
62 #define read( fd, buf, buflen ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
63 wgaim_read( ## fd ##, ## buf ##, ## buflen ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
64 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
65 extern int wgaim_write(int fd, const void *buf, unsigned int size); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
66 #define write( socket, buf, buflen ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
67 wgaim_write( ## socket ##, ## buf ##, ## buflen ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
68 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
69 extern int wgaim_close(int fd); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
70 #define close( fd ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
71 wgaim_close( ## fd ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
72 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
73 #define sleep(x) Sleep((x)*1000) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
74 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
75 /* sys/time.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
76 extern int wgaim_gettimeofday(struct timeval *p, struct timezone *z); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
77 #define gettimeofday( timeval, timezone ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
78 wgaim_gettimeofday( ## timeval ##, ## timezone ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
79 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
80 /* stdio.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
81 #define snprintf _snprintf |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
82 #define vsnprintf _vsnprintf |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
83 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
84 /* sys/stat.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
85 #define mkdir(a,b) _mkdir((a)) |
|
4373
dcc6c130c6d9
[gaim-migrate @ 4639]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4193
diff
changeset
|
86 #define fchmod(a,b) |
|
3776
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
87 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
88 #endif /* _LIBC_INTERFACE_H_ */ |
