require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_USBF_H_)) {
    eval 'sub _USBF_H_ () {1;}' unless defined(&_USBF_H_);
    eval("sub USBF_NORMAL_COMPLETION () { 0; }") unless defined(&USBF_NORMAL_COMPLETION);
    eval("sub USBF_IN_PROGRESS () { 1; }") unless defined(&USBF_IN_PROGRESS);
    eval("sub USBF_NOT_STARTED () { 2; }") unless defined(&USBF_NOT_STARTED);
    eval("sub USBF_INVAL () { 3; }") unless defined(&USBF_INVAL);
    eval("sub USBF_NOMEM () { 4; }") unless defined(&USBF_NOMEM);
    eval("sub USBF_CANCELLED () { 5; }") unless defined(&USBF_CANCELLED);
    eval("sub USBF_BAD_ADDRESS () { 6; }") unless defined(&USBF_BAD_ADDRESS);
    eval("sub USBF_IOERROR () { 7; }") unless defined(&USBF_IOERROR);
    eval("sub USBF_TIMEOUT () { 8; }") unless defined(&USBF_TIMEOUT);
    eval("sub USBF_SHORT_XFER () { 9; }") unless defined(&USBF_SHORT_XFER);
    eval("sub USBF_STALLED () { 10; }") unless defined(&USBF_STALLED);
    eval("sub USBF_ERROR_MAX () { 11; }") unless defined(&USBF_ERROR_MAX);
    eval 'sub USBF_ERROR_STRS () {{ "NORMAL_COMPLETION", "IN_PROGRESS", "NOT_STARTED", "INVAL", "NOMEM", "CANCELLED", "BAD_ADDRESS", "IOERROR", "TIMEOUT", "SHORT_XFER", "STALLED", };;}' unless defined(&USBF_ERROR_STRS);
    eval 'sub USBF_EMPTY_STRING_ID () {( &USB_LANGUAGE_TABLE+1);}' unless defined(&USBF_EMPTY_STRING_ID);
    eval 'sub USBF_STRING_ID_MIN () {( &USB_LANGUAGE_TABLE+2);}' unless defined(&USBF_STRING_ID_MIN);
    eval 'sub USBF_STRING_ID_MAX () {255;}' unless defined(&USBF_STRING_ID_MAX);
    eval 'sub usbf_endpoint_index {
        my($e) = @_;
	    eval q( &UE_GET_ADDR( &usbf_endpoint_address(($e))));
    }' unless defined(&usbf_endpoint_index);
    eval 'sub usbf_endpoint_dir {
        my($e) = @_;
	    eval q( &UE_GET_DIR( &usbf_endpoint_address(($e))));
    }' unless defined(&usbf_endpoint_dir);
    eval 'sub usbf_endpoint_type {
        my($e) = @_;
	    eval q( &UE_GET_XFERTYPE( &usbf_endpoint_attributes(($e))));
    }' unless defined(&usbf_endpoint_type);
    eval 'sub usbf_init_task {
        my($t, $f, $a) = @_;
	    eval q((($t)-> &fun=($f), ($t)-> &arg=($a), ($t)-> &onqueue=0));
    }' unless defined(&usbf_init_task);
}
1;
