require '_h2ph_pre.ph';

unless(defined(&_LINUX_FD_H)) {
    eval 'sub _LINUX_FD_H () {1;}' unless defined(&_LINUX_FD_H);
    require 'linux/ioctl.ph';
    eval 'sub FD_STRETCH () {1;}' unless defined(&FD_STRETCH);
    eval 'sub FD_SWAPSIDES () {2;}' unless defined(&FD_SWAPSIDES);
    eval 'sub FD_2M () {0x4;}' unless defined(&FD_2M);
    eval 'sub FD_SIZECODEMASK () {0x38;}' unless defined(&FD_SIZECODEMASK);
    eval 'sub FD_SIZECODE {
        local($floppy) = @_;
	    eval q(((((($floppy)-> &rate &FD_SIZECODEMASK)>> 3)+ 2) %8));
    }' unless defined(&FD_SIZECODE);
    eval 'sub FD_SECTSIZE {
        local($floppy) = @_;
	    eval q(( ($floppy)-> &rate &  &FD_2M ? 512: 128<<  &FD_SIZECODE($floppy) ));
    }' unless defined(&FD_SECTSIZE);
    eval 'sub FD_PERP () {0x40;}' unless defined(&FD_PERP);
    eval 'sub FDCLRPRM () { &_IO("2", 0x41);}' unless defined(&FDCLRPRM);
    eval 'sub FDSETPRM () { &_IOW("2", 0x42, \'struct floppy_struct\');}' unless defined(&FDSETPRM);
    eval 'sub FDSETMEDIAPRM () { &FDSETPRM;}' unless defined(&FDSETMEDIAPRM);
    eval 'sub FDDEFPRM () { &_IOW("2", 0x43, \'struct floppy_struct\');}' unless defined(&FDDEFPRM);
    eval 'sub FDGETPRM () { &_IOR("2", 0x4, \'struct floppy_struct\');}' unless defined(&FDGETPRM);
    eval 'sub FDDEFMEDIAPRM () { &FDDEFPRM;}' unless defined(&FDDEFMEDIAPRM);
    eval 'sub FDGETMEDIAPRM () { &FDGETPRM;}' unless defined(&FDGETMEDIAPRM);
    eval 'sub FDMSGON () { &_IO("2",0x45);}' unless defined(&FDMSGON);
    eval 'sub FDMSGOFF () { &_IO("2",0x46);}' unless defined(&FDMSGOFF);
    eval 'sub FD_FILL_BYTE () {0xf6;}' unless defined(&FD_FILL_BYTE);
    eval 'sub FDFMTBEG () { &_IO("2",0x47);}' unless defined(&FDFMTBEG);
    eval 'sub FDFMTTRK () { &_IOW("2",0x48, \'struct format_descr\');}' unless defined(&FDFMTTRK);
    eval 'sub FDFMTEND () { &_IO("2",0x49);}' unless defined(&FDFMTEND);
    eval 'sub FDSETEMSGTRESH () { &_IO("2",0x4a);}' unless defined(&FDSETEMSGTRESH);
    eval 'sub FDFLUSH () { &_IO("2",0x4b);}' unless defined(&FDFLUSH);
    eval 'sub FDSETMAXERRS () { &_IOW("2", 0x4c, \'struct floppy_max_errors\');}' unless defined(&FDSETMAXERRS);
    eval 'sub FDGETMAXERRS () { &_IOR("2", 0xe, \'struct floppy_max_errors\');}' unless defined(&FDGETMAXERRS);
    eval 'sub FDGETDRVTYP () { &_IOR("2", 0xf,  &floppy_drive_name);}' unless defined(&FDGETDRVTYP);
    eval 'sub FTD_MSG () {0x10;}' unless defined(&FTD_MSG);
    eval 'sub FD_BROKEN_DCL () {0x20;}' unless defined(&FD_BROKEN_DCL);
    eval 'sub FD_DEBUG () {0x2;}' unless defined(&FD_DEBUG);
    eval 'sub FD_SILENT_DCL_CLEAR () {0x4;}' unless defined(&FD_SILENT_DCL_CLEAR);
    eval 'sub FD_INVERTED_DCL () {0x80;}' unless defined(&FD_INVERTED_DCL);
    eval("sub FD_NEED_TWADDLE_BIT () { 0; }") unless defined(&FD_NEED_TWADDLE_BIT);
    eval("sub FD_VERIFY_BIT () { 1; }") unless defined(&FD_VERIFY_BIT);
    eval("sub FD_DISK_NEWCHANGE_BIT () { 2; }") unless defined(&FD_DISK_NEWCHANGE_BIT);
    eval("sub FD_UNUSED_BIT () { 3; }") unless defined(&FD_UNUSED_BIT);
    eval("sub FD_DISK_CHANGED_BIT () { 4; }") unless defined(&FD_DISK_CHANGED_BIT);
    eval("sub FD_DISK_WRITABLE_BIT () { 5; }") unless defined(&FD_DISK_WRITABLE_BIT);
    eval 'sub FDSETDRVPRM () { &_IOW("2", 0x90, \'struct floppy_drive_params\');}' unless defined(&FDSETDRVPRM);
    eval 'sub FDGETDRVPRM () { &_IOR("2", 0x11, \'struct floppy_drive_params\');}' unless defined(&FDGETDRVPRM);
    eval 'sub FD_NEED_TWADDLE () {(1<<  &FD_NEED_TWADDLE_BIT);}' unless defined(&FD_NEED_TWADDLE);
    eval 'sub FD_VERIFY () {(1<<  &FD_VERIFY_BIT);}' unless defined(&FD_VERIFY);
    eval 'sub FD_DISK_NEWCHANGE () {(1<<  &FD_DISK_NEWCHANGE_BIT);}' unless defined(&FD_DISK_NEWCHANGE);
    eval 'sub FD_DISK_CHANGED () {(1<<  &FD_DISK_CHANGED_BIT);}' unless defined(&FD_DISK_CHANGED);
    eval 'sub FD_DISK_WRITABLE () {(1<<  &FD_DISK_WRITABLE_BIT);}' unless defined(&FD_DISK_WRITABLE);
    eval 'sub FDGETDRVSTAT () { &_IOR("2", 0x12, \'struct floppy_drive_struct\');}' unless defined(&FDGETDRVSTAT);
    eval 'sub FDPOLLDRVSTAT () { &_IOR("2", 0x13, \'struct floppy_drive_struct\');}' unless defined(&FDPOLLDRVSTAT);
    eval("sub FD_RESET_IF_NEEDED () { 0; }") unless defined(&FD_RESET_IF_NEEDED);
    eval("sub FD_RESET_IF_RAWCMD () { 1; }") unless defined(&FD_RESET_IF_RAWCMD);
    eval("sub FD_RESET_ALWAYS () { 2; }") unless defined(&FD_RESET_ALWAYS);
    eval 'sub FDRESET () { &_IO("2", 0x54);}' unless defined(&FDRESET);
    eval 'sub FD_DRIVER_VERSION () {0x100;}' unless defined(&FD_DRIVER_VERSION);
    eval 'sub FDGETFDCSTAT () { &_IOR("2", 0x15, \'struct floppy_fdc_state\');}' unless defined(&FDGETFDCSTAT);
    eval 'sub FDWERRORCLR () { &_IO("2", 0x56);}' unless defined(&FDWERRORCLR);
    eval 'sub FDWERRORGET () { &_IOR("2", 0x17, \'struct floppy_write_errors\');}' unless defined(&FDWERRORGET);
    eval 'sub FDHAVEBATCHEDRAWCMD () {1;}' unless defined(&FDHAVEBATCHEDRAWCMD);
    eval 'sub FD_RAW_READ () {1;}' unless defined(&FD_RAW_READ);
    eval 'sub FD_RAW_WRITE () {2;}' unless defined(&FD_RAW_WRITE);
    eval 'sub FD_RAW_NO_MOTOR () {4;}' unless defined(&FD_RAW_NO_MOTOR);
    eval 'sub FD_RAW_DISK_CHANGE () {4;}' unless defined(&FD_RAW_DISK_CHANGE);
    eval 'sub FD_RAW_INTR () {8;}' unless defined(&FD_RAW_INTR);
    eval 'sub FD_RAW_SPIN () {0x10;}' unless defined(&FD_RAW_SPIN);
    eval 'sub FD_RAW_NO_MOTOR_AFTER () {0x20;}' unless defined(&FD_RAW_NO_MOTOR_AFTER);
    eval 'sub FD_RAW_NEED_DISK () {0x40;}' unless defined(&FD_RAW_NEED_DISK);
    eval 'sub FD_RAW_NEED_SEEK () {0x80;}' unless defined(&FD_RAW_NEED_SEEK);
    eval 'sub FD_RAW_MORE () {0x100;}' unless defined(&FD_RAW_MORE);
    eval 'sub FD_RAW_STOP_IF_FAILURE () {0x200;}' unless defined(&FD_RAW_STOP_IF_FAILURE);
    eval 'sub FD_RAW_STOP_IF_SUCCESS () {0x400;}' unless defined(&FD_RAW_STOP_IF_SUCCESS);
    eval 'sub FD_RAW_SOFTFAILURE () {0x800;}' unless defined(&FD_RAW_SOFTFAILURE);
    eval 'sub FD_RAW_FAILURE () {0x10000;}' unless defined(&FD_RAW_FAILURE);
    eval 'sub FD_RAW_HARDFAILURE () {0x20000;}' unless defined(&FD_RAW_HARDFAILURE);
    eval 'sub FDRAWCMD () { &_IO("2", 0x58);}' unless defined(&FDRAWCMD);
    eval 'sub FDTWADDLE () { &_IO("2", 0x59);}' unless defined(&FDTWADDLE);
    eval 'sub FDEJECT () { &_IO("2", 0x5a);}' unless defined(&FDEJECT);
}
1;
