CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
buffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <cx/cx.h>
4
7
25
31 union {
32 void* _is_buffer;
33 size_t sz;
34 };
35 size_t len;
36 uint8 data[];
37};
38
44_Ret_notnull_ Buffer bufCreate(size_t size);
45
54_Must_inspect_result_ _Ret_maybenull_ Buffer bufTryCreate(size_t size);
55
64_At_(*buf, _Pre_maybenull_ _Post_notnull_)
65void bufResize(_Inout_ Buffer* buf, size_t newsize);
66
76_At_(*buf, _Pre_maybenull_)
77bool bufTryResize(_Inout_ Buffer* buf, size_t newsize);
78
85_At_(*buf, _Pre_maybenull_ _Post_null_)
86void bufDestroy(_Inout_ Buffer* buf);
87
bool bufTryResize(Buffer *buf, size_t newsize)
Buffer bufTryCreate(size_t size)
void bufDestroy(Buffer *buf)
Buffer bufCreate(size_t size)
void bufResize(Buffer *buf, size_t newsize)
size_t sz
Total allocated size of buffer in bytes.
Definition buffer.h:33
size_t len
Length of valid data currently in buffer.
Definition buffer.h:35
uint8 data[]
Buffer data (flexible array member)
Definition buffer.h:36