packio-simple

view include/packio.h @ 2:4767e7769c32

packio-simple has more chances to ever get done
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 09 Aug 2015 05:14:29 +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_ */