packio-simple

view src/packio.c @ 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
children
line source
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <errno.h>
5 #include "packio_impl.h"
7 #define MAGIC "PKIOPKG1"
8 #define MAXNAME 255
10 struct header {
11 char magic[8];
12 int revision;
13 int nfiles;
14 };
16 int pack_load_packfile(struct packfile *pf, const char *fname)
17 {
18 FILE *fp;
19 struct header *hdr;
21 if(!(fp = fopen(fname, "rb"))) {
22 fprintf(stderr, "failed to open file %s: %s\n", fname, strerror(errno));
23 return -1;
24 }
26 }