packio-simple

view include/packio.h @ 1:eb07de55d0e6

redesigning packio
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 09 Aug 2015 03:15:07 +0300
parents d81c3ae262a0
children
line source
1 #ifndef PACKIO_H_
2 #define PACKIO_H_
4 struct pack_file;
6 /* not sure I like this capitalization, but it matches the libc counterparts */
7 typedef struct pack_file PACKFILE;
10 int pack_init(void);
11 void pack_cleanup(void);
12 int pack_addpk(const char *pkfname);
14 int pack_exists(const char *path);
16 /* file i/o */
17 PACKFILE *pack_fopen(const char *path, const char *mode);
18 int pack_fclose(PACKFILE *fp);
20 int pack_feof(PACKFILE *fp);
21 long pack_filesize(PACKFILE *fp);
23 int pack_fseek(PACKFILE *fp, long offs, int whence);
24 long pack_ftell(PACKFILE *fp);
25 void pack_rewind(PACKFILE *fp);
27 size_t pack_fread(void *ptr, size_t size, size_t nmemb, PACKFILE *fp);
28 size_t pack_fwrite(void *ptr, size_t size, size_t nmemb, PACKFILE *fp);
30 int pack_fgetc(PACKFILE *fp);
31 char *pack_fgets(char *buf, int size, PACKFILE *fp);
34 #endif /* PACKIO_H_ */