require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_ALTQ_ALTQ_CONF_H_)) {
    eval 'sub _ALTQ_ALTQ_CONF_H_ () {1;}' unless defined(&_ALTQ_ALTQ_CONF_H_);
    if(defined(&ALTQ3_COMPAT)) {
	if(defined(&_KERNEL)) {
	    require 'sys/param.ph';
	    require 'sys/conf.ph';
	    require 'sys/kernel.ph';
	    if(((defined(&__FreeBSD_version) ? &__FreeBSD_version : undef) > 300000)) {
		eval 'sub ALTQ_KLD () {1;}' unless defined(&ALTQ_KLD);
	    }
	    if(defined(&ALTQ_KLD)) {
		require 'sys/module.ph';
	    }
	    unless(defined(&dev_decl)) {
		if(defined(&__STDC__)) {
		    eval 'sub dev_decl {
		        my($n,$t) = @_;
    			eval q( &d_  $t   &_t $n  $t);
		    }' unless defined(&dev_decl);
		} else {
		    eval 'sub dev_decl {
		        my($n,$t) = @_;
    			eval q( &d_ $t  &_t $n $t);
		    }' unless defined(&dev_decl);
		}
	    }
	    if(defined(&__NetBSD__)) {
	    }
	    if(defined(&__OpenBSD__)) {
		eval 'sub noopen () {( &dev_type_open((*)))  &enodev;}' unless defined(&noopen);
		eval 'sub noclose () {( &dev_type_close((*)))  &enodev;}' unless defined(&noclose);
		eval 'sub noioctl () {( &dev_type_ioctl((*)))  &enodev;}' unless defined(&noioctl);
	    }
	    if(defined(&__FreeBSD__)) {
	    }
	    eval 'sub altqdev_decl {
	        my($n) = @_;
    		eval q( &dev_decl($n, &open);  &dev_decl($n, &close);  &dev_decl($n, &ioctl));
	    }' unless defined(&altqdev_decl);
	    if(defined(&ALTQ_KLD)) {
		eval 'sub ALTQ_MODULE {
		    my($name, $type, $devsw) = @_;
    		    eval q( &static \'struct altq_module_data\' $name &_moddata = { $type, 0, $devsw };  &moduledata_t $name &_mod = { $name,  &altq_module_handler, $name &_moddata };  &DECLARE_MODULE($name, $name &_mod,  &SI_SUB_DRIVERS,  &SI_ORDER_MIDDLE+96));
		}' unless defined(&ALTQ_MODULE);
	    }
	}
    }
}
1;
