Commits

jhwoodyatt  committed 1f72d14

Submit cf-0.1 release.

  • Participants
  • Parent commits e624b29

Comments (0)

Files changed (5)

File cf/cf_socket_p.h

 /*---------------------------------------------------------------------------*
   C HEADER  cf_socket_p.h
 
-  Copyright (c) 2003, James H. Woodyatt
+  Copyright (c) 2003-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without
 #include <sys/types.h>
 #include <sys/socket.h>
 
-typedef value (*Cf_socket_sockaddr_cons_f)(size_t len);
+#define Cf_socket_sockaddrx_struct(suffix) \
+struct cf_socket_sockaddrx_##suffix##_s { \
+    size_t                      sx_socklen; \
+    struct sockaddr_##suffix    sx_sockaddr_##suffix; \
+}
+
+#define Cf_socket_sockaddrx_t(suffix)   Cf_socket_sockaddrx_##suffix##_t
+
+#define Cf_socket_sockaddrx_typedef(suffix) \
+typedef struct cf_socket_sockaddrx_##suffix##_s Cf_socket_sockaddrx_t(suffix)
+
+#define Cf_socket_sockaddrx_val(suffix, v) \
+    ((Cf_socket_sockaddrx_t(suffix)*) Data_custom_val(v))
+
+Cf_socket_sockaddrx_struct(storage);
+Cf_socket_sockaddrx_typedef(storage);
+
+struct cf_socket_sockaddrx_unit_s {
+    size_t              sx_socklen;
+    struct sockaddr     sx_sockaddr;
+};
+
+typedef struct cf_socket_sockaddrx_unit_s Cf_socket_sockaddrx_unit_t;
+
+#define Cf_socket_sockaddrx_unit_val(v) \
+    ((Cf_socket_sockaddrx_unit_t*) Data_custom_val(v))
+
+typedef value (*Cf_socket_sockaddrx_cons_f)
+   (const struct sockaddr* saPtr, size_t saLen);
 
 struct cf_socket_domain_s {
     int				d_domain;	/* PF_INET, PF_LOCAL, ... */
     int				d_family;	/* AF_INET, AF_LOCAL, ... */
-    Cf_socket_sockaddr_cons_f	d_consaddr;	/* sockaddr alloc function */
+    Cf_socket_sockaddrx_cons_f	d_consaddr;	/* sockaddr alloc function */
     size_t			d_socklen;	/* sizeof(sockaddr_xxx) */
 };
 
    (const Cf_socket_option_context_t* contextPtr, value x);
 
 struct cf_socket_option_s {
-    int				opt_level;
-    int				opt_name;
+    int                     opt_level;
+    int                     opt_name;
     Cf_socket_getsockopt_f	opt_get;
     Cf_socket_setsockopt_f	opt_set;
+    const char*             opt_name_str;
 };
 
 typedef struct cf_socket_option_s Cf_socket_option_t;
 
+struct cf_socket_sockopt_lift_s {
+    value                       ol_val;
+    const Cf_socket_option_t	ol_option;
+};
+
+typedef struct cf_socket_sockopt_lift_s Cf_socket_sockopt_lift_t;
+
 #define Cf_socket_option_val(v)	\
     ((const Cf_socket_option_t**) Data_custom_val(v))
 extern value cf_socket_option_alloc(const Cf_socket_option_t* ptr);

File cf/cf_stdtime.ml

 (*---------------------------------------------------------------------------*
   IMPLEMENTATION  cf_stdtime.ml
 
-  Copyright (c) 2003, James H. Woodyatt
+  Copyright (c) 2003-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without

File cf/cf_stdtime.mli

 (*---------------------------------------------------------------------------*
   INTERFACE  cf_stdtime.mli
 
-  Copyright (c) 2003, James H. Woodyatt
+  Copyright (c) 2003-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without

File cf/cf_tai64.ml

 (*---------------------------------------------------------------------------*
   IMPLEMENTATION  cf_tai64.ml
 
-  Copyright (c) 2003, James H. Woodyatt
+  Copyright (c) 2003-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without

File cf/cf_tai64.mli

 (*---------------------------------------------------------------------------*
   INTERFACE  cf_tai64.mli
 
-  Copyright (c) 2003, James H. Woodyatt
+  Copyright (c) 2003-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without