man rbuf (Fonctions bibliothèques) - a robust string implementation

NAME

rbuf - a robust string implementation

SYNOPSIS

#include <roy.h>

DESCRIPTION

The rbuf is a string/buffer class which can be used to store variable length, auto-expanding strings, or binary buffers. A security feature of one addional byte at the end of the buffer keeps programs from violating thier segment boundries or overflowing the buffer. This byte is hidden from the programmer until code looking for the terminating '\0' finds it.

The RBuf struct is opaque, you should use rbuf_str(3) to get the C style string out, and rbuf_len(3) to get the length of the buffer.

A call to rbuf_str(3) returns a pointer to the buffer that will always be '\0' terminated one byte passed the appearent buffer length. Do not pass around references to this buffer if you are modifing the rbuf as it may become obsolete with subsequent api calls. This buffer should also never be modified directly, always use calls to one of the rbuf functions.

SEE ALSO