|
|
1.1 root 1: /*
2: *
3: * (c) 2005-2009 Laurent Vivier <[email protected]>
4: *
5: * This file has been copied from EMILE, http://emile.sf.net
6: *
7: */
8:
9: #include "libiso9660.h"
10:
11: iso9660_FILE* iso9660_open(iso9660_VOLUME *volume, const char* pathname)
12: {
13: struct iso_directory_record *root;
14: struct iso_directory_record *idr;
15: iso9660_FILE *file;
16:
17: root = iso9660_get_root_node(volume);
18: if (root == NULL)
19: return NULL;
20:
21: idr = iso9660_get_node(volume, root, pathname);
22: if (idr == NULL)
23: return NULL;
24:
25: file = (iso9660_FILE*)malloc(sizeof(iso9660_FILE));
26: if (file == NULL)
27: return NULL;
28:
29: file->base = isonum_733((char *)idr->extent);
30: file->size = isonum_733((char *)idr->size);
31: file->offset = 0;
32: file->current = -1;
33: file->volume = volume;
34: file->path = strdup(pathname);
35:
36: free(idr);
37:
38: return file;
39: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.