require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&HEADER_LHASH_H)) {
    eval 'sub HEADER_LHASH_H () {1;}' unless defined(&HEADER_LHASH_H);
    require 'openssl/e_os2.ph';
    unless(defined(&OPENSSL_NO_FP_API)) {
	require 'stdio.ph';
    }
    unless(defined(&OPENSSL_NO_BIO)) {
	require 'openssl/bio.ph';
    }
    if(defined(&__cplusplus)) {
    }
    unless(defined(&OPENSSL_NO_HASH_COMP)) {
    }
    eval 'sub DECLARE_LHASH_HASH_FN {
        my($name, $o_type) = @_;
	    eval q(\'unsigned long name\' &_LHASH_HASH( &const  &void *););
    }' unless defined(&DECLARE_LHASH_HASH_FN);
    eval 'sub IMPLEMENT_LHASH_HASH_FN {
        my($name, $o_type) = @_;
	    eval q(\'unsigned long name\' &_LHASH_HASH( &const  &void * &arg) {  &const $o_type * &a =  &arg;  &return $name &_hash( &a); });
    }' unless defined(&IMPLEMENT_LHASH_HASH_FN);
    eval 'sub LHASH_HASH_FN {
        my($name) = @_;
	    eval q($name &_LHASH_HASH);
    }' unless defined(&LHASH_HASH_FN);
    eval 'sub DECLARE_LHASH_COMP_FN {
        my($name, $o_type) = @_;
	    eval q(\'int\' $name &_LHASH_COMP( &const  &void *,  &const  &void *););
    }' unless defined(&DECLARE_LHASH_COMP_FN);
    eval 'sub IMPLEMENT_LHASH_COMP_FN {
        my($name, $o_type) = @_;
	    eval q(\'int\' $name &_LHASH_COMP( &const  &void * &arg1,  &const  &void * &arg2) {  &const $o_type * &a =  &arg1;  &const $o_type * &b =  &arg2;  &return $name &_cmp( &a, &b); });
    }' unless defined(&IMPLEMENT_LHASH_COMP_FN);
    eval 'sub LHASH_COMP_FN {
        my($name) = @_;
	    eval q($name &_LHASH_COMP);
    }' unless defined(&LHASH_COMP_FN);
    eval 'sub DECLARE_LHASH_DOALL_FN {
        my($name, $o_type) = @_;
	    eval q( &void $name &_LHASH_DOALL( &void *););
    }' unless defined(&DECLARE_LHASH_DOALL_FN);
    eval 'sub IMPLEMENT_LHASH_DOALL_FN {
        my($name, $o_type) = @_;
	    eval q( &void $name &_LHASH_DOALL( &void * &arg) { $o_type * &a =  &arg; $name &_doall( &a); });
    }' unless defined(&IMPLEMENT_LHASH_DOALL_FN);
    eval 'sub LHASH_DOALL_FN {
        my($name) = @_;
	    eval q($name &_LHASH_DOALL);
    }' unless defined(&LHASH_DOALL_FN);
    eval 'sub DECLARE_LHASH_DOALL_ARG_FN {
        my($name, $o_type, $a_type) = @_;
	    eval q( &void $name &_LHASH_DOALL_ARG( &void *,  &void *););
    }' unless defined(&DECLARE_LHASH_DOALL_ARG_FN);
    eval 'sub IMPLEMENT_LHASH_DOALL_ARG_FN {
        my($name, $o_type, $a_type) = @_;
	    eval q( &void $name &_LHASH_DOALL_ARG( &void * &arg1,  &void * &arg2) { $o_type * &a =  &arg1; $a_type * &b =  &arg2; $name &_doall_arg( &a,  &b); });
    }' unless defined(&IMPLEMENT_LHASH_DOALL_ARG_FN);
    eval 'sub LHASH_DOALL_ARG_FN {
        my($name) = @_;
	    eval q($name &_LHASH_DOALL_ARG);
    }' unless defined(&LHASH_DOALL_ARG_FN);
    eval 'sub LH_LOAD_MULT () {256;}' unless defined(&LH_LOAD_MULT);
    eval 'sub lh_error {
        my($lh) = @_;
	    eval q((($lh)-> &error));
    }' unless defined(&lh_error);
    unless(defined(&OPENSSL_NO_FP_API)) {
    }
    unless(defined(&OPENSSL_NO_BIO)) {
    }
    eval 'sub LHASH_OF {
        my($type) = @_;
	    eval q(\'struct lhash_st_\'$type);
    }' unless defined(&LHASH_OF);
    eval 'sub DECLARE_LHASH_OF {
        my($type) = @_;
	    eval q( &LHASH_OF($type) { \'int\'  &dummy; });
    }' unless defined(&DECLARE_LHASH_OF);
    eval 'sub CHECKED_LHASH_OF {
        my($type,$lh) = @_;
	    eval q((( &_LHASH *) &CHECKED_PTR_OF( &LHASH_OF($type),$lh)));
    }' unless defined(&CHECKED_LHASH_OF);
    eval 'sub LHM_lh_new {
        my($type, $name) = @_;
	    eval q((( &LHASH_OF($type) *) &lh_new( &LHASH_HASH_FN($name),  &LHASH_COMP_FN($name))));
    }' unless defined(&LHM_lh_new);
    eval 'sub LHM_lh_error {
        my($type, $lh) = @_;
	    eval q( &lh_error( &CHECKED_LHASH_OF($type,$lh)));
    }' unless defined(&LHM_lh_error);
    eval 'sub LHM_lh_insert {
        my($type, $lh, $inst) = @_;
	    eval q((($type *) &lh_insert( &CHECKED_LHASH_OF($type, $lh),  &CHECKED_PTR_OF($type, $inst))));
    }' unless defined(&LHM_lh_insert);
    eval 'sub LHM_lh_retrieve {
        my($type, $lh, $inst) = @_;
	    eval q((($type *) &lh_retrieve( &CHECKED_LHASH_OF($type, $lh),  &CHECKED_PTR_OF($type, $inst))));
    }' unless defined(&LHM_lh_retrieve);
    eval 'sub LHM_lh_delete {
        my($type, $lh, $inst) = @_;
	    eval q((($type *) &lh_delete( &CHECKED_LHASH_OF($type, $lh),  &CHECKED_PTR_OF($type, $inst))));
    }' unless defined(&LHM_lh_delete);
    eval 'sub LHM_lh_doall {
        my($type, $lh,$fn) = @_;
	    eval q( &lh_doall( &CHECKED_LHASH_OF($type, $lh), $fn));
    }' unless defined(&LHM_lh_doall);
    eval 'sub LHM_lh_doall_arg {
        my($type, $lh, $fn, $arg_type, $arg) = @_;
	    eval q( &lh_doall_arg( &CHECKED_LHASH_OF($type, $lh), $fn,  &CHECKED_PTR_OF($arg_type, $arg)));
    }' unless defined(&LHM_lh_doall_arg);
    eval 'sub LHM_lh_num_items {
        my($type, $lh) = @_;
	    eval q( &lh_num_items( &CHECKED_LHASH_OF($type, $lh)));
    }' unless defined(&LHM_lh_num_items);
    eval 'sub LHM_lh_down_load {
        my($type, $lh) = @_;
	    eval q(( &CHECKED_LHASH_OF($type, $lh)-> &down_load));
    }' unless defined(&LHM_lh_down_load);
    eval 'sub LHM_lh_node_stats_bio {
        my($type, $lh, $out) = @_;
	    eval q( &lh_node_stats_bio( &CHECKED_LHASH_OF($type, $lh), $out));
    }' unless defined(&LHM_lh_node_stats_bio);
    eval 'sub LHM_lh_node_usage_stats_bio {
        my($type, $lh, $out) = @_;
	    eval q( &lh_node_usage_stats_bio( &CHECKED_LHASH_OF($type, $lh), $out));
    }' unless defined(&LHM_lh_node_usage_stats_bio);
    eval 'sub LHM_lh_stats_bio {
        my($type, $lh, $out) = @_;
	    eval q( &lh_stats_bio( &CHECKED_LHASH_OF($type, $lh), $out));
    }' unless defined(&LHM_lh_stats_bio);
    eval 'sub LHM_lh_free {
        my($type, $lh) = @_;
	    eval q( &lh_free( &CHECKED_LHASH_OF($type, $lh)));
    }' unless defined(&LHM_lh_free);
    if(defined(&__cplusplus)) {
    }
}
1;
