Welcome to little lamb

Code » limb » release » tree

[release] / src / doc / buffer.h / buffer_isempty.3.md

% limb manual
% buffer_isempty(3)
% limb 0.1.0
% 2023-07-24

# NAME

buffer_isempty, buffer_isfull, buffer_isreadable, buffer_iswritable - state of
an I/O buffer

# SYNOPSIS

    #include <limb/buffer.h>

```pre hl
int buffer_isempty(buffer *<em>buf</em>)
int buffer_isfull(buffer *<em>buf</em>)

int buffer_isreadable(buffer *<em>buf</em>)
int buffer_iswritable(buffer *<em>buf</em>)
```

# DESCRIPTION

The `buffer_isempty`() macro returns whether or not the buffer pointed by `buf`
is empty, i.e. there is no data in its internal memory.

The `buffer_isfull`() macro returns whether or not the buffer pointed by `buf`
is full, i.e. its internal memory is fully used.

The `buffer_isreadable`() macro returns whether or not the buffer pointed by
`buf` can be filled, i.e. has available space to read data from its associated
file descriptor.

The `buffer_iswritable`() macro returns whether or not the buffer pointed by
`buf` can be flushed, i.e. contains data to be flushed to its associated file
descriptor.

# RETURN VALUE

These functions return 1 or 0 depending on the current state of the buffer
pointed by `buf`.