Browse Source

add buffer_putsaflush

master
Felix von Leitner 16 years ago
parent
commit
bb7c231fab
5 changed files with 26 additions and 0 deletions
  1. +1
    -0
      CHANGES
  2. +2
    -0
      buffer.h
  3. +14
    -0
      buffer/buffer_putsaflush.3
  4. +6
    -0
      buffer/buffer_putsaflush.c
  5. +3
    -0
      stralloc.h

+ 1
- 0
CHANGES View File

@@ -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
- 0
buffer.h View File

@@ -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
- 0
buffer/buffer_putsaflush.3 View 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
- 0
buffer/buffer_putsaflush.c View 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);
}

+ 3
- 0
stralloc.h View File

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