Welcome to little lamb

Code » limb » release » tree

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

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

# NAME

buffer_unget - "unget" data from a reading I/O buffer

# SYNOPSIS

    #include <limb/buffer.h>

```pre hl
size_t buffer_unget(buffer *<em>buf</em>, size_t <em>len</em>)
```

# DESCRIPTION

The `buffer_unget`() macro will "restore" up to `len` bytes of data into the
buffer pointed by `buf`. This simply means that the last `len` bytes of data
from its internal memory (most likely taken out via [buffer_get](3) or similar)
are back to being considered in the buffer.

# RETURN VALUE

The `buffer_unget`() function returns the amount of bytes re-put into the
buffer, which may be less than `len` (even 0 if the buffer was full).

# SEE ALSO

[buffer_rseek](3)