Skip to content

Files

Latest commit

a1152bd · Jun 13, 2020

History

History
35 lines (22 loc) · 577 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 577 Bytes

zabuffer

Build Status

Zero-Allocation buffer handling in C

Installation

With clib:

clib install rikvdh/zabuffer

Example

#include "zabuffer.h"
#include <assert.h>

// Create buffer called 'buf' with size of 100 bytes
ZA_BUFFER_DECL(buf, 100)

int main(int argc, char **argv)
{
    za_buffer_write_data(buf, "hello", 5);

    assert(5 == za_buffer_size_inuse(buf));

    za_buffer_flush(&buf);

    return 0;
}