require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&HEADER_ASN1T_H)) {
    eval 'sub HEADER_ASN1T_H () {1;}' unless defined(&HEADER_ASN1T_H);
    require 'stddef.ph';
    require 'openssl/e_os2.ph';
    require 'openssl/asn1.ph';
    if(defined(&OPENSSL_BUILD_SHLIBCRYPTO)) {
	undef(&OPENSSL_EXTERN) if defined(&OPENSSL_EXTERN);
	eval 'sub OPENSSL_EXTERN () { &OPENSSL_EXPORT;}' unless defined(&OPENSSL_EXTERN);
    }
    if(defined(&__cplusplus)) {
    }
    unless(defined(&OPENSSL_EXPORT_VAR_AS_FUNCTION)) {
	eval 'sub ASN1_ADB_ptr {
	    my($iptr) = @_;
    	    eval q((( &const  &ASN1_ADB *)($iptr)));
	}' unless defined(&ASN1_ADB_ptr);
	eval 'sub ASN1_ITEM_start {
	    my($itname) = @_;
    	    eval q( &OPENSSL_GLOBAL  &const  &ASN1_ITEM $itname &_it = {);
	}' unless defined(&ASN1_ITEM_start);
	eval 'sub ASN1_ITEM_end {
	    my($itname) = @_;
    	    eval q(};);
	}' unless defined(&ASN1_ITEM_end);
    } else {
	eval 'sub ASN1_ADB_ptr {
	    my($iptr) = @_;
    	    eval q((( &const  &ASN1_ADB *)($iptr())));
	}' unless defined(&ASN1_ADB_ptr);
	eval 'sub ASN1_ITEM_start {
	    my($itname) = @_;
    	    eval q( &const  &ASN1_ITEM * $itname &_it( &void) {  &static  &const  &ASN1_ITEM  &local_it = {);
	}' unless defined(&ASN1_ITEM_start);
	eval 'sub ASN1_ITEM_end {
	    my($itname) = @_;
    	    eval q(};  &return  &local_it; });
	}' unless defined(&ASN1_ITEM_end);
    }
    eval 'sub ASN1_ITEM_TEMPLATE {
        my($tname) = @_;
	    eval q( &const  &static  &ASN1_TEMPLATE $tname &_item_tt);
    }' unless defined(&ASN1_ITEM_TEMPLATE);
    eval 'sub ASN1_ITEM_TEMPLATE_END {
        my($tname) = @_;
	    eval q(;  &ASN1_ITEM_start($tname)  &ASN1_ITYPE_PRIMITIVE, -1, $tname &_item_tt, 0,  &NULL, 0, $tname  &ASN1_ITEM_end($tname));
    }' unless defined(&ASN1_ITEM_TEMPLATE_END);
    eval 'sub ASN1_SEQUENCE {
        my($tname) = @_;
	    eval q( &const  &static  &ASN1_TEMPLATE $tname $_seq_tt[]);
    }' unless defined(&ASN1_SEQUENCE);
    eval 'sub ASN1_SEQUENCE_END {
        my($stname) = @_;
	    eval q( &ASN1_SEQUENCE_END_name($stname, $stname));
    }' unless defined(&ASN1_SEQUENCE_END);
    eval 'sub ASN1_SEQUENCE_END_name {
        my($stname, $tname) = @_;
	    eval q(;  &ASN1_ITEM_start($tname)  &ASN1_ITYPE_SEQUENCE,  &V_ASN1_SEQUENCE, $tname &_seq_tt, $sizeof{$tname &_seq_tt} / $sizeof{ &ASN1_TEMPLATE},  &NULL, $sizeof{$stname}, $stname  &ASN1_ITEM_end($tname));
    }' unless defined(&ASN1_SEQUENCE_END_name);
    eval 'sub ASN1_SEQUENCE_cb {
        my($tname, $cb) = @_;
	    eval q( &const  &static  &ASN1_AUX $tname &_aux = { &NULL, 0, 0, 0, $cb, 0};  &ASN1_SEQUENCE($tname));
    }' unless defined(&ASN1_SEQUENCE_cb);
    eval 'sub ASN1_BROKEN_SEQUENCE {
        my($tname) = @_;
	    eval q( &const  &static  &ASN1_AUX $tname &_aux = { &NULL,  &ASN1_AFLG_BROKEN, 0, 0, 0, 0};  &ASN1_SEQUENCE($tname));
    }' unless defined(&ASN1_BROKEN_SEQUENCE);
    eval 'sub ASN1_SEQUENCE_ref {
        my($tname, $cb, $lck) = @_;
	    eval q( &const  &static  &ASN1_AUX $tname &_aux = { &NULL,  &ASN1_AFLG_REFCOUNT,  &offsetof($tname,  &references), $lck, $cb, 0};  &ASN1_SEQUENCE($tname));
    }' unless defined(&ASN1_SEQUENCE_ref);
    eval 'sub ASN1_SEQUENCE_enc {
        my($tname, $enc, $cb) = @_;
	    eval q( &const  &static  &ASN1_AUX $tname &_aux = { &NULL,  &ASN1_AFLG_ENCODING, 0, 0, $cb,  &offsetof($tname, $enc)};  &ASN1_SEQUENCE($tname));
    }' unless defined(&ASN1_SEQUENCE_enc);
    eval 'sub ASN1_BROKEN_SEQUENCE_END {
        my($stname) = @_;
	    eval q( &ASN1_SEQUENCE_END_ref($stname, $stname));
    }' unless defined(&ASN1_BROKEN_SEQUENCE_END);
    eval 'sub ASN1_SEQUENCE_END_enc {
        my($stname, $tname) = @_;
	    eval q( &ASN1_SEQUENCE_END_ref($stname, $tname));
    }' unless defined(&ASN1_SEQUENCE_END_enc);
    eval 'sub ASN1_SEQUENCE_END_cb {
        my($stname, $tname) = @_;
	    eval q( &ASN1_SEQUENCE_END_ref($stname, $tname));
    }' unless defined(&ASN1_SEQUENCE_END_cb);
    eval 'sub ASN1_SEQUENCE_END_ref {
        my($stname, $tname) = @_;
	    eval q(;  &ASN1_ITEM_start($tname)  &ASN1_ITYPE_SEQUENCE,  &V_ASN1_SEQUENCE, $tname &_seq_tt, $sizeof{$tname &_seq_tt} / $sizeof{ &ASN1_TEMPLATE}, $tname &_aux, $sizeof{$stname}, $stname  &ASN1_ITEM_end($tname));
    }' unless defined(&ASN1_SEQUENCE_END_ref);
    eval 'sub ASN1_CHOICE {
        my($tname) = @_;
	    eval q( &const  &static  &ASN1_TEMPLATE $tname $_ch_tt[]);
    }' unless defined(&ASN1_CHOICE);
    eval 'sub ASN1_CHOICE_cb {
        my($tname, $cb) = @_;
	    eval q( &const  &static  &ASN1_AUX $tname &_aux = { &NULL, 0, 0, 0, $cb, 0};  &ASN1_CHOICE($tname));
    }' unless defined(&ASN1_CHOICE_cb);
    eval 'sub ASN1_CHOICE_END {
        my($stname) = @_;
	    eval q( &ASN1_CHOICE_END_name($stname, $stname));
    }' unless defined(&ASN1_CHOICE_END);
    eval 'sub ASN1_CHOICE_END_name {
        my($stname, $tname) = @_;
	    eval q( &ASN1_CHOICE_END_selector($stname, $tname,  &type));
    }' unless defined(&ASN1_CHOICE_END_name);
    eval 'sub ASN1_CHOICE_END_selector {
        my($stname, $tname, $selname) = @_;
	    eval q(;  &ASN1_ITEM_start($tname)  &ASN1_ITYPE_CHOICE,  &offsetof($stname,$selname) , $tname &_ch_tt, $sizeof{$tname &_ch_tt} / $sizeof{ &ASN1_TEMPLATE},  &NULL, $sizeof{$stname}, $stname  &ASN1_ITEM_end($tname));
    }' unless defined(&ASN1_CHOICE_END_selector);
    eval 'sub ASN1_CHOICE_END_cb {
        my($stname, $tname, $selname) = @_;
	    eval q(;  &ASN1_ITEM_start($tname)  &ASN1_ITYPE_CHOICE,  &offsetof($stname,$selname) , $tname &_ch_tt, $sizeof{$tname &_ch_tt} / $sizeof{ &ASN1_TEMPLATE}, $tname &_aux, $sizeof{$stname}, $stname  &ASN1_ITEM_end($tname));
    }' unless defined(&ASN1_CHOICE_END_cb);
    eval 'sub ASN1_EX_TEMPLATE_TYPE {
        my($flags, $tag, $name, $type) = @_;
	    eval q({ ($flags), ($tag), 0, $name,  &ASN1_ITEM_ref($type) });
    }' unless defined(&ASN1_EX_TEMPLATE_TYPE);
    eval 'sub ASN1_EX_TYPE {
        my($flags, $tag, $stname, $field, $type) = @_;
	    eval q({ ($flags), ($tag),  &offsetof($stname, $field), $field,  &ASN1_ITEM_ref($type) });
    }' unless defined(&ASN1_EX_TYPE);
    eval 'sub ASN1_EX_COMBINE {
        my($flags, $tag, $type) = @_;
	    eval q({ ($flags)| &ASN1_TFLG_COMBINE, ($tag), 0,  &NULL,  &ASN1_ITEM_ref($type) });
    }' unless defined(&ASN1_EX_COMBINE);
    eval 'sub ASN1_IMP_EX {
        my($stname, $field, $type, $tag, $ex) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_IMPLICIT | $ex, $tag, $stname, $field, $type));
    }' unless defined(&ASN1_IMP_EX);
    eval 'sub ASN1_EXP_EX {
        my($stname, $field, $type, $tag, $ex) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_EXPLICIT | $ex, $tag, $stname, $field, $type));
    }' unless defined(&ASN1_EXP_EX);
    unless(defined(&OPENSSL_EXPORT_VAR_AS_FUNCTION)) {
	eval 'sub ASN1_ADB_OBJECT {
	    my($tblname) = @_;
    	    eval q({  &ASN1_TFLG_ADB_OID, -1, 0, $tblname, ( &const  &ASN1_ITEM *)($tblname &_adb) });
	}' unless defined(&ASN1_ADB_OBJECT);
	eval 'sub ASN1_ADB_INTEGER {
	    my($tblname) = @_;
    	    eval q({  &ASN1_TFLG_ADB_INT, -1, 0, $tblname, ( &const  &ASN1_ITEM *)($tblname &_adb) });
	}' unless defined(&ASN1_ADB_INTEGER);
    } else {
	eval 'sub ASN1_ADB_OBJECT {
	    my($tblname) = @_;
    	    eval q({  &ASN1_TFLG_ADB_OID, -1, 0, $tblname, $tblname &_adb });
	}' unless defined(&ASN1_ADB_OBJECT);
	eval 'sub ASN1_ADB_INTEGER {
	    my($tblname) = @_;
    	    eval q({  &ASN1_TFLG_ADB_INT, -1, 0, $tblname, $tblname &_adb });
	}' unless defined(&ASN1_ADB_INTEGER);
    }
    eval 'sub ASN1_SIMPLE {
        my($stname, $field, $type) = @_;
	    eval q( &ASN1_EX_TYPE(0,0, $stname, $field, $type));
    }' unless defined(&ASN1_SIMPLE);
    eval 'sub ASN1_OPT {
        my($stname, $field, $type) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_OPTIONAL, 0, $stname, $field, $type));
    }' unless defined(&ASN1_OPT);
    eval 'sub ASN1_IMP {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_IMP_EX($stname, $field, $type, $tag, 0));
    }' unless defined(&ASN1_IMP);
    eval 'sub ASN1_IMP_OPT {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_IMP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_OPTIONAL));
    }' unless defined(&ASN1_IMP_OPT);
    eval 'sub ASN1_EXP {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_EXP_EX($stname, $field, $type, $tag, 0));
    }' unless defined(&ASN1_EXP);
    eval 'sub ASN1_EXP_OPT {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_EXP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_OPTIONAL));
    }' unless defined(&ASN1_EXP_OPT);
    eval 'sub ASN1_SEQUENCE_OF {
        my($stname, $field, $type) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_SEQUENCE_OF, 0, $stname, $field, $type));
    }' unless defined(&ASN1_SEQUENCE_OF);
    eval 'sub ASN1_SEQUENCE_OF_OPT {
        my($stname, $field, $type) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_SEQUENCE_OF| &ASN1_TFLG_OPTIONAL, 0, $stname, $field, $type));
    }' unless defined(&ASN1_SEQUENCE_OF_OPT);
    eval 'sub ASN1_SET_OF {
        my($stname, $field, $type) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_SET_OF, 0, $stname, $field, $type));
    }' unless defined(&ASN1_SET_OF);
    eval 'sub ASN1_SET_OF_OPT {
        my($stname, $field, $type) = @_;
	    eval q( &ASN1_EX_TYPE( &ASN1_TFLG_SET_OF| &ASN1_TFLG_OPTIONAL, 0, $stname, $field, $type));
    }' unless defined(&ASN1_SET_OF_OPT);
    eval 'sub ASN1_IMP_SET_OF {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_IMP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SET_OF));
    }' unless defined(&ASN1_IMP_SET_OF);
    eval 'sub ASN1_EXP_SET_OF {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_EXP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SET_OF));
    }' unless defined(&ASN1_EXP_SET_OF);
    eval 'sub ASN1_IMP_SET_OF_OPT {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_IMP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SET_OF| &ASN1_TFLG_OPTIONAL));
    }' unless defined(&ASN1_IMP_SET_OF_OPT);
    eval 'sub ASN1_EXP_SET_OF_OPT {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_EXP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SET_OF| &ASN1_TFLG_OPTIONAL));
    }' unless defined(&ASN1_EXP_SET_OF_OPT);
    eval 'sub ASN1_IMP_SEQUENCE_OF {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_IMP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SEQUENCE_OF));
    }' unless defined(&ASN1_IMP_SEQUENCE_OF);
    eval 'sub ASN1_IMP_SEQUENCE_OF_OPT {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_IMP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SEQUENCE_OF| &ASN1_TFLG_OPTIONAL));
    }' unless defined(&ASN1_IMP_SEQUENCE_OF_OPT);
    eval 'sub ASN1_EXP_SEQUENCE_OF {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_EXP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SEQUENCE_OF));
    }' unless defined(&ASN1_EXP_SEQUENCE_OF);
    eval 'sub ASN1_EXP_SEQUENCE_OF_OPT {
        my($stname, $field, $type, $tag) = @_;
	    eval q( &ASN1_EXP_EX($stname, $field, $type, $tag,  &ASN1_TFLG_SEQUENCE_OF| &ASN1_TFLG_OPTIONAL));
    }' unless defined(&ASN1_EXP_SEQUENCE_OF_OPT);
    eval 'sub ASN1_ADB {
        my($name) = @_;
	    eval q( &const  &static  &ASN1_ADB_TABLE $name $_adbtbl[]);
    }' unless defined(&ASN1_ADB);
    unless(defined(&OPENSSL_EXPORT_VAR_AS_FUNCTION)) {
	eval 'sub ASN1_ADB_END {
	    my($name, $flags, $field, $app_table, $def, $none) = @_;
    	    eval q(;  &const  &static  &ASN1_ADB $name &_adb = { $flags,  &offsetof($name, $field), $app_table, $name &_adbtbl, $sizeof{$name &_adbtbl} / $sizeof{ &ASN1_ADB_TABLE}, $def, $none });
	}' unless defined(&ASN1_ADB_END);
    } else {
	eval 'sub ASN1_ADB_END {
	    my($name, $flags, $field, $app_table, $def, $none) = @_;
    	    eval q(;  &const  &static  &ASN1_ITEM *$name &_adb( &void) {  &const  &static  &ASN1_ADB  &internal_adb = { $flags,  &offsetof($name, $field), $app_table, $name &_adbtbl, $sizeof{$name &_adbtbl} / $sizeof{ &ASN1_ADB_TABLE}, $def, $none };  &return ( &const  &ASN1_ITEM *)  &internal_adb; }  &void  &dummy_function( &void));
	}' unless defined(&ASN1_ADB_END);
    }
    eval 'sub ADB_ENTRY {
        my($val, $template) = @_;
	    eval q({$val, $template});
    }' unless defined(&ADB_ENTRY);
    eval 'sub ASN1_ADB_TEMPLATE {
        my($name) = @_;
	    eval q( &const  &static  &ASN1_TEMPLATE $name &_tt);
    }' unless defined(&ASN1_ADB_TEMPLATE);
    unless(defined(&NO_ASN1_FIELD_NAMES)) {
    }
    eval 'sub ASN1_TEMPLATE_item {
        my($t) = @_;
	    eval q(( ($t->{i$tem_ptr})));
    }' unless defined(&ASN1_TEMPLATE_item);
    eval 'sub ASN1_TEMPLATE_adb {
        my($t) = @_;
	    eval q(( ($t->{i$tem_ptr})));
    }' unless defined(&ASN1_TEMPLATE_adb);
    eval 'sub ASN1_TFLG_OPTIONAL () {(0x1);}' unless defined(&ASN1_TFLG_OPTIONAL);
    eval 'sub ASN1_TFLG_SET_OF () {(0x1 << 1);}' unless defined(&ASN1_TFLG_SET_OF);
    eval 'sub ASN1_TFLG_SEQUENCE_OF () {(0x2 << 1);}' unless defined(&ASN1_TFLG_SEQUENCE_OF);
    eval 'sub ASN1_TFLG_SET_ORDER () {(0x3 << 1);}' unless defined(&ASN1_TFLG_SET_ORDER);
    eval 'sub ASN1_TFLG_SK_MASK () {(0x3 << 1);}' unless defined(&ASN1_TFLG_SK_MASK);
    eval 'sub ASN1_TFLG_IMPTAG () {(0x1 << 3);}' unless defined(&ASN1_TFLG_IMPTAG);
    eval 'sub ASN1_TFLG_EXPTAG () {(0x2 << 3);}' unless defined(&ASN1_TFLG_EXPTAG);
    eval 'sub ASN1_TFLG_TAG_MASK () {(0x3 << 3);}' unless defined(&ASN1_TFLG_TAG_MASK);
    eval 'sub ASN1_TFLG_IMPLICIT () { &ASN1_TFLG_IMPTAG| &ASN1_TFLG_CONTEXT;}' unless defined(&ASN1_TFLG_IMPLICIT);
    eval 'sub ASN1_TFLG_EXPLICIT () { &ASN1_TFLG_EXPTAG| &ASN1_TFLG_CONTEXT;}' unless defined(&ASN1_TFLG_EXPLICIT);
    eval 'sub ASN1_TFLG_UNIVERSAL () {(0x<<6);}' unless defined(&ASN1_TFLG_UNIVERSAL);
    eval 'sub ASN1_TFLG_APPLICATION () {(0x1<<6);}' unless defined(&ASN1_TFLG_APPLICATION);
    eval 'sub ASN1_TFLG_CONTEXT () {(0x2<<6);}' unless defined(&ASN1_TFLG_CONTEXT);
    eval 'sub ASN1_TFLG_PRIVATE () {(0x3<<6);}' unless defined(&ASN1_TFLG_PRIVATE);
    eval 'sub ASN1_TFLG_TAG_CLASS () {(0x3<<6);}' unless defined(&ASN1_TFLG_TAG_CLASS);
    eval 'sub ASN1_TFLG_ADB_MASK () {(0x3<<8);}' unless defined(&ASN1_TFLG_ADB_MASK);
    eval 'sub ASN1_TFLG_ADB_OID () {(0x1<<8);}' unless defined(&ASN1_TFLG_ADB_OID);
    eval 'sub ASN1_TFLG_ADB_INT () {(0x1<<9);}' unless defined(&ASN1_TFLG_ADB_INT);
    eval 'sub ASN1_TFLG_COMBINE () {(0x1<<10);}' unless defined(&ASN1_TFLG_COMBINE);
    unless(defined(&NO_ASN1_FIELD_NAMES)) {
    }
    eval 'sub ASN1_ITYPE_PRIMITIVE () {0x;}' unless defined(&ASN1_ITYPE_PRIMITIVE);
    eval 'sub ASN1_ITYPE_SEQUENCE () {0x1;}' unless defined(&ASN1_ITYPE_SEQUENCE);
    eval 'sub ASN1_ITYPE_CHOICE () {0x2;}' unless defined(&ASN1_ITYPE_CHOICE);
    eval 'sub ASN1_ITYPE_COMPAT () {0x3;}' unless defined(&ASN1_ITYPE_COMPAT);
    eval 'sub ASN1_ITYPE_EXTERN () {0x4;}' unless defined(&ASN1_ITYPE_EXTERN);
    eval 'sub ASN1_ITYPE_MSTRING () {0x5;}' unless defined(&ASN1_ITYPE_MSTRING);
    eval 'sub ASN1_AFLG_REFCOUNT () {1;}' unless defined(&ASN1_AFLG_REFCOUNT);
    eval 'sub ASN1_AFLG_ENCODING () {2;}' unless defined(&ASN1_AFLG_ENCODING);
    eval 'sub ASN1_AFLG_BROKEN () {4;}' unless defined(&ASN1_AFLG_BROKEN);
    eval 'sub ASN1_OP_NEW_PRE () {0;}' unless defined(&ASN1_OP_NEW_PRE);
    eval 'sub ASN1_OP_NEW_POST () {1;}' unless defined(&ASN1_OP_NEW_POST);
    eval 'sub ASN1_OP_FREE_PRE () {2;}' unless defined(&ASN1_OP_FREE_PRE);
    eval 'sub ASN1_OP_FREE_POST () {3;}' unless defined(&ASN1_OP_FREE_POST);
    eval 'sub ASN1_OP_D2I_PRE () {4;}' unless defined(&ASN1_OP_D2I_PRE);
    eval 'sub ASN1_OP_D2I_POST () {5;}' unless defined(&ASN1_OP_D2I_POST);
    eval 'sub ASN1_OP_I2D_PRE () {6;}' unless defined(&ASN1_OP_I2D_PRE);
    eval 'sub ASN1_OP_I2D_POST () {7;}' unless defined(&ASN1_OP_I2D_POST);
    eval 'sub IMPLEMENT_ASN1_TYPE {
        my($stname) = @_;
	    eval q( &IMPLEMENT_ASN1_TYPE_ex($stname, $stname, 0));
    }' unless defined(&IMPLEMENT_ASN1_TYPE);
    eval 'sub IMPLEMENT_ASN1_TYPE_ex {
        my($itname, $vname, $ex) = @_;
	    eval q( &ASN1_ITEM_start($itname)  &ASN1_ITYPE_PRIMITIVE,  &V_$vname,  &NULL, 0,  &NULL, $ex, $itname  &ASN1_ITEM_end($itname));
    }' unless defined(&IMPLEMENT_ASN1_TYPE_ex);
    eval 'sub IMPLEMENT_ASN1_MSTRING {
        my($itname, $mask) = @_;
	    eval q( &ASN1_ITEM_start($itname)  &ASN1_ITYPE_MSTRING, $mask,  &NULL, 0,  &NULL, $sizeof{ &ASN1_STRING}, $itname  &ASN1_ITEM_end($itname));
    }' unless defined(&IMPLEMENT_ASN1_MSTRING);
    eval 'sub IMPLEMENT_COMPAT_ASN1 {
        my($sname) = @_;
	    eval q( &IMPLEMENT_COMPAT_ASN1_type($sname,  &V_ASN1_SEQUENCE));
    }' unless defined(&IMPLEMENT_COMPAT_ASN1);
    eval 'sub IMPLEMENT_COMPAT_ASN1_type {
        my($sname, $tag) = @_;
	    eval q( &static  &const  &ASN1_COMPAT_FUNCS $sname &_ff = { ( &ASN1_new_func *)$sname &_new, ( &ASN1_free_func *)$sname &_free, ( &ASN1_d2i_func *) &d2i_$sname, ( &ASN1_i2d_func *) &i2d_$sname, };  &ASN1_ITEM_start($sname)  &ASN1_ITYPE_COMPAT, $tag,  &NULL, 0, $sname &_ff, 0, $sname  &ASN1_ITEM_end($sname));
    }' unless defined(&IMPLEMENT_COMPAT_ASN1_type);
    eval 'sub IMPLEMENT_EXTERN_ASN1 {
        my($sname, $tag, $fptrs) = @_;
	    eval q( &ASN1_ITEM_start($sname)  &ASN1_ITYPE_EXTERN, $tag,  &NULL, 0, $fptrs, 0, $sname  &ASN1_ITEM_end($sname));
    }' unless defined(&IMPLEMENT_EXTERN_ASN1);
    eval 'sub IMPLEMENT_ASN1_FUNCTIONS {
        my($stname) = @_;
	    eval q( &IMPLEMENT_ASN1_FUNCTIONS_fname($stname, $stname, $stname));
    }' unless defined(&IMPLEMENT_ASN1_FUNCTIONS);
    eval 'sub IMPLEMENT_ASN1_FUNCTIONS_name {
        my($stname, $itname) = @_;
	    eval q( &IMPLEMENT_ASN1_FUNCTIONS_fname($stname, $itname, $itname));
    }' unless defined(&IMPLEMENT_ASN1_FUNCTIONS_name);
    eval 'sub IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name {
        my($stname, $itname) = @_;
	    eval q( &IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname($stname, $itname, $itname));
    }' unless defined(&IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name);
    eval 'sub IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname {
        my($stname, $itname, $fname) = @_;
	    eval q($stname *$fname &_new( &void) {  &return ($stname *) &ASN1_item_new( &ASN1_ITEM_rptr($itname)); }  &void $fname &_free($stname * &a) {  &ASN1_item_free(( &ASN1_VALUE *) &a,  &ASN1_ITEM_rptr($itname)); });
    }' unless defined(&IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname);
    eval 'sub IMPLEMENT_ASN1_FUNCTIONS_fname {
        my($stname, $itname, $fname) = @_;
	    eval q( &IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname($stname, $itname, $fname)  &IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname($stname, $itname, $fname));
    }' unless defined(&IMPLEMENT_ASN1_FUNCTIONS_fname);
    eval 'sub IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname {
        my($stname, $itname, $fname) = @_;
	    eval q($stname * &d2i_$fname($stname ** &a, \'unsigned char\' ** &in, \'long len\') {  &return ($stname *) &ASN1_item_d2i(( &ASN1_VALUE **) &a,  &in,  &len,  &ASN1_ITEM_rptr($itname)); } \'int\'  &i2d_$fname($stname * &a, \'unsigned char\' ** &out) {  &return  &ASN1_item_i2d(( &ASN1_VALUE *) &a,  &out,  &ASN1_ITEM_rptr($itname)); });
    }' unless defined(&IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname);
    eval 'sub IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname {
        my($stname, $itname, $fname) = @_;
	    eval q($stname * &d2i_$fname($stname ** &a,  &const \'unsigned char\' ** &in, \'long len\') {  &return ($stname *) &ASN1_item_d2i(( &ASN1_VALUE **) &a,  &in,  &len,  &ASN1_ITEM_rptr($itname)); } \'int\'  &i2d_$fname( &const $stname * &a, \'unsigned char\' ** &out) {  &return  &ASN1_item_i2d(( &ASN1_VALUE *) &a,  &out,  &ASN1_ITEM_rptr($itname)); });
    }' unless defined(&IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname);
    eval 'sub IMPLEMENT_ASN1_DUP_FUNCTION {
        my($stname) = @_;
	    eval q($stname * $stname &_dup($stname * &x) {  &return  &ASN1_item_dup( &ASN1_ITEM_rptr($stname),  &x); });
    }' unless defined(&IMPLEMENT_ASN1_DUP_FUNCTION);
    eval 'sub IMPLEMENT_ASN1_FUNCTIONS_const {
        my($name) = @_;
	    eval q( &IMPLEMENT_ASN1_FUNCTIONS_const_fname($name, $name, $name));
    }' unless defined(&IMPLEMENT_ASN1_FUNCTIONS_const);
    eval 'sub IMPLEMENT_ASN1_FUNCTIONS_const_fname {
        my($stname, $itname, $fname) = @_;
	    eval q( &IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname($stname, $itname, $fname)  &IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname($stname, $itname, $fname));
    }' unless defined(&IMPLEMENT_ASN1_FUNCTIONS_const_fname);
    if(defined(&__cplusplus)) {
    }
}
1;
