man rbuf_rdonly (Fonctions bibliothèques) - get and set read-write status for an rbuf
NAME
rbuf_rdonly, rbuf_set_rdonly, rbuf_set_rdwr - get and set read-write status for an rbuf
SYNOPSIS
#include <roy.h>
int rbuf_rdonly (RBuf *buf);
void rbuf_set_rdonly (RBuf *buf);
void rbuf_set_rdwr (RBuf *buf);
DESCRIPTION
If buf is set read-only no api call can modify its buffer. An rbuf marked read-only can still be freed. Rbufs created by rbuf_auto(3) and rbuf_new_with_static(3) are automaticaly set to read-only and its highly recommened that the programmer not change them to be read-write.
A call to rbuf_rdonly(3) will see buf is already set read-only.
A call to rbuf_set_rdonly(3) will set buf read-only. This does not mean that buf is now static, so a call to rbuf_free(3) on buf will free buf, including its buffer.
A call to rbuf_set_rdwr(3) will set buf read-write. Its highly recommened that programmers do not call this on rbufs created with rbuf_auto(3) or rbuf_new_with_static(3).
RETURN VALUE
A call to rbuf_rdonly(3) returns TRUE if buf is a read-only rbuf. If buf is read-write then this call returns FALSE.
Calls to rbuf_set_rdonly(3), and rbuf_set_rdwr(3) return nothing.
ERRORS
These api calls never fail.
MACRO
These api calls are implemented using macros.
SEE ALSO
rbuf(3), rbuf_append(3), rbuf_append_char(3), rbuf_append_data(3), rbuf_append_rbuf(3), rbuf_append_sprintf(3), rbuf_append_str(3), rbuf_append_vsprintf(3), rbuf_auto(3), rbuf_down(3), rbuf_empty(3), rbuf_equal(3), rbuf_equal_data(3), rbuf_equal_rbuf(3), rbuf_equal_rbuf_len(3), rbuf_equal_rbufcase(3), rbuf_equal_str(3), rbuf_equal_str_len(3), rbuf_equal_strcase(3), rbuf_erase(3), rbuf_float(3), rbuf_free(3), rbuf_hash(3), rbuf_insert(3), rbuf_last(3), rbuf_len(3), rbuf_long(3), rbuf_new(3), rbuf_new_with_sprintf(3), rbuf_own(3), rbuf_prepend(3), rbuf_prepend_char(3), rbuf_prepend_data(3), rbuf_prepend_rbuf(3), rbuf_prepend_str(3), rbuf_set_to(3), rbuf_split(3), rbuf_sprintf(3), rbuf_str(3), rbuf_truncate(3), rbuf_up(3), roy(3)