require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&__RNDVAR_H__)) {
    eval 'sub __RNDVAR_H__ () {1;}' unless defined(&__RNDVAR_H__);
    eval 'sub POOLWORDS () {1024;}' unless defined(&POOLWORDS);
    eval 'sub RND_RND () {0;}' unless defined(&RND_RND);
    eval 'sub RND_SRND () {1;}' unless defined(&RND_SRND);
    eval 'sub RND_URND () {2;}' unless defined(&RND_URND);
    eval 'sub RND_PRND () {3;}' unless defined(&RND_PRND);
    eval 'sub RND_ARND () {4;}' unless defined(&RND_ARND);
    eval 'sub RND_NODEV () {5;}' unless defined(&RND_NODEV);
    eval 'sub RND_SRC_TRUE () {0;}' unless defined(&RND_SRC_TRUE);
    eval 'sub RND_SRC_TIMER () {1;}' unless defined(&RND_SRC_TIMER);
    eval 'sub RND_SRC_MOUSE () {2;}' unless defined(&RND_SRC_MOUSE);
    eval 'sub RND_SRC_TTY () {3;}' unless defined(&RND_SRC_TTY);
    eval 'sub RND_SRC_DISK () {4;}' unless defined(&RND_SRC_DISK);
    eval 'sub RND_SRC_NET () {5;}' unless defined(&RND_SRC_NET);
    eval 'sub RND_SRC_AUDIO () {6;}' unless defined(&RND_SRC_AUDIO);
    eval 'sub RND_SRC_VIDEO () {7;}' unless defined(&RND_SRC_VIDEO);
    eval 'sub RND_SRC_NUM () {8;}' unless defined(&RND_SRC_NUM);
    if(defined(&_KERNEL)) {
	eval 'sub add_true_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_TRUE, ($d)));
	}' unless defined(&add_true_randomness);
	eval 'sub add_timer_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_TIMER, ($d)));
	}' unless defined(&add_timer_randomness);
	eval 'sub add_mouse_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_MOUSE, ($d)));
	}' unless defined(&add_mouse_randomness);
	eval 'sub add_tty_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_TTY, ($d)));
	}' unless defined(&add_tty_randomness);
	eval 'sub add_disk_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_DISK, ($d)));
	}' unless defined(&add_disk_randomness);
	eval 'sub add_net_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_NET, ($d)));
	}' unless defined(&add_net_randomness);
	eval 'sub add_audio_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_AUDIO, ($d)));
	}' unless defined(&add_audio_randomness);
	eval 'sub add_video_randomness {
	    my($d) = @_;
    	    eval q( &enqueue_randomness( &RND_SRC_VIDEO, ($d)));
	}' unless defined(&add_video_randomness);
    }
}
1;
