struct.pack has become picky about h (short) and H (unsigned short).
[python/dscho.git] / Lib / plat-beos5 / SOCKET.py
blob90fc582147e20ac83ad7bd8cd58c85489f64387f
1 # Generated by h2py from /boot/develop/headers/be/net/socket.h
3 # Included from BeBuild.h
4 B_BEOS_VERSION_4 = 0x0400
5 B_BEOS_VERSION_4_5 = 0x0450
6 B_BEOS_VERSION_5 = 0x0500
7 B_BEOS_VERSION = B_BEOS_VERSION_5
8 B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
9 _PR2_COMPATIBLE_ = 1
10 _PR3_COMPATIBLE_ = 1
11 _R4_COMPATIBLE_ = 1
12 _R4_5_COMPATIBLE_ = 1
13 _PR2_COMPATIBLE_ = 0
14 _PR3_COMPATIBLE_ = 0
15 _R4_COMPATIBLE_ = 1
16 _R4_5_COMPATIBLE_ = 1
17 def _UNUSED(x): return x
20 # Included from sys/types.h
22 # Included from time.h
24 # Included from be_setup.h
25 def __std(ref): return ref
27 __be_os = 2
28 __dest_os = __be_os
29 __MSL__ = 0x4011
30 __GLIBC__ = -2
31 __GLIBC_MINOR__ = 1
33 # Included from null.h
34 NULL = (0)
35 NULL = 0L
37 # Included from size_t.h
39 # Included from stddef.h
41 # Included from wchar_t.h
42 CLOCKS_PER_SEC = 1000
43 CLK_TCK = CLOCKS_PER_SEC
44 MAX_TIMESTR = 70
46 # Included from sys/time.h
48 # Included from ByteOrder.h
50 # Included from endian.h
51 __LITTLE_ENDIAN = 1234
52 LITTLE_ENDIAN = __LITTLE_ENDIAN
53 __BYTE_ORDER = __LITTLE_ENDIAN
54 BYTE_ORDER = __BYTE_ORDER
55 __BIG_ENDIAN = 0
56 BIG_ENDIAN = 0
57 __BIG_ENDIAN = 4321
58 BIG_ENDIAN = __BIG_ENDIAN
59 __BYTE_ORDER = __BIG_ENDIAN
60 BYTE_ORDER = __BYTE_ORDER
61 __LITTLE_ENDIAN = 0
62 LITTLE_ENDIAN = 0
63 __PDP_ENDIAN = 3412
64 PDP_ENDIAN = __PDP_ENDIAN
66 # Included from SupportDefs.h
68 # Included from Errors.h
70 # Included from limits.h
72 # Included from float.h
73 FLT_ROUNDS = 1
74 FLT_RADIX = 2
75 FLT_MANT_DIG = 24
76 FLT_DIG = 6
77 FLT_MIN_EXP = (-125)
78 FLT_MIN_10_EXP = (-37)
79 FLT_MAX_EXP = 128
80 FLT_MAX_10_EXP = 38
81 DBL_MANT_DIG = 53
82 DBL_DIG = 15
83 DBL_MIN_EXP = (-1021)
84 DBL_MIN_10_EXP = (-308)
85 DBL_MAX_EXP = 1024
86 DBL_MAX_10_EXP = 308
87 LDBL_MANT_DIG = DBL_MANT_DIG
88 LDBL_DIG = DBL_DIG
89 LDBL_MIN_EXP = DBL_MIN_EXP
90 LDBL_MIN_10_EXP = DBL_MIN_10_EXP
91 LDBL_MAX_EXP = DBL_MAX_EXP
92 LDBL_MAX_10_EXP = DBL_MAX_10_EXP
93 CHAR_BIT = (8)
94 SCHAR_MIN = (-127-1)
95 SCHAR_MAX = (127)
96 CHAR_MIN = SCHAR_MIN
97 CHAR_MAX = SCHAR_MAX
98 MB_LEN_MAX = (1)
99 SHRT_MIN = (-32767-1)
100 SHRT_MAX = (32767)
101 LONG_MIN = (-2147483647L-1)
102 LONG_MAX = (2147483647L)
103 INT_MIN = LONG_MIN
104 INT_MAX = LONG_MAX
105 ARG_MAX = (32768)
106 ATEXIT_MAX = (32)
107 CHILD_MAX = (1024)
108 IOV_MAX = (256)
109 FILESIZEBITS = (64)
110 LINK_MAX = (1)
111 LOGIN_NAME_MAX = (32)
112 MAX_CANON = (255)
113 MAX_INPUT = (255)
114 NAME_MAX = (256)
115 NGROUPS_MAX = (32)
116 OPEN_MAX = (128)
117 PATH_MAX = (1024)
118 PIPE_MAX = (512)
119 SSIZE_MAX = (2147483647L)
120 TTY_NAME_MAX = (256)
121 TZNAME_MAX = (32)
122 SYMLINKS_MAX = (16)
123 _POSIX_ARG_MAX = (32768)
124 _POSIX_CHILD_MAX = (1024)
125 _POSIX_LINK_MAX = (1)
126 _POSIX_LOGIN_NAME_MAX = (9)
127 _POSIX_MAX_CANON = (255)
128 _POSIX_MAX_INPUT = (255)
129 _POSIX_NAME_MAX = (255)
130 _POSIX_NGROUPS_MAX = (0)
131 _POSIX_OPEN_MAX = (128)
132 _POSIX_PATH_MAX = (1024)
133 _POSIX_PIPE_BUF = (512)
134 _POSIX_SSIZE_MAX = (2147483647L)
135 _POSIX_STREAM_MAX = (8)
136 _POSIX_TTY_NAME_MAX = (256)
137 _POSIX_TZNAME_MAX = (3)
138 B_GENERAL_ERROR_BASE = LONG_MIN
139 B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000
140 B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000
141 B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000
142 B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000
143 B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800
144 B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000
145 B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000
146 B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000
147 B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000
148 B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000
149 B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000
150 B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff)
151 E2BIG = (B_POSIX_ERROR_BASE + 1)
152 ECHILD = (B_POSIX_ERROR_BASE + 2)
153 EDEADLK = (B_POSIX_ERROR_BASE + 3)
154 EFBIG = (B_POSIX_ERROR_BASE + 4)
155 EMLINK = (B_POSIX_ERROR_BASE + 5)
156 ENFILE = (B_POSIX_ERROR_BASE + 6)
157 ENODEV = (B_POSIX_ERROR_BASE + 7)
158 ENOLCK = (B_POSIX_ERROR_BASE + 8)
159 ENOSYS = (B_POSIX_ERROR_BASE + 9)
160 ENOTTY = (B_POSIX_ERROR_BASE + 10)
161 ENXIO = (B_POSIX_ERROR_BASE + 11)
162 ESPIPE = (B_POSIX_ERROR_BASE + 12)
163 ESRCH = (B_POSIX_ERROR_BASE + 13)
164 EFPOS = (B_POSIX_ERROR_BASE + 14)
165 ESIGPARM = (B_POSIX_ERROR_BASE + 15)
166 EDOM = (B_POSIX_ERROR_BASE + 16)
167 ERANGE = (B_POSIX_ERROR_BASE + 17)
168 EPROTOTYPE = (B_POSIX_ERROR_BASE + 18)
169 EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19)
170 EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20)
171 EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21)
172 EADDRINUSE = (B_POSIX_ERROR_BASE + 22)
173 EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23)
174 ENETDOWN = (B_POSIX_ERROR_BASE + 24)
175 ENETUNREACH = (B_POSIX_ERROR_BASE + 25)
176 ENETRESET = (B_POSIX_ERROR_BASE + 26)
177 ECONNABORTED = (B_POSIX_ERROR_BASE + 27)
178 ECONNRESET = (B_POSIX_ERROR_BASE + 28)
179 EISCONN = (B_POSIX_ERROR_BASE + 29)
180 ENOTCONN = (B_POSIX_ERROR_BASE + 30)
181 ESHUTDOWN = (B_POSIX_ERROR_BASE + 31)
182 ECONNREFUSED = (B_POSIX_ERROR_BASE + 32)
183 EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33)
184 ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34)
185 ENOBUFS = (B_POSIX_ERROR_BASE + 35)
186 EINPROGRESS = (B_POSIX_ERROR_BASE + 36)
187 EALREADY = (B_POSIX_ERROR_BASE + 37)
188 EILSEQ = (B_POSIX_ERROR_BASE + 38)
189 ENOMSG = (B_POSIX_ERROR_BASE + 39)
190 ESTALE = (B_POSIX_ERROR_BASE + 40)
191 EOVERFLOW = (B_POSIX_ERROR_BASE + 41)
192 EMSGSIZE = (B_POSIX_ERROR_BASE + 42)
193 EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43)
194 ENOTSOCK = (B_POSIX_ERROR_BASE + 44)
195 false = 0
196 true = 1
197 NULL = (0)
198 FALSE = 0
199 TRUE = 1
201 # Included from TypeConstants.h
202 B_HOST_IS_LENDIAN = 1
203 B_HOST_IS_BENDIAN = 0
204 def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg)
206 def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg)
208 def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg)
210 def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg)
212 def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg)
214 def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg)
216 def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg)
218 def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg)
220 def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg)
222 def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg)
224 def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
226 def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
228 def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
230 def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
232 def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
234 def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
236 def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
238 def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
240 def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
242 def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
244 B_HOST_IS_LENDIAN = 0
245 B_HOST_IS_BENDIAN = 1
246 def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg)
248 def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg)
250 def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg)
252 def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg)
254 def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg)
256 def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg)
258 def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg)
260 def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg)
262 def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg)
264 def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg)
266 def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
268 def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
270 def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
272 def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
274 def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
276 def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
278 def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
280 def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
282 def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
284 def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
286 def B_SWAP_DOUBLE(arg): return __swap_double(arg)
288 def B_SWAP_FLOAT(arg): return __swap_float(arg)
290 def B_SWAP_INT64(arg): return __swap_int64(arg)
292 def B_SWAP_INT32(arg): return __swap_int32(arg)
294 def B_SWAP_INT16(arg): return __swap_int16(arg)
296 def htonl(x): return B_HOST_TO_BENDIAN_INT32(x)
298 def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x)
300 def htons(x): return B_HOST_TO_BENDIAN_INT16(x)
302 def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x)
304 AF_INET = 1
305 INADDR_ANY = 0x00000000
306 INADDR_BROADCAST = 0xffffffff
307 INADDR_LOOPBACK = 0x7f000001
308 SOL_SOCKET = 1
309 SO_DEBUG = 1
310 SO_REUSEADDR = 2
311 SO_NONBLOCK = 3
312 SO_REUSEPORT = 4
313 MSG_OOB = 0x1
314 SOCK_DGRAM = 1
315 SOCK_STREAM = 2
316 IPPROTO_UDP = 1
317 IPPROTO_TCP = 2
318 IPPROTO_ICMP = 3
319 B_UDP_MAX_SIZE = (65536 - 1024)
320 FD_SETSIZE = 256
321 FDSETSIZE = FD_SETSIZE
322 NFDBITS = 32
323 def _FDMSKNO(fd): return ((fd) / NFDBITS)
325 def _FDBITNO(fd): return ((fd) % NFDBITS)