mirror of /home/gitosis/repositories/libowfat.git
Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat
https://www.fefe.de/libowfat/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
460 B
21 lines
460 B
#include "stralloc.h" |
|
#include "buffer.h" |
|
|
|
int main() { |
|
stralloc sa; |
|
buffer b; |
|
stralloc line; |
|
|
|
stralloc_init(&sa); |
|
stralloc_init(&line); |
|
stralloc_copys(&sa,"this is a test\nline 2\n"); |
|
buffer_fromsa(&b,&sa); |
|
|
|
while (buffer_getline_sa(&b,&line)==0) { |
|
buffer_puts(buffer_1,"got line: \""); |
|
if (stralloc_chop(&line)!='\n') break; |
|
buffer_putsa(buffer_1,&line); |
|
buffer_putsflush(buffer_1,"\"\n"); |
|
stralloc_copys(&line,""); |
|
} |
|
}
|
|
|