]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/unix/gsockunx.h
wxID_PREFERENCES added for the preferences menu item
[wxWidgets.git] / include / wx / unix / gsockunx.h
... / ...
CommitLineData
1/* -------------------------------------------------------------------------
2 * Project: GSocket (Generic Socket) for WX
3 * Name: gsockunx.h
4 * Purpose: GSocket Unix header
5 * CVSID: $Id$
6 * -------------------------------------------------------------------------
7 */
8
9#ifndef __GSOCK_UNX_H
10#define __GSOCK_UNX_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
25#ifdef __cplusplus
26extern "C" {
27#endif /* __cplusplus */
28
29#ifndef TRUE
30#define TRUE 1
31#endif
32
33#ifndef FALSE
34#define FALSE 0
35#endif
36
37
38/* Definition of GSocket */
39struct _GSocket
40{
41 int m_fd;
42 GAddress *m_local;
43 GAddress *m_peer;
44 GSocketError m_error;
45
46 int m_non_blocking;
47 int m_server;
48 int m_stream;
49 int m_oriented;
50 int m_establishing;
51 unsigned long m_timeout;
52
53 /* Callbacks */
54 GSocketEventFlags m_detected;
55 GSocketCallback m_cbacks[GSOCK_MAX_EVENT];
56 char *m_data[GSOCK_MAX_EVENT];
57
58 char *m_gui_dependent;
59
60 /* Function pointers */
61 struct GSocketBaseFunctionsTable *m_functions;
62};
63
64/* Definition of GAddress */
65struct _GAddress
66{
67 struct sockaddr *m_addr;
68 size_t m_len;
69
70 GAddressType m_family;
71 int m_realfamily;
72
73 GSocketError m_error;
74};
75
76/* Input / Output */
77
78GSocketError _GSocket_Input_Timeout(GSocket *socket);
79GSocketError _GSocket_Output_Timeout(GSocket *socket);
80int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
81int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
82int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
83int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
84
85/* Callbacks */
86
87int _GSocket_GUI_Init(void);
88void _GSocket_GUI_Cleanup(void);
89
90int _GSocket_GUI_Init_Socket(GSocket *socket);
91void _GSocket_GUI_Destroy_Socket(GSocket *socket);
92
93void _GSocket_Enable_Events(GSocket *socket);
94void _GSocket_Disable_Events(GSocket *socket);
95void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event);
96void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event);
97
98void _GSocket_Enable(GSocket *socket, GSocketEvent event);
99void _GSocket_Disable(GSocket *socket, GSocketEvent event);
100void _GSocket_Detected_Read(GSocket *socket);
101void _GSocket_Detected_Write(GSocket *socket);
102
103/* GAddress */
104
105GSocketError _GAddress_translate_from(GAddress *address,
106 struct sockaddr *addr, int len);
107GSocketError _GAddress_translate_to (GAddress *address,
108 struct sockaddr **addr, int *len);
109GSocketError _GAddress_Init_INET(GAddress *address);
110GSocketError _GAddress_Init_UNIX(GAddress *address);
111
112
113#ifdef __cplusplus
114}
115#endif /* __cplusplus */
116
117#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
118
119#endif /* __GSOCK_UNX_H */