require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&SECURITY_OPENPAM_H_INCLUDED)) {
    eval 'sub SECURITY_OPENPAM_H_INCLUDED () {1;}' unless defined(&SECURITY_OPENPAM_H_INCLUDED);
    require 'stdarg.ph';
    require 'security/openpam_attr.ph';
    if(defined(&__cplusplus)) {
    }
    if(defined(&_IOFBF)) {
    }
    eval("sub OPENPAM_RESTRICT_SERVICE_NAME () { 0; }") unless defined(&OPENPAM_RESTRICT_SERVICE_NAME);
    eval("sub OPENPAM_VERIFY_POLICY_FILE () { 1; }") unless defined(&OPENPAM_VERIFY_POLICY_FILE);
    eval("sub OPENPAM_RESTRICT_MODULE_NAME () { 2; }") unless defined(&OPENPAM_RESTRICT_MODULE_NAME);
    eval("sub OPENPAM_VERIFY_MODULE_FILE () { 3; }") unless defined(&OPENPAM_VERIFY_MODULE_FILE);
    eval("sub OPENPAM_FALLBACK_TO_OTHER () { 4; }") unless defined(&OPENPAM_FALLBACK_TO_OTHER);
    eval("sub OPENPAM_NUM_FEATURES () { 5; }") unless defined(&OPENPAM_NUM_FEATURES);
    eval("sub PAM_LOG_LIBDEBUG () { -1; }") unless defined(&PAM_LOG_LIBDEBUG);
    eval("sub PAM_LOG_DEBUG () { 0; }") unless defined(&PAM_LOG_DEBUG);
    eval("sub PAM_LOG_VERBOSE () { 1; }") unless defined(&PAM_LOG_VERBOSE);
    eval("sub PAM_LOG_NOTICE () { 2; }") unless defined(&PAM_LOG_NOTICE);
    eval("sub PAM_LOG_ERROR () { 3; }") unless defined(&PAM_LOG_ERROR);
    if(defined(&__STDC_VERSION__)  && ((defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) >= 199901)) {
	eval 'sub openpam_log () {( &lvl, ...)  &_openpam_log(( &lvl),  &__func__,  &__VA_ARGS__);}' unless defined(&openpam_log);
    }
 elsif(defined(&__GNUC__)  && ((defined(&__GNUC__) ? &__GNUC__ : undef) >= 3)) {
	eval 'sub openpam_log () {( &lvl, ...)  &_openpam_log(( &lvl),  &__func__,  &__VA_ARGS__);}' unless defined(&openpam_log);
    }
 elsif(defined(&__GNUC__)  && ((defined(&__GNUC__) ? &__GNUC__ : undef) >= 2)  && ((defined(&__GNUC_MINOR__) ? &__GNUC_MINOR__ : undef) >= 95)) {
	eval 'sub openpam_log () {( &lvl,  &fmt...)  &_openpam_log(( &lvl),  &__func__,  &fmt);}' unless defined(&openpam_log);
    }
 elsif(defined(&__GNUC__)  && defined(&__func__)) {
	eval 'sub openpam_log () {( &lvl,  &fmt...)  &_openpam_log(( &lvl),  &__func__,  &fmt);}' unless defined(&openpam_log);
    } else {
    }
    eval("sub PAM_SM_AUTHENTICATE () { 0; }") unless defined(&PAM_SM_AUTHENTICATE);
    eval("sub PAM_SM_SETCRED () { 1; }") unless defined(&PAM_SM_SETCRED);
    eval("sub PAM_SM_ACCT_MGMT () { 2; }") unless defined(&PAM_SM_ACCT_MGMT);
    eval("sub PAM_SM_OPEN_SESSION () { 3; }") unless defined(&PAM_SM_OPEN_SESSION);
    eval("sub PAM_SM_CLOSE_SESSION () { 4; }") unless defined(&PAM_SM_CLOSE_SESSION);
    eval("sub PAM_SM_CHAUTHTOK () { 5; }") unless defined(&PAM_SM_CHAUTHTOK);
    eval("sub PAM_NUM_PRIMITIVES () { 6; }") unless defined(&PAM_NUM_PRIMITIVES);
    eval 'sub PAM_SM_DUMMY {
        my($type) = @_;
	    eval q( &PAM_EXTERN \'int\'  &pam_sm_$type( &pam_handle_t * &pamh, \'int\'  &flags, \'int\'  &argc,  &const \'char\' * $argv[]) { ( &void) &pamh; ( &void) &flags; ( &void) &argc; ( &void) &argv;  &return ( &PAM_IGNORE); });
    }' unless defined(&PAM_SM_DUMMY);
    if(defined(&PAM_SM_AUTH) || defined(&PAM_SM_ACCOUNT) || defined(&PAM_SM_SESSION) || defined(&PAM_SM_PASSWORD)) {
	eval 'sub LINUX_PAM_MODULE () {1;}' unless defined(&LINUX_PAM_MODULE);
    }
    if(defined(&LINUX_PAM_MODULE)  && !defined(&PAM_SM_AUTH)) {
	eval 'sub _PAM_SM_AUTHENTICATE () {0;}' unless defined(&_PAM_SM_AUTHENTICATE);
	eval 'sub _PAM_SM_SETCRED () {0;}' unless defined(&_PAM_SM_SETCRED);
    } else {
	undef(&PAM_SM_AUTH) if defined(&PAM_SM_AUTH);
	eval 'sub PAM_SM_AUTH () {1;}' unless defined(&PAM_SM_AUTH);
	eval 'sub _PAM_SM_AUTHENTICATE () { &pam_sm_authenticate;}' unless defined(&_PAM_SM_AUTHENTICATE);
	eval 'sub _PAM_SM_SETCRED () { &pam_sm_setcred;}' unless defined(&_PAM_SM_SETCRED);
    }
    if(defined(&LINUX_PAM_MODULE)  && !defined(&PAM_SM_ACCOUNT)) {
	eval 'sub _PAM_SM_ACCT_MGMT () {0;}' unless defined(&_PAM_SM_ACCT_MGMT);
    } else {
	undef(&PAM_SM_ACCOUNT) if defined(&PAM_SM_ACCOUNT);
	eval 'sub PAM_SM_ACCOUNT () {1;}' unless defined(&PAM_SM_ACCOUNT);
	eval 'sub _PAM_SM_ACCT_MGMT () { &pam_sm_acct_mgmt;}' unless defined(&_PAM_SM_ACCT_MGMT);
    }
    if(defined(&LINUX_PAM_MODULE)  && !defined(&PAM_SM_SESSION)) {
	eval 'sub _PAM_SM_OPEN_SESSION () {0;}' unless defined(&_PAM_SM_OPEN_SESSION);
	eval 'sub _PAM_SM_CLOSE_SESSION () {0;}' unless defined(&_PAM_SM_CLOSE_SESSION);
    } else {
	undef(&PAM_SM_SESSION) if defined(&PAM_SM_SESSION);
	eval 'sub PAM_SM_SESSION () {1;}' unless defined(&PAM_SM_SESSION);
	eval 'sub _PAM_SM_OPEN_SESSION () { &pam_sm_open_session;}' unless defined(&_PAM_SM_OPEN_SESSION);
	eval 'sub _PAM_SM_CLOSE_SESSION () { &pam_sm_close_session;}' unless defined(&_PAM_SM_CLOSE_SESSION);
    }
    if(defined(&LINUX_PAM_MODULE)  && !defined(&PAM_SM_PASSWORD)) {
	eval 'sub _PAM_SM_CHAUTHTOK () {0;}' unless defined(&_PAM_SM_CHAUTHTOK);
    } else {
	undef(&PAM_SM_PASSWORD) if defined(&PAM_SM_PASSWORD);
	eval 'sub PAM_SM_PASSWORD () {1;}' unless defined(&PAM_SM_PASSWORD);
	eval 'sub _PAM_SM_CHAUTHTOK () { &pam_sm_chauthtok;}' unless defined(&_PAM_SM_CHAUTHTOK);
    }
    if(!defined(&PAM_SOEXT)) {
	eval 'sub PAM_SOEXT () {".so";}' unless defined(&PAM_SOEXT);
    }
    if((defined(&__GNUC__) || defined(&__PCC__))  && defined(&OPENPAM_STATIC_MODULES)) {
	require 'sys/cdefs.ph';
	if(defined(&__FreeBSD__)) {
	    require 'linker_set.ph';
	}
	if(defined(&__NetBSD__)) {
	    eval 'sub DATA_SET {
	        my($a, $b) = @_;
    		eval q( &__link_set_add_data($a, $b));
	    }' unless defined(&DATA_SET);
	    eval 'sub SET_DECLARE {
	        my($a, $b) = @_;
    		eval q( &__link_set_decl($a, $b));
	    }' unless defined(&SET_DECLARE);
	    eval 'sub SET_FOREACH {
	        my($a, $b) = @_;
    		eval q( &__link_set_foreach($a, $b));
	    }' unless defined(&SET_FOREACH);
	}
	eval 'sub PAM_EXTERN () { &static;}' unless defined(&PAM_EXTERN);
	eval 'sub PAM_MODULE_ENTRY {
	    my($name) = @_;
    	    eval q( &static \'char\'  $_pam_name[] = $name  &PAM_SOEXT;  &static \'struct pam_module\'  &_pam_module = { . &path =  &_pam_name, . &func = { [ &PAM_SM_AUTHENTICATE] =  &_PAM_SM_AUTHENTICATE, [ &PAM_SM_SETCRED] =  &_PAM_SM_SETCRED, [ &PAM_SM_ACCT_MGMT] =  &_PAM_SM_ACCT_MGMT, [ &PAM_SM_OPEN_SESSION] =  &_PAM_SM_OPEN_SESSION, [ &PAM_SM_CLOSE_SESSION] =  &_PAM_SM_CLOSE_SESSION, [ &PAM_SM_CHAUTHTOK] =  &_PAM_SM_CHAUTHTOK }, };  &DATA_SET( &openpam_static_modules,  &_pam_module));
	}' unless defined(&PAM_MODULE_ENTRY);
    } else {
	eval 'sub PAM_EXTERN () {1;}' unless defined(&PAM_EXTERN);
	eval 'sub PAM_MODULE_ENTRY {
	    my($name) = @_;
    	    eval q();
	}' unless defined(&PAM_MODULE_ENTRY);
    }
    if(defined(&__cplusplus)) {
    }
}
1;
