comparison src/win32/win32dep.h @ 3778:813304a57f88

[gaim-migrate @ 3918] libc_interface portions moved to libc_interface.h committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Mon, 21 Oct 2002 18:33:21 +0000
parents ac6ca3890c53
children 41e7544a9c67
comparison
equal deleted inserted replaced
3777:10ffafd1c91f 3778:813304a57f88
5 #ifndef _WIN32DEP_H_ 5 #ifndef _WIN32DEP_H_
6 #define _WIN32DEP_H_ 6 #define _WIN32DEP_H_
7 #include <winsock.h> 7 #include <winsock.h>
8 #include <gdk/gdkevents.h> 8 #include <gdk/gdkevents.h>
9 #include "winerror.h" 9 #include "winerror.h"
10 #include "libc_interface.h"
11
10 12
11 /* 13 /*
12 * PROTOS 14 * PROTOS
13 */ 15 */
14 16
19 extern GdkFilterReturn wgaim_window_filter(GdkXEvent *xevent, 21 extern GdkFilterReturn wgaim_window_filter(GdkXEvent *xevent,
20 GdkEvent *event, 22 GdkEvent *event,
21 gpointer data); 23 gpointer data);
22 extern void wgaim_init(void); 24 extern void wgaim_init(void);
23 25
24 /* sys/socket.h */
25 extern int wgaim_socket(int namespace, int style, int protocol);
26 extern int wgaim_connect(int socket, struct sockaddr *addr, u_long length);
27 extern int wgaim_getsockopt(int socket, int level, int optname, void *optval, unsigned int *optlenptr);
28 /* sys/ioctl.h */
29 extern int wgaim_ioctl(int fd, int command, void* opt);
30 /* fcntl.h */
31 extern int wgaim_fcntl(int socket, int command, int val);
32 /* arpa/inet.h */
33 extern int wgaim_inet_aton(const char *name, struct in_addr *addr);
34 /* netdb.h */
35 extern struct hostent* wgaim_gethostbyname(const char *name);
36 /* string.h */
37 extern char* wgaim_strerror( int errornum );
38 /* unistd.h */
39 extern int wgaim_read(int fd, void *buf, unsigned int size);
40 extern int wgaim_write(int fd, const void *buf, unsigned int size);
41 extern int wgaim_close(int fd);
42
43 /* 26 /*
44 * MACROS 27 * MACROS
45 */ 28 */
46
47 #define bzero( dest, size ) memset( ## dest ##, 0, ## size ## )
48 #define sleep(x) Sleep((x)*1000)
49 #define snprintf _snprintf
50 #define vsnprintf _vsnprintf
51 #define mkdir(a,b) _mkdir((a))
52 #define open( args... ) _open( ## args )
53
54 /* sockets */
55 #define socket( namespace, style, protocol ) \
56 wgaim_socket( ## namespace ##, ## style ##, ## protocol ## )
57
58 #define connect( socket, addr, length ) \
59 wgaim_connect( ## socket ##, ## addr ##, ## length ## )
60
61 #define getsockopt( args... ) \
62 wgaim_getsockopt( ## args )
63
64 #define read( fd, buf, buflen ) \
65 wgaim_read( ## fd ##, ## buf ##, ## buflen ## )
66
67 #define write( socket, buf, buflen ) \
68 wgaim_write( ## socket ##, ## buf ##, ## buflen ## )
69
70 #define close( fd ) \
71 wgaim_close( ## fd ## )
72
73 #define inet_aton( name, addr ) \
74 wgaim_inet_aton( ## name ##, ## addr ## )
75
76 /* hostent */
77 #define gethostbyname( name ) \
78 wgaim_gethostbyname( ## name ## )
79
80 #define hstrerror( herror ) wgaim_strerror( errno )
81
82 /* fcntl commands & options */
83 #define F_SETFL 1
84 #define O_NONBLOCK 1
85 #define fcntl( fd, command, val ) \
86 wgaim_fcntl( ## fd ##, ## command ##, ## val ## )
87
88 #define ioctl( fd, command, val ) \
89 wgaim_ioctl( ## fd ##, ## command ##, ## val ## )
90
91 #define strerror( errornum ) \
92 wgaim_strerror( ## errornum ## )
93 29
94 /* 30 /*
95 * Gaim specific 31 * Gaim specific
96 */ 32 */
97 #define DATADIR wgaim_install_dir() 33 #define DATADIR wgaim_install_dir()