Added GSocket for Unix (only GTK for the moment)
[wxWidgets.git] / src / unix / gsockunx.h
1 #ifndef __GSOCK_UNX_H
2 #define __GSOCK_UNX_H
3
4 #include <wx/gsocket.h>
5
6 /* Definition of GSocket */
7 struct _GSocket {
8 int m_fd;
9 GAddress *m_local, *m_peer;
10 GSocketError m_error;
11
12 bool m_blocking, m_server, m_stream, m_oriented;
13
14 /* Fallbacks */
15 GSocketFallback m_fbacks[GSOCK_MAX_EVENT];
16 char *m_data[GSOCK_MAX_EVENT];
17
18 /* IO calls associated */
19 bool m_iocalls[GSOCK_MAX_EVENT];
20
21 char *m_gui_dependent;
22 };
23
24 /* Definition of GAddress */
25 struct _GAddress {
26 struct sockaddr *m_addr;
27 size_t m_len;
28
29 GAddressType m_family;
30 int m_realfamily;
31
32 GSocketError m_error;
33 };
34
35 void _GSocket_Enable(GSocket *socket, GSocketEvent event);
36 void _GSocket_Disable(GSocket *socket, GSocketEvent event);
37 int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
38 int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
39 int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
40 int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
41 void _GSocket_Install_Fallback(GSocket *socket, GSocketEvent count);
42 void _GSocket_Uninstall_Fallback(GSocket *socket, GSocketEvent count);
43 void _GSocket_Detected_Read(GSocket *socket);
44 void _GSocket_Detected_Write(GSocket *socket);
45 void _GSocket_GUI_Init(GSocket *socket);
46 void _GSocket_GUI_Destroy(GSocket *socket);
47 void _GAddress_translate_from(GAddress *address,
48 struct sockaddr *addr, int len);
49 void _GAddress_translate_to(GAddress *address,
50 struct sockaddr **addr, int *len);
51
52 /* Internet address family */
53 void _GAddress_Init_INET(GAddress *address);
54 /* Local address family */
55 void _GAddress_Init_UNIX(GAddress *address);
56
57 #endif