mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
There is at least one user of the buffer API that reuse a single buffer by just resetting `buf.len` to `0`. This works as long as the new user of the buffer actually adds something to the buffer. However, if we don't add anything but still provide `buf.buf` to a consumer, the old content will be re-used. This patch thus adds two new clearing variants to the buffer API: - `buf_clear()` which doesn't reset the internal allocations - `buf_reset()` which does free the internal allocations Additionally, this patch makes `buffer_add_char()` public which allows adding single characters to an existing buffer. This will be used in a future PR which implements custom format strings for the OSD. |
||
|---|---|---|
| .. | ||
| array.h | ||
| border.h | ||
| buf.h | ||
| dir.h | ||
| fd_util.h | ||
| file-helpers.h | ||
| font.h | ||
| grab-file.h | ||
| graphic-helpers.h | ||
| list.h | ||
| macros.h | ||
| match.h | ||
| mem.h | ||
| nodename.h | ||
| parse-bool.h | ||
| scaled_font_buffer.h | ||
| scaled_scene_buffer.h | ||
| scene-helpers.h | ||
| spawn.h | ||
| string-helpers.h | ||
| surface-helpers.h | ||