5 int buf_load(u8 *buf, const char *file, int size)
9 fp = fopen(file, "rb");
13 fseek(fp, 0, SEEK_SET);
14 fread(buf, sizeof(u8), size, fp);
19 void* buf_load_full(const char *file, int *size)
25 fp = fopen(file, "rb");
29 fseek(fp, 0, SEEK_END);
35 fseek(fp, 0, SEEK_SET);
37 fread(buf, sizeof(u8), *size, fp);
42 void buf_save(const void *buf, const char *file, int size)
46 fp = fopen(file, "wb");
47 fseek(fp, 0, SEEK_SET);
48 fwrite(buf, sizeof(u8), size, fp);