diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2022-10-28 23:13:15 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2022-10-28 23:13:15 +0000 |
commit | 4280d43e83deb0a9ed00ce362d3f01f273f24630 (patch) | |
tree | dbba3f1b50db0587289e386f594affd7fcfc5c9e | |
parent | 7fe720f95ca1ce1cdd2c752d70edcbc0cf1836fc (diff) | |
download | skalibs-4280d43e83deb0a9ed00ce362d3f01f273f24630.tar.gz skalibs-4280d43e83deb0a9ed00ce362d3f01f273f24630.tar.xz skalibs-4280d43e83deb0a9ed00ce362d3f01f273f24630.zip |
Prepare for 2.12.1.0; add buffer_timed_put(s)
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | doc/index.html | 2 | ||||
-rw-r--r-- | doc/license.html | 2 | ||||
-rw-r--r-- | doc/upgrade.html | 4 | ||||
-rw-r--r-- | package/deps.mak | 6 | ||||
-rw-r--r-- | package/info | 2 | ||||
-rw-r--r-- | src/include/skalibs/disize.h | 2 | ||||
-rw-r--r-- | src/include/skalibs/unix-timed.h | 4 | ||||
-rw-r--r-- | src/libunixonacid/buffer_timed_put.c | 17 | ||||
-rw-r--r-- | src/libunixonacid/buffer_timed_puts.c | 10 |
10 files changed, 43 insertions, 9 deletions
diff --git a/NEWS b/NEWS index 75139fe..cd4d727 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,10 @@ Changelog for skalibs. -In 2.12.0.2 +In 2.12.1.0 ----------- - Bugfixes. + - New functions: buffer_timed_put(), buffer_timed_puts(). In 2.12.0.1 diff --git a/doc/index.html b/doc/index.html index 90c8308..e79ba0f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -60,7 +60,7 @@ with a standard C development environment </li> <h3> Download </h3> <ul> - <li> The current released version of skalibs is <a href="skalibs-2.12.0.2.tar.gz">2.12.0.2</a>. </li> + <li> The current released version of skalibs is <a href="skalibs-2.12.1.0.tar.gz">2.12.1.0</a>. </li> <li> Alternatively, you can checkout a copy of the <a href="//git.skarnet.org/cgi-bin/cgit.cgi/skalibs/">skalibs git repository</a>: diff --git a/doc/license.html b/doc/license.html index 7366341..210e221 100644 --- a/doc/license.html +++ b/doc/license.html @@ -74,7 +74,7 @@ color, or different text font. </li> <p> <em>I am aware that the previous restrictions sound completely ridiculous while the official skalibs documentation is incomplete. -As of 2.12.0.2, I'm not going to enforce those restrictions, but if you're +As of 2.12.1.0, I'm not going to enforce those restrictions, but if you're going to provide documentation for skalibs, don't keep it to yourself, please send it to me instead. :-) </em> </p> diff --git a/doc/upgrade.html b/doc/upgrade.html index 75c9a1c..6ecb200 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -16,10 +16,10 @@ <a href="//skarnet.org/">skarnet.org</a> </p> -<h2> in 2.12.0.2 </h2> +<h2> in 2.12.1.0 </h2> <ul> - <li> No functional changes. </li> + <li> New functions: <tt>buffer_timed_put()</tt>, <tt>buffer_timed_puts()</tt>. </li> </ul> <h2> in 2.12.0.1 </h2> diff --git a/package/deps.mak b/package/deps.mak index bb641fd..1b3c78d 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -468,13 +468,13 @@ src/libstddjb/selfpipe_init.o src/libstddjb/selfpipe_init.lo: src/libstddjb/self src/libstddjb/selfpipe_internal.o src/libstddjb/selfpipe_internal.lo: src/libstddjb/selfpipe_internal.c src/include/skalibs/allreadwrite.h src/libstddjb/selfpipe-internal.h src/include/skalibs/sysdeps.h src/libstddjb/selfpipe_read.o src/libstddjb/selfpipe_read.lo: src/libstddjb/selfpipe_read.c src/include/skalibs/allreadwrite.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sysdeps.h src/libstddjb/selfpipe_trap.o src/libstddjb/selfpipe_trap.lo: src/libstddjb/selfpipe_trap.c src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h -src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/bsdsnowflake.h src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h +src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h src/libstddjb/sgetopt.o src/libstddjb/sgetopt.lo: src/libstddjb/sgetopt.c src/include/skalibs/buffer.h src/include/skalibs/sgetopt.h src/libstddjb/sig0_scan.o src/libstddjb/sig0_scan.lo: src/libstddjb/sig0_scan.c src/include/skalibs/sig.h src/include/skalibs/types.h src/libstddjb/sig_altignore.o src/libstddjb/sig_altignore.lo: src/libstddjb/sig_altignore.c src/include/skalibs/sig.h src/libstddjb/sig_block.o src/libstddjb/sig_block.lo: src/libstddjb/sig_block.c src/include/skalibs/sig.h src/libstddjb/sig_blocknone.o src/libstddjb/sig_blocknone.lo: src/libstddjb/sig_blocknone.c src/include/skalibs/sig.h -src/libstddjb/sig_catch.o src/libstddjb/sig_catch.lo: src/libstddjb/sig_catch.c src/include/skalibs/functypes.h src/include/skalibs/sig.h +src/libstddjb/sig_catch.o src/libstddjb/sig_catch.lo: src/libstddjb/sig_catch.c src/include/skalibs/functypes.h src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/include/skalibs/sig.h src/libstddjb/sig_name.o src/libstddjb/sig_name.lo: src/libstddjb/sig_name.c src/libstddjb/sig-internal.h src/include/skalibs/sig.h src/libstddjb/sig_number.o src/libstddjb/sig_number.lo: src/libstddjb/sig_number.c src/libstddjb/sig-internal.h src/include/skalibs/sig.h src/libstddjb/sig_restoreto.o src/libstddjb/sig_restoreto.lo: src/libstddjb/sig_restoreto.c src/include/skalibs/sig.h @@ -708,6 +708,8 @@ src/libunixonacid/bufalloc_timed_flush.o src/libunixonacid/bufalloc_timed_flush. src/libunixonacid/buffer_timed_fill.o src/libunixonacid/buffer_timed_fill.lo: src/libunixonacid/buffer_timed_fill.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/unix-timed.h src/libunixonacid/buffer_timed_flush.o src/libunixonacid/buffer_timed_flush.lo: src/libunixonacid/buffer_timed_flush.c src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/unix-timed.h src/libunixonacid/buffer_timed_get.o src/libunixonacid/buffer_timed_get.lo: src/libunixonacid/buffer_timed_get.c src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/unix-timed.h +src/libunixonacid/buffer_timed_put.o src/libunixonacid/buffer_timed_put.lo: src/libunixonacid/buffer_timed_put.c src/include/skalibs/buffer.h src/include/skalibs/unix-timed.h +src/libunixonacid/buffer_timed_puts.o src/libunixonacid/buffer_timed_puts.lo: src/libunixonacid/buffer_timed_puts.c src/include/skalibs/unix-timed.h src/libunixonacid/ipc_timed_recv.o src/libunixonacid/ipc_timed_recv.lo: src/libunixonacid/ipc_timed_recv.c src/include/skalibs/allreadwrite.h src/include/skalibs/functypes.h src/include/skalibs/socket.h src/include/skalibs/unix-timed.h src/libunixonacid/ipc_timed_send.o src/libunixonacid/ipc_timed_send.lo: src/libunixonacid/ipc_timed_send.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/unix-timed.h src/libunixonacid/ipc_timed_sendv.o src/libunixonacid/ipc_timed_sendv.lo: src/libunixonacid/ipc_timed_sendv.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/siovec.h src/include/skalibs/unix-timed.h diff --git a/package/info b/package/info index 7920c2f..5cbf323 100644 --- a/package/info +++ b/package/info @@ -1,4 +1,4 @@ package=skalibs -version=2.12.0.2 +version=2.12.1.0 category=prog package_macro_name=SKALIBS diff --git a/src/include/skalibs/disize.h b/src/include/skalibs/disize.h index 0b3cd23..eef82f3 100644 --- a/src/include/skalibs/disize.h +++ b/src/include/skalibs/disize.h @@ -3,7 +3,7 @@ #ifndef SKALIBS_DISIZE_H #define SKALIBS_DISIZE_H -#include <sys/types.h> +#include <stddef.h> typedef struct disize_s disize, *disize_ref ; struct disize_s diff --git a/src/include/skalibs/unix-timed.h b/src/include/skalibs/unix-timed.h index ffff5c3..ca3d9c7 100644 --- a/src/include/skalibs/unix-timed.h +++ b/src/include/skalibs/unix-timed.h @@ -28,6 +28,10 @@ extern int buffer_timed_flush (buffer *, tain const *, tain *) ; #define buffer_timed_flush_g(b, deadline) buffer_timed_flush(b, (deadline), &STAMP) extern size_t buffer_timed_get (buffer *, char *, size_t, tain const *, tain *) ; #define buffer_timed_get_g(b, buf, buflen, deadline) buffer_timed_get(b, buf, buflen, (deadline), &STAMP) +extern size_t buffer_timed_put (buffer *, char const *, size_t, tain const *, tain *) ; +#define buffer_timed_put_g(b, s, len, deadline) buffer_timed_put(b, s, len, (deadline), &STAMP) +extern size_t buffer_timed_puts (buffer *, char const *, tain const *, tain *) ; +#define buffer_timed_puts_g(b, s, deadline) buffer_timed_puts(b, s, (deadline), &STAMP) extern int timed_getln (buffer *, stralloc *, char, tain const *, tain *) ; #define timed_getln_g(b, sa, sep, deadline) timed_getln(b, sa, sep, (deadline), &STAMP) diff --git a/src/libunixonacid/buffer_timed_put.c b/src/libunixonacid/buffer_timed_put.c new file mode 100644 index 0000000..a645465 --- /dev/null +++ b/src/libunixonacid/buffer_timed_put.c @@ -0,0 +1,17 @@ +/* ISC license. */ + +#include <stddef.h> + +#include <skalibs/buffer.h> +#include <skalibs/unix-timed.h> + +size_t buffer_timed_put (buffer *b, char const *s, size_t len, tain const *deadline, tain *stamp) +{ + size_t w = 0 ; + for (;;) + { + w += buffer_putnoflush(b, s + w, len - w) ; + if (w >= len || !buffer_timed_flush(b, deadline, stamp)) break ; + } + return w ; +} diff --git a/src/libunixonacid/buffer_timed_puts.c b/src/libunixonacid/buffer_timed_puts.c new file mode 100644 index 0000000..edc157a --- /dev/null +++ b/src/libunixonacid/buffer_timed_puts.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <string.h> + +#include <skalibs/unix-timed.h> + +size_t buffer_timed_puts (buffer *b, char const *s, tain const *deadline, tain *stamp) +{ + return buffer_timed_put(b, s, strlen(s), deadline, stamp) ; +} |