diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-06-24 15:05:12 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-06-24 15:05:12 +0000 |
commit | e235eac7e00a3f52299273f734723dbc9fbaee70 (patch) | |
tree | 7a31f7567d6ab7c7c056a29c677509b0988faea9 /src/libstddjb | |
parent | 191d21f2acde7c2fa3003972a8b04bc080d64e2d (diff) | |
download | skalibs-e235eac7e00a3f52299273f734723dbc9fbaee70.tar.xz |
Add skagetln_loose, skagetlnsep_loose, ipc_timed_sendv
Diffstat (limited to 'src/libstddjb')
-rw-r--r-- | src/libstddjb/skagetln_loose.c | 15 | ||||
-rw-r--r-- | src/libstddjb/skagetlnsep_loose.c | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/libstddjb/skagetln_loose.c b/src/libstddjb/skagetln_loose.c new file mode 100644 index 0000000..7fc5916 --- /dev/null +++ b/src/libstddjb/skagetln_loose.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include <errno.h> +#include <skalibs/stralloc.h> +#include <skalibs/skamisc.h> + +int skagetln_loose (buffer *b, stralloc *sa, char sep) +{ + int e = errno ; + int r = skagetln(b, sa, sep) ; + if (r >= 0) return r ; + if (errno != EPIPE) return -1 ; + if (!stralloc_0(sa)) return -1 ; + return (errno = e, 3) ; +} diff --git a/src/libstddjb/skagetlnsep_loose.c b/src/libstddjb/skagetlnsep_loose.c new file mode 100644 index 0000000..ad0fd0a --- /dev/null +++ b/src/libstddjb/skagetlnsep_loose.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include <errno.h> +#include <skalibs/stralloc.h> +#include <skalibs/skamisc.h> + +int skagetlnsep_loose (buffer *b, stralloc *sa, char const *sep, size_t seplen) +{ + int e = errno ; + int r = skagetlnsep(b, sa, sep, seplen) ; + if (r >= 0) return r ; + if (errno != EPIPE) return -1 ; + if (!stralloc_0(sa)) return -1 ; + return (errno = e, 3) ; +} |