require '_h2ph_pre.ph';

unless(defined(&_FTAPE_HEADER_SEGMENT_H)) {
    eval 'sub _FTAPE_HEADER_SEGMENT_H () {1;}' unless defined(&_FTAPE_HEADER_SEGMENT_H);
    eval 'sub FT_SIGNATURE () {0;}' unless defined(&FT_SIGNATURE);
    eval 'sub FT_FMT_CODE () {4;}' unless defined(&FT_FMT_CODE);
    eval 'sub FT_REV_LEVEL () {5;}' unless defined(&FT_REV_LEVEL);
    eval 'sub FT_HSEG_1 () {6;}' unless defined(&FT_HSEG_1);
    eval 'sub FT_HSEG_2 () {8;}' unless defined(&FT_HSEG_2);
    eval 'sub FT_FRST_SEG () {10;}' unless defined(&FT_FRST_SEG);
    eval 'sub FT_LAST_SEG () {12;}' unless defined(&FT_LAST_SEG);
    eval 'sub FT_FMT_DATE () {14;}' unless defined(&FT_FMT_DATE);
    eval 'sub FT_WR_DATE () {18;}' unless defined(&FT_WR_DATE);
    eval 'sub FT_SPT () {24;}' unless defined(&FT_SPT);
    eval 'sub FT_TPC () {26;}' unless defined(&FT_TPC);
    eval 'sub FT_FHM () {27;}' unless defined(&FT_FHM);
    eval 'sub FT_FTM () {28;}' unless defined(&FT_FTM);
    eval 'sub FT_FSM () {29;}' unless defined(&FT_FSM);
    eval 'sub FT_LABEL () {30;}' unless defined(&FT_LABEL);
    eval 'sub FT_LABEL_DATE () {74;}' unless defined(&FT_LABEL_DATE);
    eval 'sub FT_LABEL_SZ () {( &FT_LABEL_DATE -  &FT_LABEL);}' unless defined(&FT_LABEL_SZ);
    eval 'sub FT_CMAP_START () {78;}' unless defined(&FT_CMAP_START);
    eval 'sub FT_FMT_ERROR () {128;}' unless defined(&FT_FMT_ERROR);
    eval 'sub FT_SEG_CNT () {130;}' unless defined(&FT_SEG_CNT);
    eval 'sub FT_INIT_DATE () {138;}' unless defined(&FT_INIT_DATE);
    eval 'sub FT_FMT_CNT () {142;}' unless defined(&FT_FMT_CNT);
    eval 'sub FT_FSL_CNT () {144;}' unless defined(&FT_FSL_CNT);
    eval 'sub FT_MK_CODE () {146;}' unless defined(&FT_MK_CODE);
    eval 'sub FT_LOT_CODE () {190;}' unless defined(&FT_LOT_CODE);
    eval 'sub FT_6_HSEG_1 () {234;}' unless defined(&FT_6_HSEG_1);
    eval 'sub FT_6_HSEG_2 () {238;}' unless defined(&FT_6_HSEG_2);
    eval 'sub FT_6_FRST_SEG () {242;}' unless defined(&FT_6_FRST_SEG);
    eval 'sub FT_6_LAST_SEG () {246;}' unless defined(&FT_6_LAST_SEG);
    eval 'sub FT_FSL () {256;}' unless defined(&FT_FSL);
    eval 'sub FT_HEADER_END () {256;}' unless defined(&FT_HEADER_END);
    eval 'sub FT_HSEG_MAGIC () {0xaa55aa55;}' unless defined(&FT_HSEG_MAGIC);
    eval 'sub FT_D2G_MAGIC () {0x82288228;}' unless defined(&FT_D2G_MAGIC);
    eval 'sub FT_YEAR_SHIFT () {25;}' unless defined(&FT_YEAR_SHIFT);
    eval 'sub FT_YEAR_MASK () {0xfe000000;}' unless defined(&FT_YEAR_MASK);
    eval 'sub FT_YEAR_0 () {1970;}' unless defined(&FT_YEAR_0);
    eval 'sub FT_YEAR_MAX () {127;}' unless defined(&FT_YEAR_MAX);
    eval 'sub FT_YEAR {
        local($year) = @_;
	    eval q((((($year)- &FT_YEAR_0)<< &FT_YEAR_SHIFT) &FT_YEAR_MASK));
    }' unless defined(&FT_YEAR);
    eval 'sub FT_TIME_SHIFT () {0;}' unless defined(&FT_TIME_SHIFT);
    eval 'sub FT_TIME_MASK () {0x1ffffff;}' unless defined(&FT_TIME_MASK);
    eval 'sub FT_TIME_MAX () {0x1ea6dff;}' unless defined(&FT_TIME_MAX);
    eval 'sub FT_TIME {
        local($mo,$d,$h,$m,$s) = @_;
	    eval q((((($s)+60*(($m)+60*(($h)+24*(($d)+31*($mo))))) &  &FT_TIME_MASK)));
    }' unless defined(&FT_TIME);
    eval 'sub FT_TIME_STAMP {
        local($y,$mo,$d,$h,$m,$s) = @_;
	    eval q(( &FT_YEAR($y) |  &FT_TIME($mo,$d,$h,$m,$s)));
    }' unless defined(&FT_TIME_STAMP);
    eval("sub fmt_normal () { 2; }") unless defined(&fmt_normal);
    eval("sub fmt_1100ft () { 3; }") unless defined(&fmt_1100ft);
    eval("sub fmt_var () { 4; }") unless defined(&fmt_var);
    eval("sub fmt_425ft () { 5; }") unless defined(&fmt_425ft);
    eval("sub fmt_big () { 6; }") unless defined(&fmt_big);
    eval 'sub FT_FSL_SIZE () {(2*  &FT_SECTOR_SIZE -  &FT_HEADER_END);}' unless defined(&FT_FSL_SIZE);
    eval 'sub FT_FSL_MAX_ENTRIES () {( &FT_FSL_SIZE/$sizeof{ &__u32});}' unless defined(&FT_FSL_MAX_ENTRIES);
    eval 'sub FT_FSL_TIME_STAMP {
        local($y,$m,$d) = @_;
	    eval q(((((($y) -  &FT_YEAR_0)<<9)&0xfe00) | ((($m)<<5)&0x1e0) | (($d)&0x1f)));
    }' unless defined(&FT_FSL_TIME_STAMP);
}
1;
