isofs.h revision 4a4a02cc2a09b5e3c55908c6995182c6b038e398
/** @file
* IPRT - ISO 9660 file system handling.
*/
/*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___iprt_isofs_h
#define ___iprt_isofs_h
/** @defgroup grp_rt_isofs RTIsoFs - ISO 9660 Filesystem
* @ingroup grp_rt
* @{
*/
#define RTISOFS_MAX_SYSTEM_ID 32
#define RTISOFS_MAX_VOLUME_ID 32
#define RTISOFS_MAX_PUBLISHER_ID 128
#define RTISOFS_MAX_VOLUME_ID 32
#define RTISOFS_MAX_VOLUMESET_ID 128
#define RTISOFS_MAX_PREPARER_ID 128
#define RTISOFS_MAX_APPLICATION_ID 128
/** Standard ID of volume descriptors. */
#define RTISOFS_STANDARD_ID "CD001"
/** Default sector size. */
#define RTISOFS_SECTOR_SIZE 2048
#pragma pack(1)
typedef struct RTISOFSDATESHORT
{
typedef struct RTISOFSDATELONG
{
char year[4];
char month[2];
char day[2];
char hour[2];
char minute[2];
char second[2];
char hseconds[2];
/* Directory Record. */
typedef struct RTISOFSDIRRECORD
{
/* Starting here there will be the actual directory entry name
* and a padding of 1 byte if name_len is odd. */
/* Primary Volume Descriptor. */
typedef struct RTISOFSPRIVOLDESC
{
char name_id[6];
char system_id[RTISOFS_MAX_SYSTEM_ID];
char volume_id[RTISOFS_MAX_VOLUME_ID];
char copyright_file_id[37];
char abstract_file_id[37];
char bibliographic_file_id[37];
char application_data[512];
typedef struct RTISOFSPATHTABLEHEADER
{
/** Sector of starting directory table. */
/** Index of parent directory (1 for the root). */
/* Starting here there will be the name of the directory,
* specified by length above. */
typedef struct RTISOFSPATHTABLEENTRY
{
char *path;
char *path_full;
typedef struct RTISOFSFILE
{
} RTISOFSFILE, *PRTISOFSFILE;
#pragma pack()
#ifdef IN_RING3
/**
* Opens an ISO file.
*
* The following limitations apply:
* - Fixed sector size (2048 bytes).
* - No extensions (Joliet, RockRidge etc.) support (yet).
* - Only primary volume descriptor (PVD) handled.
*
* @return IPRT status code.
* @param pFile Pointer to ISO handle.
* @param pszFileName Path to ISO file to open.
*/
/**
* Closes an ISO file.
*
* @param pFile Pointer to open ISO file returned by RTIsoFsOpen().
*/
/**
* Retrieves the offset + length (both in bytes) of a given file
* stored in the ISO.
*
* @return IPRT status code.
* @param pFile Pointer to open ISO file returned by RTIsoFsOpen().
* @param pszPath Path of file within the ISO to retrieve information for.
* @param pcbOffset Pointer to store the file's absolute offset within the ISO.
* @param pcbLength Pointer to store the file's size.
*/
/**
* Extracts a file from an ISO to the given destination.
*
* @return IPRT status code.
* @param pFile Pointer to open ISO file returned by RTIsoFsOpen().
* @param pszPath Path of file within the ISO to extract.
* @param pszDest Where to store the extracted file.
*/
const char *pszDest);
#endif /* IN_RING3 */
/** @} */
#endif