summaryrefslogtreecommitdiff
path: root/src/libstddjb
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-06-24 15:05:12 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-06-24 15:05:12 +0000
commite235eac7e00a3f52299273f734723dbc9fbaee70 (patch)
tree7a31f7567d6ab7c7c056a29c677509b0988faea9 /src/libstddjb
parent191d21f2acde7c2fa3003972a8b04bc080d64e2d (diff)
downloadskalibs-e235eac7e00a3f52299273f734723dbc9fbaee70.tar.xz
Add skagetln_loose, skagetlnsep_loose, ipc_timed_sendv
Diffstat (limited to 'src/libstddjb')
-rw-r--r--src/libstddjb/skagetln_loose.c15
-rw-r--r--src/libstddjb/skagetlnsep_loose.c15
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) ;
+}