summaryrefslogtreecommitdiff
path: root/src/libunixonacid
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid')
-rw-r--r--src/libunixonacid/access_at.c3
-rw-r--r--src/libunixonacid/bufalloc_timed_flush.c4
-rw-r--r--src/libunixonacid/buffer_timed_fill.c4
-rw-r--r--src/libunixonacid/buffer_timed_flush.c4
-rw-r--r--src/libunixonacid/buffer_timed_get.c4
-rw-r--r--src/libunixonacid/dd_cancel.c14
-rw-r--r--src/libunixonacid/dd_close.c9
-rw-r--r--src/libunixonacid/dd_commit.c68
-rw-r--r--src/libunixonacid/dd_commit_devino.c14
-rw-r--r--src/libunixonacid/dd_open_read.c14
-rw-r--r--src/libunixonacid/dd_open_write.c33
-rw-r--r--src/libunixonacid/ipc_timed_recv.c4
-rw-r--r--src/libunixonacid/ipc_timed_send.c2
-rw-r--r--src/libunixonacid/ipc_timed_sendv.c2
-rw-r--r--src/libunixonacid/kolbak_call.c3
-rw-r--r--src/libunixonacid/kolbak_enqueue.c3
-rw-r--r--src/libunixonacid/kolbak_queue_init.c3
-rw-r--r--src/libunixonacid/kolbak_unenqueue.c3
-rw-r--r--src/libunixonacid/netstring_timed_get.c2
-rw-r--r--src/libunixonacid/skaclient-internal.h5
-rw-r--r--src/libunixonacid/skaclient_default_cb.c2
-rw-r--r--src/libunixonacid/skaclient_end.c2
-rw-r--r--src/libunixonacid/skaclient_init.c6
-rw-r--r--src/libunixonacid/skaclient_put.c4
-rw-r--r--src/libunixonacid/skaclient_putmsg.c2
-rw-r--r--src/libunixonacid/skaclient_putmsgv.c2
-rw-r--r--src/libunixonacid/skaclient_putv.c4
-rw-r--r--src/libunixonacid/skaclient_send.c4
-rw-r--r--src/libunixonacid/skaclient_sendmsg.c2
-rw-r--r--src/libunixonacid/skaclient_sendmsgv.c2
-rw-r--r--src/libunixonacid/skaclient_sendv.c4
-rw-r--r--src/libunixonacid/skaclient_server_ack.c4
-rw-r--r--src/libunixonacid/skaclient_server_bidi_ack.c2
-rw-r--r--src/libunixonacid/skaclient_server_init.c4
-rw-r--r--src/libunixonacid/skaclient_start.c13
-rw-r--r--src/libunixonacid/skaclient_start_async.c8
-rw-r--r--src/libunixonacid/skaclient_start_cb.c2
-rw-r--r--src/libunixonacid/skaclient_startf.c13
-rw-r--r--src/libunixonacid/skaclient_startf_async.c9
-rw-r--r--src/libunixonacid/skaclient_syncify.c3
-rw-r--r--src/libunixonacid/skaclient_zero.c2
-rw-r--r--src/libunixonacid/textclient_command.c2
-rw-r--r--src/libunixonacid/textclient_commandv.c2
-rw-r--r--src/libunixonacid/textclient_end.c3
-rw-r--r--src/libunixonacid/textclient_server_init.c2
-rw-r--r--src/libunixonacid/textclient_server_init_frompipe.c2
-rw-r--r--src/libunixonacid/textclient_server_init_fromsocket.c2
-rw-r--r--src/libunixonacid/textclient_start.c2
-rw-r--r--src/libunixonacid/textclient_startf.c2
-rw-r--r--src/libunixonacid/textclient_zero.c2
-rw-r--r--src/libunixonacid/textmessage_create_send_channel.c2
-rw-r--r--src/libunixonacid/textmessage_handle.c2
-rw-r--r--src/libunixonacid/textmessage_put.c2
-rw-r--r--src/libunixonacid/textmessage_putv.c2
-rw-r--r--src/libunixonacid/textmessage_receive.c2
-rw-r--r--src/libunixonacid/textmessage_receiver_0.c2
-rw-r--r--src/libunixonacid/textmessage_receiver_free.c2
-rw-r--r--src/libunixonacid/textmessage_receiver_hasmsginbuf.c2
-rw-r--r--src/libunixonacid/textmessage_receiver_init.c2
-rw-r--r--src/libunixonacid/textmessage_receiver_zero.c2
-rw-r--r--src/libunixonacid/textmessage_recv_channel.c2
-rw-r--r--src/libunixonacid/textmessage_sender_1.c2
-rw-r--r--src/libunixonacid/textmessage_sender_flush.c2
-rw-r--r--src/libunixonacid/textmessage_sender_getfd.c2
-rw-r--r--src/libunixonacid/textmessage_sender_timed_flush.c6
-rw-r--r--src/libunixonacid/textmessage_sender_x.c2
-rw-r--r--src/libunixonacid/textmessage_sender_zero.c2
-rw-r--r--src/libunixonacid/textmessage_timed_handle.c16
-rw-r--r--src/libunixonacid/textmessage_timed_receive.c17
-rw-r--r--src/libunixonacid/timed_flush.c2
-rw-r--r--src/libunixonacid/timed_get.c2
-rw-r--r--src/libunixonacid/timed_getln.c4
-rw-r--r--src/libunixonacid/timed_getlnmax.c4
-rw-r--r--src/libunixonacid/unixconnection_free.c2
-rw-r--r--src/libunixonacid/unixconnection_init.c2
-rw-r--r--src/libunixonacid/unixconnection_init_withclosecb.c2
-rw-r--r--src/libunixonacid/unixconnection_zero.c2
-rw-r--r--src/libunixonacid/unixmessage_drop.c2
-rw-r--r--src/libunixonacid/unixmessage_handle.c4
-rw-r--r--src/libunixonacid/unixmessage_put.c8
-rw-r--r--src/libunixonacid/unixmessage_receive.c4
-rw-r--r--src/libunixonacid/unixmessage_receiver_0.c2
-rw-r--r--src/libunixonacid/unixmessage_receiver_free.c2
-rw-r--r--src/libunixonacid/unixmessage_receiver_hasmsginbuf.c2
-rw-r--r--src/libunixonacid/unixmessage_receiver_init.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_1.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_flush.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_free.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_getfd.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_init.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_init_withclosecb.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_timed_flush.c6
-rw-r--r--src/libunixonacid/unixmessage_sender_x.c2
-rw-r--r--src/libunixonacid/unixmessage_sender_zero.c2
-rw-r--r--src/libunixonacid/unixmessage_timed_handle.c16
-rw-r--r--src/libunixonacid/unixmessage_timed_receive.c19
-rw-r--r--src/libunixonacid/unixmessage_unput.c2
-rw-r--r--src/libunixonacid/unixmessage_v_zero.c5
-rw-r--r--src/libunixonacid/unixmessage_zero.c2
-rw-r--r--src/libunixonacid/unixmessagev_zero.c5
100 files changed, 181 insertions, 318 deletions
diff --git a/src/libunixonacid/access_at.c b/src/libunixonacid/access_at.c
index 03cac7d..ebe6dd7 100644
--- a/src/libunixonacid/access_at.c
+++ b/src/libunixonacid/access_at.c
@@ -9,8 +9,10 @@
#endif
#include <skalibs/nonposix.h>
+
#include <fcntl.h>
#include <unistd.h>
+
#include <skalibs/unix-transactional.h>
int access_at (int dirfd, char const *file, int amode, unsigned int flag)
@@ -22,6 +24,7 @@ int access_at (int dirfd, char const *file, int amode, unsigned int flag)
#include <errno.h>
#include <unistd.h>
+
#include <skalibs/djbunix.h>
#include <skalibs/unix-transactional.h>
diff --git a/src/libunixonacid/bufalloc_timed_flush.c b/src/libunixonacid/bufalloc_timed_flush.c
index 7ebb70e..1f14606 100644
--- a/src/libunixonacid/bufalloc_timed_flush.c
+++ b/src/libunixonacid/bufalloc_timed_flush.c
@@ -9,7 +9,7 @@ static int bufalloc_isnonempty (bufalloc *ba)
return !!bufalloc_len(ba) ;
}
-int bufalloc_timed_flush (bufalloc *ba, tain_t const *deadline, tain_t *stamp)
+int bufalloc_timed_flush (bufalloc *ba, tain const *deadline, tain *stamp)
{
- return timed_flush(ba, (initfunc_t_ref)&bufalloc_getfd, (initfunc_t_ref)&bufalloc_isnonempty, (initfunc_t_ref)&bufalloc_flush, deadline, stamp) ;
+ return timed_flush(ba, (init_func_ref)&bufalloc_getfd, (init_func_ref)&bufalloc_isnonempty, (init_func_ref)&bufalloc_flush, deadline, stamp) ;
}
diff --git a/src/libunixonacid/buffer_timed_fill.c b/src/libunixonacid/buffer_timed_fill.c
index eb41b5b..6ec3e30 100644
--- a/src/libunixonacid/buffer_timed_fill.c
+++ b/src/libunixonacid/buffer_timed_fill.c
@@ -10,7 +10,7 @@ static ssize_t get (buffer *b)
return sanitize_read(buffer_fill(b)) ;
}
-ssize_t buffer_timed_fill (buffer *b, tain_t const *deadline, tain_t *stamp)
+ssize_t buffer_timed_fill (buffer *b, tain const *deadline, tain *stamp)
{
- return timed_get(b, (initfunc_t_ref)&buffer_getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ return timed_get(b, (init_func_ref)&buffer_getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/buffer_timed_flush.c b/src/libunixonacid/buffer_timed_flush.c
index 4de467a..d688243 100644
--- a/src/libunixonacid/buffer_timed_flush.c
+++ b/src/libunixonacid/buffer_timed_flush.c
@@ -9,7 +9,7 @@ static int buffer_isnonempty (buffer *b)
return !buffer_isempty(b) ;
}
-int buffer_timed_flush (buffer *b, tain_t const *deadline, tain_t *stamp)
+int buffer_timed_flush (buffer *b, tain const *deadline, tain *stamp)
{
- return timed_flush(b, (initfunc_t_ref)&buffer_getfd, (initfunc_t_ref)&buffer_isnonempty, (initfunc_t_ref)&buffer_flush, deadline, stamp) ;
+ return timed_flush(b, (init_func_ref)&buffer_getfd, (init_func_ref)&buffer_isnonempty, (init_func_ref)&buffer_flush, deadline, stamp) ;
}
diff --git a/src/libunixonacid/buffer_timed_get.c b/src/libunixonacid/buffer_timed_get.c
index 8dee2c2..e87c956 100644
--- a/src/libunixonacid/buffer_timed_get.c
+++ b/src/libunixonacid/buffer_timed_get.c
@@ -22,9 +22,9 @@ static ssize_t get (struct blah_s *blah)
return buffer_getall(blah->b, blah->s, blah->len, &blah->w) ;
}
-size_t buffer_timed_get (buffer *b, char *s, size_t len, tain_t const *deadline, tain_t *stamp)
+size_t buffer_timed_get (buffer *b, char *s, size_t len, tain const *deadline, tain *stamp)
{
struct blah_s blah = { .b = b, .s = s, .len = len, .w = 0 } ;
- timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ timed_get(&blah, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
return blah.w ;
}
diff --git a/src/libunixonacid/dd_cancel.c b/src/libunixonacid/dd_cancel.c
deleted file mode 100644
index 34b6014..0000000
--- a/src/libunixonacid/dd_cancel.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* ISC license. */
-
-#include <skalibs/stralloc.h>
-#include <skalibs/djbunix.h>
-#include <skalibs/unix-transactional.h>
-
-void dd_cancel (dirdescriptor_t *dd)
-{
- dirdescriptor_t zero = DIRDESCRIPTOR_ZERO ;
- fd_close(dd->fd) ;
- rm_rf_in_tmp(&dd->new, 0) ;
- stralloc_free(&dd->new) ;
- *dd = zero ;
-}
diff --git a/src/libunixonacid/dd_close.c b/src/libunixonacid/dd_close.c
deleted file mode 100644
index be5bdd9..0000000
--- a/src/libunixonacid/dd_close.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* ISC license. */
-
-#include <skalibs/djbunix.h>
-#include <skalibs/unix-transactional.h>
-
-void dd_close (dirdescriptor_t *dd)
-{
- fd_close(dd->fd) ;
-}
diff --git a/src/libunixonacid/dd_commit.c b/src/libunixonacid/dd_commit.c
deleted file mode 100644
index 1c940d2..0000000
--- a/src/libunixonacid/dd_commit.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ISC license. */
-
-#include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <skalibs/stralloc.h>
-#include <skalibs/djbunix.h>
-#include <skalibs/random.h>
-#include <skalibs/unix-transactional.h>
-
-static char const *mybasename (char const *s, size_t len)
-{
- size_t i = len ;
- while (i--) if (s[i] == '/') return s + i + 1 ;
- return s ;
-}
-
-int dd_commit (dirdescriptor_t *dd)
-{
- dirdescriptor_t zero = DIRDESCRIPTOR_ZERO ;
- size_t len = strlen(dd->lnkfn) ;
- size_t oldbase = dd->new.len ;
- size_t newlnkbase ;
- char const *lnkbn = mybasename(dd->lnkfn, len) ;
- if (!sadirname(&dd->new, dd->lnkfn, len)) return 0 ;
- if (!stralloc_catb(&dd->new, "/", 1)) goto fail ;
- if (sareadlink(&dd->new, dd->lnkfn) < 0)
- {
- size_t lnkbnbase = dd->new.len ;
- if (errno != EINVAL) goto fail ;
- if (!stralloc_cats(&dd->new, lnkbn)) goto fail ;
- if (!random_sauniquename(&dd->new, 8)) goto fail ;
- if (!stralloc_0(&dd->new)) goto fail ;
- if (rename(dd->lnkfn, dd->new.s + oldbase) < 0) goto fail ;
- /* /!\ race condition right here: there's no lnkfn in the fs */
- if (symlink(dd->new.s + lnkbnbase, dd->lnkfn) < 0) /* now that's VERY BAD if it fails */
- {
- int e = errno ;
- rename(dd->new.s + oldbase, dd->lnkfn) ; /* attempt to revert to initial situation */
- errno = e ;
- goto fail ; /* and hope for the best */
- }
- }
- if (!stralloc_0(&dd->new)) goto fail ;
- newlnkbase = dd->new.len ;
- if (!stralloc_catb(&dd->new, dd->lnkfn, len)) goto fail ;
- if (!random_sauniquename(&dd->new, 8)) goto fail ;
- if (!stralloc_0(&dd->new)) goto fail ;
- if (symlink(dd->new.s, dd->new.s + newlnkbase) < 0) goto fail ;
- if (rename(dd->new.s + newlnkbase, dd->lnkfn) < 0)
- {
- int e = errno ;
- unlink(dd->new.s + newlnkbase) ;
- errno = e ;
- goto fail ;
- }
- fd_close(dd->fd) ;
- dd->new.len = newlnkbase ;
- rm_rf_in_tmp(&dd->new, oldbase) ;
- stralloc_free(&dd->new) ;
- *dd = zero ;
- return 1 ;
-
- fail:
- dd->new.len = oldbase ;
- return 0 ;
-}
diff --git a/src/libunixonacid/dd_commit_devino.c b/src/libunixonacid/dd_commit_devino.c
deleted file mode 100644
index 96713fe..0000000
--- a/src/libunixonacid/dd_commit_devino.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* ISC license. */
-
-#include <sys/stat.h>
-#include <skalibs/unix-transactional.h>
-
-int dd_commit_devino (dirdescriptor_t *dd, dev_t *dev, ino_t *ino)
-{
- struct stat st ;
- if (fstat(dd->fd, &st) < 0) return 0 ;
- if (!dd_commit(dd)) return 0 ;
- *dev = st.st_dev ;
- *ino = st.st_ino ;
- return 1 ;
-}
diff --git a/src/libunixonacid/dd_open_read.c b/src/libunixonacid/dd_open_read.c
deleted file mode 100644
index 9189582..0000000
--- a/src/libunixonacid/dd_open_read.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* ISC license. */
-
-#include <skalibs/djbunix.h>
-#include <skalibs/unix-transactional.h>
-
-int dd_open_read (dirdescriptor_t *dd, char const *path)
-{
- dirdescriptor_t d = DIRDESCRIPTOR_ZERO ;
- d.fd = open_read(path) ;
- if (d.fd < 0) return 0 ;
- d.lnkfn = path ;
- *dd = d ;
- return 1 ;
-}
diff --git a/src/libunixonacid/dd_open_write.c b/src/libunixonacid/dd_open_write.c
deleted file mode 100644
index fbaf28e..0000000
--- a/src/libunixonacid/dd_open_write.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ISC license. */
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <skalibs/stralloc.h>
-#include <skalibs/djbunix.h>
-#include <skalibs/random.h>
-#include <skalibs/unix-transactional.h>
-
-int dd_open_write (dirdescriptor_t *dd, char const *lnkfn, unsigned int mode)
-{
- dirdescriptor_t d = DIRDESCRIPTOR_ZERO ;
- d.lnkfn = lnkfn ;
- if (!stralloc_cats(&d.new, lnkfn)) return 0 ;
- if (!random_sauniquename(&d.new, 8)) goto fail ;
- if (!stralloc_0(&d.new)) goto fail ;
- if (mkdir(d.new.s, mode) < 0) goto fail ;
- d.fd = open_read(d.new.s) ;
- if (d.fd < 0)
- {
- int e = errno ;
- rmdir(d.new.s) ;
- errno = e ;
- goto fail ;
- }
- *dd = d ;
- return 1 ;
-
- fail:
- stralloc_free(&d.new) ;
- return 0 ;
-}
diff --git a/src/libunixonacid/ipc_timed_recv.c b/src/libunixonacid/ipc_timed_recv.c
index 5710a8c..d108f5d 100644
--- a/src/libunixonacid/ipc_timed_recv.c
+++ b/src/libunixonacid/ipc_timed_recv.c
@@ -23,8 +23,8 @@ static ssize_t get (struct blah_s *blah)
return sanitize_read(ipc_recv(blah->fd, blah->s, blah->len, blah->path)) ;
}
-ssize_t ipc_timed_recv (int fd, char *s, size_t len, char *path, tain_t const *deadline, tain_t *stamp)
+ssize_t ipc_timed_recv (int fd, char *s, size_t len, char *path, tain const *deadline, tain *stamp)
{
struct blah_s blah = { .fd = fd, .s = s, .len = len, .path = path } ;
- return timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ return timed_get(&blah, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/ipc_timed_send.c b/src/libunixonacid/ipc_timed_send.c
index 2f6ce88..d4a4d7b 100644
--- a/src/libunixonacid/ipc_timed_send.c
+++ b/src/libunixonacid/ipc_timed_send.c
@@ -10,7 +10,7 @@
#include <skalibs/unix-timed.h>
#include <skalibs/posixishard.h>
-int ipc_timed_send (int fd, char const *s, size_t len, tain_t const *deadline, tain_t *stamp)
+int ipc_timed_send (int fd, char const *s, size_t len, tain const *deadline, tain *stamp)
{
iopause_fd x = { .fd = fd, .events = IOPAUSE_WRITE, .revents = 0 } ;
for (;;)
diff --git a/src/libunixonacid/ipc_timed_sendv.c b/src/libunixonacid/ipc_timed_sendv.c
index 1bdae5b..673503d 100644
--- a/src/libunixonacid/ipc_timed_sendv.c
+++ b/src/libunixonacid/ipc_timed_sendv.c
@@ -11,7 +11,7 @@
#include <skalibs/unix-timed.h>
#include <skalibs/posixishard.h>
-int ipc_timed_sendv (int fd, struct iovec const *v, unsigned int n, tain_t const *deadline, tain_t *stamp)
+int ipc_timed_sendv (int fd, struct iovec const *v, unsigned int n, tain const *deadline, tain *stamp)
{
struct msghdr hdr =
{
diff --git a/src/libunixonacid/kolbak_call.c b/src/libunixonacid/kolbak_call.c
index b7b97c0..fce2add 100644
--- a/src/libunixonacid/kolbak_call.c
+++ b/src/libunixonacid/kolbak_call.c
@@ -1,10 +1,11 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/unixmessage.h>
#include <skalibs/kolbak.h>
-int kolbak_call (unixmessage_t const *m, kolbak_queue_t *q)
+int kolbak_call (unixmessage const *m, kolbak_queue *q)
{
if (q->head == q->tail) return (errno = EILSEQ, 0) ;
if (!(*q->x[q->head].f)(m, q->x[q->head].data)) return 0 ;
diff --git a/src/libunixonacid/kolbak_enqueue.c b/src/libunixonacid/kolbak_enqueue.c
index 0838e99..7a7b619 100644
--- a/src/libunixonacid/kolbak_enqueue.c
+++ b/src/libunixonacid/kolbak_enqueue.c
@@ -2,10 +2,11 @@
#include <sys/types.h>
#include <errno.h>
+
#include <skalibs/kolbak.h>
#include <skalibs/unixmessage.h>
-int kolbak_enqueue (kolbak_queue_t *q, unixmessage_handler_func_t *f, void *data)
+int kolbak_enqueue (kolbak_queue *q, unixmessage_handler_func_ref f, void *data)
{
size_t newtail = (q->tail + 1) % q->n ;
if (newtail == q->head) return (errno = ENOBUFS, 0) ;
diff --git a/src/libunixonacid/kolbak_queue_init.c b/src/libunixonacid/kolbak_queue_init.c
index a6c8fa5..b8c9b42 100644
--- a/src/libunixonacid/kolbak_queue_init.c
+++ b/src/libunixonacid/kolbak_queue_init.c
@@ -1,9 +1,10 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/kolbak.h>
-int kolbak_queue_init (kolbak_queue_t *q, kolbak_closure_t *s, size_t len)
+int kolbak_queue_init (kolbak_queue *q, kolbak_closure *s, size_t len)
{
if (len < 2) return (errno = EINVAL, 0) ;
q->x = s ;
diff --git a/src/libunixonacid/kolbak_unenqueue.c b/src/libunixonacid/kolbak_unenqueue.c
index 894beea..07ad8ea 100644
--- a/src/libunixonacid/kolbak_unenqueue.c
+++ b/src/libunixonacid/kolbak_unenqueue.c
@@ -1,9 +1,10 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/kolbak.h>
-int kolbak_unenqueue (kolbak_queue_t *q)
+int kolbak_unenqueue (kolbak_queue *q)
{
if (q->head == q->tail) return (errno = EINVAL, 0) ;
q->tail = (q->tail + q->n - 1) % q->n ;
diff --git a/src/libunixonacid/netstring_timed_get.c b/src/libunixonacid/netstring_timed_get.c
index c540a3f..106bbbd 100644
--- a/src/libunixonacid/netstring_timed_get.c
+++ b/src/libunixonacid/netstring_timed_get.c
@@ -6,7 +6,7 @@
#include <skalibs/iopause.h>
#include <skalibs/unix-timed.h>
-int netstring_timed_get (buffer *b, stralloc *sa, tain_t const *deadline, tain_t *stamp)
+int netstring_timed_get (buffer *b, stralloc *sa, tain const *deadline, tain *stamp)
{
iopause_fd x = { .fd = buffer_fd(b), .events = IOPAUSE_READ } ;
size_t w = 0 ;
diff --git a/src/libunixonacid/skaclient-internal.h b/src/libunixonacid/skaclient-internal.h
index b26152b..7828879 100644
--- a/src/libunixonacid/skaclient-internal.h
+++ b/src/libunixonacid/skaclient-internal.h
@@ -4,11 +4,12 @@
#define SKACLIENT_INTERNAL_H
#include <sys/types.h>
+
#include <skalibs/kolbak.h>
#include <skalibs/unixmessage.h>
#include <skalibs/skaclient.h>
-extern int skaclient_init (skaclient_t *, int, char *, size_t, char *, size_t, char *, size_t, char *, size_t, kolbak_closure_t *, size_t, char const *, size_t) ;
-extern int skaclient_start_cb (unixmessage_t const *, skaclient_cbdata_t *) ;
+extern int skaclient_init (skaclient *, int, char *, size_t, char *, size_t, char *, size_t, char *, size_t, kolbak_closure *, size_t, char const *, size_t) ;
+extern int skaclient_start_cb (unixmessage const *, skaclient_cbdata *) ;
#endif
diff --git a/src/libunixonacid/skaclient_default_cb.c b/src/libunixonacid/skaclient_default_cb.c
index 447d796..87fe62b 100644
--- a/src/libunixonacid/skaclient_default_cb.c
+++ b/src/libunixonacid/skaclient_default_cb.c
@@ -6,7 +6,7 @@
#include <skalibs/unixmessage.h>
#include <skalibs/posixishard.h>
-int skaclient_default_cb (unixmessage_t const *m, void *p)
+int skaclient_default_cb (unixmessage const *m, void *p)
{
unsigned char *err = p ;
if (m->len != 1 || m->nfds) return (errno = EPROTO, 0) ;
diff --git a/src/libunixonacid/skaclient_end.c b/src/libunixonacid/skaclient_end.c
index 1b24303..2fd39ab 100644
--- a/src/libunixonacid/skaclient_end.c
+++ b/src/libunixonacid/skaclient_end.c
@@ -5,7 +5,7 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-void skaclient_end (skaclient_t *a)
+void skaclient_end (skaclient *a)
{
fd_close(a->syncout.fd) ;
fd_close(a->asyncout.fd) ;
diff --git a/src/libunixonacid/skaclient_init.c b/src/libunixonacid/skaclient_init.c
index a1cda0a..8419fc6 100644
--- a/src/libunixonacid/skaclient_init.c
+++ b/src/libunixonacid/skaclient_init.c
@@ -5,7 +5,7 @@
#include "skaclient-internal.h"
int skaclient_init (
- skaclient_t *a,
+ skaclient *a,
int fd,
char *bufss,
size_t bufsn,
@@ -15,12 +15,12 @@ int skaclient_init (
size_t bufan,
char *auxbufas,
size_t auxbufan,
- kolbak_closure_t *q,
+ kolbak_closure *q,
size_t qlen,
char const *before,
size_t beforelen)
{
- unixmessage_t msg = { .s = (char *)before, .len = beforelen, .fds = 0, .nfds = 0 } ;
+ unixmessage msg = { .s = (char *)before, .len = beforelen, .fds = 0, .nfds = 0 } ;
if (!unixmessage_receiver_init(&a->syncin, fd, bufss, bufsn, auxbufss, auxbufsn)
|| !unixmessage_receiver_init(&a->asyncin, -1, bufas, bufan, auxbufas, auxbufan)
|| !kolbak_queue_init(&a->kq, q, qlen)) return 0 ;
diff --git a/src/libunixonacid/skaclient_put.c b/src/libunixonacid/skaclient_put.c
index 214d013..35b85e9 100644
--- a/src/libunixonacid/skaclient_put.c
+++ b/src/libunixonacid/skaclient_put.c
@@ -3,8 +3,8 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_put (skaclient_t *a, char const *s, size_t len, unixmessage_handler_func_t *cb, void *result)
+int skaclient_put (skaclient *a, char const *s, size_t len, unixmessage_handler_func *cb, void *result)
{
- unixmessage_t m = { .s = (char *)s, .len = len, .fds = 0, .nfds = 0 } ;
+ unixmessage m = { .s = (char *)s, .len = len, .fds = 0, .nfds = 0 } ;
return skaclient_putmsg(a, &m, cb, result) ;
}
diff --git a/src/libunixonacid/skaclient_putmsg.c b/src/libunixonacid/skaclient_putmsg.c
index d1cb68e..83878bd 100644
--- a/src/libunixonacid/skaclient_putmsg.c
+++ b/src/libunixonacid/skaclient_putmsg.c
@@ -4,7 +4,7 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_putmsg_and_close (skaclient_t *a, unixmessage_t const *m, unsigned char const *bits, unixmessage_handler_func_t_ref cb, void *result)
+int skaclient_putmsg_and_close (skaclient *a, unixmessage const *m, unsigned char const *bits, unixmessage_handler_func_ref cb, void *result)
{
if (!kolbak_enqueue(&a->kq, cb, result)) return 0 ;
if (!unixmessage_put_and_close(&a->syncout, m, bits))
diff --git a/src/libunixonacid/skaclient_putmsgv.c b/src/libunixonacid/skaclient_putmsgv.c
index fb0b866..6905479 100644
--- a/src/libunixonacid/skaclient_putmsgv.c
+++ b/src/libunixonacid/skaclient_putmsgv.c
@@ -4,7 +4,7 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_putmsgv_and_close (skaclient_t *a, unixmessage_v_t const *m, unsigned char const *bits, unixmessage_handler_func_t_ref cb, void *result)
+int skaclient_putmsgv_and_close (skaclient *a, unixmessagev const *m, unsigned char const *bits, unixmessage_handler_func_ref cb, void *result)
{
if (!kolbak_enqueue(&a->kq, cb, result)) return 0 ;
if (!unixmessage_putv_and_close(&a->syncout, m, bits))
diff --git a/src/libunixonacid/skaclient_putv.c b/src/libunixonacid/skaclient_putv.c
index 8a5276e..8831373 100644
--- a/src/libunixonacid/skaclient_putv.c
+++ b/src/libunixonacid/skaclient_putv.c
@@ -4,8 +4,8 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_putv (skaclient_t *a, struct iovec const *v, unsigned int vlen, unixmessage_handler_func_t *cb, void *result)
+int skaclient_putv (skaclient *a, struct iovec const *v, unsigned int vlen, unixmessage_handler_func *cb, void *result)
{
- unixmessage_v_t m = { .v = (struct iovec *)v, .vlen = vlen, .fds = 0, .nfds = 0 } ;
+ unixmessagev m = { .v = (struct iovec *)v, .vlen = vlen, .fds = 0, .nfds = 0 } ;
return skaclient_putmsgv(a, &m, cb, result) ;
}
diff --git a/src/libunixonacid/skaclient_send.c b/src/libunixonacid/skaclient_send.c
index 980d953..cb5b44d 100644
--- a/src/libunixonacid/skaclient_send.c
+++ b/src/libunixonacid/skaclient_send.c
@@ -3,8 +3,8 @@
#include <skalibs/unixmessage.h>
#include <skalibs/skaclient.h>
-int skaclient_send (skaclient_t *a, char const *s, size_t len, unixmessage_handler_func_t *cb, void *result, tain_t const *deadline, tain_t *stamp)
+int skaclient_send (skaclient *a, char const *s, size_t len, unixmessage_handler_func *cb, void *result, tain const *deadline, tain *stamp)
{
- unixmessage_t m = { .s = (char *)s, .len = len, .fds = 0, .nfds = 0 } ;
+ unixmessage m = { .s = (char *)s, .len = len, .fds = 0, .nfds = 0 } ;
return skaclient_sendmsg(a, &m, cb, result, deadline, stamp) ;
}
diff --git a/src/libunixonacid/skaclient_sendmsg.c b/src/libunixonacid/skaclient_sendmsg.c
index 6ace2ba..2d60a16 100644
--- a/src/libunixonacid/skaclient_sendmsg.c
+++ b/src/libunixonacid/skaclient_sendmsg.c
@@ -2,7 +2,7 @@
#include <skalibs/skaclient.h>
-int skaclient_sendmsg_and_close (skaclient_t *a, unixmessage_t const *m, unsigned char const *bits, unixmessage_handler_func_t_ref cb, void *result, tain_t const *deadline, tain_t *stamp)
+int skaclient_sendmsg_and_close (skaclient *a, unixmessage const *m, unsigned char const *bits, unixmessage_handler_func_ref cb, void *result, tain const *deadline, tain *stamp)
{
return skaclient_putmsg_and_close(a, m, bits, cb, result)
&& skaclient_syncify(a, deadline, stamp) ;
diff --git a/src/libunixonacid/skaclient_sendmsgv.c b/src/libunixonacid/skaclient_sendmsgv.c
index 0b8a702..10ab27a 100644
--- a/src/libunixonacid/skaclient_sendmsgv.c
+++ b/src/libunixonacid/skaclient_sendmsgv.c
@@ -2,7 +2,7 @@
#include <skalibs/skaclient.h>
-int skaclient_sendmsgv_and_close (skaclient_t *a, unixmessage_v_t const *m, unsigned char const *bits, unixmessage_handler_func_t_ref cb, void *result, tain_t const *deadline, tain_t *stamp)
+int skaclient_sendmsgv_and_close (skaclient *a, unixmessagev const *m, unsigned char const *bits, unixmessage_handler_func_ref cb, void *result, tain const *deadline, tain *stamp)
{
return skaclient_putmsgv_and_close(a, m, bits, cb, result)
&& skaclient_syncify(a, deadline, stamp) ;
diff --git a/src/libunixonacid/skaclient_sendv.c b/src/libunixonacid/skaclient_sendv.c
index fa2713d..7cbf098 100644
--- a/src/libunixonacid/skaclient_sendv.c
+++ b/src/libunixonacid/skaclient_sendv.c
@@ -3,8 +3,8 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_sendv (skaclient_t *a, struct iovec const *v, unsigned int vlen, unixmessage_handler_func_t *cb, void *result, tain_t const *deadline, tain_t *stamp)
+int skaclient_sendv (skaclient *a, struct iovec const *v, unsigned int vlen, unixmessage_handler_func *cb, void *result, tain const *deadline, tain *stamp)
{
- unixmessage_v_t m = { .v = (struct iovec *)v, .vlen = vlen, .fds = 0, .nfds = 0 } ;
+ unixmessagev m = { .v = (struct iovec *)v, .vlen = vlen, .fds = 0, .nfds = 0 } ;
return skaclient_sendmsgv(a, &m, cb, result, deadline, stamp) ;
}
diff --git a/src/libunixonacid/skaclient_server_ack.c b/src/libunixonacid/skaclient_server_ack.c
index cec61d1..0f08d55 100644
--- a/src/libunixonacid/skaclient_server_ack.c
+++ b/src/libunixonacid/skaclient_server_ack.c
@@ -9,10 +9,10 @@
#include <skalibs/socket.h>
#include <skalibs/posixishard.h>
-int skaclient_server_ack (unixmessage_t const *clientmsg, unixmessage_sender_t *out, unixmessage_sender_t *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen)
+int skaclient_server_ack (unixmessage const *clientmsg, unixmessage_sender *out, unixmessage_sender *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen)
{
int fd[2] ;
- unixmessage_t m = { .s = (char *)after, .len = afterlen, .fds = fd, .nfds = 1 } ;
+ unixmessage m = { .s = (char *)after, .len = afterlen, .fds = fd, .nfds = 1 } ;
static unsigned char const bits = 0xff ;
if (clientmsg->nfds
|| clientmsg->len != beforelen
diff --git a/src/libunixonacid/skaclient_server_bidi_ack.c b/src/libunixonacid/skaclient_server_bidi_ack.c
index 4a65fdb..b1a60f3 100644
--- a/src/libunixonacid/skaclient_server_bidi_ack.c
+++ b/src/libunixonacid/skaclient_server_bidi_ack.c
@@ -3,7 +3,7 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_server_bidi_ack (unixmessage_t const *clientmsg, unixmessage_sender_t *out, unixmessage_sender_t *asyncout, unixmessage_receiver_t *asyncin, char *mainbuf, size_t mainlen, char *auxbuf, size_t auxlen, char const *before, size_t beforelen, char const *after, size_t afterlen)
+int skaclient_server_bidi_ack (unixmessage const *clientmsg, unixmessage_sender *out, unixmessage_sender *asyncout, unixmessage_receiver *asyncin, char *mainbuf, size_t mainlen, char *auxbuf, size_t auxlen, char const *before, size_t beforelen, char const *after, size_t afterlen)
{
if (!unixmessage_receiver_init(asyncin, -1, mainbuf, mainlen, auxbuf, auxlen)) return 0 ;
if (!skaclient_server_ack(clientmsg, out, asyncout, before, beforelen, after, afterlen)) return 0 ;
diff --git a/src/libunixonacid/skaclient_server_init.c b/src/libunixonacid/skaclient_server_init.c
index 827a5e4..796ed43 100644
--- a/src/libunixonacid/skaclient_server_init.c
+++ b/src/libunixonacid/skaclient_server_init.c
@@ -4,9 +4,9 @@
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
-int skaclient_server_init (unixmessage_receiver_t *in, unixmessage_sender_t *out, unixmessage_sender_t *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int skaclient_server_init (unixmessage_receiver *in, unixmessage_sender *out, unixmessage_sender *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
- unixmessage_t m ;
+ unixmessage m ;
return (sanitize_read(unixmessage_timed_receive(in, &m, deadline, stamp)) >= 0)
&& skaclient_server_ack(&m, out, asyncout, before, beforelen, after, afterlen)
&& unixmessage_sender_timed_flush(out, deadline, stamp) ;
diff --git a/src/libunixonacid/skaclient_start.c b/src/libunixonacid/skaclient_start.c
index d78a1e3..15cc3af 100644
--- a/src/libunixonacid/skaclient_start.c
+++ b/src/libunixonacid/skaclient_start.c
@@ -1,12 +1,13 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/kolbak.h>
#include <skalibs/skaclient.h>
#include "skaclient-internal.h"
int skaclient_start (
- skaclient_t *a,
+ skaclient *a,
char *bufss,
size_t bufsn,
char *auxbufss,
@@ -15,7 +16,7 @@ int skaclient_start (
size_t bufan,
char *auxbufas,
size_t auxbufan,
- kolbak_closure_t *q,
+ kolbak_closure *q,
size_t qlen,
char const *path,
uint32_t options,
@@ -23,11 +24,11 @@ int skaclient_start (
size_t beforelen,
char const *after,
size_t afterlen,
- tain_t const *deadline,
- tain_t *stamp)
+ tain const *deadline,
+ tain *stamp)
{
- skaclient_cbdata_t blah ;
- unixmessage_t m ;
+ skaclient_cbdata blah ;
+ unixmessage m ;
int r ;
if (!skaclient_start_async(a, bufss, bufsn, auxbufss, auxbufsn, bufas, bufan, auxbufas, auxbufan, q, qlen, path, options, before, beforelen, after, afterlen, &blah)) return 0 ;
if (!skaclient_timed_flush(a, deadline, stamp))
diff --git a/src/libunixonacid/skaclient_start_async.c b/src/libunixonacid/skaclient_start_async.c
index 3847ec0..48aecf7 100644
--- a/src/libunixonacid/skaclient_start_async.c
+++ b/src/libunixonacid/skaclient_start_async.c
@@ -11,7 +11,7 @@
#include "skaclient-internal.h"
int skaclient_start_async (
- skaclient_t *a,
+ skaclient *a,
char *bufss,
size_t bufsn,
char *auxbufss,
@@ -20,7 +20,7 @@ int skaclient_start_async (
size_t bufan,
char *auxbufas,
size_t auxbufan,
- kolbak_closure_t *q,
+ kolbak_closure *q,
size_t qlen,
char const *path,
uint32_t options,
@@ -28,7 +28,7 @@ int skaclient_start_async (
size_t beforelen,
char const *after,
size_t afterlen,
- skaclient_cbdata_t *blah)
+ skaclient_cbdata *blah)
{
int fd = ipc_stream_nbcoe() ;
if (fd < 0) return 0 ;
@@ -40,7 +40,7 @@ int skaclient_start_async (
}
a->pid = 0 ;
a->options = options & ~SKACLIENT_OPTION_WAITPID ;
- if (!kolbak_enqueue(&a->kq, (unixmessage_handler_func_t_ref)&skaclient_start_cb, blah))
+ if (!kolbak_enqueue(&a->kq, (unixmessage_handler_func_ref)&skaclient_start_cb, blah))
{
skaclient_end(a) ;
return 0 ;
diff --git a/src/libunixonacid/skaclient_start_cb.c b/src/libunixonacid/skaclient_start_cb.c
index f385b6b..117faf3 100644
--- a/src/libunixonacid/skaclient_start_cb.c
+++ b/src/libunixonacid/skaclient_start_cb.c
@@ -8,7 +8,7 @@
#include <skalibs/posixishard.h>
#include "skaclient-internal.h"
-int skaclient_start_cb (unixmessage_t const *m, skaclient_cbdata_t *blah)
+int skaclient_start_cb (unixmessage const *m, skaclient_cbdata *blah)
{
if (m->len != blah->afterlen
|| memcmp(m->s, blah->after, m->len)
diff --git a/src/libunixonacid/skaclient_startf.c b/src/libunixonacid/skaclient_startf.c
index 9d9cbff..bc58baf 100644
--- a/src/libunixonacid/skaclient_startf.c
+++ b/src/libunixonacid/skaclient_startf.c
@@ -1,12 +1,13 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/kolbak.h>
#include <skalibs/skaclient.h>
#include "skaclient-internal.h"
int skaclient_startf (
- skaclient_t *a,
+ skaclient *a,
char *bufss,
size_t bufsn,
char *auxbufss,
@@ -15,7 +16,7 @@ int skaclient_startf (
size_t bufan,
char *auxbufas,
size_t auxbufan,
- kolbak_closure_t *q,
+ kolbak_closure *q,
size_t qlen,
char const *prog,
char const *const *argv,
@@ -25,11 +26,11 @@ int skaclient_startf (
size_t beforelen,
char const *after,
size_t afterlen,
- tain_t const *deadline,
- tain_t *stamp)
+ tain const *deadline,
+ tain *stamp)
{
- skaclient_cbdata_t blah ;
- unixmessage_t m ;
+ skaclient_cbdata blah ;
+ unixmessage m ;
int r ;
if (!skaclient_startf_async(a, bufss, bufsn, auxbufss, auxbufsn, bufas, bufan, auxbufas, auxbufan, q, qlen, prog, argv, envp, options, before, beforelen, after, afterlen, &blah)) return 0 ;
if (!skaclient_timed_flush(a, deadline, stamp))
diff --git a/src/libunixonacid/skaclient_startf_async.c b/src/libunixonacid/skaclient_startf_async.c
index 9427ce3..7b2e1da 100644
--- a/src/libunixonacid/skaclient_startf_async.c
+++ b/src/libunixonacid/skaclient_startf_async.c
@@ -2,13 +2,14 @@
#include <errno.h>
#include <signal.h>
+
#include <skalibs/djbunix.h>
#include <skalibs/kolbak.h>
#include <skalibs/skaclient.h>
#include "skaclient-internal.h"
int skaclient_startf_async (
- skaclient_t *a,
+ skaclient *a,
char *bufss,
size_t bufsn,
char *auxbufss,
@@ -17,7 +18,7 @@ int skaclient_startf_async (
size_t bufan,
char *auxbufas,
size_t auxbufan,
- kolbak_closure_t *q,
+ kolbak_closure *q,
size_t qlen,
char const *prog,
char const *const *argv,
@@ -27,7 +28,7 @@ int skaclient_startf_async (
size_t beforelen,
char const *after,
size_t afterlen,
- skaclient_cbdata_t *blah)
+ skaclient_cbdata *blah)
{
int fd ;
pid_t pid = child_spawn1_socket(prog, argv, envp, &fd) ;
@@ -48,7 +49,7 @@ int skaclient_startf_async (
}
a->pid = pid ;
a->options = options ;
- if (!kolbak_enqueue(&a->kq, (unixmessage_handler_func_t_ref)&skaclient_start_cb, blah))
+ if (!kolbak_enqueue(&a->kq, (unixmessage_handler_func_ref)&skaclient_start_cb, blah))
{
skaclient_end(a) ;
return 0 ;
diff --git a/src/libunixonacid/skaclient_syncify.c b/src/libunixonacid/skaclient_syncify.c
index a0fd30f..8ef01b0 100644
--- a/src/libunixonacid/skaclient_syncify.c
+++ b/src/libunixonacid/skaclient_syncify.c
@@ -1,9 +1,10 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/skaclient.h>
-int skaclient_syncify (skaclient_t *a, tain_t const *deadline, tain_t *stamp)
+int skaclient_syncify (skaclient *a, tain const *deadline, tain *stamp)
{
int r ;
if (!skaclient_timed_flush(a, deadline, stamp)) return 0 ;
diff --git a/src/libunixonacid/skaclient_zero.c b/src/libunixonacid/skaclient_zero.c
index 4bb85b5..e630891 100644
--- a/src/libunixonacid/skaclient_zero.c
+++ b/src/libunixonacid/skaclient_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/skaclient.h>
-skaclient_t const skaclient_zero = SKACLIENT_ZERO ;
+skaclient const skaclient_zero = SKACLIENT_ZERO ;
diff --git a/src/libunixonacid/textclient_command.c b/src/libunixonacid/textclient_command.c
index a0015ac..1c1417e 100644
--- a/src/libunixonacid/textclient_command.c
+++ b/src/libunixonacid/textclient_command.c
@@ -6,7 +6,7 @@
#include <skalibs/textclient.h>
#include <skalibs/posixishard.h>
-int textclient_command (textclient_t *a, char const *s, size_t len, tain_t const *deadline, tain_t *stamp)
+int textclient_command (textclient *a, char const *s, size_t len, tain const *deadline, tain *stamp)
{
struct iovec ans ;
if (!textclient_exchange(a, s, len, &ans, deadline, stamp)) return 0 ;
diff --git a/src/libunixonacid/textclient_commandv.c b/src/libunixonacid/textclient_commandv.c
index 267e584..1983a33 100644
--- a/src/libunixonacid/textclient_commandv.c
+++ b/src/libunixonacid/textclient_commandv.c
@@ -6,7 +6,7 @@
#include <skalibs/textclient.h>
#include <skalibs/posixishard.h>
-int textclient_commandv (textclient_t *a, struct iovec const *v, unsigned int n, tain_t const *deadline, tain_t *stamp)
+int textclient_commandv (textclient *a, struct iovec const *v, unsigned int n, tain const *deadline, tain *stamp)
{
struct iovec ans ;
if (!textclient_exchangev(a, v, n, &ans, deadline, stamp)) return 0 ;
diff --git a/src/libunixonacid/textclient_end.c b/src/libunixonacid/textclient_end.c
index 1ddf93f..a87a58f 100644
--- a/src/libunixonacid/textclient_end.c
+++ b/src/libunixonacid/textclient_end.c
@@ -1,11 +1,12 @@
/* ISC license. */
#include <errno.h>
+
#include <skalibs/djbunix.h>
#include <skalibs/textmessage.h>
#include <skalibs/textclient.h>
-void textclient_end (textclient_t *a)
+void textclient_end (textclient *a)
{
fd_close(textmessage_sender_fd(&a->syncout)) ;
if (textmessage_receiver_fd(&a->syncin) != textmessage_sender_fd(&a->syncout))
diff --git a/src/libunixonacid/textclient_server_init.c b/src/libunixonacid/textclient_server_init.c
index 27d3a20..09f17ba 100644
--- a/src/libunixonacid/textclient_server_init.c
+++ b/src/libunixonacid/textclient_server_init.c
@@ -4,7 +4,7 @@
#include <skalibs/djbunix.h>
#include <skalibs/textclient.h>
-int textclient_server_init (textmessage_receiver_t *in, textmessage_sender_t *syncout, textmessage_sender_t *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textclient_server_init (textmessage_receiver *in, textmessage_sender *syncout, textmessage_sender *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
return getenv(SKALIBS_CHILD_SPAWN_FDS_ENVVAR) ?
textclient_server_init_frompipe(in, syncout, asyncout, before, beforelen, after, afterlen, deadline, stamp) :
diff --git a/src/libunixonacid/textclient_server_init_frompipe.c b/src/libunixonacid/textclient_server_init_frompipe.c
index 515916a..78e07b9 100644
--- a/src/libunixonacid/textclient_server_init_frompipe.c
+++ b/src/libunixonacid/textclient_server_init_frompipe.c
@@ -12,7 +12,7 @@
#include <skalibs/textclient.h>
#include <skalibs/posixishard.h>
-int textclient_server_init_frompipe (textmessage_receiver_t *in, textmessage_sender_t *syncout, textmessage_sender_t *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textclient_server_init_frompipe (textmessage_receiver *in, textmessage_sender *syncout, textmessage_sender *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
struct iovec v ;
unsigned int asyncfd ;
diff --git a/src/libunixonacid/textclient_server_init_fromsocket.c b/src/libunixonacid/textclient_server_init_fromsocket.c
index a662cfc..7a146e2 100644
--- a/src/libunixonacid/textclient_server_init_fromsocket.c
+++ b/src/libunixonacid/textclient_server_init_fromsocket.c
@@ -9,7 +9,7 @@
#include <skalibs/textclient.h>
#include <skalibs/posixishard.h>
-int textclient_server_init_fromsocket (textmessage_receiver_t *in, textmessage_sender_t *syncout, textmessage_sender_t *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textclient_server_init_fromsocket (textmessage_receiver *in, textmessage_sender *syncout, textmessage_sender *asyncout, char const *before, size_t beforelen, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
struct iovec v ;
if (sanitize_read(textmessage_timed_receive(in, &v, deadline, stamp)) <= 0) return 0 ;
diff --git a/src/libunixonacid/textclient_start.c b/src/libunixonacid/textclient_start.c
index ee2f800..fc087bb 100644
--- a/src/libunixonacid/textclient_start.c
+++ b/src/libunixonacid/textclient_start.c
@@ -10,7 +10,7 @@
#include <skalibs/textclient.h>
#include <skalibs/posixishard.h>
-int textclient_start (textclient_t *a, char const *path, uint32_t options, char const *before, size_t beforelen, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textclient_start (textclient *a, char const *path, uint32_t options, char const *before, size_t beforelen, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
struct iovec v ;
int fd = ipc_stream_nbcoe() ;
diff --git a/src/libunixonacid/textclient_startf.c b/src/libunixonacid/textclient_startf.c
index fc871fd..0162d6b 100644
--- a/src/libunixonacid/textclient_startf.c
+++ b/src/libunixonacid/textclient_startf.c
@@ -10,7 +10,7 @@
#include <skalibs/textclient.h>
#include <skalibs/posixishard.h>
-int textclient_startf (textclient_t *a, char const *const *argv, char const *const *envp, uint32_t options, char const *before, size_t beforelen, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textclient_startf (textclient *a, char const *const *argv, char const *const *envp, uint32_t options, char const *before, size_t beforelen, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
struct iovec v ;
int fd[3] = { 0, 1 } ;
diff --git a/src/libunixonacid/textclient_zero.c b/src/libunixonacid/textclient_zero.c
index c2897d7..d2b27eb 100644
--- a/src/libunixonacid/textclient_zero.c
+++ b/src/libunixonacid/textclient_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/textclient.h>
-textclient_t const textclient_zero = TEXTCLIENT_ZERO ;
+textclient const textclient_zero = TEXTCLIENT_ZERO ;
diff --git a/src/libunixonacid/textmessage_create_send_channel.c b/src/libunixonacid/textmessage_create_send_channel.c
index 40f7ff7..deeb979 100644
--- a/src/libunixonacid/textmessage_create_send_channel.c
+++ b/src/libunixonacid/textmessage_create_send_channel.c
@@ -27,7 +27,7 @@ static int sendit (void *p)
return ancil_send_fd(fd[0], fd[1], '|') ;
}
-int textmessage_create_send_channel (int sock, textmessage_sender_t *asyncout, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textmessage_create_send_channel (int sock, textmessage_sender *asyncout, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
int fd[3] = { sock } ;
int r ;
diff --git a/src/libunixonacid/textmessage_handle.c b/src/libunixonacid/textmessage_handle.c
index bec62cb..acde280 100644
--- a/src/libunixonacid/textmessage_handle.c
+++ b/src/libunixonacid/textmessage_handle.c
@@ -3,7 +3,7 @@
#include <sys/uio.h>
#include <skalibs/textmessage.h>
-int textmessage_handle (textmessage_receiver_t *tr, textmessage_handler_func_t_ref f, void *p)
+int textmessage_handle (textmessage_receiver *tr, textmessage_handler_func_ref f, void *p)
{
unsigned int count = 0 ;
while (count < TEXTMESSAGE_MAXREADS || textmessage_receiver_hasmsginbuf(tr))
diff --git a/src/libunixonacid/textmessage_put.c b/src/libunixonacid/textmessage_put.c
index 5b7d944..4e7d924 100644
--- a/src/libunixonacid/textmessage_put.c
+++ b/src/libunixonacid/textmessage_put.c
@@ -7,7 +7,7 @@
#include <skalibs/bufalloc.h>
#include <skalibs/textmessage.h>
-int textmessage_put (textmessage_sender_t *ts, char const *s, size_t len)
+int textmessage_put (textmessage_sender *ts, char const *s, size_t len)
{
char pack[4] ;
struct iovec v[2] =
diff --git a/src/libunixonacid/textmessage_putv.c b/src/libunixonacid/textmessage_putv.c
index 759ce84..0e742aa 100644
--- a/src/libunixonacid/textmessage_putv.c
+++ b/src/libunixonacid/textmessage_putv.c
@@ -8,7 +8,7 @@
#include <skalibs/siovec.h>
#include <skalibs/textmessage.h>
-int textmessage_putv (textmessage_sender_t *ts, struct iovec const *v, unsigned int n)
+int textmessage_putv (textmessage_sender *ts, struct iovec const *v, unsigned int n)
{
size_t len = siovec_len(v, n) ;
char pack[4] ;
diff --git a/src/libunixonacid/textmessage_receive.c b/src/libunixonacid/textmessage_receive.c
index 1411f9a..c9b8008 100644
--- a/src/libunixonacid/textmessage_receive.c
+++ b/src/libunixonacid/textmessage_receive.c
@@ -9,7 +9,7 @@
#include <skalibs/stralloc.h>
#include <skalibs/textmessage.h>
-int textmessage_receive (textmessage_receiver_t *tr, struct iovec *v)
+int textmessage_receive (textmessage_receiver *tr, struct iovec *v)
{
if (tr->indata.len == tr->wanted)
{
diff --git a/src/libunixonacid/textmessage_receiver_0.c b/src/libunixonacid/textmessage_receiver_0.c
index ab883de..28e332a 100644
--- a/src/libunixonacid/textmessage_receiver_0.c
+++ b/src/libunixonacid/textmessage_receiver_0.c
@@ -6,4 +6,4 @@
#include <skalibs/textmessage.h>
static char buf[BUFFER_INSIZE] ;
-textmessage_receiver_t textmessage_receiver_0_ = TEXTMESSAGE_RECEIVER_INIT(0, buf, BUFFER_INSIZE, TEXTMESSAGE_MAXLEN) ;
+textmessage_receiver textmessage_receiver_0_ = TEXTMESSAGE_RECEIVER_INIT(0, buf, BUFFER_INSIZE, TEXTMESSAGE_MAXLEN) ;
diff --git a/src/libunixonacid/textmessage_receiver_free.c b/src/libunixonacid/textmessage_receiver_free.c
index 037e23b..fb02989 100644
--- a/src/libunixonacid/textmessage_receiver_free.c
+++ b/src/libunixonacid/textmessage_receiver_free.c
@@ -3,7 +3,7 @@
#include <skalibs/stralloc.h>
#include <skalibs/textmessage.h>
-void textmessage_receiver_free (textmessage_receiver_t *ts)
+void textmessage_receiver_free (textmessage_receiver *ts)
{
stralloc_free(&ts->indata) ;
*ts = textmessage_receiver_zero ;
diff --git a/src/libunixonacid/textmessage_receiver_hasmsginbuf.c b/src/libunixonacid/textmessage_receiver_hasmsginbuf.c
index d0cdcc3..e41f520 100644
--- a/src/libunixonacid/textmessage_receiver_hasmsginbuf.c
+++ b/src/libunixonacid/textmessage_receiver_hasmsginbuf.c
@@ -7,7 +7,7 @@
#include <skalibs/buffer.h>
#include <skalibs/textmessage.h>
-int textmessage_receiver_hasmsginbuf (textmessage_receiver_t const *tr)
+int textmessage_receiver_hasmsginbuf (textmessage_receiver const *tr)
{
size_t len = buffer_len(&tr->in) ;
uint32_t n ;
diff --git a/src/libunixonacid/textmessage_receiver_init.c b/src/libunixonacid/textmessage_receiver_init.c
index 8a29d68..3085fe8 100644
--- a/src/libunixonacid/textmessage_receiver_init.c
+++ b/src/libunixonacid/textmessage_receiver_init.c
@@ -4,7 +4,7 @@
#include <skalibs/stralloc.h>
#include <skalibs/textmessage.h>
-int textmessage_receiver_init (textmessage_receiver_t *tr, int fd, char *buf, size_t buflen, uint32_t max)
+int textmessage_receiver_init (textmessage_receiver *tr, int fd, char *buf, size_t buflen, uint32_t max)
{
if (!buffer_init(&tr->in, &buffer_read, fd, buf, buflen)) return 0 ;
tr->indata = stralloc_zero ;
diff --git a/src/libunixonacid/textmessage_receiver_zero.c b/src/libunixonacid/textmessage_receiver_zero.c
index 1e852e5..aae22f1 100644
--- a/src/libunixonacid/textmessage_receiver_zero.c
+++ b/src/libunixonacid/textmessage_receiver_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/textmessage.h>
-textmessage_receiver_t const textmessage_receiver_zero = TEXTMESSAGE_RECEIVER_ZERO ;
+textmessage_receiver const textmessage_receiver_zero = TEXTMESSAGE_RECEIVER_ZERO ;
diff --git a/src/libunixonacid/textmessage_recv_channel.c b/src/libunixonacid/textmessage_recv_channel.c
index 69adbcf..884821f 100644
--- a/src/libunixonacid/textmessage_recv_channel.c
+++ b/src/libunixonacid/textmessage_recv_channel.c
@@ -26,7 +26,7 @@ static ssize_t get (void *p)
return 1 ;
}
-int textmessage_recv_channel (int sock, textmessage_receiver_t *asyncin, char *asyncbuf, size_t asyncbufsize, char const *after, size_t afterlen, tain_t const *deadline, tain_t *stamp)
+int textmessage_recv_channel (int sock, textmessage_receiver *asyncin, char *asyncbuf, size_t asyncbufsize, char const *after, size_t afterlen, tain const *deadline, tain *stamp)
{
struct iovec v ;
int fd[2] = { sock, -1 } ;
diff --git a/src/libunixonacid/textmessage_sender_1.c b/src/libunixonacid/textmessage_sender_1.c
index 0be2ae9..0988f2e 100644
--- a/src/libunixonacid/textmessage_sender_1.c
+++ b/src/libunixonacid/textmessage_sender_1.c
@@ -4,4 +4,4 @@
#include <skalibs/textmessage.h>
-textmessage_sender_t textmessage_sender_1_ = TEXTMESSAGE_SENDER_INIT(1) ;
+textmessage_sender textmessage_sender_1_ = TEXTMESSAGE_SENDER_INIT(1) ;
diff --git a/src/libunixonacid/textmessage_sender_flush.c b/src/libunixonacid/textmessage_sender_flush.c
index 53bd407..12476eb 100644
--- a/src/libunixonacid/textmessage_sender_flush.c
+++ b/src/libunixonacid/textmessage_sender_flush.c
@@ -3,7 +3,7 @@
#include <skalibs/bufalloc.h>
#include <skalibs/textmessage.h>
-int textmessage_sender_flush (textmessage_sender_t *ts)
+int textmessage_sender_flush (textmessage_sender *ts)
{
return bufalloc_flush(&ts->out) ;
}
diff --git a/src/libunixonacid/textmessage_sender_getfd.c b/src/libunixonacid/textmessage_sender_getfd.c
index 8a6ddf7..9dc3168 100644
--- a/src/libunixonacid/textmessage_sender_getfd.c
+++ b/src/libunixonacid/textmessage_sender_getfd.c
@@ -3,7 +3,7 @@
#include <skalibs/bufalloc.h>
#include <skalibs/textmessage.h>
-int textmessage_sender_getfd (textmessage_sender_t const *ts)
+int textmessage_sender_getfd (textmessage_sender const *ts)
{
return bufalloc_fd(&ts->out) ;
}
diff --git a/src/libunixonacid/textmessage_sender_timed_flush.c b/src/libunixonacid/textmessage_sender_timed_flush.c
index 18eddd2..fbe30a6 100644
--- a/src/libunixonacid/textmessage_sender_timed_flush.c
+++ b/src/libunixonacid/textmessage_sender_timed_flush.c
@@ -4,12 +4,12 @@
#include <skalibs/unix-timed.h>
#include <skalibs/textmessage.h>
-static int textmessage_sender_isnonempty (textmessage_sender_t *ts)
+static int textmessage_sender_isnonempty (textmessage_sender *ts)
{
return !textmessage_sender_isempty(ts) ;
}
-int textmessage_sender_timed_flush (textmessage_sender_t *ts, tain_t const *deadline, tain_t *stamp)
+int textmessage_sender_timed_flush (textmessage_sender *ts, tain const *deadline, tain *stamp)
{
- return timed_flush(ts, (initfunc_t_ref)&textmessage_sender_getfd, (initfunc_t_ref)&textmessage_sender_isnonempty, (initfunc_t_ref)&textmessage_sender_flush, deadline, stamp) ;
+ return timed_flush(ts, (init_func_ref)&textmessage_sender_getfd, (init_func_ref)&textmessage_sender_isnonempty, (init_func_ref)&textmessage_sender_flush, deadline, stamp) ;
}
diff --git a/src/libunixonacid/textmessage_sender_x.c b/src/libunixonacid/textmessage_sender_x.c
index 2f6c557..82e2475 100644
--- a/src/libunixonacid/textmessage_sender_x.c
+++ b/src/libunixonacid/textmessage_sender_x.c
@@ -4,4 +4,4 @@
#include <skalibs/textmessage.h>
-textmessage_sender_t textmessage_sender_x_ = TEXTMESSAGE_SENDER_ZERO ;
+textmessage_sender textmessage_sender_x_ = TEXTMESSAGE_SENDER_ZERO ;
diff --git a/src/libunixonacid/textmessage_sender_zero.c b/src/libunixonacid/textmessage_sender_zero.c
index fbb2921..23687c4 100644
--- a/src/libunixonacid/textmessage_sender_zero.c
+++ b/src/libunixonacid/textmessage_sender_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/textmessage.h>
-textmessage_sender_t const textmessage_sender_zero = TEXTMESSAGE_SENDER_ZERO ;
+textmessage_sender const textmessage_sender_zero = TEXTMESSAGE_SENDER_ZERO ;
diff --git a/src/libunixonacid/textmessage_timed_handle.c b/src/libunixonacid/textmessage_timed_handle.c
index f8cf2dd..161314d 100644
--- a/src/libunixonacid/textmessage_timed_handle.c
+++ b/src/libunixonacid/textmessage_timed_handle.c
@@ -4,26 +4,26 @@
#include <skalibs/unix-timed.h>
#include <skalibs/textmessage.h>
-typedef struct textmessage_handler_blah_s textmessage_handler_blah_t, *textmessage_handler_blah_t_ref ;
+typedef struct textmessage_handler_blah_s textmessage_handler_blah, *textmessage_handler_blah_ref ;
struct textmessage_handler_blah_s
{
- textmessage_receiver_t *tr ;
- textmessage_handler_func_t_ref f ;
+ textmessage_receiver *tr ;
+ textmessage_handler_func_ref f ;
void *p ;
} ;
-static int getfd (textmessage_handler_blah_t *blah)
+static int getfd (textmessage_handler_blah *blah)
{
return textmessage_receiver_fd(blah->tr) ;
}
-static ssize_t get (textmessage_handler_blah_t *blah)
+static ssize_t get (textmessage_handler_blah *blah)
{
return textmessage_handle(blah->tr, blah->f, blah->p) ;
}
-int textmessage_timed_handle (textmessage_receiver_t *tr, textmessage_handler_func_t_ref f, void *p, tain_t const *deadline, tain_t *stamp)
+int textmessage_timed_handle (textmessage_receiver *tr, textmessage_handler_func_ref f, void *p, tain const *deadline, tain *stamp)
{
- textmessage_handler_blah_t blah = { .tr = tr, .f = f, .p = p } ;
- return timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ textmessage_handler_blah blah = { .tr = tr, .f = f, .p = p } ;
+ return timed_get(&blah, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/textmessage_timed_receive.c b/src/libunixonacid/textmessage_timed_receive.c
index 5c7a848..fe02080 100644
--- a/src/libunixonacid/textmessage_timed_receive.c
+++ b/src/libunixonacid/textmessage_timed_receive.c
@@ -1,29 +1,30 @@
/* ISC license. */
#include <sys/uio.h>
+
#include <skalibs/functypes.h>
#include <skalibs/unix-timed.h>
#include <skalibs/textmessage.h>
-typedef struct textmessage_get_s textmessage_get_t, *textmessage_get_t_ref ;
-struct textmessage_get_s
+typedef struct textmessage_getter_s textmessage_getter, *textmessage_getter_ref ;
+struct textmessage_getter_s
{
- textmessage_receiver_t *tr ;
+ textmessage_receiver *tr ;
struct iovec *v ;
} ;
-static int getfd (textmessage_get_t *g)
+static int getfd (textmessage_getter *g)
{
return textmessage_receiver_fd(g->tr) ;
}
-static ssize_t get (textmessage_get_t *g)
+static ssize_t get (textmessage_getter *g)
{
return textmessage_receive(g->tr, g->v) ;
}
-int textmessage_timed_receive (textmessage_receiver_t *tr, struct iovec *v, tain_t const *deadline, tain_t *stamp)
+int textmessage_timed_receive (textmessage_receiver *tr, struct iovec *v, tain const *deadline, tain *stamp)
{
- textmessage_get_t g = { .tr = tr, .v = v } ;
- return timed_get(&g, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ textmessage_getter g = { .tr = tr, .v = v } ;
+ return timed_get(&g, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/timed_flush.c b/src/libunixonacid/timed_flush.c
index 10367ad..02206f6 100644
--- a/src/libunixonacid/timed_flush.c
+++ b/src/libunixonacid/timed_flush.c
@@ -5,7 +5,7 @@
#include <skalibs/iopause.h>
#include <skalibs/unix-timed.h>
-int timed_flush (void *b, initfunc_t_ref getfd, initfunc_t_ref isnonempty, initfunc_t_ref flush, tain_t const *deadline, tain_t *stamp)
+int timed_flush (void *b, init_func_ref getfd, init_func_ref isnonempty, init_func_ref flush, tain const *deadline, tain *stamp)
{
iopause_fd x = { .fd = (*getfd)(b), .events = IOPAUSE_WRITE, .revents = 0 } ;
while ((*isnonempty)(b))
diff --git a/src/libunixonacid/timed_get.c b/src/libunixonacid/timed_get.c
index ddbfa97..fb751d2 100644
--- a/src/libunixonacid/timed_get.c
+++ b/src/libunixonacid/timed_get.c
@@ -5,7 +5,7 @@
#include <skalibs/iopause.h>
#include <skalibs/unix-timed.h>
-ssize_t timed_get (void *b, initfunc_t_ref getfd, getfunc_t_ref get, tain_t const *deadline, tain_t *stamp)
+ssize_t timed_get (void *b, init_func_ref getfd, get_func_ref get, tain const *deadline, tain *stamp)
{
iopause_fd x = { .fd = (*getfd)(b), .events = IOPAUSE_READ, .revents = 0 } ;
ssize_t r = (*get)(b) ;
diff --git a/src/libunixonacid/timed_getln.c b/src/libunixonacid/timed_getln.c
index dda0a9f..0fa1908 100644
--- a/src/libunixonacid/timed_getln.c
+++ b/src/libunixonacid/timed_getln.c
@@ -25,8 +25,8 @@ static ssize_t get (struct blah_s *blah)
return sanitize_read(skagetln(blah->b, blah->sa, blah->sep)) ;
}
-int timed_getln (buffer *b, stralloc *sa, char sep, tain_t const *deadline, tain_t *stamp)
+int timed_getln (buffer *b, stralloc *sa, char sep, tain const *deadline, tain *stamp)
{
struct blah_s blah = { .b = b, .sa = sa, .sep = sep } ;
- return timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ return timed_get(&blah, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/timed_getlnmax.c b/src/libunixonacid/timed_getlnmax.c
index a054b59..77ba605 100644
--- a/src/libunixonacid/timed_getlnmax.c
+++ b/src/libunixonacid/timed_getlnmax.c
@@ -26,10 +26,10 @@ static ssize_t get (struct blah_s *blah)
return sanitize_read(getlnmax(blah->b, blah->d, blah->max, &blah->w, blah->sep)) ;
}
-ssize_t timed_getlnmax (buffer *b, char *d, size_t max, size_t *w, char sep, tain_t const *deadline, tain_t *stamp)
+ssize_t timed_getlnmax (buffer *b, char *d, size_t max, size_t *w, char sep, tain const *deadline, tain *stamp)
{
struct blah_s blah = { .b = b, .d = d, .max = max, .w = *w, .sep = sep } ;
- ssize_t r = timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ ssize_t r = timed_get(&blah, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
*w = blah.w ;
return r ;
}
diff --git a/src/libunixonacid/unixconnection_free.c b/src/libunixonacid/unixconnection_free.c
index 52f9027..a10ebe4 100644
--- a/src/libunixonacid/unixconnection_free.c
+++ b/src/libunixonacid/unixconnection_free.c
@@ -3,7 +3,7 @@
#include <skalibs/unixmessage.h>
#include <skalibs/unixconnection.h>
-void unixconnection_free (unixconnection_t *io)
+void unixconnection_free (unixconnection *io)
{
unixmessage_sender_free(&io->out) ;
unixmessage_receiver_free(&io->in) ;
diff --git a/src/libunixonacid/unixconnection_init.c b/src/libunixonacid/unixconnection_init.c
index 52ecd44..8ae7508 100644
--- a/src/libunixonacid/unixconnection_init.c
+++ b/src/libunixonacid/unixconnection_init.c
@@ -3,7 +3,7 @@
#include <skalibs/unixmessage.h>
#include <skalibs/unixconnection.h>
-void unixconnection_init (unixconnection_t *io, int fdin, int fdout)
+void unixconnection_init (unixconnection *io, int fdin, int fdout)
{
unixconnection_init_withclosecb(io, fdin, fdout, &unixmessage_sender_closecb, 0) ;
}
diff --git a/src/libunixonacid/unixconnection_init_withclosecb.c b/src/libunixonacid/unixconnection_init_withclosecb.c
index b89b3ee..fedc176 100644
--- a/src/libunixonacid/unixconnection_init_withclosecb.c
+++ b/src/libunixonacid/unixconnection_init_withclosecb.c
@@ -3,7 +3,7 @@
#include <skalibs/unixmessage.h>
#include <skalibs/unixconnection.h>
-void unixconnection_init_withclosecb (unixconnection_t *io, int fdin, int fdout, unixmessage_sender_closecb_func_t_ref f, void *p)
+void unixconnection_init_withclosecb (unixconnection *io, int fdin, int fdout, unixmessage_sender_closecb_func_ref f, void *p)
{
unixmessage_receiver_init(&io->in, fdin, io->mainbuf, UNIXMESSAGE_BUFSIZE, io->auxbuf, UNIXMESSAGE_AUXBUFSIZE) ;
unixmessage_sender_init_withclosecb(&io->out, fdout, f, p) ;
diff --git a/src/libunixonacid/unixconnection_zero.c b/src/libunixonacid/unixconnection_zero.c
index 9100cac..81143b5 100644
--- a/src/libunixonacid/unixconnection_zero.c
+++ b/src/libunixonacid/unixconnection_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/unixconnection.h>
-unixconnection_t const unixconnection_zero = UNIXCONNECTION_ZERO ;
+unixconnection const unixconnection_zero = UNIXCONNECTION_ZERO ;
diff --git a/src/libunixonacid/unixmessage_drop.c b/src/libunixonacid/unixmessage_drop.c
index bf37df3..d9fc429 100644
--- a/src/libunixonacid/unixmessage_drop.c
+++ b/src/libunixonacid/unixmessage_drop.c
@@ -3,7 +3,7 @@
#include <skalibs/djbunix.h>
#include <skalibs/unixmessage.h>
-void unixmessage_drop (unixmessage_t const *m)
+void unixmessage_drop (unixmessage const *m)
{
unsigned int i = m->nfds ;
while (i--) fd_close(m->fds[i]) ;
diff --git a/src/libunixonacid/unixmessage_handle.c b/src/libunixonacid/unixmessage_handle.c
index 487430d..61fc522 100644
--- a/src/libunixonacid/unixmessage_handle.c
+++ b/src/libunixonacid/unixmessage_handle.c
@@ -2,12 +2,12 @@
#include <skalibs/unixmessage.h>
-int unixmessage_handle (unixmessage_receiver_t *b, unixmessage_handler_func_t_ref f, void *p)
+int unixmessage_handle (unixmessage_receiver *b, unixmessage_handler_func_ref f, void *p)
{
unsigned int count = 0 ;
while (count < UNIXMESSAGE_MAXREADS || unixmessage_receiver_hasmsginbuf(b))
{
- unixmessage_t m ;
+ unixmessage m ;
int r = unixmessage_receive(b, &m) ;
if (r < 0) return -1 ;
if (!r) break ;
diff --git a/src/libunixonacid/unixmessage_put.c b/src/libunixonacid/unixmessage_put.c
index 9ce103d..a41c5c0 100644
--- a/src/libunixonacid/unixmessage_put.c
+++ b/src/libunixonacid/unixmessage_put.c
@@ -11,7 +11,7 @@
#include <skalibs/unixmessage.h>
#include <skalibs/posixishard.h>
-static inline int copyfds (char *s, int const *fds, unsigned int n, unsigned char const *bits, unixmessage_sender_closecb_func_t_ref closecb, void *closecbdata)
+static inline int copyfds (char *s, int const *fds, unsigned int n, unsigned char const *bits, unixmessage_sender_closecb_func_ref closecb, void *closecbdata)
{
unsigned int i = 0 ;
for (; i < n ; i++)
@@ -25,7 +25,7 @@ static inline int copyfds (char *s, int const *fds, unsigned int n, unsigned cha
return 1 ;
}
-static int reserve_and_copy (unixmessage_sender_t *b, size_t len, int const *fds, unsigned int nfds, unsigned char const *bits)
+static int reserve_and_copy (unixmessage_sender *b, size_t len, int const *fds, unsigned int nfds, unsigned char const *bits)
{
disize cur = { .left = b->data.len, .right = genalloc_len(int, &b->fds) } ;
if (len > UNIXMESSAGE_MAXSIZE || nfds > UNIXMESSAGE_MAXFDS)
@@ -39,7 +39,7 @@ static int reserve_and_copy (unixmessage_sender_t *b, size_t len, int const *fds
return genalloc_append(disize, &b->offsets, &cur) ;
}
-int unixmessage_put_and_close (unixmessage_sender_t *b, unixmessage_t const *m, unsigned char const *bits)
+int unixmessage_put_and_close (unixmessage_sender *b, unixmessage const *m, unsigned char const *bits)
{
if (!reserve_and_copy(b, m->len, m->fds, m->nfds, bits)) return 0 ;
memmove(b->data.s + b->data.len, m->s, m->len) ;
@@ -47,7 +47,7 @@ int unixmessage_put_and_close (unixmessage_sender_t *b, unixmessage_t const *m,
return 1 ;
}
-int unixmessage_putv_and_close (unixmessage_sender_t *b, unixmessage_v_t const *m, unsigned char const *bits)
+int unixmessage_putv_and_close (unixmessage_sender *b, unixmessagev const *m, unsigned char const *bits)
{
size_t len = siovec_len(m->v, m->vlen) ;
if (!reserve_and_copy(b, len, m->fds, m->nfds, bits)) return 0 ;
diff --git a/src/libunixonacid/unixmessage_receive.c b/src/libunixonacid/unixmessage_receive.c
index b4171f0..c3e1107 100644
--- a/src/libunixonacid/unixmessage_receive.c
+++ b/src/libunixonacid/unixmessage_receive.c
@@ -36,7 +36,7 @@ static int const awesomeflags =
#endif
;
-static int unixmessage_receiver_fill (unixmessage_receiver_t *b)
+static int unixmessage_receiver_fill (unixmessage_receiver *b)
{
union aligner_u ancilbuf[1 + CMSG_SPACE(b->auxb.a - 1) / sizeof(union aligner_u)] ;
struct iovec iov[2] ;
@@ -98,7 +98,7 @@ static int unixmessage_receiver_fill (unixmessage_receiver_t *b)
return 1 ;
}
-int unixmessage_receive (unixmessage_receiver_t *b, unixmessage_t *m)
+int unixmessage_receive (unixmessage_receiver *b, unixmessage *m)
{
if (b->maindata.len == b->mainlen && b->auxdata.len == b->auxlen)
{
diff --git a/src/libunixonacid/unixmessage_receiver_0.c b/src/libunixonacid/unixmessage_receiver_0.c
index 76a537f..0ddddad 100644
--- a/src/libunixonacid/unixmessage_receiver_0.c
+++ b/src/libunixonacid/unixmessage_receiver_0.c
@@ -7,4 +7,4 @@
static char mainbuf[UNIXMESSAGE_BUFSIZE] ;
static char auxbuf[UNIXMESSAGE_AUXBUFSIZE] ;
-unixmessage_receiver_t unixmessage_receiver_0_ = UNIXMESSAGE_RECEIVER_INIT(0, mainbuf, UNIXMESSAGE_BUFSIZE, auxbuf, UNIXMESSAGE_AUXBUFSIZE) ;
+unixmessage_receiver unixmessage_receiver_0_ = UNIXMESSAGE_RECEIVER_INIT(0, mainbuf, UNIXMESSAGE_BUFSIZE, auxbuf, UNIXMESSAGE_AUXBUFSIZE) ;
diff --git a/src/libunixonacid/unixmessage_receiver_free.c b/src/libunixonacid/unixmessage_receiver_free.c
index 776509c..29ae58d 100644
--- a/src/libunixonacid/unixmessage_receiver_free.c
+++ b/src/libunixonacid/unixmessage_receiver_free.c
@@ -6,7 +6,7 @@
#include <skalibs/djbunix.h>
#include <skalibs/unixmessage.h>
-void unixmessage_receiver_free (unixmessage_receiver_t *b)
+void unixmessage_receiver_free (unixmessage_receiver *b)
{
size_t maindatalen = b->maindata.len ;
int h ;
diff --git a/src/libunixonacid/unixmessage_receiver_hasmsginbuf.c b/src/libunixonacid/unixmessage_receiver_hasmsginbuf.c
index 0a5f7d2..c35b3af 100644
--- a/src/libunixonacid/unixmessage_receiver_hasmsginbuf.c
+++ b/src/libunixonacid/unixmessage_receiver_hasmsginbuf.c
@@ -7,7 +7,7 @@
#include <skalibs/cbuffer.h>
#include <skalibs/unixmessage.h>
-int unixmessage_receiver_hasmsginbuf (unixmessage_receiver_t const *b)
+int unixmessage_receiver_hasmsginbuf (unixmessage_receiver const *b)
{
size_t len = cbuffer_len(&b->mainb) ;
uint32_t mainlen ;
diff --git a/src/libunixonacid/unixmessage_receiver_init.c b/src/libunixonacid/unixmessage_receiver_init.c
index 32a514a..e1e9e92 100644
--- a/src/libunixonacid/unixmessage_receiver_init.c
+++ b/src/libunixonacid/unixmessage_receiver_init.c
@@ -4,7 +4,7 @@
#include <skalibs/stralloc.h>
#include <skalibs/unixmessage.h>
-int unixmessage_receiver_init (unixmessage_receiver_t *b, int fd, char *mainbuf, size_t mainlen, char *auxbuf, size_t auxlen)
+int unixmessage_receiver_init (unixmessage_receiver *b, int fd, char *mainbuf, size_t mainlen, char *auxbuf, size_t auxlen)
{
if (!cbuffer_init(&b->mainb, mainbuf, mainlen)
|| !cbuffer_init(&b->auxb, auxbuf, auxlen)) return 0 ;
diff --git a/src/libunixonacid/unixmessage_sender_1.c b/src/libunixonacid/unixmessage_sender_1.c
index e01081d..55d199c 100644
--- a/src/libunixonacid/unixmessage_sender_1.c
+++ b/src/libunixonacid/unixmessage_sender_1.c
@@ -4,4 +4,4 @@
#include <skalibs/unixmessage.h>
-unixmessage_sender_t unixmessage_sender_1_ = UNIXMESSAGE_SENDER_INIT(1) ;
+unixmessage_sender unixmessage_sender_1_ = UNIXMESSAGE_SENDER_INIT(1) ;
diff --git a/src/libunixonacid/unixmessage_sender_flush.c b/src/libunixonacid/unixmessage_sender_flush.c
index 96f9112..93bbbd7 100644
--- a/src/libunixonacid/unixmessage_sender_flush.c
+++ b/src/libunixonacid/unixmessage_sender_flush.c
@@ -30,7 +30,7 @@ union aligner_u
XXX: We assume ancillary data is attached to the first byte.
*/
-int unixmessage_sender_flush (unixmessage_sender_t *b)
+int unixmessage_sender_flush (unixmessage_sender *b)
{
disize last = { .left = b->data.len, .right = genalloc_len(int, &b->fds) } ;
disize *offsets = genalloc_s(disize, &b->offsets) ;
diff --git a/src/libunixonacid/unixmessage_sender_free.c b/src/libunixonacid/unixmessage_sender_free.c
index 4c07952..f01a940 100644
--- a/src/libunixonacid/unixmessage_sender_free.c
+++ b/src/libunixonacid/unixmessage_sender_free.c
@@ -7,7 +7,7 @@
#include <skalibs/djbunix.h>
#include <skalibs/unixmessage.h>
-void unixmessage_sender_free (unixmessage_sender_t *b)
+void unixmessage_sender_free (unixmessage_sender *b)
{
size_t n = genalloc_len(int, &b->fds) ;
if (n)
diff --git a/src/libunixonacid/unixmessage_sender_getfd.c b/src/libunixonacid/unixmessage_sender_getfd.c
index 1f130eb..7e1c45e 100644
--- a/src/libunixonacid/unixmessage_sender_getfd.c
+++ b/src/libunixonacid/unixmessage_sender_getfd.c
@@ -2,7 +2,7 @@
#include <skalibs/unixmessage.h>
-int unixmessage_sender_getfd (unixmessage_sender_t const *b)
+int unixmessage_sender_getfd (unixmessage_sender const *b)
{
return b->fd ;
}
diff --git a/src/libunixonacid/unixmessage_sender_init.c b/src/libunixonacid/unixmessage_sender_init.c
index 71a8b3b..0dbd963 100644
--- a/src/libunixonacid/unixmessage_sender_init.c
+++ b/src/libunixonacid/unixmessage_sender_init.c
@@ -2,7 +2,7 @@
#include <skalibs/unixmessage.h>
-void unixmessage_sender_init (unixmessage_sender_t *b, int fd)
+void unixmessage_sender_init (unixmessage_sender *b, int fd)
{
unixmessage_sender_init_withclosecb(b, fd, &unixmessage_sender_closecb, 0) ;
}
diff --git a/src/libunixonacid/unixmessage_sender_init_withclosecb.c b/src/libunixonacid/unixmessage_sender_init_withclosecb.c
index 7d82a8e..25d85e8 100644
--- a/src/libunixonacid/unixmessage_sender_init_withclosecb.c
+++ b/src/libunixonacid/unixmessage_sender_init_withclosecb.c
@@ -4,7 +4,7 @@
#include <skalibs/genalloc.h>
#include <skalibs/unixmessage.h>
-void unixmessage_sender_init_withclosecb (unixmessage_sender_t *b, int fd, unixmessage_sender_closecb_func_t_ref f, void *p)
+void unixmessage_sender_init_withclosecb (unixmessage_sender *b, int fd, unixmessage_sender_closecb_func_ref f, void *p)
{
b->fd = fd ;
b->data = stralloc_zero ;
diff --git a/src/libunixonacid/unixmessage_sender_timed_flush.c b/src/libunixonacid/unixmessage_sender_timed_flush.c
index 65b1b7d..90accfe 100644
--- a/src/libunixonacid/unixmessage_sender_timed_flush.c
+++ b/src/libunixonacid/unixmessage_sender_timed_flush.c
@@ -4,12 +4,12 @@
#include <skalibs/unix-timed.h>
#include <skalibs/unixmessage.h>
-static int unixmessage_sender_isnonempty (unixmessage_sender_t *b)
+static int unixmessage_sender_isnonempty (unixmessage_sender *b)
{
return !unixmessage_sender_isempty(b) ;
}
-int unixmessage_sender_timed_flush (unixmessage_sender_t *b, tain_t const *deadline, tain_t *stamp)
+int unixmessage_sender_timed_flush (unixmessage_sender *b, tain const *deadline, tain *stamp)
{
- return timed_flush(b, (initfunc_t_ref)&unixmessage_sender_getfd, (initfunc_t_ref)&unixmessage_sender_isnonempty, (initfunc_t_ref)&unixmessage_sender_flush, deadline, stamp) ;
+ return timed_flush(b, (init_func_ref)&unixmessage_sender_getfd, (init_func_ref)&unixmessage_sender_isnonempty, (init_func_ref)&unixmessage_sender_flush, deadline, stamp) ;
}
diff --git a/src/libunixonacid/unixmessage_sender_x.c b/src/libunixonacid/unixmessage_sender_x.c
index da8659f..9d3d518 100644
--- a/src/libunixonacid/unixmessage_sender_x.c
+++ b/src/libunixonacid/unixmessage_sender_x.c
@@ -4,4 +4,4 @@
#include <skalibs/unixmessage.h>
-unixmessage_sender_t unixmessage_sender_x_ = UNIXMESSAGE_SENDER_ZERO ;
+unixmessage_sender unixmessage_sender_x_ = UNIXMESSAGE_SENDER_ZERO ;
diff --git a/src/libunixonacid/unixmessage_sender_zero.c b/src/libunixonacid/unixmessage_sender_zero.c
index bda0a9b..b9883c5 100644
--- a/src/libunixonacid/unixmessage_sender_zero.c
+++ b/src/libunixonacid/unixmessage_sender_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/unixmessage.h>
-unixmessage_sender_t const unixmessage_sender_zero = UNIXMESSAGE_SENDER_ZERO ;
+unixmessage_sender const unixmessage_sender_zero = UNIXMESSAGE_SENDER_ZERO ;
diff --git a/src/libunixonacid/unixmessage_timed_handle.c b/src/libunixonacid/unixmessage_timed_handle.c
index dd198e7..570cebf 100644
--- a/src/libunixonacid/unixmessage_timed_handle.c
+++ b/src/libunixonacid/unixmessage_timed_handle.c
@@ -4,26 +4,26 @@
#include <skalibs/unix-timed.h>
#include <skalibs/unixmessage.h>
-typedef struct unixmessage_handler_blah_s unixmessage_handler_blah_t, *unixmessage_handler_blah_t_ref ;
+typedef struct unixmessage_handler_blah_s unixmessage_handler_blah, *unixmessage_handler_blah_ref ;
struct unixmessage_handler_blah_s
{
- unixmessage_receiver_t *b ;
- unixmessage_handler_func_t_ref f ;
+ unixmessage_receiver *b ;
+ unixmessage_handler_func_ref f ;
void *p ;
} ;
-static int getfd (unixmessage_handler_blah_t *blah)
+static int getfd (unixmessage_handler_blah *blah)
{
return unixmessage_receiver_fd(blah->b) ;
}
-static ssize_t get (unixmessage_handler_blah_t *blah)
+static ssize_t get (unixmessage_handler_blah *blah)
{
return unixmessage_handle(blah->b, blah->f, blah->p) ;
}
-int unixmessage_timed_handle (unixmessage_receiver_t *b, unixmessage_handler_func_t_ref f, void *p, tain_t const *deadline, tain_t *stamp)
+int unixmessage_timed_handle (unixmessage_receiver *b, unixmessage_handler_func_ref f, void *p, tain const *deadline, tain *stamp)
{
- unixmessage_handler_blah_t blah = { .b = b, .f = f, .p = p } ;
- return timed_get(&blah, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ unixmessage_handler_blah blah = { .b = b, .f = f, .p = p } ;
+ return timed_get(&blah, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/unixmessage_timed_receive.c b/src/libunixonacid/unixmessage_timed_receive.c
index 08aabb2..b22cfd5 100644
--- a/src/libunixonacid/unixmessage_timed_receive.c
+++ b/src/libunixonacid/unixmessage_timed_receive.c
@@ -1,29 +1,30 @@
/* ISC license. */
#include <sys/types.h>
+
#include <skalibs/functypes.h>
#include <skalibs/unix-timed.h>
#include <skalibs/unixmessage.h>
-typedef struct unixmessage_get_s unixmessage_get_t, *unixmessage_get_t_ref ;
-struct unixmessage_get_s
+typedef struct unixmessage_getter_s unixmessage_getter, *unixmessage_getter_ref ;
+struct unixmessage_getter_s
{
- unixmessage_receiver_t *b ;
- unixmessage_t *m ;
+ unixmessage_receiver *b ;
+ unixmessage *m ;
} ;
-static int getfd (unixmessage_get_t *g)
+static int getfd (unixmessage_getter *g)
{
return unixmessage_receiver_fd(g->b) ;
}
-static ssize_t get (unixmessage_get_t *g)
+static ssize_t get (unixmessage_getter *g)
{
return unixmessage_receive(g->b, g->m) ;
}
-int unixmessage_timed_receive (unixmessage_receiver_t *b, unixmessage_t *m, tain_t const *deadline, tain_t *stamp)
+int unixmessage_timed_receive (unixmessage_receiver *b, unixmessage *m, tain const *deadline, tain *stamp)
{
- unixmessage_get_t g = { .b = b, .m = m } ;
- return timed_get(&g, (initfunc_t_ref)&getfd, (getfunc_t_ref)&get, deadline, stamp) ;
+ unixmessage_getter g = { .b = b, .m = m } ;
+ return timed_get(&g, (init_func_ref)&getfd, (get_func_ref)&get, deadline, stamp) ;
}
diff --git a/src/libunixonacid/unixmessage_unput.c b/src/libunixonacid/unixmessage_unput.c
index 3ee2abc..a59f6f3 100644
--- a/src/libunixonacid/unixmessage_unput.c
+++ b/src/libunixonacid/unixmessage_unput.c
@@ -5,7 +5,7 @@
#include <skalibs/djbunix.h>
#include <skalibs/unixmessage.h>
-int unixmessage_unput_and_maybe_drop (unixmessage_sender_t *b, int drop)
+int unixmessage_unput_and_maybe_drop (unixmessage_sender *b, int drop)
{
disize *start ;
size_t n = genalloc_len(disize, &b->offsets) ;
diff --git a/src/libunixonacid/unixmessage_v_zero.c b/src/libunixonacid/unixmessage_v_zero.c
deleted file mode 100644
index b4ab13a..0000000
--- a/src/libunixonacid/unixmessage_v_zero.c
+++ /dev/null
@@ -1,5 +0,0 @@
-/* ISC license. */
-
-#include <skalibs/unixmessage.h>
-
-unixmessage_v_t const unixmessage_v_zero = UNIXMESSAGE_V_ZERO ;
diff --git a/src/libunixonacid/unixmessage_zero.c b/src/libunixonacid/unixmessage_zero.c
index 4cfb242..02d30c2 100644
--- a/src/libunixonacid/unixmessage_zero.c
+++ b/src/libunixonacid/unixmessage_zero.c
@@ -2,4 +2,4 @@
#include <skalibs/unixmessage.h>
-unixmessage_t const unixmessage_zero = UNIXMESSAGE_ZERO ;
+unixmessage const unixmessage_zero = UNIXMESSAGE_ZERO ;
diff --git a/src/libunixonacid/unixmessagev_zero.c b/src/libunixonacid/unixmessagev_zero.c
new file mode 100644
index 0000000..af9ee3e
--- /dev/null
+++ b/src/libunixonacid/unixmessagev_zero.c
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#include <skalibs/unixmessage.h>
+
+unixmessagev const unixmessagev_zero = UNIXMESSAGEV_ZERO ;