Browse Source

add buffer_putsaflush

master
Felix von Leitner 17 years ago
parent
commit
bb7c231fab
  1. 1
      CHANGES
  2. 2
      buffer.h
  3. 14
      buffer/buffer_putsaflush.3
  4. 6
      buffer/buffer_putsaflush.c
  5. 3
      stralloc.h

1
CHANGES

@ -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

2
buffer.h

@ -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

14
buffer/buffer_putsaflush.3

@ -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)

6
buffer/buffer_putsaflush.c

@ -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);
}

3
stralloc.h

@ -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