File:  [Qemu by Fabrice Bellard] / qemu / roms / openbios / fs / iso9660 / iso9660_open.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 19:19:38 2018 UTC (8 years, 1 month ago) by root
Branches: qemu, MAIN
CVS tags: qemu1101, qemu1001, HEAD
qemu 1.0.1

/*
 *
 * (c) 2005-2009 Laurent Vivier <[email protected]>
 *
 * 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;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.