hsfs_spec.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* High Sierra filesystem specification
* Copyright (c) 1989 by Sun Microsystem, Inc.
*/
#ifndef _HSFS_SPEC_H_
#define _HSFS_SPEC_H_
/* routines required for date parsing */
extern void hs_parse_dirdate(); /* parse date in directory */
extern void hs_parse_longdate(); /* parse date in volume id */
/* macros to parse binary integers */
#define MSB_INT(x) \
#define LSB_INT(x) \
/* for sun 3 only */
#if defined(_LITTLE_ENDIAN)
#define BOTH_SHORT(x) (short) *((short *)x)
#define BOTH_INT(x) (int) *((int *)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 */
#define HS_SYSAREA_SEC 0 /* 1st sector of system area */
#define MAXHSMASK (~MAXHSOFFSET)
/* Standard File Structure Volume Descriptor */
enum hs_voldesc_type {
};
/* macros to get the address of each field */
#define HSV_desc_lbn(x) (&((u_char *)x)[0])
/* macros to get the values of each field (strings are returned as ptrs) */
#define HSV_STD_ID(x) HSV_std_id(x)
#define HSV_STD_VER(x) *(HSV_std_ver(x))
#define HSV_SYS_ID(x) HSV_sys_id(x)
#define HSV_VOL_ID(x) HSV_vol_id(x)
#define HSV_ROOT_DIR(x) HSV_root_dir(x)
#define HSV_VOL_SET_ID(x) HSV_vol_set_id(x)
#define HSV_PUB_ID(x) HSV_pub_id(x)
#define HSV_PREP_ID(x) HSV_prep_id(x)
#define HSV_APPL_ID(x) HSV_appl_id(x)
#define HSV_COPYR_ID(x) HSV_copyr_id(x)
#define HSV_ABSTR_ID(x) HSV_abstr_id(x)
#define HSV_CRE_DATE(x) HSV_cre_date(x)
#define HSV_MOD_DATE(x) HSV_mod_date(x)
#define HSV_EXP_DATE(x) HSV_exp_date(x)
#define HSV_EFF_DATE(x) HSV_eff_date(x)
#define HSV_FILE_STRUCT_VER(x) *(HSV_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') )
/* Path table enry */
/* fix size of path table entry */
#define HPE_FPESIZE 8
/* macros to get the address of each field */
#define HPE_ext_lbn(x) (&((u_char *)x)[0])
/* macros to get the values of each field */
#if sun4
#else
#define HPE_EXT_LBN(x) *(int *)(HPE_ext_lbn(x))
#endif
#define HPE_XAR_LEN(x) *(HPE_xar_len(x))
#define HPE_NAME_LEN(x) *(HPE_name_len(x))
#define HPE_PARENT_NO(x) *(short *)(HPE_parent_no(x))
/* root record */
/* max size of a name */
/* Directory Entry (Directory Record) */
/* macros to get the address of each field */
#define HDE_dir_len(x) (&((u_char *)x)[0])
/***UNIX extension****/
/* macros to get the values of each field (strings are returned as ptrs) */
#define HDE_DIR_LEN(x) *(HDE_dir_len(x))
#define HDE_XAR_LEN(x) *(HDE_xar_len(x))
#define HDE_RESERVED(x) *(HDE_reserved(x))
#define HDE_INTRLV_SIZE(x) *(HDE_intrlv_size(x))
#define HDE_INTRLV_SKIP(x) *(HDE_intrlv_skip(x))
#define HDE_NAME_LEN(x) *(HDE_name_len(x))
/***UNIX EXTENSION*****/
/* mask bits for HDE_FLAGS */
#define HDE_UNUSED_FLAGS 0x60
/* Directory Record date fields */
/* tests for Interchange Levels 1 & 2 file types */
#define HDE_REGULAR_FILE(x) (((x) & HDE_PROHIBITED) == 0)
#endif /*!_HSFS_SPEC_H_*/