diff network.h @ 564:6e5789cbb4d4

Change network layer error/info message passing API to pass direct strings instead of fmt+ap varargs in the connection context callback functions. Also rename the callback functions in the main program.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 15 Nov 2012 20:27:44 +0200
parents 52c56ada3816
children 97a49a6cc959
line wrap: on
line diff
--- a/network.h	Thu Nov 15 20:26:10 2012 +0200
+++ b/network.h	Thu Nov 15 20:27:44 2012 +0200
@@ -91,8 +91,8 @@
     struct in_addr addr;
     fd_set sockfds;
 
-    void (*errfunc)(struct _nn_conn_t *conn, const char *fmt, va_list ap);
-    void (*msgfunc)(struct _nn_conn_t *conn, const char *fmt, va_list ap);
+    void (*errfunc)(struct _nn_conn_t *conn, const char *msg);
+    void (*msgfunc)(struct _nn_conn_t *conn, const char *msg);
 
     int err;
     int status;
@@ -109,8 +109,8 @@
 
 struct hostent *nn_resolve_host(nn_conn_t *conn, const char *name);
 nn_conn_t * nn_conn_new(
-    void (*errfunc)(nn_conn_t *conn, const char *fmt, va_list ap),
-    void (*msgfunc)(nn_conn_t *conn, const char *fmt, va_list ap));
+    void (*errfunc)(nn_conn_t *conn, const char *msg),
+    void (*msgfunc)(nn_conn_t *conn, const char *msg));
 
 int         nn_conn_set_proxy(nn_conn_t *conn, int type, int port, const char *host);
 int         nn_conn_open(nn_conn_t *conn, const int port, const char *host);