]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/gsockmsw.h
wxUSE_GIF instead of wxUSE_LIBGIF
[wxWidgets.git] / include / wx / msw / gsockmsw.h
1 /* -------------------------------------------------------------------------
2 * Project: GSocket (Generic Socket) for WX
3 * Name: gsockmsw.h
4 * Purpose: GSocket MSW header
5 * CVSID: $Id$
6 * -------------------------------------------------------------------------
7 */
8
9 #ifndef __GSOCK_MSW_H
10 #define __GSOCK_MSW_H
11
12 #ifdef __WXMSW__
13 #include "wx/gsocket.h"
14 #else
15 #include "gsocket.h"
16 #endif
17
18 #include <winsock.h>
19
20
21 /* Definition of GSocket */
22 struct _GSocket
23 {
24 SOCKET m_fd;
25 GAddress *m_local;
26 GAddress *m_peer;
27 GSocketError m_error;
28
29 bool m_non_blocking;
30 bool m_server;
31 bool m_stream;
32 bool m_oriented;
33 struct timeval m_timeout;
34
35 /* Callbacks */
36 GSocketCallback m_cbacks[GSOCK_MAX_EVENT];
37 char *m_data[GSOCK_MAX_EVENT];
38 int m_msgnumber;
39 };
40
41 /* Definition of GAddress */
42 struct _GAddress
43 {
44 struct sockaddr *m_addr;
45 size_t m_len;
46
47 GAddressType m_family;
48 int m_realfamily;
49
50 GSocketError m_error;
51 };
52
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58 /* Input / output */
59
60 GSocketError _GSocket_Input_Timeout(GSocket *socket);
61 GSocketError _GSocket_Output_Timeout(GSocket *socket);
62 int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
63 int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
64 int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
65 int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
66
67 /* Callbacks */
68
69 void _GSocket_Configure_Callbacks(GSocket *socket);
70 LRESULT CALLBACK _GSocket_Internal_WinProc(HWND, UINT, WPARAM, LPARAM);
71
72 /* GAddress */
73
74 GSocketError _GAddress_translate_from(GAddress *address,
75 struct sockaddr *addr, int len);
76
77 GSocketError _GAddress_translate_to(GAddress *address,
78 struct sockaddr **addr, int *len);
79
80 GSocketError _GAddress_Init_INET(GAddress *address);
81 GSocketError _GAddress_Init_UNIX(GAddress *address);
82
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif /* __GSOCK_MSW_H */