You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
471 B

#ifndef _FILEDATA_H_
#define _FILEDATA_H_
#include <stdint.h>
struct databuf {
uint32_t size; // allocation size
uint32_t length; // used size
uint8_t data[0];
struct databuf * dbuf_alloc(uint32_t size);
void dbuf_free(struct databuf *dbuf);
int file_getsize(const char *filename, uint32_t *size);
int file_read(const char *filename, struct databuf *dbuf);
int file_write(const char *filename, struct databuf *dbuf);
#endif /* _FILEDATA_H_ */