add buffer_putsaflush

master
leitner 20 years ago
parent 82b0bb6f39
commit 5dfea5617e

@ -4,6 +4,7 @@
extend API To read line/token to stralloc to allow clearing the
stralloc first.
add stralloc_zero to clear a stralloc
add buffer_putsflush
0.20:
add errmsg API

@ -87,6 +87,8 @@ extern buffer *buffer_2;
#ifdef STRALLOC_H
/* write stralloc to buffer */
int buffer_putsa(buffer* b,stralloc* sa);
/* write stralloc to buffer and flush */
int buffer_putsaflush(buffer* b,stralloc* sa);
/* these "read token" functions return 0 if the token was complete or
* EOF was hit or -1 on error. In contrast to the non-stralloc token

@ -0,0 +1,14 @@
.TH buffer_putsaflush 3
.SH NAME
buffer_putsa \- write stralloc to buffer and flush
.SH SYNTAX
.nf
.B #include <stralloc.h>
.B #include <buffer.h>
int \fBbuffer_putsaflush\fP(buffer* \fIb\fR,const char* \fIx\fR);
.SH DESCRIPTION
buffer_putsaflush is equivalent to buffer_putflush(b,x.sa,x.len).
.SH "SEE ALSO"
buffer_puts(3), buffer_flush(3), buffer(3)

@ -0,0 +1,6 @@
#include "stralloc.h"
#include "buffer.h"
int buffer_putsaflush(buffer* b,stralloc* sa) {
return buffer_putflush(b,sa->s,sa->len);
}

@ -116,6 +116,9 @@ int stralloc_chomp(stralloc* sa);
#ifdef BUFFER_H
/* write stralloc to buffer */
int buffer_putsa(buffer* b,stralloc* sa);
/* write stralloc to buffer and flush */
int buffer_putsaflush(buffer* b,stralloc* sa);
/* these "read token" functions return 0 if the token was complete or
* EOF was hit or -1 on error. In contrast to the non-stralloc token
* functions, the separator is also put in the stralloc; use

Loading…
Cancel
Save