3
0
mirror of https://github.com/CrazyRedMachine/popnhax.git synced 2024-11-24 06:10:12 +01:00
popnhax/util/membuf.h

19 lines
381 B
C

#ifndef __MEMBUF_H__
#define __MEMBUF_H__
#include <stdint.h>
typedef struct membuf_s {
char *buffer;
uint32_t size;
uint32_t idx;
} membuf_t;
membuf_t* membuf_new(uint32_t size);
void membuf_free(membuf_t* membuf);
void membuf_rewind(membuf_t *membuf);
int membuf_printf(membuf_t *membuf, const char *fmt, ...);
bool membuf_tofile(membuf_t *membuf, char *filepath);
#endif