]> git.saurik.com Git - wxWidgets.git/blob - src/unix/gsockunx.h
More asserts (well, checks) without _T()
[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
21 /* Fallbacks */
22 GSocketFallback m_fbacks[GSOCK_MAX_EVENT];
23 char *m_data[GSOCK_MAX_EVENT];
24
25 /* IO calls associated */
26 bool m_iocalls[GSOCK_MAX_EVENT];
27
28 char *m_gui_dependent;
29 };
30
31 /* Definition of GAddress */
32 struct _GAddress {
33 struct sockaddr *m_addr;
34 size_t m_len;
35
36 GAddressType m_family;
37 int m_realfamily;
38
39 GSocketError m_error;
40 };
41
42 void _GSocket_Enable(GSocket *socket, GSocketEvent event);
43 void _GSocket_Disable(GSocket *socket, GSocketEvent event);
44 int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
45 int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
46 int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
47 int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
48 void _GSocket_Install_Fallback(GSocket *socket, GSocketEvent count);
49 void _GSocket_Uninstall_Fallback(GSocket *socket, GSocketEvent count);
50 void _GSocket_Detected_Read(GSocket *socket);
51 void _GSocket_Detected_Write(GSocket *socket);
52 void _GSocket_GUI_Init(GSocket *socket);
53 void _GSocket_GUI_Destroy(GSocket *socket);
54 void _GAddress_translate_from(GAddress *address,
55 struct sockaddr *addr, int len);
56 void _GAddress_translate_to(GAddress *address,
57 struct sockaddr **addr, int *len);
58
59 /* Internet address family */
60 void _GAddress_Init_INET(GAddress *address);
61 /* Local address family */
62 void _GAddress_Init_UNIX(GAddress *address);
63
64 #endif