File: getln.c

package info (click to toggle)
ucspi-tcp 0.88-5
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,032 kB
  • ctags: 697
  • sloc: ansic: 5,651; makefile: 753; sh: 329
file content (14 lines) | stat: -rw-r--r-- 298 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "byte.h"
#include "getln.h"

int getln(buffer *ss,stralloc *sa,int *match,int sep)
{
  char *cont;
  unsigned int clen;

  if (getln2(ss,sa,&cont,&clen,sep) == -1) return -1;
  if (!clen) { *match = 0; return 0; }
  if (!stralloc_catb(sa,cont,clen)) return -1;
  *match = 1;
  return 0;
}