summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/skaclient.h2
-rw-r--r--src/include/skalibs/unixmessage.h12
2 files changed, 11 insertions, 3 deletions
diff --git a/src/include/skalibs/skaclient.h b/src/include/skalibs/skaclient.h
index 602adce..86662c2 100644
--- a/src/include/skalibs/skaclient.h
+++ b/src/include/skalibs/skaclient.h
@@ -17,7 +17,7 @@ extern int skaclient_server_ack (unixmessage_t const *, unixmessage_sender_t *,
extern int skaclient_server_bidi_ack (unixmessage_t const *, unixmessage_sender_t *, unixmessage_sender_t *, unixmessage_receiver_t *, char *, unsigned int, char *, unsigned int, char const *, unsigned int, char const *, unsigned int) ;
extern int skaclient_server_init (unixmessage_receiver_t *, unixmessage_sender_t *, unixmessage_sender_t *, char const *, unsigned int, char const *, unsigned int, tain_t const *, tain_t *) ;
#define skaclient_server_init_g(in, out, asyncout, before, beforelen, after, afterlen, deadline) skaclient_server_init(in, out, asyncout, before, beforelen, after, afterlen, (deadline), &STAMP)
-extern int skaclient_server_01x_init (char const *, unsigned int, char const *, unsigned int, tain_t const *, tain_t *) ;
+#define skaclient_server_01x_init(before, beforelen, after, afterlen, deadline, stamp) skaclient_server_init(unixmessage_receiver_0, unixmessage_sender_1, unixmessage_sender_x, before, beforelen, after, afterlen, deadline, stamp)
#define skaclient_server_01x_init_g(before, beforelen, after, afterlen, deadline) skaclient_server_01x_init(before, beforelen, after, afterlen, (deadline), &STAMP)
diff --git a/src/include/skalibs/unixmessage.h b/src/include/skalibs/unixmessage.h
index 58c11eb..d603a86 100644
--- a/src/include/skalibs/unixmessage.h
+++ b/src/include/skalibs/unixmessage.h
@@ -90,7 +90,16 @@ struct unixmessage_receiver_s
unsigned int auxw ;
} ;
#define UNIXMESSAGE_RECEIVER_ZERO { .mainb = BUFFER_ZERO, .auxb = CBUFFER_ZERO, .mainlen = 0, .auxlen = 0, .data = STRALLOC_ZERO, .fds = { -1 }, .auxw = 0 }
-
+#define UNIXMESSAGE_RECEIVER_INIT(var, fd, s, n, auxs, auxn) \
+{ \
+ .mainb = BUFFER_INIT_AUX(&unixmessage_read, fd, s, n, &(var).auxb), \
+ .auxb = CBUFFER_INIT(auxs, auxn), \
+ .mainlen = 0, \
+ .auxlen = 0, \
+ .data = STRALLOC_ZERO, \
+ .auxw = 0 \
+}
+#define UNIXMESSAGE_RECEIVER_DECLARE_AND_INIT(var, fd, s, n, auxs, auxn) unixmessage_receiver_t var = UNIXMESSAGE_RECEIVER_INIT(var, fd, s, n, auxs, auxn)
extern int unixmessage_receiver_init (unixmessage_receiver_t *, int, char *, unsigned int, char *, unsigned int) ;
extern void unixmessage_receiver_free (unixmessage_receiver_t *) ;
#define unixmessage_receiver_fd(b) buffer_fd(&(b)->mainb)
@@ -114,7 +123,6 @@ extern int unixmessage_timed_handle (unixmessage_receiver_t *, unixmessage_handl
extern unixmessage_receiver_t unixmessage_receiver_0_ ;
#define unixmessage_receiver_0 (&unixmessage_receiver_0_)
-extern int unixmessage_receiver_0_init (void) ;
extern unixmessage_sender_t unixmessage_sender_1_ ;
#define unixmessage_sender_1 (&unixmessage_sender_1_)