StringBuffer(3)

NAME
StringBuffer - Handle strings like files

SYNOPSIS
#include sbuffer.h
StringBuffer* sbopen()
int sbclose(sb)
StringBuffer* sb;
int sbputs(string,sb)
char* string;
StringBuffer* sb;
int sbputc(c,sb)
int c;
StringBuffer* sb;
int sbputchar(c,sb)
int c;
StringBuffer* sb;
char* sbflush(sb)
StringBuffer* sb;
int sbtell(sb)
StringBuffer* sb;
int sbrewind(sb)
StringBuffer* sb;
int sbseek(sb,pos)
StringBuffer* sb;
int pos;

DESCRIPTION
The string buffer routines are a means to use strings like files. The routines manage the allocation and freeing of memory internally. sbopen() returns a new string buffer. Memory is allocated to keep the informations required. sbclose() frees the memory allocated for a string buffer. Any access to a part of the string buffer is not save after this call. sbputs() put a string into the string buffer. The string is appended at the end of existing contents. 0 is returned upon success. sbputc() put a character into the string buffer. The character is appended at the end of existing contents. 0 is returned upon success. This is a function. A macro with the same functionality is provided by sbputchar() sbputchar() put a character into the string buffer. This is a macro with the same functionality as sbputc() sbtell() find the current position of the string buffer for later use with sbseek() sbseek() set the writing position of the string buffer to the given value. If value points beyond the current string size non null is returned. sbrewind() reset the writing position to the beginning of the string buffer. sbflush() close the string component of the string buffer and return a pointer to a string containing the contents of the string buffer. The writing position is not changed. Thus following calls to sbputs() or sbputc() continue adding characters. The string may not be properly terminated after additional writing operations.

FILES
sbuffer.h

SEE ALSO
fopen(3), fclose(3), fputs(3), fputc(3),...

DIAGNOSTICS
Usually 0 is returned to indicate success.

BUGS
Missing a printf() variant for string buffer.
 Horrible documentation.