project_files/frontlib/util/buffer.h
changeset 10017 de822cd3df3a
parent 7314 6171f0bad318
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    28  * for e.g. conveniently returning it from a function.
    28  * for e.g. conveniently returning it from a function.
    29  *
    29  *
    30  * Convention: Size is zero iff data is a NULL pointer.
    30  * Convention: Size is zero iff data is a NULL pointer.
    31  */
    31  */
    32 typedef struct {
    32 typedef struct {
    33 	void *data;
    33     void *data;
    34 	size_t size;
    34     size_t size;
    35 } flib_buffer;
    35 } flib_buffer;
    36 
    36 
    37 /**
    37 /**
    38  * Just like flib_buffer, but the contents are not supposed to be modified.
    38  * Just like flib_buffer, but the contents are not supposed to be modified.
    39  */
    39  */
    40 typedef struct {
    40 typedef struct {
    41 	const void *data;
    41     const void *data;
    42 	size_t size;
    42     size_t size;
    43 } flib_constbuffer;
    43 } flib_constbuffer;
    44 
    44 
    45 /**
    45 /**
    46  * Simple variable-capacity data structure that can be efficiently appended to.
    46  * Simple variable-capacity data structure that can be efficiently appended to.
    47  */
    47  */