require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_RUMP_UKFS_H_)) {
    eval 'sub _RUMP_UKFS_H_ () {1;}' unless defined(&_RUMP_UKFS_H_);
    require 'sys/types.ph';
    require 'stdint.ph';
    eval 'sub UKFS_DEFAULTMP () {"/ukfs";}' unless defined(&UKFS_DEFAULTMP);
    eval 'sub UKFS_RELFLAG_NOUNMOUNT () {0x1;}' unless defined(&UKFS_RELFLAG_NOUNMOUNT);
    eval 'sub UKFS_RELFLAG_FORCE () {0x2;}' unless defined(&UKFS_RELFLAG_FORCE);
    eval 'sub UKFS_VERSION () {002;}' unless defined(&UKFS_VERSION);
    eval 'sub ukfs_init () {
        eval q( &_ukfs_init( &UKFS_VERSION));
    }' unless defined(&ukfs_init);
    eval 'sub UKFS_PARTITION_SCANMAGIC () {"%PART:";}' unless defined(&UKFS_PARTITION_SCANMAGIC);
    eval 'sub UKFS_DISKLABEL_SCANMAGIC () {"%DISKLABEL:";}' unless defined(&UKFS_DISKLABEL_SCANMAGIC);
    eval 'sub UKFS_DISKLABEL_MAGICLEN () {($sizeof{ &UKFS_DISKLABEL_SCANMAGIC "a%"}-1);}' unless defined(&UKFS_DISKLABEL_MAGICLEN);
    eval 'sub UKFS_OFFSET_SCANMAGIC () {"%OFFSET:";}' unless defined(&UKFS_OFFSET_SCANMAGIC);
    eval 'sub UKFS_OFFSET_MINLEN () {($sizeof{ &UKFS_OFFSET_SCANMAGIC "512,512%"}-1);}' unless defined(&UKFS_OFFSET_MINLEN);
    eval 'sub UKFS_DEVICE_MAXSTR () {128;}' unless defined(&UKFS_DEVICE_MAXSTR);
    eval 'sub UKFS_DEVICE_MAXPATHLEN () {( &MAXPATHLEN+ &UKFS_DEVICE_MAXSTR);}' unless defined(&UKFS_DEVICE_MAXPATHLEN);
    eval 'sub UKFS_DEVICE_ARGVPROBE {
        my($part) = @_;
	    eval q( &do {  &if ( &argc < 3) *$part =  &NULL;  &else  &if ( &ukfs_part_probe( $argv[ &argc-2], $part) == -1)  &err(1, \\"ukfs_part_probe\\"); }  &while (0));
    }' unless defined(&UKFS_DEVICE_ARGVPROBE);
}
1;
