packio

view src/packio.c @ 1:a5728bc6a02f

moving along
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 09 Jan 2015 02:31:29 +0200
parents a71bd70c1014
children
line source
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "packio.h"
4 #include "packio_types.h"
5 #include "logger.h"
6 #include "pathmap.h"
9 PKIO_FILE *pkio_fopen(const char *path, const char *mode)
10 {
11 struct pkio_file *file;
12 FILE *fp;
13 const char *fname = pkio_pathmap(path);
15 if((fp = fopen(fname, mode))) {
16 if(!(file = calloc(1, sizeof *file))) {
17 pkio_logmsg("%s: failed to allocate file structure\n", __FUNCTION__);
18 return 0;
19 }
20 file->fp = fp;
21 file->in_archive = 0;
22 }
24 return 0; /* TODO */
25 }