require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_FS_HFS_LIBHFS_H_)) {
    eval 'sub _FS_HFS_LIBHFS_H_ () {1;}' unless defined(&_FS_HFS_LIBHFS_H_);
    require 'sys/endian.ph';
    require 'sys/param.ph';
    require 'sys/mount.ph';
    require 'sys/types.ph';
    if(defined(&_KERNEL)) {
	require 'sys/kernel.ph';
	require 'sys/systm.ph';
	require 'sys/fcntl.ph';
    }
    if(!defined(&_KERNEL)  && !defined(&STANDALONE)) {
	require 'fcntl.ph';
	require 'iconv.ph';
	require 'stdarg.ph';
	require 'stdint.ph';
	require 'stdio.ph';
	require 'stdlib.ph';
	require 'unistd.ph';
    }
    eval 'sub max {
        my($A,$B) = @_;
	    eval q((($A) > ($B) ? ($A):($B)));
    }' unless defined(&max);
    eval 'sub min {
        my($A,$B) = @_;
	    eval q((($A) < ($B) ? ($A):($B)));
    }' unless defined(&min);
    eval 'sub HFS_LIBERR () {( &format, ...)  &do{  &hfslib_error( &format,  &__FILE__,  &__LINE__,  &__VA_ARGS__);  &goto  &error; }  &while( 0);}' unless defined(&HFS_LIBERR);
    if(0) {
    }
    eval("sub HFS_SIG_HFSP () { 0x482B; }") unless defined(&HFS_SIG_HFSP);
    eval("sub HFS_SIG_HFSX () { 0x4858; }") unless defined(&HFS_SIG_HFSX);
    eval("sub HFS_SIG_HFS () { 0x4244; }") unless defined(&HFS_SIG_HFS);
    eval("sub HFS_VOL_HWLOCK () { 7; }") unless defined(&HFS_VOL_HWLOCK);
    eval("sub HFS_VOL_UNMOUNTED () { 8; }") unless defined(&HFS_VOL_UNMOUNTED);
    eval("sub HFS_VOL_BADBLOCKS () { 9; }") unless defined(&HFS_VOL_BADBLOCKS);
    eval("sub HFS_VOL_NOCACHE () { 10; }") unless defined(&HFS_VOL_NOCACHE);
    eval("sub HFS_VOL_DIRTY () { 11; }") unless defined(&HFS_VOL_DIRTY);
    eval("sub HFS_VOL_CNIDS_RECYCLED () { 12; }") unless defined(&HFS_VOL_CNIDS_RECYCLED);
    eval("sub HFS_VOL_JOURNALED () { 13; }") unless defined(&HFS_VOL_JOURNALED);
    eval("sub HFS_VOL_SWLOCK () { 15; }") unless defined(&HFS_VOL_SWLOCK);
    eval("sub HFS_LEAFNODE () { -1; }") unless defined(&HFS_LEAFNODE);
    eval("sub HFS_INDEXNODE () { 0; }") unless defined(&HFS_INDEXNODE);
    eval("sub HFS_HEADERNODE () { 1; }") unless defined(&HFS_HEADERNODE);
    eval("sub HFS_MAPNODE () { 2; }") unless defined(&HFS_MAPNODE);
    eval("sub HFS_BAD_CLOSE_MASK () { 0x00000001; }") unless defined(&HFS_BAD_CLOSE_MASK);
    eval("sub HFS_BIG_KEYS_MASK () { 0x00000002; }") unless defined(&HFS_BIG_KEYS_MASK);
    eval("sub HFS_VAR_INDEX_KEYS_MASK () { 0x00000004; }") unless defined(&HFS_VAR_INDEX_KEYS_MASK);
    eval("sub HFS_CNID_ROOT_PARENT () { 1; }") unless defined(&HFS_CNID_ROOT_PARENT);
    eval("sub HFS_CNID_ROOT_FOLDER () { 2; }") unless defined(&HFS_CNID_ROOT_FOLDER);
    eval("sub HFS_CNID_EXTENTS () { 3; }") unless defined(&HFS_CNID_EXTENTS);
    eval("sub HFS_CNID_CATALOG () { 4; }") unless defined(&HFS_CNID_CATALOG);
    eval("sub HFS_CNID_BADBLOCKS () { 5; }") unless defined(&HFS_CNID_BADBLOCKS);
    eval("sub HFS_CNID_ALLOCATION () { 6; }") unless defined(&HFS_CNID_ALLOCATION);
    eval("sub HFS_CNID_STARTUP () { 7; }") unless defined(&HFS_CNID_STARTUP);
    eval("sub HFS_CNID_ATTRIBUTES () { 8; }") unless defined(&HFS_CNID_ATTRIBUTES);
    eval("sub HFS_CNID_REPAIR () { 14; }") unless defined(&HFS_CNID_REPAIR);
    eval("sub HFS_CNID_TEMP () { 15; }") unless defined(&HFS_CNID_TEMP);
    eval("sub HFS_CNID_USER () { 16; }") unless defined(&HFS_CNID_USER);
    eval("sub HFS_REC_FLDR () { 0x0001; }") unless defined(&HFS_REC_FLDR);
    eval("sub HFS_REC_FILE () { 0x0002; }") unless defined(&HFS_REC_FILE);
    eval("sub HFS_REC_FLDR_THREAD () { 0x0003; }") unless defined(&HFS_REC_FLDR_THREAD);
    eval("sub HFS_REC_FILE_THREAD () { 0x0004; }") unless defined(&HFS_REC_FILE_THREAD);
    eval("sub HFS_JOURNAL_ON_DISK_MASK () { 0x00000001; }") unless defined(&HFS_JOURNAL_ON_DISK_MASK);
    eval("sub HFS_JOURNAL_ON_OTHER_MASK () { 0x00000002; }") unless defined(&HFS_JOURNAL_ON_OTHER_MASK);
    eval("sub HFS_JOURNAL_NEEDS_INIT_MASK () { 0x00000004; }") unless defined(&HFS_JOURNAL_NEEDS_INIT_MASK);
    eval("sub HFS_JOURNAL_HEADER_MAGIC () { 0x4a4e4c78; }") unless defined(&HFS_JOURNAL_HEADER_MAGIC);
    eval("sub HFS_JOURNAL_ENDIAN_MAGIC () { 0x12345678; }") unless defined(&HFS_JOURNAL_ENDIAN_MAGIC);
    eval("sub HFS_DATAFORK () { 0x00; }") unless defined(&HFS_DATAFORK);
    eval("sub HFS_RSRCFORK () { 0xFF; }") unless defined(&HFS_RSRCFORK);
    eval("sub HFS_KEY_CASEFOLD () { 0xCF; }") unless defined(&HFS_KEY_CASEFOLD);
    eval("sub HFS_KEY_BINARY () { 0XBC; }") unless defined(&HFS_KEY_BINARY);
    eval("sub HFS_MIN_CAT_KEY_LEN () { 6; }") unless defined(&HFS_MIN_CAT_KEY_LEN);
    eval("sub HFS_MAX_CAT_KEY_LEN () { 516; }") unless defined(&HFS_MAX_CAT_KEY_LEN);
    eval("sub HFS_MAX_EXT_KEY_LEN () { 10; }") unless defined(&HFS_MAX_EXT_KEY_LEN);
    eval("sub HFS_HARD_LINK_FILE_TYPE () { 0x686C6E6B; }") unless defined(&HFS_HARD_LINK_FILE_TYPE);
    eval("sub HFS_HFSLUS_CREATOR () { 0x6866732B; }") unless defined(&HFS_HFSLUS_CREATOR);
    if(0) {
    }
    eval 'sub HFS_VOLUME_HEAD_RESERVE_SIZE () {1024;}' unless defined(&HFS_VOLUME_HEAD_RESERVE_SIZE);
    eval("sub HFS_CATALOG_FILE () { 1; }") unless defined(&HFS_CATALOG_FILE);
    eval("sub HFS_EXTENTS_FILE () { 2; }") unless defined(&HFS_EXTENTS_FILE);
    eval("sub HFS_ATTRIBUTES_FILE () { 3; }") unless defined(&HFS_ATTRIBUTES_FILE);
    if(0) {
    }
    if(0) {
    }
    if(0) {
    }
    if(0) {
    }
}
1;
