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