]> git.saurik.com Git - wxWidgets.git/blob - src/unix/gsockunx.h
Renamed GSocket_SetBlocking to GSocket_SetNonBlocking and *Fallback to *Callback
[wxWidgets.git] / src / unix / gsockunx.h
1 /* -------------------------------------------------------------------------
2 * Project: GSocket (Generic Socket) for WX
3 * Name: gsockunx.h
4 * Purpose: GSocket Unix header
5 * CVSID: $Id$
6 * -------------------------------------------------------------------------
7 */
8 #ifndef __GSOCK_UNX_H
9 #define __GSOCK_UNX_H
10
11 #include <wx/gsocket.h>
12
13 /* Definition of GSocket */
14 struct _GSocket {
15 int m_fd;
16 GAddress *m_local, *m_peer;
17 GSocketError m_error;
18
19 bool m_blocking, m_server, m_stream, m_oriented;
20 unsigned long m_timeout;
21
22 /* Callbacks */
23 GSocketCallback m_fbacks[GSOCK_MAX_EVENT];
24 char *m_data[GSOCK_MAX_EVENT];
25
26 /* IO calls associated */
27 bool m_iocalls[GSOCK_MAX_EVENT];
28
29 char *m_gui_dependent;
30 };
31
32 /* Definition of GAddress */
33 struct _GAddress {
34 struct sockaddr *m_addr;
35 size_t m_len;
36
37 GAddressType m_family;
38 int m_realfamily;
39
40 GSocketError m_error;
41 };
42
43 void _GSocket_Enable(GSocket *socket, GSocketEvent event);
44 void _GSocket_Disable(GSocket *socket, GSocketEvent event);
45 int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
46 int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
47 int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
48 int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
49 void _GSocket_Install_Callback(GSocket *socket, GSocketEvent count);
50 void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent count);
51 void _GSocket_Detected_Read(GSocket *socket);
52 void _GSocket_Detected_Write(GSocket *socket);
53 void _GSocket_GUI_Init(GSocket *socket);
54 void _GSocket_GUI_Destroy(GSocket *socket);
55 void _GAddress_translate_from(GAddress *address,
56 struct sockaddr *addr, int len);
57 void _GAddress_translate_to(GAddress *address,
58 struct sockaddr **addr, int *len);
59
60 /* Internet address family */
61 void _GAddress_Init_INET(GAddress *address);
62 /* Local address family */
63 void _GAddress_Init_UNIX(GAddress *address);
64
65 #endif