]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/unix/gsockunx.h
Solving link problem with 16 bits versions (wxProcessEvent, wxSpinEvent)
[wxWidgets.git] / src / 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#ifndef __GSOCK_UNX_H
9#define __GSOCK_UNX_H
10
11#include "wx/setup.h"
12
13#if wxUSE_SOCKETS
14
15#include "wx/gsocket.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21
22/* Definition of GSocket */
23struct _GSocket {
24 int m_fd;
25 GAddress *m_local, *m_peer;
26 GSocketError m_error;
27
28 bool m_non_blocking, m_server, m_stream, m_oriented;
29 unsigned long m_timeout;
30
31 /* Callbacks */
32 GSocketCallback m_cbacks[GSOCK_MAX_EVENT];
33 char *m_data[GSOCK_MAX_EVENT];
34
35 /* IO calls associated */
36 bool m_iocalls[GSOCK_MAX_EVENT];
37
38 char *m_gui_dependent;
39};
40
41/* Definition of GAddress */
42struct _GAddress {
43 struct sockaddr *m_addr;
44 size_t m_len;
45
46 GAddressType m_family;
47 int m_realfamily;
48
49 GSocketError m_error;
50};
51
52void _GSocket_Enable(GSocket *socket, GSocketEvent event);
53void _GSocket_Disable(GSocket *socket, GSocketEvent event);
54int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size);
55int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size);
56int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size);
57int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size);
58void _GSocket_Install_Callback(GSocket *socket, GSocketEvent count);
59void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent count);
60void _GSocket_Detected_Read(GSocket *socket);
61void _GSocket_Detected_Write(GSocket *socket);
62void _GSocket_GUI_Init(GSocket *socket);
63void _GSocket_GUI_Destroy(GSocket *socket);
64
65/* Translaters returns false when memory is exhausted */
66GSocketError _GAddress_translate_from(GAddress *address,
67 struct sockaddr *addr, int len);
68GSocketError _GAddress_translate_to(GAddress *address,
69 struct sockaddr **addr, int *len);
70
71/* Initialisers returns FALSE when an error happened in the initialisation */
72
73/* Internet address family */
74GSocketError _GAddress_Init_INET(GAddress *address);
75/* Local address family */
76GSocketError _GAddress_Init_UNIX(GAddress *address);
77
78#ifdef __cplusplus
79}
80#endif /* __cplusplus */
81
82#endif
83 /* wxUSE_SOCKETS */
84
85#endif
86 /* __GSOCK_UNX_H */