diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-20 12:34:14 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-20 12:34:14 +0000 |
commit | 0d82edd9f8bebb396a9154d4e1003340dbf6b967 (patch) | |
tree | 0659c834f387f3504944a610ed6858b9e268e6c7 | |
parent | 2436785702b47996e9f0e281df0d6027660ec914 (diff) | |
download | skalibs-0d82edd9f8bebb396a9154d4e1003340dbf6b967.tar.xz |
Lots of cosmetic fixes.
sha256 documented.
107 files changed, 211 insertions, 191 deletions
diff --git a/doc/libstdcrypto/index.html b/doc/libstdcrypto/index.html index bbc5f08..02b06cb 100644 --- a/doc/libstdcrypto/index.html +++ b/doc/libstdcrypto/index.html @@ -28,6 +28,7 @@ operations are provided: <li> rc4 </li> <li> md5 </li> <li> sha1 </li> + <li> sha256 </li> </ul> <h2> Compiling </h2> @@ -106,5 +107,26 @@ SHA1 </h3> <li> <tt>sha1_final()</tt> computes the digest </li> </ul> +<h3> <a name="sha256"></a> +SHA256 </h3> + +<pre> + SHA256Schedule ctx ; + char const *message ; + unsigned int messagelen ; + char digest[32] ; + + sha256_init(&ctx) ; + sha256_update(&ctx, message, messagelen) ; + sha256_final(&ctx, digest) ; +</pre> + +<ul> + <li> <tt>sha256_init()</tt> prepares a SHA256Schedule structure for computation </li> + <li> <tt>sha256_update()</tt> adds <em>message</em> to the message to be digested </li> + <li> <tt>sha256_final()</tt> computes the digest </li> +</ul> + + </body> </html> diff --git a/src/headers/ip46-header b/src/headers/ip46-header index 4f0cf8c..ba310d3 100644 --- a/src/headers/ip46-header +++ b/src/headers/ip46-header @@ -27,8 +27,8 @@ struct ip46full_s #define ip46full_is6(i) ((i)->is6) #define ip46full_fmt(s, i) ((i)->is6 ? ip6_fmt(s, (i)->ip) : ip4_fmt(s, (i)->ip)) -extern unsigned int ip46full_scan (char const *, ip46full_t_ref) ; -extern unsigned int ip46full_scanlist (ip46full_t_ref, unsigned int, char const *, unsigned int *) ; +extern unsigned int ip46full_scan (char const *, ip46full_t *) ; +extern unsigned int ip46full_scanlist (ip46full_t *, unsigned int, char const *, unsigned int *) ; #define ip46full_from_ip4(i, ip4) (byte_copy((i)->ip, 4, ip4), byte_zero((i)->ip + 4, 12), (i)->is6 = 0) #define ip46full_from_ip6(i, ip6) (byte_copy((i)->ip, 16, ip6), (i)->is6 = 1) diff --git a/src/headers/ip46-with b/src/headers/ip46-with index 0cd3d19..8ff6752 100644 --- a/src/headers/ip46-with +++ b/src/headers/ip46-with @@ -17,8 +17,8 @@ typedef ip46full_t ip46_t, *ip46_t_ref ; #define socket_udp46(h) ((h) ? socket_udp6() : socket_udp4()) #define socket_recv46(fd, s, len, i, port) ((i)->is6 ? socket_recv6(fd, s, len, (i)->ip, port) : socket_recv4(fd, s, len, (i)->ip, port)) #define socket_send46(fd, s, len, i, port) ((i)->is6 ? socket_send6(fd, s, len, (i)->ip, port) : socket_send4(fd, s, len, (i)->ip, port)) -extern int socket_local46 (int, ip46_t_ref, uint16 *) ; -extern int socket_remote46 (int, ip46_t_ref, uint16 *) ; +extern int socket_local46 (int, ip46_t *, uint16 *) ; +extern int socket_remote46 (int, ip46_t *, uint16 *) ; #define socket_recvnb46(fd, buf, len, i, port, deadline, stamp) ((i)->is6 ? socket_recvnb6(fd, buf, len, (i)->ip, port, deadline, stamp) : socket_recvnb4(fd, buf, len, (i)->ip, port, deadline, stamp)) #define socket_sendnb46(fd, buf, len, i, port, deadline, stamp) ((i)->is6 ? socket_sendnb6(fd, buf, len, (i)->ip, port, deadline, stamp) : socket_sendnb4(fd, buf, len, (i)->ip, port, deadline, stamp)) diff --git a/src/include/skalibs/alloc.h b/src/include/skalibs/alloc.h index 707d5c1..0df0f9d 100644 --- a/src/include/skalibs/alloc.h +++ b/src/include/skalibs/alloc.h @@ -8,9 +8,9 @@ typedef char aligned_char gccattr_aligned ; typedef aligned_char *aligned_char_ref, **aligned_char_ref_ref ; -extern aligned_char_ref alloc (unsigned int) ; +extern aligned_char *alloc (unsigned int) ; extern void alloc_free (void *) ; #define alloc_re(p, old, new) alloc_realloc(p, new) -extern int alloc_realloc (aligned_char_ref_ref, unsigned int) ; +extern int alloc_realloc (aligned_char **, unsigned int) ; #endif diff --git a/src/include/skalibs/avlnode.h b/src/include/skalibs/avlnode.h index 4d13d15..faaee10 100644 --- a/src/include/skalibs/avlnode.h +++ b/src/include/skalibs/avlnode.h @@ -35,10 +35,10 @@ extern int avlnode_extreme (avlnode const *, unsigned int, unsigned int, int, un #define avlnode_min(s, max, r, data) avlnode_extreme(s, max, (r), 0, data) #define avlnode_max(s, max, r, data) avlnode_extreme(s, max, (r), 1, data) -extern unsigned int avlnode_insertnode (avlnode_ref, unsigned int, unsigned int, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; -extern unsigned int avlnode_delete (avlnode_ref, unsigned int, unsigned int *, void const *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; +extern unsigned int avlnode_insertnode (avlnode *, unsigned int, unsigned int, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; +extern unsigned int avlnode_delete (avlnode *, unsigned int, unsigned int *, void const *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; #define avlnode_deletenode(s, max, r, i, dtok, f, p) avlnode_delete(s, max, r, (*(dtok))((s)[i].data), dtok, f, p) -extern int avlnode_iter (avlnode_ref, unsigned int, unsigned int, avliterfunc_t_ref, void *) ; +extern int avlnode_iter (avlnode *, unsigned int, unsigned int, avliterfunc_t_ref, void *) ; #endif diff --git a/src/include/skalibs/avltree.h b/src/include/skalibs/avltree.h index cefd116..cd035f6 100644 --- a/src/include/skalibs/avltree.h +++ b/src/include/skalibs/avltree.h @@ -21,13 +21,13 @@ struct avltree_s extern avltree const avltree_zero ; #define avltree_len(t) gensetdyn_n(&(t)->x) #define avltree_totalsize(t) ((t)->x.storage.len) -#define avltree_nodes(t) ((avlnode_ref)(t)->x.storage.s) +#define avltree_nodes(t) ((avlnode *)(t)->x.storage.s) #define avltree_data(t, i) (avltree_nodes(t)[i].data) #define avltree_root(t) ((t)->root) #define avltree_setroot(t, r) ((t)->root = (r)) -extern void avltree_free (avltree_ref) ; -extern void avltree_init (avltree_ref, unsigned int, unsigned int, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; +extern void avltree_free (avltree *) ; +extern void avltree_init (avltree *, unsigned int, unsigned int, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; #define AVLTREE_INIT(b, num, den, dtk, f, p) { .x = GENSETDYN_INIT(avlnode, (b), num, den), .root = (unsigned int)-1, .dtok = (dtk), .kcmp = (f), .external = (p) } #define avltree_searchnode(t, k) avlnode_searchnode(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), k, (t)->dtok, (t)->kcmp, (t)->external) @@ -43,12 +43,12 @@ extern void avltree_init (avltree_ref, unsigned int, unsigned int, unsigned int, #define avltree_min(t, data) avltree_extreme((t), 0, data) #define avltree_max(t, data) avltree_extreme((t), 1, data) -extern int avltree_newnode (avltree_ref, unsigned int, unsigned int *) ; +extern int avltree_newnode (avltree *, unsigned int, unsigned int *) ; #define avltree_insertnode(t, i) avltree_setroot(t, avlnode_insertnode(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), i, (t)->dtok, (t)->kcmp, (t)->external)) -extern int avltree_insert (avltree_ref, unsigned int) ; +extern int avltree_insert (avltree *, unsigned int) ; #define avltree_deletenode(t, i) avltree_delete(t, (*(t)->dtok)(avltree_data(t, i))) -extern int avltree_delete (avltree_ref, void const *) ; +extern int avltree_delete (avltree *, void const *) ; #define avltree_iter(t, f, p) avlnode_iter(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), f, p) diff --git a/src/include/skalibs/avltreen.h b/src/include/skalibs/avltreen.h index 8151e9d..c453b99 100644 --- a/src/include/skalibs/avltreen.h +++ b/src/include/skalibs/avltreen.h @@ -23,11 +23,11 @@ struct avltreen_s #define AVLTREEN_ZERO { .x = GENSET_ZERO, .root = (unsigned int)-1, .dtok = 0, .kcmp = 0, .external = 0 } #define avltreen_totalsize(t) ((t)->x.max) #define avltreen_len(t) genset_n(&(t)->x) -#define avltreen_nodes(t) ((avlnode_ref)(t)->x.storage) +#define avltreen_nodes(t) ((avlnode *)(t)->x.storage) #define avltreen_data(t, i) (avltreen_nodes(t)[i].data) #define avltreen_root(t) ((t)->root) #define avltreen_setroot(t, r) ((t)->root = (r)) -extern void avltreen_init (avltreen_ref, avlnode_ref, unsigned int *, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; +extern void avltreen_init (avltreen *, avlnode *, unsigned int *, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ; #define avltreen_searchnode(t, k) avlnode_searchnode(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), (k), (t)->dtok, (t)->kcmp, (t)->external) #define avltreen_search(t, k, data) avlnode_search(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), k, (data), (t)->dtok, (t)->kcmp, (t)->external) @@ -42,12 +42,12 @@ extern void avltreen_init (avltreen_ref, avlnode_ref, unsigned int *, unsigned i #define avltreen_min(t, data) avltreen_extreme((t), 0, data) #define avltreen_max(t, data) avltreen_extreme((t), 1, data) -extern unsigned int avltreen_newnode (avltreen_ref, unsigned int) ; +extern unsigned int avltreen_newnode (avltreen *, unsigned int) ; #define avltreen_insertnode(t, i) avltreen_setroot(t, avlnode_insertnode(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), i, (t)->dtok, (t)->kcmp, (t)->external)) -extern int avltreen_insert (avltreen_ref, unsigned int) ; +extern int avltreen_insert (avltreen *, unsigned int) ; #define avltreen_deletenode(t, i) avltreen_delete(t, avltreen_data(t, i)) -extern int avltreen_delete (avltreen_ref, void const *) ; +extern int avltreen_delete (avltreen *, void const *) ; #define avltreen_iter(t, f, p) avlnode_iter(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), f, p) @@ -58,7 +58,7 @@ extern int avltreen_delete (avltreen_ref, void const *) ; #define avltreeb_init(t, size, dtk, f, p) avltreen_init(&(t)->info, (t)->storage, (t)->freelist, size, dtk, f, p) #define avltreeb_totalsize(t) avltreen_totalsize(&(t)->info) #define avltreeb_len(t) avltreen_len(&(t)->info) -#define avltreeb_nodes(t) ((avlnode_ref)(t)->storage) +#define avltreeb_nodes(t) ((avlnode *)(t)->storage) #define avltreeb_data(t, i) (avltreeb_nodes(t)[i].data) #define avltreeb_root(t) ((t)->info.root) #define avltreeb_setroot(t, r) ((t)->info.root = (r)) diff --git a/src/include/skalibs/bufalloc.h b/src/include/skalibs/bufalloc.h index c2779b6..2941311 100644 --- a/src/include/skalibs/bufalloc.h +++ b/src/include/skalibs/bufalloc.h @@ -17,7 +17,7 @@ struct bufalloc #define BUFALLOC_ZERO { .x = STRALLOC_ZERO, .p = 0, .fd = -1, .op = 0 } #define BUFALLOC_INIT(f, d) { .x = STRALLOC_ZERO, .p = 0, .fd = (d), .op = (f) } -extern void bufalloc_init (bufalloc_ref, int (*)(int, char const *, unsigned int), int) ; +extern void bufalloc_init (bufalloc *, int (*)(int, char const *, unsigned int), int) ; #define bufalloc_shrink(ba) stralloc_shrink(&(ba)->x) #define bufalloc_free(ba) stralloc_free(&(ba)->x) #define bufalloc_put(ba, s, n) stralloc_catb(&(ba)->x, s, n) @@ -25,12 +25,15 @@ extern void bufalloc_init (bufalloc_ref, int (*)(int, char const *, unsigned int #define bufalloc_putv(ba, v, n) stralloc_catv(&(ba)->x, v, n) #define bufalloc_fd(ba) ((ba)->fd) extern int bufalloc_getfd (bufalloc const *) gccattr_pure ; -extern int bufalloc_flush (bufalloc_ref) ; -extern void bufalloc_clean (bufalloc_ref) ; +extern int bufalloc_flush (bufalloc *) ; +extern void bufalloc_clean (bufalloc *) ; #define bufalloc_len(ba) ((ba)->x.len - (ba)->p) extern unsigned int bufalloc_getlen (bufalloc const *) gccattr_pure ; #define bufalloc_isempty(ba) ((ba)->x.len == (ba)->p) -extern bufalloc_ref bufalloc_1, bufalloc_2 ; +extern bufalloc bufalloc_1_ ; +#define bufalloc_1 (&bufalloc_1_) +extern bufalloc bufalloc_2_ ; +#define bufalloc_2 (&bufalloc_2_) #endif diff --git a/src/include/skalibs/djbtime.h b/src/include/skalibs/djbtime.h index 60a1d0b..8aace55 100644 --- a/src/include/skalibs/djbtime.h +++ b/src/include/skalibs/djbtime.h @@ -54,9 +54,9 @@ extern int utc_from_localtm (uint64 *, struct tm const *) ; extern int localtm_from_tai (struct tm *, tai_t const *, int) ; extern int tai_from_localtm (tai_t *, struct tm const *) ; -extern int localtmn_from_tain (localtmn_t_ref, tain_t const *, int) ; +extern int localtmn_from_tain (localtmn_t *, tain_t const *, int) ; extern int tain_from_localtmn (tain_t *, localtmn_t const *) ; -extern int localtmn_from_sysclock (localtmn_t_ref, tain_t const *, int) ; +extern int localtmn_from_sysclock (localtmn_t *, tain_t const *, int) ; extern int sysclock_from_localtmn (tain_t *, localtmn_t const *) ; #define LOCALTM_FMT 21 @@ -65,6 +65,6 @@ extern unsigned int localtm_scan (char const *, struct tm *) ; #define LOCALTMN_FMT 31 extern unsigned int localtmn_fmt (char *, localtmn_t const *) ; -extern unsigned int localtmn_scan (char const *, localtmn_t_ref) ; +extern unsigned int localtmn_scan (char const *, localtmn_t *) ; #endif diff --git a/src/include/skalibs/genset.h b/src/include/skalibs/genset.h index 5eb47d7..5e27821 100644 --- a/src/include/skalibs/genset.h +++ b/src/include/skalibs/genset.h @@ -16,14 +16,14 @@ struct genset_s } ; #define GENSET_ZERO { .storage = 0, .freelist = 0, .esize = 1, .max = 0, .sp = 0 } -extern void genset_init (genset_ref, void *, unsigned int *, unsigned int, unsigned int) ; +extern void genset_init (genset *, void *, unsigned int *, unsigned int, unsigned int) ; #define GENSET_init(g, type, storage, fl, size) genset_init(g, storage, fl, sizeof(type), size) #define genset_p(type, g, i) ((type *)((g)->storage + (i) * (g)->esize)) -extern unsigned int genset_new (genset_ref) ; -extern int genset_delete (genset_ref, unsigned int) ; +extern unsigned int genset_new (genset *) ; +extern int genset_delete (genset *, unsigned int) ; #define genset_n(g) ((g)->max - (g)->sp) -extern unsigned int genset_iter (genset_ref, iterfunc_t_ref, void *) ; +extern unsigned int genset_iter (genset *, iterfunc_t_ref, void *) ; #define GENSETB_TYPE(type, size) struct { type storage[size] ; unsigned int freelist[size] ; genset info ; } diff --git a/src/include/skalibs/gensetdyn.h b/src/include/skalibs/gensetdyn.h index 4fe396b..20dfde6 100644 --- a/src/include/skalibs/gensetdyn.h +++ b/src/include/skalibs/gensetdyn.h @@ -22,19 +22,19 @@ struct gensetdyn_s extern gensetdyn const gensetdyn_zero ; #define GENSETDYN_INIT(type, b, num, den) { .storage = STRALLOC_ZERO, .freelist = GENALLOC_ZERO, .esize = sizeof(type), .base = (b), .fracnum = (num), .fracden = (den) } -extern void gensetdyn_init (gensetdyn_ref, unsigned int, unsigned int, unsigned int, unsigned int) ; +extern void gensetdyn_init (gensetdyn *, unsigned int, unsigned int, unsigned int, unsigned int) ; #define gensetdyn_n(g) ((g)->storage.len - genalloc_len(unsigned int, &(g)->freelist)) -extern int gensetdyn_ready (gensetdyn_ref, unsigned int) ; +extern int gensetdyn_ready (gensetdyn *, unsigned int) ; #define gensetdyn_readyplus(x, n) gensetdyn_ready(x, gensetdyn_n(x) + (n)) -extern void gensetdyn_free (gensetdyn_ref) ; +extern void gensetdyn_free (gensetdyn *) ; -extern int gensetdyn_new (gensetdyn_ref, unsigned int *) ; -extern int gensetdyn_delete (gensetdyn_ref, unsigned int) ; +extern int gensetdyn_new (gensetdyn *, unsigned int *) ; +extern int gensetdyn_delete (gensetdyn *, unsigned int) ; #define gensetdyn_p(g, i) ((g)->storage.s + (i) * (g)->esize) #define GENSETDYN_P(type, g, i) ((type *)gensetdyn_p(g, i)) -extern unsigned int gensetdyn_iter (gensetdyn_ref, iterfunc_t_ref, void *) ; +extern unsigned int gensetdyn_iter (gensetdyn *, iterfunc_t_ref, void *) ; #endif diff --git a/src/include/skalibs/iobuffer.h b/src/include/skalibs/iobuffer.h index d9d44d8..93a98c5 100644 --- a/src/include/skalibs/iobuffer.h +++ b/src/include/skalibs/iobuffer.h @@ -58,7 +58,7 @@ typedef iobufferk_finish_func_t *iobufferk_finish_func_t_ref ; extern iobufferk_io_func_t iobufferk_nosys ; extern iobufferk_io_func_t iobufferk_isworking ; -extern int iobufferk_init (iobufferk_ref, int, int) ; +extern int iobufferk_init (iobufferk *, int, int) ; extern iobufferk_io_func_t_ref const iobufferk_fill_f[4] ; extern iobufferk_io_func_t_ref const iobufferk_flush_f[4] ; extern iobufferk_finish_func_t_ref const iobufferk_finish_f[4] ; diff --git a/src/include/skalibs/md5.h b/src/include/skalibs/md5.h index 00e43cc..c5d61a8 100644 --- a/src/include/skalibs/md5.h +++ b/src/include/skalibs/md5.h @@ -14,8 +14,8 @@ struct MD5Schedule } ; #define MD5_INIT() { .buf = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL }, .bits = { 0, 0 }, .in = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" } -extern void md5_init (MD5Schedule_ref) ; -extern void md5_update (MD5Schedule_ref, char const *, unsigned int) ; -extern void md5_final (MD5Schedule_ref, char * /* 16 chars */) ; +extern void md5_init (MD5Schedule *) ; +extern void md5_update (MD5Schedule *, char const *, unsigned int) ; +extern void md5_final (MD5Schedule *, char * /* 16 chars */) ; #endif diff --git a/src/include/skalibs/rc4.h b/src/include/skalibs/rc4.h index 16683ce..6bb8062 100644 --- a/src/include/skalibs/rc4.h +++ b/src/include/skalibs/rc4.h @@ -13,7 +13,7 @@ struct RC4Schedule unsigned char x, y ; } ; -extern void rc4_init (RC4Schedule_ref, char const *, unsigned int) ; -extern void rc4 (RC4Schedule_ref, char const *, char *, unsigned int) ; +extern void rc4_init (RC4Schedule *, char const *, unsigned int) ; +extern void rc4 (RC4Schedule *, char const *, char *, unsigned int) ; #endif diff --git a/src/include/skalibs/rrandom.h b/src/include/skalibs/rrandom.h index 7f6a2aa..0678523 100644 --- a/src/include/skalibs/rrandom.h +++ b/src/include/skalibs/rrandom.h @@ -23,14 +23,14 @@ struct rrandom #define RRANDOM_ZERO { .tries = { RRANDOMINFO_ZERO, RRANDOMINFO_ZERO, RRANDOMINFO_ZERO }, .n = 0 } -extern int rrandom_add (rrandom_ref, int (*) (unirandom_ref)) ; -extern int rrandom_finish (rrandom_ref) ; +extern int rrandom_add (rrandom *, int (*) (unirandom *)) ; +extern int rrandom_finish (rrandom *) ; -extern unsigned int rrandom_read (rrandom_ref, char *, unsigned int, unsigned int (*) (unirandom_ref, char *, unsigned int)) ; -extern unsigned int rrandom_readint (rrandom_ref, unsigned int, unsigned int (*) (unirandom_ref, char *, unsigned int)) ; +extern unsigned int rrandom_read (rrandom *, char *, unsigned int, unsigned int (*) (unirandom *, char *, unsigned int)) ; +extern unsigned int rrandom_readint (rrandom *, unsigned int, unsigned int (*) (unirandom *, char *, unsigned int)) ; #define rrandom_readb(z, s, n) rrandom_read((z), (s), (n), &unirandom_readb) #define rrandom_readnb(z, s, n) rrandom_read((z), (s), (n), &unirandom_readnb) -extern unsigned int rrandom_name (rrandom_ref, char *, unsigned int, int) ; +extern unsigned int rrandom_name (rrandom *, char *, unsigned int, int) ; #endif diff --git a/src/include/skalibs/sgetopt.h b/src/include/skalibs/sgetopt.h index 367edf3..3c7a393 100644 --- a/src/include/skalibs/sgetopt.h +++ b/src/include/skalibs/sgetopt.h @@ -19,12 +19,12 @@ struct subgetopt_s #define SUBGETOPT_ZERO { .ind = 1, .err = 1, .problem = 0, .arg = 0, .pos = 0, .prog = 0 } -extern int subgetopt_r (int, char const *const *, char const *, subgetopt_t_ref) ; +extern int subgetopt_r (int, char const *const *, char const *, subgetopt_t *) ; /* non-reentrant */ -extern int sgetopt_r (int, char const *const *, char const *, subgetopt_t_ref) ; +extern int sgetopt_r (int, char const *const *, char const *, subgetopt_t *) ; extern subgetopt_t subgetopt_here ; diff --git a/src/include/skalibs/sha1.h b/src/include/skalibs/sha1.h index 03cdaf0..be252ba 100644 --- a/src/include/skalibs/sha1.h +++ b/src/include/skalibs/sha1.h @@ -15,8 +15,8 @@ struct SHA1Schedule } ; #define SHA1_INIT() { .buf = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 } -extern void sha1_init (SHA1Schedule_ref) ; -extern void sha1_update (SHA1Schedule_ref, char const *, unsigned int) ; -extern void sha1_final (SHA1Schedule_ref, char * /* 20 chars */) ; +extern void sha1_init (SHA1Schedule *) ; +extern void sha1_update (SHA1Schedule *, char const *, unsigned int) ; +extern void sha1_final (SHA1Schedule *, char * /* 20 chars */) ; #endif diff --git a/src/include/skalibs/sha256.h b/src/include/skalibs/sha256.h index 8f28c38..3675211 100644 --- a/src/include/skalibs/sha256.h +++ b/src/include/skalibs/sha256.h @@ -22,8 +22,8 @@ struct SHA256Schedule_s } ; #define SHA256_INIT() { .buf = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 } -extern void sha256_init (SHA256Schedule_ref) ; -extern void sha256_update (SHA256Schedule_ref, char const *, unsigned int) ; -extern void sha256_final (SHA256Schedule_ref, char *digest) ; +extern void sha256_init (SHA256Schedule *) ; +extern void sha256_update (SHA256Schedule *, char const *, unsigned int) ; +extern void sha256_final (SHA256Schedule *, char *digest) ; #endif diff --git a/src/include/skalibs/surf.h b/src/include/skalibs/surf.h index 6422903..aa872e1 100644 --- a/src/include/skalibs/surf.h +++ b/src/include/skalibs/surf.h @@ -16,14 +16,11 @@ struct SURFSchedule #define SURFSCHEDULE_ZERO { .seed = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .out = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", .pos = 32 } -extern void surf_sinit (SURFSchedule_ref, char const *) ; /* 160 chars */ -extern void surf (SURFSchedule_ref, char *, unsigned int) ; - - - /* The following functions need libstdcrypto.a */ +extern void surf_sinit (SURFSchedule *, char const *) ; /* 160 chars */ +extern void surf (SURFSchedule *, char *, unsigned int) ; extern void surf_makeseed (char *) ; /* fills 160 chars */ -extern void surf_init (SURFSchedule_ref) ; -extern void surf_autoinit (SURFSchedule_ref, char *, unsigned int) ; +extern void surf_init (SURFSchedule *) ; +extern void surf_autoinit (SURFSchedule *, char *, unsigned int) ; #endif diff --git a/src/include/skalibs/unirandom.h b/src/include/skalibs/unirandom.h index fc87886..ecbe6de 100644 --- a/src/include/skalibs/unirandom.h +++ b/src/include/skalibs/unirandom.h @@ -43,15 +43,14 @@ struct unirandom #define UNIRANDOM_ZERO { .readb = 0, .readnb = 0, .init = 0, .finish = 0, .data = UNIRANDOMINFO_ZERO, .initted = 0 } -extern int unirandom_register_devrandom (unirandom_ref) ; -extern int unirandom_register_devurandom (unirandom_ref) ; -extern int unirandom_register_hasegd (unirandom_ref) ; -extern int unirandom_register_surf (unirandom_ref) ; - -extern int unirandom_init (unirandom_ref) ; -extern unsigned int unirandom_readb (unirandom_ref, char *, unsigned int) ; -extern unsigned int unirandom_readnb (unirandom_ref, char *, unsigned int) ; -extern int unirandom_finish (unirandom_ref) ; - +extern int unirandom_register_devrandom (unirandom *) ; +extern int unirandom_register_devurandom (unirandom *) ; +extern int unirandom_register_hasegd (unirandom *) ; +extern int unirandom_register_surf (unirandom *) ; + +extern int unirandom_init (unirandom *) ; +extern unsigned int unirandom_readb (unirandom *, char *, unsigned int) ; +extern unsigned int unirandom_readnb (unirandom *, char *, unsigned int) ; +extern int unirandom_finish (unirandom *) ; #endif diff --git a/src/include/skalibs/unix-timed.h b/src/include/skalibs/unix-timed.h index f5a25b6..5fad179 100644 --- a/src/include/skalibs/unix-timed.h +++ b/src/include/skalibs/unix-timed.h @@ -26,9 +26,9 @@ extern int buffer_timed_flush (buffer *, tain_t const *, tain_t *) ; extern unsigned int buffer_timed_get (buffer *, char *, unsigned int, tain_t const *, tain_t *) ; #define buffer_timed_get_g(b, buf, buflen, deadline) buffer_timed_get(b, buf, buflen, (deadline), &STAMP) -extern int timed_getln (buffer_ref, stralloc *, char, tain_t const *, tain_t *) ; +extern int timed_getln (buffer *, stralloc *, char, tain_t const *, tain_t *) ; #define timed_getln_g(b, sa, sep, deadline) timed_getln(b, sa, sep, (deadline), &STAMP) -extern int timed_getlnmax (buffer_ref, char *, unsigned int, unsigned int *, char, tain_t const *, tain_t *) ; +extern int timed_getlnmax (buffer *, char *, unsigned int, unsigned int *, char, tain_t const *, tain_t *) ; #define timed_getlnmax_g(b, max, maxlen, len, sep, deadline) timed_getlnmax(b, max, maxlen, len, sep, (deadline), &STAMP) extern int netstring_timed_get (buffer *, stralloc *, tain_t const *, tain_t *) ; #define netstring_timed_get_g(b, sa, deadline) netstring_timed_get(b, sa, (deadline), &STAMP) diff --git a/src/include/skalibs/unix-transactional.h b/src/include/skalibs/unix-transactional.h index e1545e0..b811c99 100644 --- a/src/include/skalibs/unix-transactional.h +++ b/src/include/skalibs/unix-transactional.h @@ -44,12 +44,12 @@ struct dirdescriptor_s #define DIRDESCRIPTOR_ZERO { .fd = 0, .lnkfn = 0, .new = STRALLOC_ZERO } -extern int dd_open_read (dirdescriptor_t_ref, char const *) ; -extern int dd_open_write (dirdescriptor_t_ref, char const *, unsigned int) ; -extern int dd_close (dirdescriptor_t_ref) ; /* after dd_open_read */ -extern void dd_cancel (dirdescriptor_t_ref) ; /* after dd_open_write */ -extern int dd_commit (dirdescriptor_t_ref) ; /* after dd_open_write */ -extern int dd_commit_devino (dirdescriptor_t_ref, uint64 *, uint64 *) ; /* after dd_open_write */ +extern int dd_open_read (dirdescriptor_t *, char const *) ; +extern int dd_open_write (dirdescriptor_t *, char const *, unsigned int) ; +extern int dd_close (dirdescriptor_t *) ; /* after dd_open_read */ +extern void dd_cancel (dirdescriptor_t *) ; /* after dd_open_write */ +extern int dd_commit (dirdescriptor_t *) ; /* after dd_open_write */ +extern int dd_commit_devino (dirdescriptor_t *, uint64 *, uint64 *) ; /* after dd_open_write */ #define dd_openreadnclose(blah, file, s, len) openreadnclose_at((blah)->fd, file, s, len) #define dd_openslurpclose(blah, file, sa) openslurpclose_at((blah)->fd, file, sa) diff --git a/src/libdatastruct/avlnode-internal.h b/src/libdatastruct/avlnode-internal.h index 0342695..2151cf3 100644 --- a/src/libdatastruct/avlnode-internal.h +++ b/src/libdatastruct/avlnode-internal.h @@ -8,8 +8,8 @@ #define avlnode_ufroms(c) ((c) > 0) #define avlnode_sfromu(h) ((h) ? 1 : -1) -extern unsigned int avlnode_rotate (avlnode_ref, unsigned int, unsigned int, int) ; -extern unsigned int avlnode_doublerotate (avlnode_ref, unsigned int, unsigned int, int) ; +extern unsigned int avlnode_rotate (avlnode *, unsigned int, unsigned int, int) ; +extern unsigned int avlnode_doublerotate (avlnode *, unsigned int, unsigned int, int) ; #define avlnode_rotate_maydouble(s, max, r, h, isdouble) ((isdouble) ? avlnode_doublerotate(s, max, r, h) : avlnode_rotate(s, max, r, h)) #endif diff --git a/src/libdatastruct/avlnode_insertnode.c b/src/libdatastruct/avlnode_insertnode.c index c69b34e..ac44877 100644 --- a/src/libdatastruct/avlnode_insertnode.c +++ b/src/libdatastruct/avlnode_insertnode.c @@ -4,7 +4,7 @@ #include <skalibs/avlnode.h> #include "avlnode-internal.h" -unsigned int avlnode_insertnode (avlnode_ref s, unsigned int max, unsigned int r, unsigned int i, dtokfunc_t_ref dtok, cmpfunc_t_ref f, void *p) +unsigned int avlnode_insertnode (avlnode *s, unsigned int max, unsigned int r, unsigned int i, dtokfunc_t_ref dtok, cmpfunc_t_ref f, void *p) { unsigned int stack[AVLNODE_MAXDEPTH] ; int spin[AVLNODE_MAXDEPTH] ; diff --git a/src/libdatastruct/avlnode_iter.c b/src/libdatastruct/avlnode_iter.c index 9e1d698..c6064f3 100644 --- a/src/libdatastruct/avlnode_iter.c +++ b/src/libdatastruct/avlnode_iter.c @@ -4,7 +4,7 @@ struct avlnode_iter_s { - avlnode_ref s ; + avlnode *s ; unsigned int max ; avliterfunc_t_ref f ; void *p ; @@ -19,7 +19,7 @@ static int avlnode_iter_rec (struct avlnode_iter_s const *blah, unsigned int r, : 1 ; } -int avlnode_iter (avlnode_ref s, unsigned int max, unsigned int r, avliterfunc_t_ref f, void *p) +int avlnode_iter (avlnode *s, unsigned int max, unsigned int r, avliterfunc_t_ref f, void *p) { struct avlnode_iter_s blah = { s, max, f, p } ; return avlnode_iter_rec(&blah, r, 0) ; diff --git a/src/libdatastruct/avlnode_rotate.c b/src/libdatastruct/avlnode_rotate.c index fe06994..f2f75d7 100644 --- a/src/libdatastruct/avlnode_rotate.c +++ b/src/libdatastruct/avlnode_rotate.c @@ -3,7 +3,7 @@ #include <skalibs/avlnode.h> #include "avlnode-internal.h" -unsigned int avlnode_rotate (avlnode_ref s, unsigned int max, unsigned int i, int h) +unsigned int avlnode_rotate (avlnode *s, unsigned int max, unsigned int i, int h) { register unsigned int j = s[i].child[!h] ; s[i].child[!h] = s[j].child[h] ; diff --git a/src/libdatastruct/avltree_delete.c b/src/libdatastruct/avltree_delete.c index 5127f01..682877c 100644 --- a/src/libdatastruct/avltree_delete.c +++ b/src/libdatastruct/avltree_delete.c @@ -5,7 +5,7 @@ #include <skalibs/avlnode.h> #include <skalibs/avltree.h> -int avltree_delete (avltree_ref t, void const *k) +int avltree_delete (avltree *t, void const *k) { unsigned int r = avltree_root(t) ; unsigned int i = avlnode_delete(avltree_nodes(t), avltree_totalsize(t), &r, k, t->dtok, t->kcmp, t->external) ; diff --git a/src/libdatastruct/avltree_free.c b/src/libdatastruct/avltree_free.c index 14198fe..161004a 100644 --- a/src/libdatastruct/avltree_free.c +++ b/src/libdatastruct/avltree_free.c @@ -3,7 +3,7 @@ #include <skalibs/gensetdyn.h> #include <skalibs/avltree.h> -void avltree_free (avltree_ref t) +void avltree_free (avltree *t) { gensetdyn_free(&t->x) ; *t = avltree_zero ; diff --git a/src/libdatastruct/avltree_init.c b/src/libdatastruct/avltree_init.c index 290ff64..b4bfbe5 100644 --- a/src/libdatastruct/avltree_init.c +++ b/src/libdatastruct/avltree_init.c @@ -6,7 +6,7 @@ #include <skalibs/avlnode.h> #include <skalibs/avltree.h> -void avltree_init (avltree_ref t, unsigned int base, unsigned int fracnum, unsigned int fracden, dtokfunc_t_ref dtok, cmpfunc_t_ref f, void *p) +void avltree_init (avltree *t, unsigned int base, unsigned int fracnum, unsigned int fracden, dtokfunc_t_ref dtok, cmpfunc_t_ref f, void *p) { gensetdyn_init(&t->x, sizeof(avlnode), base, fracnum, fracden) ; t->root = (unsigned int)-1 ; diff --git a/src/libdatastruct/avltree_newnode.c b/src/libdatastruct/avltree_newnode.c index dc972a0..934da2c 100644 --- a/src/libdatastruct/avltree_newnode.c +++ b/src/libdatastruct/avltree_newnode.c @@ -5,11 +5,11 @@ #include <skalibs/avlnode.h> #include <skalibs/avltree.h> -int avltree_newnode (avltree_ref t, unsigned int data, unsigned int *i) +int avltree_newnode (avltree *t, unsigned int data, unsigned int *i) { if (!gensetdyn_new(&t->x, i)) return 0 ; { - register avlnode_ref s = avltree_nodes(t) ; + register avlnode *s = avltree_nodes(t) ; s[*i].data = data ; s[*i].child[0] = s[*i].child[1] = (unsigned int)-1 ; s[*i].balance = 0 ; diff --git a/src/libdatastruct/avltreen_delete.c b/src/libdatastruct/avltreen_delete.c index bfe85c5..ecf6ea4 100644 --- a/src/libdatastruct/avltreen_delete.c +++ b/src/libdatastruct/avltreen_delete.c @@ -5,7 +5,7 @@ #include <skalibs/avlnode.h> #include <skalibs/avltreen.h> -int avltreen_delete (avltreen_ref t, void const *k) +int avltreen_delete (avltreen *t, void const *k) { unsigned int r = avltreen_root(t) ; unsigned int i = avlnode_delete(avltreen_nodes(t), avltreen_totalsize(t), &r, k, t->dtok, t->kcmp, t->external) ; diff --git a/src/libdatastruct/avltreen_init.c b/src/libdatastruct/avltreen_init.c index 5e141b1..b4172b8 100644 --- a/src/libdatastruct/avltreen_init.c +++ b/src/libdatastruct/avltreen_init.c @@ -5,7 +5,7 @@ #include <skalibs/avlnode.h> #include <skalibs/avltreen.h> -void avltreen_init (avltreen_ref t, avlnode_ref storage, unsigned int *freelist, unsigned int size, dtokfunc_t_ref dtok, cmpfunc_t_ref f, void *p) +void avltreen_init (avltreen *t, avlnode_ref storage, unsigned int *freelist, unsigned int size, dtokfunc_t_ref dtok, cmpfunc_t_ref f, void *p) { GENSET_init(&t->x, avlnode, storage, freelist, size) ; t->root = size ; diff --git a/src/libdatastruct/avltreen_insert.c b/src/libdatastruct/avltreen_insert.c index 795216d..b3d24d0 100644 --- a/src/libdatastruct/avltreen_insert.c +++ b/src/libdatastruct/avltreen_insert.c @@ -2,7 +2,7 @@ #include <skalibs/avltreen.h> -int avltreen_insert (avltreen_ref t, unsigned int d) +int avltreen_insert (avltreen *t, unsigned int d) { unsigned int i = avltreen_newnode(t, d) ; if (i >= avltreen_totalsize(t)) return 0 ; diff --git a/src/libdatastruct/avltreen_newnode.c b/src/libdatastruct/avltreen_newnode.c index 335025c..62b08e2 100644 --- a/src/libdatastruct/avltreen_newnode.c +++ b/src/libdatastruct/avltreen_newnode.c @@ -4,12 +4,12 @@ #include <skalibs/avlnode.h> #include <skalibs/avltreen.h> -unsigned int avltreen_newnode (avltreen_ref t, unsigned int d) +unsigned int avltreen_newnode (avltreen *t, unsigned int d) { register unsigned int i = genset_new(&t->x) ; if (i < avltreen_totalsize(t)) { - register avlnode_ref s = avltreen_nodes(t) ; + register avlnode *s = avltreen_nodes(t) ; s[i].data = d ; s[i].child[0] = s[i].child[1] = avltreen_totalsize(t) ; s[i].balance = 0 ; diff --git a/src/libdatastruct/genset.c b/src/libdatastruct/genset.c index 8d750b7..c8fc36e 100644 --- a/src/libdatastruct/genset.c +++ b/src/libdatastruct/genset.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/genset.h> -void genset_init (genset_ref x, void *storage, unsigned int *freelist, unsigned int esize, unsigned int max) +void genset_init (genset *x, void *storage, unsigned int *freelist, unsigned int esize, unsigned int max) { register unsigned int i = 0 ; x->storage = (char *)storage ; @@ -14,12 +14,12 @@ void genset_init (genset_ref x, void *storage, unsigned int *freelist, unsigned for (; i < max ; i++) freelist[i] = max - 1 - i ; } -unsigned int genset_new (genset_ref x) +unsigned int genset_new (genset *x) { return x->sp ? x->freelist[--x->sp] : (errno = ENOSPC, x->max) ; } -int genset_delete (genset_ref x, unsigned int i) +int genset_delete (genset *x, unsigned int i) { if ((i >= x->max) || (x->sp >= x->max)) return (errno = EINVAL, 0) ; x->freelist[x->sp++] = i ; diff --git a/src/libdatastruct/genset_iter.c b/src/libdatastruct/genset_iter.c index cc6e863..fba95de 100644 --- a/src/libdatastruct/genset_iter.c +++ b/src/libdatastruct/genset_iter.c @@ -4,7 +4,7 @@ #include <skalibs/functypes.h> #include <skalibs/genset.h> -unsigned int genset_iter (genset_ref g, iterfunc_t_ref f, void *stuff) +unsigned int genset_iter (genset *g, iterfunc_t_ref f, void *stuff) { unsigned char bits[bitarray_div8(g->max)] ; unsigned int i = 0, j = 0, n = 0, m = genset_n(g) ; diff --git a/src/libdatastruct/gensetdyn_delete.c b/src/libdatastruct/gensetdyn_delete.c index 58aec05..cfa15cf 100644 --- a/src/libdatastruct/gensetdyn_delete.c +++ b/src/libdatastruct/gensetdyn_delete.c @@ -4,7 +4,7 @@ #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> -int gensetdyn_delete (gensetdyn_ref g, unsigned int i) +int gensetdyn_delete (gensetdyn *g, unsigned int i) { return (i >= g->storage.len) ? (errno = EINVAL, 0) : genalloc_catb(unsigned int, &g->freelist, &i, 1) ; diff --git a/src/libdatastruct/gensetdyn_free.c b/src/libdatastruct/gensetdyn_free.c index c0a4366..b0e03ad 100644 --- a/src/libdatastruct/gensetdyn_free.c +++ b/src/libdatastruct/gensetdyn_free.c @@ -4,7 +4,7 @@ #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> -void gensetdyn_free (gensetdyn_ref g) +void gensetdyn_free (gensetdyn *g) { stralloc_free(&g->storage) ; genalloc_free(unsigned int, &g->freelist) ; diff --git a/src/libdatastruct/gensetdyn_init.c b/src/libdatastruct/gensetdyn_init.c index cff6ff5..7cfdf86 100644 --- a/src/libdatastruct/gensetdyn_init.c +++ b/src/libdatastruct/gensetdyn_init.c @@ -4,7 +4,7 @@ #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> -void gensetdyn_init (gensetdyn_ref g, unsigned int esize, unsigned int base, unsigned int fracnum, unsigned int fracden) +void gensetdyn_init (gensetdyn *g, unsigned int esize, unsigned int base, unsigned int fracnum, unsigned int fracden) { g->storage = stralloc_zero ; g->freelist = genalloc_zero ; diff --git a/src/libdatastruct/gensetdyn_iter.c b/src/libdatastruct/gensetdyn_iter.c index 216d42b..51d598b 100644 --- a/src/libdatastruct/gensetdyn_iter.c +++ b/src/libdatastruct/gensetdyn_iter.c @@ -4,7 +4,7 @@ #include <skalibs/functypes.h> #include <skalibs/gensetdyn.h> -unsigned int gensetdyn_iter (gensetdyn_ref g, iterfunc_t_ref f, void *stuff) +unsigned int gensetdyn_iter (gensetdyn *g, iterfunc_t_ref f, void *stuff) { /* XXX: we may be called by a freeing function, so we cannot alloc - diff --git a/src/libdatastruct/gensetdyn_new.c b/src/libdatastruct/gensetdyn_new.c index 6a49189..5e199b3 100644 --- a/src/libdatastruct/gensetdyn_new.c +++ b/src/libdatastruct/gensetdyn_new.c @@ -3,7 +3,7 @@ #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> -int gensetdyn_new (gensetdyn_ref g, unsigned int *i) +int gensetdyn_new (gensetdyn *g, unsigned int *i) { register unsigned int n ; if (!genalloc_len(unsigned int, &g->freelist) && !gensetdyn_readyplus(g, 1)) return 0 ; diff --git a/src/libdatastruct/gensetdyn_ready.c b/src/libdatastruct/gensetdyn_ready.c index d1cfd9f..8418e1a 100644 --- a/src/libdatastruct/gensetdyn_ready.c +++ b/src/libdatastruct/gensetdyn_ready.c @@ -4,7 +4,7 @@ #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> -int gensetdyn_ready (gensetdyn_ref g, unsigned int n) +int gensetdyn_ready (gensetdyn *g, unsigned int n) { int wasnull = !g->storage.s ; unsigned int i = g->storage.len ; diff --git a/src/librandom/random-internal.h b/src/librandom/random-internal.h index 37b534e..a9788fc 100644 --- a/src/librandom/random-internal.h +++ b/src/librandom/random-internal.h @@ -8,7 +8,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -extern void unirandom_register (unirandom_ref, int (*) (union unirandominfo *), int (*) (union unirandominfo *), unsigned int (*) (union unirandominfo *, char *, unsigned int), unsigned int (*) (union unirandominfo *, char *, unsigned int)) ; +extern void unirandom_register (unirandom *, int (*) (union unirandominfo *), int (*) (union unirandominfo *), unsigned int (*) (union unirandominfo *, char *, unsigned int), unsigned int (*) (union unirandominfo *, char *, unsigned int)) ; extern unsigned int random_mask2 (unsigned int) gccattr_const ; extern unsigned int random_nchars (unsigned int) gccattr_const ; diff --git a/src/librandom/rrandom_add.c b/src/librandom/rrandom_add.c index c22a43c..23fa2af 100644 --- a/src/librandom/rrandom_add.c +++ b/src/librandom/rrandom_add.c @@ -4,7 +4,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -int rrandom_add (rrandom_ref z, int (*f) (unirandom_ref)) +int rrandom_add (rrandom *z, int (*f) (unirandom *)) { if (z->n >= 3) return (errno = EBUSY, 0) ; if (!(*f)(&z->tries[z->n].it)) return 0 ; diff --git a/src/librandom/rrandom_finish.c b/src/librandom/rrandom_finish.c index a3cb24b..c2d4992 100644 --- a/src/librandom/rrandom_finish.c +++ b/src/librandom/rrandom_finish.c @@ -3,7 +3,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -int rrandom_finish (rrandom_ref z) +int rrandom_finish (rrandom *z) { rrandom zero = RRANDOM_ZERO ; unsigned int i = z->n ; diff --git a/src/librandom/rrandom_name.c b/src/librandom/rrandom_name.c index 5e77e83..2085d17 100644 --- a/src/librandom/rrandom_name.c +++ b/src/librandom/rrandom_name.c @@ -3,7 +3,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -unsigned int rrandom_name (rrandom_ref z, char *s, unsigned int n, int nb) +unsigned int rrandom_name (rrandom *z, char *s, unsigned int n, int nb) { static char const *oklist = "ABCDEFGHIJKLMNOPQRSTUVWXYZghijklmnopqrstuvwxyz-_0123456789abcdef" ; register unsigned int r = rrandom_read(z, s, n, nb ? &unirandom_readnb : &unirandom_readb) ; diff --git a/src/librandom/rrandom_read.c b/src/librandom/rrandom_read.c index 57ff920..9d56b0c 100644 --- a/src/librandom/rrandom_read.c +++ b/src/librandom/rrandom_read.c @@ -6,7 +6,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -unsigned int rrandom_read (rrandom_ref z, char *s, unsigned int n, unsigned int (*f) (unirandom_ref, char *, unsigned int)) +unsigned int rrandom_read (rrandom *z, char *s, unsigned int n, unsigned int (*f) (unirandom *, char *, unsigned int)) { unsigned int i = 0 ; for (; i < 3 ; i++) diff --git a/src/librandom/rrandom_readint.c b/src/librandom/rrandom_readint.c index e4f677c..6a34de2 100644 --- a/src/librandom/rrandom_readint.c +++ b/src/librandom/rrandom_readint.c @@ -1,11 +1,12 @@ /* ISC license. */ #include <skalibs/uint.h> +#include <skalibs/bytestr.h> #include <skalibs/unirandom.h> #include "random-internal.h" #include <skalibs/rrandom.h> -unsigned int rrandom_readint (rrandom_ref z, unsigned int n, unsigned int (*f) (unirandom_ref, char *, unsigned int)) +unsigned int rrandom_readint (rrandom *z, unsigned int n, unsigned int (*f) (unirandom *, char *, unsigned int)) { if (!n) return 0 ; else diff --git a/src/librandom/surf.c b/src/librandom/surf.c index 1687df9..ad0aab1 100644 --- a/src/librandom/surf.c +++ b/src/librandom/surf.c @@ -7,7 +7,7 @@ #define ROTATE(x, b) (((x) << (b)) | ((x) >> (32 - (b)))) #define MUSH(i, b) x = t[i] += (((x ^ ctx->seed[i]) + sum) ^ ROTATE(x, b)) -static void surfit (SURFSchedule_ref ctx) +static void surfit (SURFSchedule *ctx) { uint32 t[12] ; uint32 z[8] ; @@ -33,7 +33,7 @@ static void surfit (SURFSchedule_ref ctx) for (i = 0 ; i < 8 ; i++) uint32_pack(ctx->out + (i<<2), z[i]) ; } -void surf (SURFSchedule_ref ctx, char *s, unsigned int n) +void surf (SURFSchedule *ctx, char *s, unsigned int n) { { register unsigned int i = 32 - ctx->pos ; diff --git a/src/librandom/surf_autoinit.c b/src/librandom/surf_autoinit.c index 920612b..b7774c0 100644 --- a/src/librandom/surf_autoinit.c +++ b/src/librandom/surf_autoinit.c @@ -2,7 +2,7 @@ #include <skalibs/surf.h> -void surf_autoinit (SURFSchedule_ref ctx, char *s, unsigned int n) +void surf_autoinit (SURFSchedule *ctx, char *s, unsigned int n) { if (!ctx->in[0] && !ctx->in[1] && !ctx->in[2] && !ctx->in[3]) surf_init(ctx) ; diff --git a/src/librandom/surf_init.c b/src/librandom/surf_init.c index 3662fa8..045ec09 100644 --- a/src/librandom/surf_init.c +++ b/src/librandom/surf_init.c @@ -2,7 +2,7 @@ #include <skalibs/surf.h> -void surf_init (SURFSchedule_ref ctx) +void surf_init (SURFSchedule *ctx) { char s[160] ; surf_makeseed(s) ; diff --git a/src/librandom/surf_sinit.c b/src/librandom/surf_sinit.c index ae7f480..f81a5c8 100644 --- a/src/librandom/surf_sinit.c +++ b/src/librandom/surf_sinit.c @@ -3,7 +3,7 @@ #include <skalibs/uint32.h> #include <skalibs/surf.h> -void surf_sinit (SURFSchedule_ref ctx, char const *s) +void surf_sinit (SURFSchedule *ctx, char const *s) { SURFSchedule zero = SURFSCHEDULE_ZERO ; register unsigned int i = 4 ; diff --git a/src/librandom/unirandom_finish.c b/src/librandom/unirandom_finish.c index 14c4411..bb54eb5 100644 --- a/src/librandom/unirandom_finish.c +++ b/src/librandom/unirandom_finish.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -int unirandom_finish (unirandom_ref u) +int unirandom_finish (unirandom *u) { if (!u->initted) return 1 ; if (!(*u->finish)(&u->data)) return 0 ; diff --git a/src/librandom/unirandom_init.c b/src/librandom/unirandom_init.c index 711a4ac..6324d71 100644 --- a/src/librandom/unirandom_init.c +++ b/src/librandom/unirandom_init.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -int unirandom_init (unirandom_ref u) +int unirandom_init (unirandom *u) { if (u->initted) return 1 ; if (!(*u->init)(&u->data)) return 0 ; diff --git a/src/librandom/unirandom_readb.c b/src/librandom/unirandom_readb.c index cbe45a6..605e467 100644 --- a/src/librandom/unirandom_readb.c +++ b/src/librandom/unirandom_readb.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -unsigned int unirandom_readb (unirandom_ref u, char *s, unsigned int n) +unsigned int unirandom_readb (unirandom *u, char *s, unsigned int n) { if (!u->initted && !unirandom_init(u)) return 0 ; return (*u->readb)(&u->data, s, n) ; diff --git a/src/librandom/unirandom_readnb.c b/src/librandom/unirandom_readnb.c index f0cc38e..5ccc6bc 100644 --- a/src/librandom/unirandom_readnb.c +++ b/src/librandom/unirandom_readnb.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -unsigned int unirandom_readnb (unirandom_ref u, char *s, unsigned int n) +unsigned int unirandom_readnb (unirandom *u, char *s, unsigned int n) { if (!u->initted && !unirandom_init(u)) return 0 ; return (*u->readnb)(&u->data, s, n) ; diff --git a/src/librandom/unirandom_register.c b/src/librandom/unirandom_register.c index 35f7411..e174909 100644 --- a/src/librandom/unirandom_register.c +++ b/src/librandom/unirandom_register.c @@ -4,7 +4,7 @@ #include <skalibs/unirandom.h> #include "random-internal.h" -void unirandom_register (unirandom_ref u, int (*init) (union unirandominfo *), int (*finish) (union unirandominfo *), unsigned int (*readb) (union unirandominfo *, char *, unsigned int), unsigned int (*readnb) (union unirandominfo *, char *, unsigned int)) +void unirandom_register (unirandom *u, int (*init) (union unirandominfo *), int (*finish) (union unirandominfo *), unsigned int (*readb) (union unirandominfo *, char *, unsigned int), unsigned int (*readnb) (union unirandominfo *, char *, unsigned int)) { unirandom zero = UNIRANDOM_ZERO ; *u = zero ; diff --git a/src/libstdcrypto/md5_final.c b/src/libstdcrypto/md5_final.c index 834d57c..e89e075 100644 --- a/src/libstdcrypto/md5_final.c +++ b/src/libstdcrypto/md5_final.c @@ -5,7 +5,7 @@ #include <skalibs/md5.h> #include "md5-internal.h" -void md5_final (MD5Schedule_ref ctx, char *digest /* 16 chars */) +void md5_final (MD5Schedule *ctx, char *digest /* 16 chars */) { register unsigned int count = (ctx->bits[0] >> 3) & 0x3F ; register unsigned char *p = ctx->in + count ; diff --git a/src/libstdcrypto/md5_init.c b/src/libstdcrypto/md5_init.c index cb2f611..56c85de 100644 --- a/src/libstdcrypto/md5_init.c +++ b/src/libstdcrypto/md5_init.c @@ -2,7 +2,7 @@ #include <skalibs/md5.h> -void md5_init (MD5Schedule_ref ctx) +void md5_init (MD5Schedule *ctx) { ctx->buf[0] = 0x67452301UL ; ctx->buf[1] = 0xefcdab89UL ; diff --git a/src/libstdcrypto/md5_update.c b/src/libstdcrypto/md5_update.c index 63fdea3..c03a598 100644 --- a/src/libstdcrypto/md5_update.c +++ b/src/libstdcrypto/md5_update.c @@ -5,7 +5,7 @@ #include <skalibs/md5.h> #include "md5-internal.h" -void md5_update (MD5Schedule_ref ctx, char const *s, unsigned int len) +void md5_update (MD5Schedule *ctx, char const *s, unsigned int len) { register uint32 t = ctx->bits[0] ; if ((ctx->bits[0] = t + (len << 3)) < t) diff --git a/src/libstdcrypto/rc4.c b/src/libstdcrypto/rc4.c index 7ead2c6..e52a706 100644 --- a/src/libstdcrypto/rc4.c +++ b/src/libstdcrypto/rc4.c @@ -4,7 +4,7 @@ #include <skalibs/bytestr.h> #include <skalibs/rc4.h> -void rc4 (RC4Schedule_ref r, char const *in, char *out, unsigned int n) +void rc4 (RC4Schedule *r, char const *in, char *out, unsigned int n) { register unsigned int i = 0 ; for (; i < n ; i++) diff --git a/src/libstdcrypto/rc4_init.c b/src/libstdcrypto/rc4_init.c index d6f8c20..2be9ac3 100644 --- a/src/libstdcrypto/rc4_init.c +++ b/src/libstdcrypto/rc4_init.c @@ -4,7 +4,7 @@ #include <skalibs/bytestr.h> #include <skalibs/rc4.h> -void rc4_init (RC4Schedule_ref r, char const *key, unsigned int ksize) +void rc4_init (RC4Schedule *r, char const *key, unsigned int ksize) { register unsigned int i = 0, j = 0 ; register unsigned char c = 0; diff --git a/src/libstdcrypto/sha1-internal.h b/src/libstdcrypto/sha1-internal.h index eae3947..584c874 100644 --- a/src/libstdcrypto/sha1-internal.h +++ b/src/libstdcrypto/sha1-internal.h @@ -6,7 +6,7 @@ #include <skalibs/uint32.h> #include <skalibs/sha1.h> -extern void sha1_feed (SHA1Schedule_ref, unsigned char) ; +extern void sha1_feed (SHA1Schedule *, unsigned char) ; extern void sha1_transform (uint32 * /* 5 uint32s */, uint32 const * /* 16 uint32s */) ; #endif diff --git a/src/libstdcrypto/sha1_feed.c b/src/libstdcrypto/sha1_feed.c index 208cebd..65764bc 100644 --- a/src/libstdcrypto/sha1_feed.c +++ b/src/libstdcrypto/sha1_feed.c @@ -5,7 +5,7 @@ #include <skalibs/sha1.h> #include "sha1-internal.h" -void sha1_feed (SHA1Schedule_ref ctx, unsigned char inb) +void sha1_feed (SHA1Schedule *ctx, unsigned char inb) { register uint32 tmp ; diff --git a/src/libstdcrypto/sha1_final.c b/src/libstdcrypto/sha1_final.c index 4af2efb..603c89c 100644 --- a/src/libstdcrypto/sha1_final.c +++ b/src/libstdcrypto/sha1_final.c @@ -4,7 +4,7 @@ #include <skalibs/sha1.h> #include "sha1-internal.h" -void sha1_final (SHA1Schedule_ref ctx, char *digest) +void sha1_final (SHA1Schedule *ctx, char *digest) { char pack[8] ; register unsigned int i = 0 ; diff --git a/src/libstdcrypto/sha1_init.c b/src/libstdcrypto/sha1_init.c index bdcb5fd..e6fadd9 100644 --- a/src/libstdcrypto/sha1_init.c +++ b/src/libstdcrypto/sha1_init.c @@ -2,7 +2,7 @@ #include <skalibs/sha1.h> -void sha1_init (SHA1Schedule_ref ctx) +void sha1_init (SHA1Schedule *ctx) { register unsigned int i = 0 ; ctx->buf[0] = 0x67452301UL ; diff --git a/src/libstdcrypto/sha1_update.c b/src/libstdcrypto/sha1_update.c index 1b3c4de..8758a4d 100644 --- a/src/libstdcrypto/sha1_update.c +++ b/src/libstdcrypto/sha1_update.c @@ -3,7 +3,7 @@ #include <skalibs/sha1.h> #include "sha1-internal.h" -void sha1_update (SHA1Schedule_ref ctx, char const *buf, unsigned int len) +void sha1_update (SHA1Schedule *ctx, char const *buf, unsigned int len) { register unsigned int i = 0 ; for (; i < len ; i++) sha1_feed(ctx, (unsigned char)buf[i]) ; diff --git a/src/libstdcrypto/sha256-internal.h b/src/libstdcrypto/sha256-internal.h index 377e6ef..e5bb974 100644 --- a/src/libstdcrypto/sha256-internal.h +++ b/src/libstdcrypto/sha256-internal.h @@ -6,7 +6,7 @@ #include <skalibs/uint32.h> #include <skalibs/sha256.h> -extern void sha256_feed (SHA256Schedule_ref, unsigned char) ; +extern void sha256_feed (SHA256Schedule *, unsigned char) ; extern void sha256_transform (uint32 *, uint32 const *) ; #endif diff --git a/src/libstdcrypto/sha256_feed.c b/src/libstdcrypto/sha256_feed.c index 5533d75..a0a3503 100644 --- a/src/libstdcrypto/sha256_feed.c +++ b/src/libstdcrypto/sha256_feed.c @@ -5,7 +5,7 @@ #include <skalibs/sha256.h> #include "sha256-internal.h" -void sha256_feed (SHA256Schedule_ref ctx, unsigned char inb) +void sha256_feed (SHA256Schedule *ctx, unsigned char inb) { register uint32 tmp ; ctx->in[ctx->b>>2] <<= 8 ; diff --git a/src/libstdcrypto/sha256_final.c b/src/libstdcrypto/sha256_final.c index 58b938a..be0af2d 100644 --- a/src/libstdcrypto/sha256_final.c +++ b/src/libstdcrypto/sha256_final.c @@ -5,7 +5,7 @@ #include <skalibs/sha256.h> #include "sha256-internal.h" -void sha256_final (SHA256Schedule_ref ctx, char *digest) +void sha256_final (SHA256Schedule *ctx, char *digest) { register unsigned int i = 0 ; register unsigned char *p = (unsigned char *)digest ; diff --git a/src/libstdcrypto/sha256_init.c b/src/libstdcrypto/sha256_init.c index e8a9ae1..6dbe865 100644 --- a/src/libstdcrypto/sha256_init.c +++ b/src/libstdcrypto/sha256_init.c @@ -2,7 +2,7 @@ #include <skalibs/sha256.h> -void sha256_init (SHA256Schedule_ref ctx) +void sha256_init (SHA256Schedule *ctx) { SHA256Schedule empty = SHA256_INIT() ; *ctx = empty ; diff --git a/src/libstdcrypto/sha256_update.c b/src/libstdcrypto/sha256_update.c index c87644e..3cd4781 100644 --- a/src/libstdcrypto/sha256_update.c +++ b/src/libstdcrypto/sha256_update.c @@ -3,7 +3,7 @@ #include <skalibs/sha256.h> #include "sha256-internal.h" -void sha256_update (SHA256Schedule_ref ctx, char const *buf, unsigned int len) +void sha256_update (SHA256Schedule *ctx, char const *buf, unsigned int len) { register unsigned int i = 0 ; for (; i < len ; i++) sha256_feed(ctx, (unsigned char)buf[i]) ; diff --git a/src/libstddjb/alloc.c b/src/libstddjb/alloc.c index e3f89dd..31e3e05 100644 --- a/src/libstddjb/alloc.c +++ b/src/libstddjb/alloc.c @@ -13,9 +13,9 @@ # define PLM(...) (bprintf(buffer_2, "%s: debug_alloc: ", PROG), bprintf(buffer_2, __VA_ARGS__), buffer_putflush(buffer_2, "\n", 1)) #endif -aligned_char_ref alloc (unsigned int n) +aligned_char *alloc (unsigned int n) { - register aligned_char_ref p = n ? (aligned_char_ref)malloc(n) : (aligned_char_ref)alloc_0 ; + register aligned_char *p = n ? (aligned_char *)malloc(n) : (aligned_char *)alloc_0 ; #ifdef DEBUG_ALLOC static unsigned int counter = 0 ; PLM("alloc(%u): %p. Allocated: %u", n, p, ++counter) ; @@ -37,9 +37,9 @@ void alloc_free (void *p) errno = e ; } -int alloc_realloc (aligned_char_ref *x, unsigned int n) +int alloc_realloc (aligned_char **x, unsigned int n) { - aligned_char_ref y = n ? (aligned_char_ref)realloc(*x, n) : (free(*x), alloc_0) ; + aligned_char *y = n ? (aligned_char *)realloc(*x, n) : (free(*x), alloc_0) ; #ifdef DEBUG_ALLOC PLM("alloc_realloc(&%p) -> new address = %p", *x, y) ; #endif diff --git a/src/libstddjb/alloc_0.c b/src/libstddjb/alloc_0.c index 2175262..bdd42a4 100644 --- a/src/libstddjb/alloc_0.c +++ b/src/libstddjb/alloc_0.c @@ -8,6 +8,6 @@ #define ALIGNMENT 16 static union { unsigned char blah[ALIGNMENT] ; long double ld ; } const zeroblock ; -aligned_char_ref alloc_0 = (aligned_char_ref)(&zeroblock) ; +aligned_char *alloc_0 = (aligned_char_ref)(&zeroblock) ; #endif diff --git a/src/libstddjb/bufalloc_1.c b/src/libstddjb/bufalloc_1.c index 6e636ca..08fbf06 100644 --- a/src/libstddjb/bufalloc_1.c +++ b/src/libstddjb/bufalloc_1.c @@ -5,5 +5,4 @@ #include <skalibs/allreadwrite.h> #include <skalibs/bufalloc.h> -static bufalloc b = BUFALLOC_INIT(&fd_write, 1) ; -bufalloc_ref bufalloc_1 = &b ; +bufalloc bufalloc_1_ = BUFALLOC_INIT(&fd_write, 1) ; diff --git a/src/libstddjb/bufalloc_2.c b/src/libstddjb/bufalloc_2.c index bcf97da..563b64a 100644 --- a/src/libstddjb/bufalloc_2.c +++ b/src/libstddjb/bufalloc_2.c @@ -5,5 +5,4 @@ #include <skalibs/allreadwrite.h> #include <skalibs/bufalloc.h> -static bufalloc b = BUFALLOC_INIT(&fd_write, 2) ; -bufalloc_ref bufalloc_2 = &b ; +bufalloc bufalloc_2_ = BUFALLOC_INIT(&fd_write, 2) ; diff --git a/src/libstddjb/bufalloc_clean.c b/src/libstddjb/bufalloc_clean.c index 28bd35e..79b5880 100644 --- a/src/libstddjb/bufalloc_clean.c +++ b/src/libstddjb/bufalloc_clean.c @@ -3,7 +3,7 @@ #include <skalibs/bytestr.h> #include <skalibs/bufalloc.h> -void bufalloc_clean (register bufalloc_ref ba) +void bufalloc_clean (register bufalloc *ba) { if (ba->p) { diff --git a/src/libstddjb/bufalloc_flush.c b/src/libstddjb/bufalloc_flush.c index 49b2eb1..e6ddfc2 100644 --- a/src/libstddjb/bufalloc_flush.c +++ b/src/libstddjb/bufalloc_flush.c @@ -3,7 +3,7 @@ #include <skalibs/allreadwrite.h> #include <skalibs/bufalloc.h> -int bufalloc_flush (bufalloc_ref ba) +int bufalloc_flush (bufalloc *ba) { ba->p += allreadwrite((iofunc_t_ref)ba->op, ba->fd, ba->x.s + ba->p, ba->x.len - ba->p) ; bufalloc_clean(ba) ; diff --git a/src/libstddjb/bufalloc_init.c b/src/libstddjb/bufalloc_init.c index ddb6b6b..921dc3d 100644 --- a/src/libstddjb/bufalloc_init.c +++ b/src/libstddjb/bufalloc_init.c @@ -3,7 +3,7 @@ #include <skalibs/stralloc.h> #include <skalibs/bufalloc.h> -void bufalloc_init (bufalloc_ref ba, int (*op)(int, char const *, unsigned int), int fd) +void bufalloc_init (bufalloc *ba, int (*op)(int, char const *, unsigned int), int fd) { ba->x.len = 0 ; ba->op = op ; diff --git a/src/libstddjb/buffer_getall.c b/src/libstddjb/buffer_getall.c index 34db9df..4f1490b 100644 --- a/src/libstddjb/buffer_getall.c +++ b/src/libstddjb/buffer_getall.c @@ -4,7 +4,7 @@ #include <skalibs/allreadwrite.h> #include <skalibs/buffer.h> -int buffer_getall (buffer_ref b, char *buf, unsigned int len, unsigned int *w) +int buffer_getall (buffer *b, char *buf, unsigned int len, unsigned int *w) { if (*w > len) return (errno = EINVAL, -1) ; *w += buffer_getnofill(b, buf + *w, len - *w) ; diff --git a/src/libstddjb/buffer_getallnf.c b/src/libstddjb/buffer_getallnf.c index 8a97a31..be46196 100644 --- a/src/libstddjb/buffer_getallnf.c +++ b/src/libstddjb/buffer_getallnf.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/buffer.h> -int buffer_getallnofill (buffer_ref b, char *s, unsigned int len) +int buffer_getallnofill (buffer *b, char *s, unsigned int len) { register unsigned int r = buffer_getnofill(b, s, len) ; if (r < len) diff --git a/src/libstddjb/buffer_getvallnf.c b/src/libstddjb/buffer_getvallnf.c index 2f4b82d..15f6c3d 100644 --- a/src/libstddjb/buffer_getvallnf.c +++ b/src/libstddjb/buffer_getvallnf.c @@ -4,7 +4,7 @@ #include <skalibs/buffer.h> #include <skalibs/siovec.h> -int buffer_getvallnofill (buffer_ref b, siovec_t const *v, unsigned int n) +int buffer_getvallnofill (buffer *b, siovec_t const *v, unsigned int n) { register unsigned int r = buffer_getvnofill(b, v, n) ; if (r < siovec_len(v, n)) diff --git a/src/libstddjb/iobuffer_flush.c b/src/libstddjb/iobuffer_flush.c index 543744b..93efc9d 100644 --- a/src/libstddjb/iobuffer_flush.c +++ b/src/libstddjb/iobuffer_flush.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/iobuffer.h> -int iobuffer_flush (iobuffer_ref b) +int iobuffer_flush (iobuffer *b) { if (b->isk) { diff --git a/src/libstddjb/iobuffer_init.c b/src/libstddjb/iobuffer_init.c index 561379a..fc699a0 100644 --- a/src/libstddjb/iobuffer_init.c +++ b/src/libstddjb/iobuffer_init.c @@ -2,7 +2,7 @@ #include <skalibs/iobuffer.h> -int iobuffer_init (iobuffer_ref b, int fdin, int fdout) +int iobuffer_init (iobuffer *b, int fdin, int fdout) { if (!iobufferk_init(&b->x.k, fdin, fdout)) goto user ; if (!iobufferk_isworking(&b->x.k)) goto fk ; diff --git a/src/libstddjb/iobuffer_kfromu.c b/src/libstddjb/iobuffer_kfromu.c index 28785e6..7f2feda 100644 --- a/src/libstddjb/iobuffer_kfromu.c +++ b/src/libstddjb/iobuffer_kfromu.c @@ -11,7 +11,7 @@ #include <skalibs/iobuffer.h> #include <skalibs/siovec.h> -int iobuffer_kfromu (iobufferk_ref k, iobufferu_ref u) +int iobuffer_kfromu (iobufferk *k, iobufferu *u) { struct iovec iov[2] ; siovec_t v[2] ; @@ -31,7 +31,7 @@ int iobuffer_kfromu (iobufferk_ref k, iobufferu_ref u) #include <errno.h> #include <skalibs/iobuffer.h> -int iobuffer_kfromu (iobufferk_ref k, iobufferu_ref u) +int iobuffer_kfromu (iobufferk *k, iobufferu *u) { (void)k ; (void)u ; diff --git a/src/libstddjb/iobuffer_salvage.c b/src/libstddjb/iobuffer_salvage.c index b434568..6f2c5d8 100644 --- a/src/libstddjb/iobuffer_salvage.c +++ b/src/libstddjb/iobuffer_salvage.c @@ -2,7 +2,7 @@ #include <skalibs/iobuffer.h> -int iobuffer_salvage (iobuffer_ref b) +int iobuffer_salvage (iobuffer *b) { iobufferu u ; if (!b->isk) return 1 ; diff --git a/src/libstddjb/iobuffer_ufromk.c b/src/libstddjb/iobuffer_ufromk.c index efb0368..778ddf2 100644 --- a/src/libstddjb/iobuffer_ufromk.c +++ b/src/libstddjb/iobuffer_ufromk.c @@ -6,7 +6,7 @@ #include <skalibs/iobuffer.h> -int iobuffer_ufromk (iobufferu_ref u, iobufferk_ref k) +int iobuffer_ufromk (iobufferu *u, iobufferk *k) { int in = u->b[0].fd ; u->b[0].fd = k->p[0] ; @@ -29,7 +29,7 @@ int iobuffer_ufromk (iobufferu_ref u, iobufferk_ref k) #include <errno.h> #include <skalibs/iobuffer.h> -int iobuffer_ufromk (iobufferu_ref u, iobufferk_ref k) +int iobuffer_ufromk (iobufferu *u, iobufferk *k) { (void)u ; (void)k ; diff --git a/src/libstddjb/iobufferk_fill.c b/src/libstddjb/iobufferk_fill.c index 50ac403..c811c24 100644 --- a/src/libstddjb/iobufferk_fill.c +++ b/src/libstddjb/iobufferk_fill.c @@ -9,14 +9,14 @@ #include <errno.h> #include <skalibs/iobuffer.h> -static int iobufferk_tee (iobufferk_ref k) +static int iobufferk_tee (iobufferk *k) { register int r = tee(k->fd[0], k->fd[1], IOBUFFERK_SIZE - k->n, k->nb & 1 ? SPLICE_F_NONBLOCK : 0) ; if (r > 0) k->n += r ; return r ; } -static int iobufferk_splice (iobufferk_ref k) +static int iobufferk_splice (iobufferk *k) { register int r = splice(k->fd[0], 0, k->fd[1], 0, IOBUFFERK_SIZE, k->nb ? SPLICE_F_NONBLOCK : 0) ; if (r > 0) k->n += r ; @@ -24,7 +24,7 @@ static int iobufferk_splice (iobufferk_ref k) return r ; } -static int iobufferk_fill_3 (iobufferk_ref k) +static int iobufferk_fill_3 (iobufferk *k) { register int r = splice(k->fd[0], 0, k->p[1], 0, IOBUFFERK_SIZE - k->n, k->nb & 1 ? SPLICE_F_NONBLOCK : 0) ; if (r > 0) k->n += r ; diff --git a/src/libstddjb/iobufferk_finish.c b/src/libstddjb/iobufferk_finish.c index ef20d57..f743328 100644 --- a/src/libstddjb/iobufferk_finish.c +++ b/src/libstddjb/iobufferk_finish.c @@ -8,19 +8,19 @@ #include <skalibs/djbunix.h> #include <skalibs/iobuffer.h> -static void iobufferk_nop (iobufferk_ref k) +static void iobufferk_nop (iobufferk *k) { (void)k ; } -static void iobufferk_finish_0 (iobufferk_ref k) +static void iobufferk_finish_0 (iobufferk *k) { register int e = errno ; fd_close(k->p[1]) ; errno = e ; } -static void iobufferk_finish_3 (iobufferk_ref k) +static void iobufferk_finish_3 (iobufferk *k) { register int e = errno ; fd_close(k->p[1]) ; @@ -37,7 +37,7 @@ iobufferk_finish_func_t_ref const iobufferk_finish_f[4] = #include <skalibs/iobuffer.h> -static void iobufferk_nop (iobufferk_ref k) +static void iobufferk_nop (iobufferk *k) { (void)k ; } diff --git a/src/libstddjb/iobufferk_init.c b/src/libstddjb/iobufferk_init.c index 03f7fae..7affabd 100644 --- a/src/libstddjb/iobufferk_init.c +++ b/src/libstddjb/iobufferk_init.c @@ -9,7 +9,7 @@ #include <skalibs/djbunix.h> #include <skalibs/iobuffer.h> -static int iobufferk_init_0 (iobufferk_ref k) +static int iobufferk_init_0 (iobufferk *k) { register int fd = open_write("/dev/null") ; if (fd < 0) return 0 ; @@ -23,13 +23,13 @@ static int iobufferk_init_0 (iobufferk_ref k) return 1 ; } -static int iobufferk_nofd (iobufferk_ref k) +static int iobufferk_nofd (iobufferk *k) { k->p[0] = k->p[1] = -1 ; return 1 ; } -static int iobufferk_init_3 (iobufferk_ref k) +static int iobufferk_init_3 (iobufferk *k) { return (pipenbcoe(k->p) >= 0) ; } @@ -39,7 +39,7 @@ static iobufferk_io_func_t_ref iobufferk_init_f[4] = &iobufferk_init_0, &iobufferk_nofd, &iobufferk_nofd, &iobufferk_init_3 } ; -int iobufferk_init (iobufferk_ref k, int fdin, int fdout) +int iobufferk_init (iobufferk *k, int fdin, int fdout) { iobufferk tmp ; struct stat st ; @@ -67,7 +67,7 @@ int iobufferk_init (iobufferk_ref k, int fdin, int fdout) #include <errno.h> #include <skalibs/iobuffer.h> -int iobufferk_init (iobufferk_ref k, int fdin, int fdout) +int iobufferk_init (iobufferk *k, int fdin, int fdout) { (void)k ; (void)fdin ; diff --git a/src/libstddjb/iobufferk_isworking.c b/src/libstddjb/iobufferk_isworking.c index f02b7e0..f671f81 100644 --- a/src/libstddjb/iobufferk_isworking.c +++ b/src/libstddjb/iobufferk_isworking.c @@ -9,7 +9,7 @@ #include <fcntl.h> #include <skalibs/iobuffer.h> -int iobufferk_isworking (iobufferk_ref k) +int iobufferk_isworking (iobufferk *k) { /* for now splice() with a length of 0 returns 0 no matter what, so this */ /* test is useless. splice() should test the underlying filesystems even */ @@ -38,7 +38,7 @@ int iobufferk_isworking (iobufferk_ref k) #include <skalibs/iobuffer.h> -int iobufferk_isworking (iobufferk_ref k) +int iobufferk_isworking (iobufferk *k) { (void)k ; return 0 ; diff --git a/src/libstddjb/iobufferk_nosys.c b/src/libstddjb/iobufferk_nosys.c index 46f8be4..363e400 100644 --- a/src/libstddjb/iobufferk_nosys.c +++ b/src/libstddjb/iobufferk_nosys.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/iobuffer.h> -int iobufferk_nosys (iobufferk_ref k) +int iobufferk_nosys (iobufferk *k) { (void)k ; return (errno = ENOSYS, -1) ; diff --git a/src/libstddjb/iobufferu_fill.c b/src/libstddjb/iobufferu_fill.c index 7ebb67c..de1a56c 100644 --- a/src/libstddjb/iobufferu_fill.c +++ b/src/libstddjb/iobufferu_fill.c @@ -3,7 +3,7 @@ #include <skalibs/buffer.h> #include <skalibs/iobuffer.h> -int iobufferu_fill (iobufferu_ref b) +int iobufferu_fill (iobufferu *b) { register int r = buffer_fill(&b->b[0]) ; b->b[1].c.n = b->b[0].c.n ; diff --git a/src/libstddjb/iobufferu_finish.c b/src/libstddjb/iobufferu_finish.c index eb3749e..612ec18 100644 --- a/src/libstddjb/iobufferu_finish.c +++ b/src/libstddjb/iobufferu_finish.c @@ -3,7 +3,7 @@ #include <skalibs/alloc.h> #include <skalibs/iobuffer.h> -void iobufferu_finish (iobufferu_ref b) +void iobufferu_finish (iobufferu *b) { alloc_free(b->buf) ; } diff --git a/src/libstddjb/ip46_scanlist.c b/src/libstddjb/ip46_scanlist.c index 37f2e18..6462da7 100644 --- a/src/libstddjb/ip46_scanlist.c +++ b/src/libstddjb/ip46_scanlist.c @@ -5,7 +5,7 @@ #include <skalibs/bytestr.h> #include <skalibs/fmtscan.h> -unsigned int ip46full_scanlist (ip46full_t_ref out, unsigned int max, char const *s, unsigned int *num) +unsigned int ip46full_scanlist (ip46full_t *out, unsigned int max, char const *s, unsigned int *num) { unsigned int n = 0, w = 0 ; for (; s[w] && (n < max) ; n++) diff --git a/src/libstddjb/localtmn_from_sysclock.c b/src/libstddjb/localtmn_from_sysclock.c index 2d4e4fd..08e64b7 100644 --- a/src/libstddjb/localtmn_from_sysclock.c +++ b/src/libstddjb/localtmn_from_sysclock.c @@ -3,7 +3,7 @@ #include <skalibs/tai.h> #include <skalibs/djbtime.h> -int localtmn_from_sysclock (localtmn_t_ref l, tain_t const *a, int tz) +int localtmn_from_sysclock (localtmn_t *l, tain_t const *a, int tz) { struct tm t ; if (!localtm_from_sysclock(&t, a->sec.x, tz)) return 0 ; diff --git a/src/libstddjb/localtmn_from_tain.c b/src/libstddjb/localtmn_from_tain.c index a3d3f6e..78cc051 100644 --- a/src/libstddjb/localtmn_from_tain.c +++ b/src/libstddjb/localtmn_from_tain.c @@ -3,7 +3,7 @@ #include <skalibs/tai.h> #include <skalibs/djbtime.h> -int localtmn_from_tain (localtmn_t_ref l, tain_t const *a, int tz) +int localtmn_from_tain (localtmn_t *l, tain_t const *a, int tz) { struct tm t ; if (!localtm_from_tai(&t, tain_secp(a), tz)) return 0 ; diff --git a/src/libstddjb/localtmn_scan.c b/src/libstddjb/localtmn_scan.c index f33ab51..087c642 100644 --- a/src/libstddjb/localtmn_scan.c +++ b/src/libstddjb/localtmn_scan.c @@ -3,7 +3,7 @@ #include <skalibs/uint32.h> #include <skalibs/djbtime.h> -unsigned int localtmn_scan (char const *s, localtmn_t_ref l) +unsigned int localtmn_scan (char const *s, localtmn_t *l) { localtmn_t m ; unsigned int n = localtm_scan(s, &m.tm) ; diff --git a/src/libstddjb/socket_local46.c b/src/libstddjb/socket_local46.c index a53bcac..6235527 100644 --- a/src/libstddjb/socket_local46.c +++ b/src/libstddjb/socket_local46.c @@ -10,7 +10,7 @@ #ifdef SKALIBS_IPV6_ENABLED -int socket_local46 (int s, ip46_t_ref ip, uint16 *port) +int socket_local46 (int s, ip46_t *ip, uint16 *port) { struct sockaddr sa ; socklen_t dummy = sizeof sa ; diff --git a/src/libstddjb/socket_remote46.c b/src/libstddjb/socket_remote46.c index 835b7c9..bf6b934 100644 --- a/src/libstddjb/socket_remote46.c +++ b/src/libstddjb/socket_remote46.c @@ -10,7 +10,7 @@ #ifdef SKALIBS_IPV6_ENABLED -int socket_remote46 (int s, ip46_t_ref ip, uint16 *port) +int socket_remote46 (int s, ip46_t *ip, uint16 *port) { struct sockaddr sa ; socklen_t dummy = sizeof sa ; diff --git a/src/libstddjb/subgetopt.c b/src/libstddjb/subgetopt.c index 69201c6..67cdfa1 100644 --- a/src/libstddjb/subgetopt.c +++ b/src/libstddjb/subgetopt.c @@ -3,7 +3,7 @@ #undef SUBGETOPT_SHORT #include <skalibs/sgetopt.h> -int subgetopt_r (int argc, char const *const *argv, char const *opts, subgetopt_t_ref o) +int subgetopt_r (int argc, char const *const *argv, char const *opts, subgetopt_t *o) { o->arg = 0 ; if ((o->ind >= argc) || !argv[o->ind]) return -1 ; diff --git a/src/libunixonacid/dd_cancel.c b/src/libunixonacid/dd_cancel.c index 22adf4e..cbd044e 100644 --- a/src/libunixonacid/dd_cancel.c +++ b/src/libunixonacid/dd_cancel.c @@ -5,7 +5,7 @@ #include <skalibs/djbunix.h> #include <skalibs/unix-transactional.h> -void dd_cancel (dirdescriptor_t_ref dd) +void dd_cancel (dirdescriptor_t *dd) { dirdescriptor_t zero = DIRDESCRIPTOR_ZERO ; register int e = errno ; diff --git a/src/libunixonacid/dd_close.c b/src/libunixonacid/dd_close.c index 74961a1..ffe8b1e 100644 --- a/src/libunixonacid/dd_close.c +++ b/src/libunixonacid/dd_close.c @@ -3,7 +3,7 @@ #include <skalibs/djbunix.h> #include <skalibs/unix-transactional.h> -int dd_close (dirdescriptor_t_ref dd) +int dd_close (dirdescriptor_t *dd) { return (fd_close(dd->fd) >= 0) ; } diff --git a/src/libunixonacid/dd_commit.c b/src/libunixonacid/dd_commit.c index b55addb..2555d1e 100644 --- a/src/libunixonacid/dd_commit.c +++ b/src/libunixonacid/dd_commit.c @@ -16,7 +16,7 @@ static char const *mybasename (char const *s, unsigned int len) return s ; } -int dd_commit (dirdescriptor_t_ref dd) +int dd_commit (dirdescriptor_t *dd) { dirdescriptor_t zero = DIRDESCRIPTOR_ZERO ; unsigned int len = str_len(dd->lnkfn) ; diff --git a/src/libunixonacid/dd_commit_devino.c b/src/libunixonacid/dd_commit_devino.c index 481db19..7155c7b 100644 --- a/src/libunixonacid/dd_commit_devino.c +++ b/src/libunixonacid/dd_commit_devino.c @@ -5,7 +5,7 @@ #include <skalibs/uint64.h> #include <skalibs/unix-transactional.h> -int dd_commit_devino (dirdescriptor_t_ref dd, uint64 *dev, uint64 *ino) +int dd_commit_devino (dirdescriptor_t *dd, uint64 *dev, uint64 *ino) { struct stat st ; if (fstat(dd->fd, &st) < 0) return 0 ; diff --git a/src/libunixonacid/dd_open_read.c b/src/libunixonacid/dd_open_read.c index 1996297..9189582 100644 --- a/src/libunixonacid/dd_open_read.c +++ b/src/libunixonacid/dd_open_read.c @@ -3,7 +3,7 @@ #include <skalibs/djbunix.h> #include <skalibs/unix-transactional.h> -int dd_open_read (dirdescriptor_t_ref dd, char const *path) +int dd_open_read (dirdescriptor_t *dd, char const *path) { dirdescriptor_t d = DIRDESCRIPTOR_ZERO ; d.fd = open_read(path) ; diff --git a/src/libunixonacid/dd_open_write.c b/src/libunixonacid/dd_open_write.c index efee60f..f579c73 100644 --- a/src/libunixonacid/dd_open_write.c +++ b/src/libunixonacid/dd_open_write.c @@ -9,7 +9,7 @@ #include <skalibs/random.h> #include <skalibs/unix-transactional.h> -int dd_open_write (dirdescriptor_t_ref dd, char const *lnkfn, unsigned int mode) +int dd_open_write (dirdescriptor_t *dd, char const *lnkfn, unsigned int mode) { dirdescriptor_t d = DIRDESCRIPTOR_ZERO ; d.lnkfn = lnkfn ; |