]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/gsockmsw.h
Fixed a typo in wxDbConnectionsInUse()
[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 #ifndef __GSOCKET_STANDALONE__
13 #include "wx/setup.h"
14 #endif
15
16 #if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
17
18 #ifndef __GSOCKET_STANDALONE__
19 #include "wx/gsocket.h"
20 #else
21 #include "gsocket.h"
22 #endif
23
24 #include <windows.h>
25 #include <winsock.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /* Definition of GSocket */
32 struct _GSocket
33 {
34 SOCKET m_fd;
35 GAddress *m_local;
36 GAddress *m_peer;
37 GSocketError m_error;
38
39 /* Attributes */
40 bool m_non_blocking;
41 bool m_server;
42 bool m_stream;
43 bool m_oriented;
44 bool m_establishing;
45 struct timeval m_timeout;
46
47 /* Callbacks */
48 GSocketEventFlags m_detected;
49 GSocketCallback m_cbacks[GSOCK_MAX_EVENT];
50 char *m_data[GSOCK_MAX_EVENT];
51 int m_msgnumber;
52 };
53
54 /* Definition of GAddress */
55 struct _GAddress
56 {
57 struct sockaddr *m_addr;
58 size_t m_len;
59
60 GAddressType m_family;
61 int m_realfamily;
62
63 GSocketError m_error;
64 };
65
66 /* Input / output */
67
68 GSocketError _GSocket_Input_Timeout(GSocket *socket);
69 GSocketError _GSocket_Output_Timeout(GSocket *socket);
70 GSocketError _GSocket_Connect_Timeout(GSocket *socket);
71 int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
72 int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
73 int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
74 int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
75
76 /* Callbacks */
77
78 bool _GSocket_GUI_Init(GSocket *socket);
79 void _GSocket_GUI_Destroy(GSocket *socket);
80
81 LRESULT CALLBACK _GSocket_Internal_WinProc(HWND, UINT, WPARAM, LPARAM);
82
83 void _GSocket_Enable_Events(GSocket *socket);
84 void _GSocket_Disable_Events(GSocket *socket);
85
86 /* GAddress */
87
88 GSocketError _GAddress_translate_from(GAddress *address,
89 struct sockaddr *addr, int len);
90 GSocketError _GAddress_translate_to (GAddress *address,
91 struct sockaddr **addr, int *len);
92 GSocketError _GAddress_Init_INET(GAddress *address);
93 GSocketError _GAddress_Init_UNIX(GAddress *address);
94
95 #ifdef __cplusplus
96 }
97 #endif
98
99 #endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
100
101 #endif /* __GSOCK_MSW_H */