Module of module types for OrderedType,ComparableType,Printable,Serializable,Discrete...
[ocaml.git] / otherlibs / win32unix / socketaddr.h
blob8abc63b47783c2bc9ae4762cf0bee602609660ff
1 /***********************************************************************/
2 /* */
3 /* Objective Caml */
4 /* */
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
6 /* */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
11 /* */
12 /***********************************************************************/
14 /* $Id$ */
16 #include <misc.h>
18 union sock_addr_union {
19 struct sockaddr s_gen;
20 struct sockaddr_in s_inet;
23 extern union sock_addr_union sock_addr;
25 #ifdef HAS_SOCKLEN_T
26 typedef socklen_t socklen_param_type;
27 #else
28 typedef int socklen_param_type;
29 #endif
31 extern void get_sockaddr (value mladdr,
32 union sock_addr_union * addr /*out*/,
33 socklen_param_type * addr_len /*out*/);
34 CAMLprim value alloc_sockaddr (union sock_addr_union * addr /*in*/,
35 socklen_param_type addr_len, int close_on_error);
36 CAMLprim value alloc_inet_addr (struct in_addr * inaddr);
37 #define GET_INET_ADDR(v) (*((struct in_addr *) (v)))