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