OSSP CVS Repository

ossp - Check-in [2701]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2701
Date: 2002-Oct-30 21:22:06 (local)
2002-Oct-30 20:22:06 (UTC)
User:rse
Branch:
Comment: API Cleanups: use politically correct use "extern" keyword in sa.h; use leading underscores for variables names in prototypes; move "raddr" argument to second position in sa_{send,recv,sendf}.
Tickets:
Inspections:
Files:
ossp-pkg/sa/ChangeLog      1.5 -> 1.6     7 inserted, 0 deleted
ossp-pkg/sa/sa.c      1.65 -> 1.66     3 inserted, 3 deleted
ossp-pkg/sa/sa.h      1.33 -> 1.34     31 inserted, 31 deleted
ossp-pkg/sa/sa.pod      1.36 -> 1.37     2 inserted, 2 deleted
ossp-pkg/sa/sa_test.c      1.20 -> 1.21     2 inserted, 2 deleted

ossp-pkg/sa/ChangeLog 1.5 -> 1.6

--- ChangeLog    2002/10/30 19:15:59     1.5
+++ ChangeLog    2002/10/30 20:22:06     1.6
@@ -11,6 +11,13 @@
   This is a list of all changes to OSSP sa.
   For a more brief summary please have a look at the NEWS file.
 
+  Changes between 0.9.3 and x.x.x (30-Oct-2002 to xx-Nov-2002)
+
+   o API Cleanups: use politically correct use "extern" keyword in sa.h;
+     use leading underscores for variables names in prototypes; move
+     "raddr" argument to second position in sa_{send,recv,sendf}.
+     [Ralf S. Engelschall]
+
   Changes between 0.9.2 and 0.9.3 (11-Oct-2002 to 30-Oct-2002)
 
    o Added a function sa_sendf(3) which is a convience wrapper


ossp-pkg/sa/sa.c 1.65 -> 1.66

--- sa.c 2002/10/30 19:09:35     1.65
+++ sa.c 2002/10/30 20:22:06     1.66
@@ -2076,7 +2076,7 @@
 }
 
 /* receive data via socket */
-sa_rc_t sa_recv(sa_t *sa, char *buf, size_t buflen, size_t *bufdone, sa_addr_t **raddr)
+sa_rc_t sa_recv(sa_t *sa, sa_addr_t **raddr, char *buf, size_t buflen, size_t *bufdone)
 {
     sa_rc_t rv;
     union {
@@ -2138,7 +2138,7 @@
 }
 
 /* send data via socket */
-sa_rc_t sa_send(sa_t *sa, const char *buf, size_t buflen, size_t *bufdone, sa_addr_t *raddr)
+sa_rc_t sa_send(sa_t *sa, sa_addr_t *raddr, const char *buf, size_t buflen, size_t *bufdone)
 {
     size_t n;
     fd_set fds;
@@ -2214,7 +2214,7 @@
     va_end(ap);
 
     /* pass-through to sa_send() */
-    rv = sa_send(sa, cpBuf, nBuf, NULL, raddr);
+    rv = sa_send(sa, raddr, cpBuf, nBuf, NULL);
 
     /* cleanup dynamically allocated buffer */
     if ((nBuf+1) > sizeof(caBuf))


ossp-pkg/sa/sa.h 1.33 -> 1.34

--- sa.h 2002/10/30 19:09:35     1.33
+++ sa.h 2002/10/30 20:22:06     1.34
@@ -159,51 +159,51 @@
 extern const char sa_id[];
 
 /* address object operations */
-sa_rc_t sa_addr_create  (sa_addr_t **saa);
-sa_rc_t sa_addr_destroy (sa_addr_t *saa);
+extern sa_rc_t sa_addr_create  (sa_addr_t **__saa);
+extern sa_rc_t sa_addr_destroy (sa_addr_t  *__saa);
 
 /* address operations */
-sa_rc_t sa_addr_u2a     (sa_addr_t *saa, const char *uri, ...);
-sa_rc_t sa_addr_s2a     (sa_addr_t *saa, const struct sockaddr *sabuf, socklen_t salen);
-sa_rc_t sa_addr_a2u     (sa_addr_t *saa, char **uri);
-sa_rc_t sa_addr_a2s     (sa_addr_t *saa, struct sockaddr **sabuf, socklen_t *salen);
-sa_rc_t sa_addr_match   (sa_addr_t *saa1, sa_addr_t *saa2, int prefixlen);
+extern sa_rc_t sa_addr_u2a     (sa_addr_t  *__saa, const char *__uri, ...);
+extern sa_rc_t sa_addr_s2a     (sa_addr_t  *__saa, const struct sockaddr *__sabuf, socklen_t __salen);
+extern sa_rc_t sa_addr_a2u     (sa_addr_t  *__saa, char **__uri);
+extern sa_rc_t sa_addr_a2s     (sa_addr_t  *__saa, struct sockaddr **__sabuf, socklen_t *__salen);
+extern sa_rc_t sa_addr_match   (sa_addr_t  *__saa1, sa_addr_t *__saa2, int __prefixlen);
 
 /* socket object operations */
-sa_rc_t sa_create       (sa_t **sa);
-sa_rc_t sa_destroy      (sa_t *sa);
+extern sa_rc_t sa_create       (sa_t **__sa);
+extern sa_rc_t sa_destroy      (sa_t  *__sa);
 
 /* socket parameter operations */
-sa_rc_t sa_type         (sa_t *sa, sa_type_t type);
-sa_rc_t sa_timeout      (sa_t *sa, sa_timeout_t id, long sec, long usec);
-sa_rc_t sa_buffer       (sa_t *sa, sa_buffer_t  id, size_t size);
-sa_rc_t sa_option       (sa_t *sa, sa_option_t  id, ...);
-sa_rc_t sa_syscall      (sa_t *sa, sa_syscall_t id, void (*fptr)(), void *fctx);
+extern sa_rc_t sa_type         (sa_t  *__sa, sa_type_t    __id);
+extern sa_rc_t sa_timeout      (sa_t  *__sa, sa_timeout_t __id, long __sec, long __usec);
+extern sa_rc_t sa_buffer       (sa_t  *__sa, sa_buffer_t  __id, size_t __size);
+extern sa_rc_t sa_option       (sa_t  *__sa, sa_option_t  __id, ...);
+extern sa_rc_t sa_syscall      (sa_t  *__sa, sa_syscall_t __id, void (*__fptr)(), void *__fctx);
 
 /* socket connection operations */
-sa_rc_t sa_bind         (sa_t *sa, sa_addr_t *laddr);
-sa_rc_t sa_connect      (sa_t *sa, sa_addr_t *raddr);
-sa_rc_t sa_listen       (sa_t *sa, int backlog);
-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);
+extern sa_rc_t sa_bind         (sa_t  *__sa, sa_addr_t  *__laddr);
+extern sa_rc_t sa_connect      (sa_t  *__sa, sa_addr_t  *__raddr);
+extern sa_rc_t sa_listen       (sa_t  *__sa, int __backlog);
+extern sa_rc_t sa_accept       (sa_t  *__sa, sa_addr_t **__caddr, sa_t **__csa);
+extern sa_rc_t sa_getremote    (sa_t  *__sa, sa_addr_t **__raddr);
+extern sa_rc_t sa_getlocal     (sa_t  *__sa, sa_addr_t **__laddr);
+extern sa_rc_t sa_getfd        (sa_t  *__sa, int *__fd);
+extern sa_rc_t sa_shutdown     (sa_t  *__sa, char *__flags);
 
 /* socket input/output operations (stream communication) */
-sa_rc_t sa_read         (sa_t *sa, char *buf, size_t buflen, size_t *bufdone);
-sa_rc_t sa_readln       (sa_t *sa, char *buf, size_t buflen, size_t *bufdone);
-sa_rc_t sa_write        (sa_t *sa, const char *buf, size_t buflen, size_t *bufdone);
-sa_rc_t sa_writef       (sa_t *sa, const char *fmt, ...);
-sa_rc_t sa_flush        (sa_t *sa);
+extern sa_rc_t sa_read         (sa_t  *__sa, char       *__buf, size_t __buflen, size_t *__bufdone);
+extern sa_rc_t sa_readln       (sa_t  *__sa, char       *__buf, size_t __buflen, size_t *__bufdone);
+extern sa_rc_t sa_write        (sa_t  *__sa, const char *__buf, size_t __buflen, size_t *__bufdone);
+extern sa_rc_t sa_writef       (sa_t  *__sa, const char *__fmt, ...);
+extern sa_rc_t sa_flush        (sa_t  *__sa);
 
 /* socket input/output operations (datagram communication) */
-sa_rc_t sa_recv         (sa_t *sa, char *buf, size_t buflen, size_t *bufdone, sa_addr_t **raddr);
-sa_rc_t sa_send         (sa_t *sa, const char *buf, size_t buflen, size_t *bufdone, sa_addr_t *raddr);
-sa_rc_t sa_sendf        (sa_t *sa, sa_addr_t *raddr, const char *fmt, ...);
+extern sa_rc_t sa_recv         (sa_t  *__sa, sa_addr_t **__raddr, char       *__buf, size_t __buflen, size_t *__bufdone);
+extern sa_rc_t sa_send         (sa_t  *__sa, sa_addr_t  *__raddr, const char *__buf, size_t __buflen, size_t *__bufdone);
+extern sa_rc_t sa_sendf        (sa_t  *__sa, sa_addr_t  *__raddr, const char *__fmt, ...);
 
 /* error handling operations */
-char   *sa_error        (sa_rc_t rv);
+extern char   *sa_error        (sa_rc_t __rv);
 
 /* cleanup */
 #if defined(HAVE_CONFIG_H) && !defined(HAVE_SOCKLEN_T)


ossp-pkg/sa/sa.pod 1.36 -> 1.37

--- sa.pod       2002/10/30 19:09:35     1.36
+++ sa.pod       2002/10/30 20:22:06     1.37
@@ -754,7 +754,7 @@
 
 =over 4
 
-=item sa_rc_t B<sa_recv>(sa_t *I<sa>, char *I<buf>, size_t I<buflen>, size_t *I<bufdone>, sa_addr_t **I<raddr>);
+=item sa_rc_t B<sa_recv>(sa_t *I<sa>, sa_addr_t **I<raddr>, char *I<buf>, size_t I<buflen>, size_t *I<bufdone>);
 
 Receive a chunk of data from remote address via socket into own buffer.
 
@@ -765,7 +765,7 @@
 
 Example: C<char buf[1024]; size_t n; sa_recv(sa, buf, sizeof(buf), &n, saa);>
 
-=item sa_rc_t B<sa_send>(sa_t *I<sa>, const char *I<buf>, size_t I<buflen>, size_t *I<bufdone>, sa_addr_t *I<raddr>);
+=item sa_rc_t B<sa_send>(sa_t *I<sa>, sa_addr_t *I<raddr>, const char *I<buf>, size_t I<buflen>, size_t *I<bufdone>);
 
 Send a chunk of data to remote address via socket from own buffer.
 


ossp-pkg/sa/sa_test.c 1.20 -> 1.21

--- sa_test.c    2002/10/30 19:09:35     1.20
+++ sa_test.c    2002/10/30 20:22:06     1.21
@@ -285,7 +285,7 @@
         ex(SRV, sa_bind(sa_srv, saa_srv));
 
         /* communicate with client */
-        ex(SRV, sa_recv(sa_srv, buf_srv, sizeof(buf_srv), &l, &saa_clt));
+        ex(SRV, sa_recv(sa_srv, &saa_clt, buf_srv, sizeof(buf_srv), &l));
         if (strncmp(buf_srv, MSG_UDP_CLT_REQUEST, l) != 0)
             ts_test_fail(TS_CTX, "server: got \"%s\", expected \"%s\"",
                          buf_srv, MSG_UDP_CLT_REQUEST);
@@ -312,7 +312,7 @@
         ex(CLT, sa_addr_u2a(saa_srv, "inet://127.0.0.1:12345#udp"));
         ex(CLT, sa_sendf(sa_clt, saa_srv, "%s", MSG_UDP_CLT_REQUEST));
         ex(CLT, sa_addr_destroy(saa_srv));
-        ex(CLT, sa_recv(sa_clt, buf_clt, sizeof(buf_clt), &l, &saa_srv));
+        ex(CLT, sa_recv(sa_clt, &saa_srv, buf_clt, sizeof(buf_clt), &l));
         if (strncmp(buf_clt, MSG_UDP_SRV_RESPONSE, l) != 0)
             ts_test_fail(TS_CTX, "client: got \"%s\", expected \"%s\"",
                          buf_clt, MSG_UDP_SRV_RESPONSE);

CVSTrac 2.0.1