hsfs_isospec.h revision 54e0249cec4d26fd6496e82b90bd3c762bd61b4b
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_HSFS_ISOSPEC_H
#define _SYS_FS_HSFS_ISOSPEC_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ISO 9660 filesystem specification
*/
#ifdef __cplusplus
extern "C" {
#endif
/* macros to parse binary integers */
#define MSB_INT(x) \
#define LSB_INT(x) \
#define BOTH_SHORT(x) (short)*((short *)x)
#define BOTH_INT(x) (int)*((int *)x)
/*
* SPARC machines require that integers must
* be aligned on a full word boundary. CD-ROM data aligns
* to even word boundary only. Because of this mismatch,
* we have to move integer data from CD-ROM to memory one
* byte at a time. LSB data starts first. We therefore
* use this to do byte by byte copying.
*/
#define BOTH_SHORT(x) LSB_SHORT(x)
#endif
/*
* The following describes actual on-disk structures.
* To achieve portability, all structures are #defines
* rather than a structure definition. Macros are provided
* to get either the data or address of individual fields.
*/
/* Overall High Sierra disk structure */
/* sectors per page */
#define ISO_SYSAREA_SEC 0 /* 1st sector of system area */
#define MAXISOMASK (~MAXISOOFFSET)
/* Standard File Structure Volume Descriptor */
enum iso_voldesc_type {
ISO_VD_EOV = 255
};
#define ISO_SYS_ID_STRLEN 32
#define ISO_VOL_ID_STRLEN 32
#define ISO_VOL_SET_ID_STRLEN 128
#define ISO_PUB_ID_STRLEN 128
#define ISO_PREP_ID_STRLEN 128
#define ISO_APPL_ID_STRLEN 128
#define ISO_COPYR_ID_STRLEN 37
#define ISO_ABSTR_ID_STRLEN 37
#define ISO_SHORT_DATE_LEN 7
#define ISO_DATE_LEN 17
/* macros to get the address of each field */
#define ISO_desc_type(x) (&((uchar_t *)x)[0])
/* macros to get the values of each field (strings are returned as ptrs) */
#define ISO_STD_ID(x) ISO_std_id(x)
#define ISO_STD_VER(x) *(ISO_std_ver(x))
#define ISO_SYS_ID(x) ISO_sys_id(x)
#define ISO_VOL_ID(x) ISO_vol_id(x)
#define ISO_ROOT_DIR(x) ISO_root_dir(x)
#define ISO_VOL_SET_ID(x) ISO_vol_set_id(x)
#define ISO_PUB_ID(x) ISO_pub_id(x)
#define ISO_PREP_ID(x) ISO_prep_id(x)
#define ISO_APPL_ID(x) ISO_appl_id(x)
#define ISO_COPYR_ID(x) ISO_copyr_id(x)
#define ISO_ABSTR_ID(x) ISO_abstr_id(x)
#define ISO_BIBLI_ID(x) ISO_bibli_id(x)
#define ISO_CRE_DATE(x) HSV_cre_date(x)
#define ISO_MOD_DATE(x) HSV_mod_date(x)
#define ISO_EXP_DATE(x) HSV_exp_date(x)
#define ISO_EFF_DATE(x) HSV_eff_date(x)
#define ISO_FILE_STRUCT_VER(x) *(ISO_file_struct_ver(x))
/* Standard File Structure Volume Descriptor date fields */
((x)[1] - '0'))
(((x)[1] - '0') * 100) + \
(((x)[2] - '0') * 10) + \
((x)[3] - '0'))
#define ISO_DATE_GMTOFF(x) (((char *)x)[16])
/* Directory Entry (Directory Record) */
/* max size of a name */
/* macros to get the address of each field */
#define IDE_dir_len(x) (&((uchar_t *)x)[0])
IDE_PAD_LEN(x)] + IDE_FDESIZE)
/* macros to get the values of each field (strings are returned as ptrs) */
#define IDE_DIR_LEN(x) *(IDE_dir_len(x))
#define IDE_XAR_LEN(x) *(IDE_xar_len(x))
#define IDE_INTRLV_SIZE(x) *(IDE_intrlv_size(x))
#define IDE_INTRLV_SKIP(x) *(IDE_intrlv_skip(x))
#define IDE_NAME_LEN(x) *(IDE_name_len(x))
(int)(IDE_NAME_LEN(x)) - (int)(IDE_PAD_LEN(x)))
/* mask bits for IDE_FLAGS */
#define IDE_UNUSED_FLAGS 0x60
/* Directory Record date fields */
#define IDE_DATE_GMTOFF(x) (((char *)x)[6])
/* tests for Interchange Levels 1 & 2 file types */
#define IDE_REGULAR_FILE(x) (((x) & IDE_PROHIBITED) == 0)
/* excluding ";" and version num */
/* Path table enry */
/* fix size of path table entry */
#define IPE_FPESIZE 8
/* macros to get the address of each field */
#define IPE_name_len(x) (&((uchar_t *)x)[0])
/* macros to get the values of each field */
#define IPE_XAR_LEN(x) *(IPE_xar_len(x))
#define IPE_NAME_LEN(x) *(IPE_name_len(x))
#define IPE_PARENT_NO(x) *(short *)(IPE_parent_no(x))
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_HSFS_ISOSPEC_H */