add buffer_putsaflush
This commit is contained in:
parent
82b0bb6f39
commit
5dfea5617e
1
CHANGES
1
CHANGES
@ -4,6 +4,7 @@
|
|||||||
extend API To read line/token to stralloc to allow clearing the
|
extend API To read line/token to stralloc to allow clearing the
|
||||||
stralloc first.
|
stralloc first.
|
||||||
add stralloc_zero to clear a stralloc
|
add stralloc_zero to clear a stralloc
|
||||||
|
add buffer_putsflush
|
||||||
|
|
||||||
0.20:
|
0.20:
|
||||||
add errmsg API
|
add errmsg API
|
||||||
|
2
buffer.h
2
buffer.h
@ -87,6 +87,8 @@ extern buffer *buffer_2;
|
|||||||
#ifdef STRALLOC_H
|
#ifdef STRALLOC_H
|
||||||
/* write stralloc to buffer */
|
/* write stralloc to buffer */
|
||||||
int buffer_putsa(buffer* b,stralloc* sa);
|
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
|
/* 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
|
* EOF was hit or -1 on error. In contrast to the non-stralloc token
|
||||||
|
14
buffer/buffer_putsaflush.3
Normal file
14
buffer/buffer_putsaflush.3
Normal file
@ -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
Normal file
6
buffer/buffer_putsaflush.c
Normal file
@ -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
|
#ifdef BUFFER_H
|
||||||
/* write stralloc to buffer */
|
/* write stralloc to buffer */
|
||||||
int buffer_putsa(buffer* b,stralloc* sa);
|
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
|
/* 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
|
* EOF was hit or -1 on error. In contrast to the non-stralloc token
|
||||||
* functions, the separator is also put in the stralloc; use
|
* functions, the separator is also put in the stralloc; use
|
||||||
|
Loading…
x
Reference in New Issue
Block a user