summaryrefslogtreecommitdiffstats
path: root/getln.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
committermanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
commit69aec538b456402170dc723af417ba5c05389c32 (patch)
treee6f34c543f17c6392447ea337b2e2868212424d1 /getln.c
downloadqmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz
qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2
qmail-69aec538b456402170dc723af417ba5c05389c32.zip
qmail 1.03 import
Diffstat (limited to 'getln.c')
-rw-r--r--getln.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/getln.c b/getln.c
new file mode 100644
index 0000000..c5cb097
--- /dev/null
+++ b/getln.c
@@ -0,0 +1,20 @@
1#include "substdio.h"
2#include "byte.h"
3#include "stralloc.h"
4#include "getln.h"
5
6int getln(ss,sa,match,sep)
7register substdio *ss;
8register stralloc *sa;
9int *match;
10int sep;
11{
12 char *cont;
13 unsigned int clen;
14
15 if (getln2(ss,sa,&cont,&clen,sep) == -1) return -1;
16 if (!clen) { *match = 0; return 0; }
17 if (!stralloc_catb(sa,cont,clen)) return -1;
18 *match = 1;
19 return 0;
20}