rbuf_rdonly(3)

rbuf_rdonly3

Get and set read-write status for an rbuf

Usage

#include <roy.h>

int rbuf_rdonly (RBuf *buf);

void rbuf_set_rdonly (RBuf *buf);

void rbuf_set_rdwr (RBuf *buf);

Overview

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.

Releases

2 releases since Debian 3.0 (Woody); the text changed 1 time.

  1. 3.0
  2. 3.1

From libroy-dev 1.0.8-1 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.