diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/openbios/fs/iso9660/iso9660_open.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/openbios/fs/iso9660/iso9660_open.c')
-rw-r--r-- | roms/openbios/fs/iso9660/iso9660_open.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/roms/openbios/fs/iso9660/iso9660_open.c b/roms/openbios/fs/iso9660/iso9660_open.c new file mode 100644 index 000000000..77c271f0f --- /dev/null +++ b/roms/openbios/fs/iso9660/iso9660_open.c @@ -0,0 +1,39 @@ +/* + * + * (c) 2005-2009 Laurent Vivier <Laurent@vivier.eu> + * + * This file has been copied from EMILE, http://emile.sf.net + * + */ + +#include "libiso9660.h" + +iso9660_FILE* iso9660_open(iso9660_VOLUME *volume, const char* pathname) +{ + struct iso_directory_record *root; + struct iso_directory_record *idr; + iso9660_FILE *file; + + root = iso9660_get_root_node(volume); + if (root == NULL) + return NULL; + + idr = iso9660_get_node(volume, root, pathname); + if (idr == NULL) + return NULL; + + file = (iso9660_FILE*)malloc(sizeof(iso9660_FILE)); + if (file == NULL) + return NULL; + + file->base = isonum_733((char *)idr->extent); + file->size = isonum_733((char *)idr->size); + file->offset = 0; + file->current = -1; + file->volume = volume; + file->path = strdup(pathname); + + free(idr); + + return file; +} |