OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_ut_sa.h versions 1.7 and 1.8
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_ut_sa.h 1.7 -> 1.8

--- l2_ut_sa.h   2001/09/14 19:06:40     1.7
+++ l2_ut_sa.h   2001/10/02 14:11:51     1.8
@@ -30,16 +30,59 @@
 #ifndef __SA_H__
 #define __SA_H__
 
+/* system definitions of "size_t", "socklen_t", "struct sockaddr" */
 #include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 
-struct sa_st;
-typedef struct sa_st sa_t;
+/* embedding support */
+#ifdef SA_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __SA_CONCAT(x,y) x ## y
+#define SA_CONCAT(x,y) __SA_CONCAT(x,y)
+#else
+#define __SA_CONCAT(x) x
+#define SA_CONCAT(x,y) __SA_CONCAT(x)y
+#endif
+#define sa_addr_st   SA_CONCAT(SA_PREFIX,sa_addr_st)
+#define sa_addr_t    SA_CONCAT(SA_PREFIX,sa_addr_t)
+#define sa_rc_t      SA_CONCAT(SA_PREFIX,sa_rc_t)
+#define sa_st        SA_CONCAT(SA_PREFIX,sa_st)
+#define sa_t         SA_CONCAT(SA_PREFIX,sa_t)
+#define sa_u2a       SA_CONCAT(SA_PREFIX,sa_u2a)
+#define sa_s2a       SA_CONCAT(SA_PREFIX,sa_s2a)
+#define sa_a2u       SA_CONCAT(SA_PREFIX,sa_a2u)
+#define sa_a2s       SA_CONCAT(SA_PREFIX,sa_a2s)
+#define sa_create    SA_CONCAT(SA_PREFIX,sa_create)
+#define sa_destroy   SA_CONCAT(SA_PREFIX,sa_destroy)
+#define sa_timeout   SA_CONCAT(SA_PREFIX,sa_timeout)
+#define sa_buffers   SA_CONCAT(SA_PREFIX,sa_buffers)
+#define sa_bind      SA_CONCAT(SA_PREFIX,sa_bind)
+#define sa_connect   SA_CONCAT(SA_PREFIX,sa_connect)
+#define sa_listen    SA_CONCAT(SA_PREFIX,sa_listen)
+#define sa_accept    SA_CONCAT(SA_PREFIX,sa_accept)
+#define sa_getremote SA_CONCAT(SA_PREFIX,sa_getremote)
+#define sa_getlocal  SA_CONCAT(SA_PREFIX,sa_getlocal)
+#define sa_getfd     SA_CONCAT(SA_PREFIX,sa_getfd)
+#define sa_shutdown  SA_CONCAT(SA_PREFIX,sa_shutdown)
+#define sa_read      SA_CONCAT(SA_PREFIX,sa_read)
+#define sa_readfrom  SA_CONCAT(SA_PREFIX,sa_readfrom)
+#define sa_readline  SA_CONCAT(SA_PREFIX,sa_readline)
+#define sa_write     SA_CONCAT(SA_PREFIX,sa_write)
+#define sa_writeto   SA_CONCAT(SA_PREFIX,sa_writeto)
+#define sa_printf    SA_CONCAT(SA_PREFIX,sa_printf)
+#define sa_flush     SA_CONCAT(SA_PREFIX,sa_flush)
+#endif
 
+/* socket address abstraction object type */
 struct sa_addr_st;
 typedef struct sa_addr_st sa_addr_t;
 
+/* socket abstraction object type */
+struct sa_st;
+typedef struct sa_st sa_t;
+
+/* return codes */
 typedef enum {
     SA_OK,
     SA_ERR_ARG,
@@ -70,6 +113,7 @@
 sa_rc_t sa_accept   (sa_t *sa, sa_addr_t **caddr, sa_t **csa);
 sa_rc_t sa_getremote(sa_t *sa, sa_addr_t **raddr);
 sa_rc_t sa_getlocal (sa_t *sa, sa_addr_t **laddr);
+sa_rc_t sa_getfd    (sa_t *sa, int *fd);
 sa_rc_t sa_shutdown (sa_t *sa, char *flags);
 
 /* input/output operations */

CVSTrac 2.0.1