]>
Commit | Line | Data |
---|---|---|
52479aef SC |
1 | /* ------------------------------------------------------------------------- |
2 | * Project: GSocket (Generic Socket) for WX | |
3 | * Name: gsockunx.h | |
4 | * Purpose: GSocket Macintosh 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 | |
26 | extern "C" { | |
27 | #endif /* __cplusplus */ | |
28 | ||
29 | typedef GSocket* GSocketPtr ; | |
30 | ||
31 | /* Definition of GSocket */ | |
32 | struct _GSocket | |
33 | { | |
34 | wxMacNotifierTableRef m_mac_events ; | |
35 | EndpointRef m_endpoint; | |
36 | GAddress *m_local; | |
37 | GAddress *m_peer; | |
38 | GSocketError m_error; | |
39 | ||
40 | int m_non_blocking; | |
41 | int m_server; | |
42 | int m_stream; | |
43 | int m_oriented; | |
44 | unsigned long m_timeout; | |
45 | ||
46 | /* Callbacks */ | |
47 | GSocketEventFlags m_detected; | |
48 | GSocketCallback m_cbacks[GSOCK_MAX_EVENT]; | |
49 | char *m_data[GSOCK_MAX_EVENT]; | |
50 | int m_takesEvents ; | |
51 | }; | |
52 | ||
53 | /* Definition of GAddress */ | |
54 | ||
55 | struct _GAddress | |
56 | { | |
57 | UInt32 m_host ; | |
58 | UInt16 m_port ; | |
59 | GAddressType m_family; | |
60 | GSocketError m_error; | |
61 | }; | |
62 | ||
63 | /* Input / Output */ | |
64 | ||
65 | GSocketError _GSocket_Input_Timeout(GSocket *socket); | |
66 | GSocketError _GSocket_Output_Timeout(GSocket *socket); | |
67 | int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size); | |
68 | int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size); | |
69 | int _GSocket_Send_Stream(GSocket *socket, const char *buffer, int size); | |
70 | int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size); | |
71 | ||
72 | /* Callbacks */ | |
73 | ||
74 | void _GSocket_Enable_Events(GSocket *socket); | |
75 | void _GSocket_Disable_Events(GSocket *socket); | |
76 | void _GSocket_Internal_Proc(unsigned long e , void* data ) ; | |
77 | ||
78 | /* GAddress */ | |
79 | ||
80 | GSocketError _GAddress_translate_from(GAddress *address, | |
81 | InetAddress *addr ); | |
82 | GSocketError _GAddress_translate_to(GAddress *address, | |
83 | InetAddress *addr); | |
84 | ||
85 | GSocketError _GAddress_Init_INET(GAddress *address); | |
86 | ||
87 | #ifdef __cplusplus | |
88 | } | |
89 | #endif /* __cplusplus */ | |
90 | ||
91 | #endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ | |
92 | ||
93 | #endif /* __GSOCK_UNX_H */ |