This repository has been archived on 2021-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
twiboot/linux/filedata.h
2012-02-11 12:44:02 +01:00

20 lines
471 B
C

#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_ */