fsw_iso9660.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/* $Id$ */
/** @file
* fsw_iso9660.h - ISO9660 file system driver header.
*/
/*-
* Copyright (c) 2006 Christoph Pfisterer
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* distribution.
*
* * Neither the name of Christoph Pfisterer nor the names of the
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _FSW_ISO9660_H_
#define _FSW_ISO9660_H_
#define VOLSTRUCTNAME fsw_iso9660_volume
#define DNODESTRUCTNAME fsw_iso9660_dnode
#include "fsw_core.h"
//! Block size for ISO9660 volumes.
#define ISO9660_BLOCKSIZE 2048
#define ISO9660_BLOCKSIZE_BITS 11
//! Block number where the ISO9660 superblock resides.
#define ISO9660_SUPERBLOCK_BLOCKNO 16
#pragma pack(1)
typedef struct {
} iso9660_u16;
typedef struct {
} iso9660_u32;
struct iso9660_dirrec {
char file_identifier[1];
};
//#if sizeof(struct fsw_iso9660_dirrec) != 34
//#fail Structure fsw_iso9660_dirrec has wrong size
//#endif
struct iso9660_volume_descriptor {
char standard_identifier[5];
};
struct iso9660_primary_volume_descriptor {
char standard_identifier[5];
char system_identifier[32];
char volume_identifier[32];
struct iso9660_dirrec root_directory;
char volume_set_identifier[128];
char publisher_identifier[128];
char data_preparer_identifier[128];
char application_identifier[128];
char copyright_file_identifier[37];
char abstract_file_identifier[37];
char bibliographic_file_identifier[37];
char volume_creation_datetime[17];
char volume_modification_datetime[17];
char volume_expiration_datetime[17];
char volume_effective_datetime[17];
};
//#if sizeof(struct fsw_iso9660_volume_descriptor) != 2048
//#fail Structure fsw_iso9660_volume_descriptor has wrong size
//#endif
#pragma pack()
struct iso9660_dirrec_buffer {
struct fsw_string name;
struct iso9660_dirrec dirrec;
char dirrec_buffer[222];
};
/**
* ISO9660: Volume structure with ISO9660-specific data.
*/
struct fsw_iso9660_volume {
struct fsw_volume g; //!< Generic volume structure
/*Note: don't move g!*/
int fJoliet;
/*Joliet specific fields*/
int fRockRidge;
/*Rock Ridge specific fields*/
int rr_susp_skip;
};
/**
* ISO9660: Dnode structure with ISO9660-specific data.
*/
struct fsw_iso9660_dnode {
struct fsw_dnode g; //!< Generic dnode structure
};
struct fsw_rock_ridge_susp_entry
{
};
struct fsw_rock_ridge_susp_sp
{
struct fsw_rock_ridge_susp_entry e;
};
struct fsw_rock_ridge_susp_nm
{
struct fsw_rock_ridge_susp_entry e;
};
#define RR_NM_CONT (1<<0)
union fsw_rock_ridge_susp_ce
{
struct X{
struct fsw_rock_ridge_susp_entry e;
} X;
};
#endif