/*
 *
 * This file is generated by gen_constants.pl
 * Do not edit by hand!
 *
 */

#include "common.h"
#include "enums.h"
#include "util.h"

SV *enum2sv_ldap_auth[4];
SV *enum2sv_ldap_deref_aliases[4];
SV *enum2sv_ldap_error[72];
SV *enum2sv_ldap_filter[10];
SV *enum2sv_ldap_modop[3];
SV *enum2sv_ldap_op[26];
SV *enum2sv_ldap_scope[3];

void init_constants(void) {
    enum2sv_ldap_auth[0] = make_constant("LDAP_AUTH_SIMPLE", 16, LDAP_AUTH_SIMPLE);
    enum2sv_ldap_auth[1] = make_constant("LDAP_AUTH_1", 11, 1);
    enum2sv_ldap_auth[2] = make_constant("LDAP_AUTH_2", 11, 2);
    enum2sv_ldap_auth[3] = make_constant("LDAP_AUTH_SASL", 14, LDAP_AUTH_SASL);

    enum2sv_ldap_deref_aliases[0] = make_constant("LDAP_DEREF_ALIASES_NEVER", 24, LDAP_DEREF_ALIASES_NEVER);
    enum2sv_ldap_deref_aliases[1] = make_constant("LDAP_DEREF_ALIASES_IN_SEARCHING", 31, LDAP_DEREF_ALIASES_IN_SEARCHING);
    enum2sv_ldap_deref_aliases[2] = make_constant("LDAP_DEREF_ALIASES_FINDING_BASE_OBJ", 35, LDAP_DEREF_ALIASES_FINDING_BASE_OBJ);
    enum2sv_ldap_deref_aliases[3] = make_constant("LDAP_DEREF_ALIASES_ALWAYS", 25, LDAP_DEREF_ALIASES_ALWAYS);

    enum2sv_ldap_error[0] = make_constant("LDAP_SUCCESS", 12, LDAP_SUCCESS);
    enum2sv_ldap_error[1] = make_constant("LDAP_OPERATIONS_ERROR", 21, LDAP_OPERATIONS_ERROR);
    enum2sv_ldap_error[2] = make_constant("LDAP_PROTOCOL_ERROR", 19, LDAP_PROTOCOL_ERROR);
    enum2sv_ldap_error[3] = make_constant("LDAP_TIME_LIMIT_EXCEEDED", 24, LDAP_TIME_LIMIT_EXCEEDED);
    enum2sv_ldap_error[4] = make_constant("LDAP_SIZE_LIMIT_EXCEEDED", 24, LDAP_SIZE_LIMIT_EXCEEDED);
    enum2sv_ldap_error[5] = make_constant("LDAP_COMPARE_FALSE", 18, LDAP_COMPARE_FALSE);
    enum2sv_ldap_error[6] = make_constant("LDAP_COMPARE_TRUE", 17, LDAP_COMPARE_TRUE);
    enum2sv_ldap_error[7] = make_constant("LDAP_AUTHENTICATION_METHOD_NOT_SUPPORTED", 40, LDAP_AUTHENTICATION_METHOD_NOT_SUPPORTED);
    enum2sv_ldap_error[8] = make_constant("LDAP_STRONG_AUTHENTICATION_REQUIRED", 35, LDAP_STRONG_AUTHENTICATION_REQUIRED);
    enum2sv_ldap_error[9] = make_constant("LDAP_ERROR_9", 12, 9);
    enum2sv_ldap_error[10] = make_constant("LDAP_REFERRAL", 13, LDAP_REFERRAL);
    enum2sv_ldap_error[11] = make_constant("LDAP_ADMIN_LIMIT_EXCEEDED", 25, LDAP_ADMIN_LIMIT_EXCEEDED);
    enum2sv_ldap_error[12] = make_constant("LDAP_UNAVAILABLE_CRITICAL_EXTENSION", 35, LDAP_UNAVAILABLE_CRITICAL_EXTENSION);
    enum2sv_ldap_error[13] = make_constant("LDAP_CONFIDENTIALITY_REQUIRED", 29, LDAP_CONFIDENTIALITY_REQUIRED);
    enum2sv_ldap_error[14] = make_constant("LDAP_SASL_BIND_IN_PROGRESS", 26, LDAP_SASL_BIND_IN_PROGRESS);
    enum2sv_ldap_error[15] = make_constant("LDAP_ERROR_15", 13, 15);
    enum2sv_ldap_error[16] = make_constant("LDAP_NO_SUCH_ATTRIBUTE", 22, LDAP_NO_SUCH_ATTRIBUTE);
    enum2sv_ldap_error[17] = make_constant("LDAP_UNDEFINED_ATTRIBUTE_TYPE", 29, LDAP_UNDEFINED_ATTRIBUTE_TYPE);
    enum2sv_ldap_error[18] = make_constant("LDAP_INAPPROPRIATE_MATCHING", 27, LDAP_INAPPROPRIATE_MATCHING);
    enum2sv_ldap_error[19] = make_constant("LDAP_CONSTRAINT_VIOLATION", 25, LDAP_CONSTRAINT_VIOLATION);
    enum2sv_ldap_error[20] = make_constant("LDAP_ATTRIBUTE_OR_VALUE_EXISTS", 30, LDAP_ATTRIBUTE_OR_VALUE_EXISTS);
    enum2sv_ldap_error[21] = make_constant("LDAP_INVALID_ATTRIBUTE_SYNTAX", 29, LDAP_INVALID_ATTRIBUTE_SYNTAX);
    enum2sv_ldap_error[22] = make_constant("LDAP_ERROR_22", 13, 22);
    enum2sv_ldap_error[23] = make_constant("LDAP_ERROR_23", 13, 23);
    enum2sv_ldap_error[24] = make_constant("LDAP_ERROR_24", 13, 24);
    enum2sv_ldap_error[25] = make_constant("LDAP_ERROR_25", 13, 25);
    enum2sv_ldap_error[26] = make_constant("LDAP_ERROR_26", 13, 26);
    enum2sv_ldap_error[27] = make_constant("LDAP_ERROR_27", 13, 27);
    enum2sv_ldap_error[28] = make_constant("LDAP_ERROR_28", 13, 28);
    enum2sv_ldap_error[29] = make_constant("LDAP_ERROR_29", 13, 29);
    enum2sv_ldap_error[30] = make_constant("LDAP_ERROR_30", 13, 30);
    enum2sv_ldap_error[31] = make_constant("LDAP_ERROR_31", 13, 31);
    enum2sv_ldap_error[32] = make_constant("LDAP_NO_SUCH_OBJECT", 19, LDAP_NO_SUCH_OBJECT);
    enum2sv_ldap_error[33] = make_constant("LDAP_ALIAS_PROBLEM", 18, LDAP_ALIAS_PROBLEM);
    enum2sv_ldap_error[34] = make_constant("LDAP_INVALID_DN_SYNTAX", 22, LDAP_INVALID_DN_SYNTAX);
    enum2sv_ldap_error[35] = make_constant("LDAP_ERROR_35", 13, 35);
    enum2sv_ldap_error[36] = make_constant("LDAP_ALIAS_DEREFERENCING_PROBLEM", 32, LDAP_ALIAS_DEREFERENCING_PROBLEM);
    enum2sv_ldap_error[37] = make_constant("LDAP_ERROR_37", 13, 37);
    enum2sv_ldap_error[38] = make_constant("LDAP_ERROR_38", 13, 38);
    enum2sv_ldap_error[39] = make_constant("LDAP_ERROR_39", 13, 39);
    enum2sv_ldap_error[40] = make_constant("LDAP_ERROR_40", 13, 40);
    enum2sv_ldap_error[41] = make_constant("LDAP_ERROR_41", 13, 41);
    enum2sv_ldap_error[42] = make_constant("LDAP_ERROR_42", 13, 42);
    enum2sv_ldap_error[43] = make_constant("LDAP_ERROR_43", 13, 43);
    enum2sv_ldap_error[44] = make_constant("LDAP_ERROR_44", 13, 44);
    enum2sv_ldap_error[45] = make_constant("LDAP_ERROR_45", 13, 45);
    enum2sv_ldap_error[46] = make_constant("LDAP_ERROR_46", 13, 46);
    enum2sv_ldap_error[47] = make_constant("LDAP_ERROR_47", 13, 47);
    enum2sv_ldap_error[48] = make_constant("LDAP_INAPPROPRIATE_AUTHENTICATION", 33, LDAP_INAPPROPRIATE_AUTHENTICATION);
    enum2sv_ldap_error[49] = make_constant("LDAP_INVALID_CREDENTIALS", 24, LDAP_INVALID_CREDENTIALS);
    enum2sv_ldap_error[50] = make_constant("LDAP_INSUFFICIENT_ACCESS_RIGHTS", 31, LDAP_INSUFFICIENT_ACCESS_RIGHTS);
    enum2sv_ldap_error[51] = make_constant("LDAP_BUSY", 9, LDAP_BUSY);
    enum2sv_ldap_error[52] = make_constant("LDAP_UNAVAILABLE", 16, LDAP_UNAVAILABLE);
    enum2sv_ldap_error[53] = make_constant("LDAP_UNWILLING_TO_PERFORM", 25, LDAP_UNWILLING_TO_PERFORM);
    enum2sv_ldap_error[54] = make_constant("LDAP_LOOP_DETECT", 16, LDAP_LOOP_DETECT);
    enum2sv_ldap_error[55] = make_constant("LDAP_ERROR_55", 13, 55);
    enum2sv_ldap_error[56] = make_constant("LDAP_ERROR_56", 13, 56);
    enum2sv_ldap_error[57] = make_constant("LDAP_ERROR_57", 13, 57);
    enum2sv_ldap_error[58] = make_constant("LDAP_ERROR_58", 13, 58);
    enum2sv_ldap_error[59] = make_constant("LDAP_ERROR_59", 13, 59);
    enum2sv_ldap_error[60] = make_constant("LDAP_ERROR_60", 13, 60);
    enum2sv_ldap_error[61] = make_constant("LDAP_ERROR_61", 13, 61);
    enum2sv_ldap_error[62] = make_constant("LDAP_ERROR_62", 13, 62);
    enum2sv_ldap_error[63] = make_constant("LDAP_ERROR_63", 13, 63);
    enum2sv_ldap_error[64] = make_constant("LDAP_NAMING_VIOLATION", 21, LDAP_NAMING_VIOLATION);
    enum2sv_ldap_error[65] = make_constant("LDAP_OBJECT_CLASS_VIOLATION", 27, LDAP_OBJECT_CLASS_VIOLATION);
    enum2sv_ldap_error[66] = make_constant("LDAP_NOT_ALLOWED_ON_NON_LEAF", 28, LDAP_NOT_ALLOWED_ON_NON_LEAF);
    enum2sv_ldap_error[67] = make_constant("LDAP_NOT_ALLOWED_ON_RDN", 23, LDAP_NOT_ALLOWED_ON_RDN);
    enum2sv_ldap_error[68] = make_constant("LDAP_ENTRY_ALREADY_EXISTS", 25, LDAP_ENTRY_ALREADY_EXISTS);
    enum2sv_ldap_error[69] = make_constant("LDAP_OBJECT_CLASS_MODS_PROHIBITED", 33, LDAP_OBJECT_CLASS_MODS_PROHIBITED);
    enum2sv_ldap_error[70] = make_constant("LDAP_ERROR_70", 13, 70);
    enum2sv_ldap_error[71] = make_constant("LDAP_AFFECTS_MULTIPLE_DSAS", 26, LDAP_AFFECTS_MULTIPLE_DSAS);

    enum2sv_ldap_filter[0] = make_constant("LDAP_FILTER_AND", 15, LDAP_FILTER_AND);
    enum2sv_ldap_filter[1] = make_constant("LDAP_FILTER_OR", 14, LDAP_FILTER_OR);
    enum2sv_ldap_filter[2] = make_constant("LDAP_FILTER_NOT", 15, LDAP_FILTER_NOT);
    enum2sv_ldap_filter[3] = make_constant("LDAP_FILTER_EQ", 14, LDAP_FILTER_EQ);
    enum2sv_ldap_filter[4] = make_constant("LDAP_FILTER_SUBSTRINGS", 22, LDAP_FILTER_SUBSTRINGS);
    enum2sv_ldap_filter[5] = make_constant("LDAP_FILTER_GE", 14, LDAP_FILTER_GE);
    enum2sv_ldap_filter[6] = make_constant("LDAP_FILTER_LE", 14, LDAP_FILTER_LE);
    enum2sv_ldap_filter[7] = make_constant("LDAP_FILTER_PRESENT", 19, LDAP_FILTER_PRESENT);
    enum2sv_ldap_filter[8] = make_constant("LDAP_FILTER_APPROX", 18, LDAP_FILTER_APPROX);
    enum2sv_ldap_filter[9] = make_constant("LDAP_FILTER_EXT", 15, LDAP_FILTER_EXT);

    enum2sv_ldap_modop[0] = make_constant("LDAP_MODOP_ADD", 14, LDAP_MODOP_ADD);
    enum2sv_ldap_modop[1] = make_constant("LDAP_MODOP_DELETE", 17, LDAP_MODOP_DELETE);
    enum2sv_ldap_modop[2] = make_constant("LDAP_MODOP_REPLACE", 18, LDAP_MODOP_REPLACE);

    enum2sv_ldap_op[0] = make_constant("LDAP_OP_BIND_REQUEST", 20, LDAP_OP_BIND_REQUEST);
    enum2sv_ldap_op[1] = make_constant("LDAP_OP_BIND_RESPONSE", 21, LDAP_OP_BIND_RESPONSE);
    enum2sv_ldap_op[2] = make_constant("LDAP_OP_UNBIND_REQUEST", 22, LDAP_OP_UNBIND_REQUEST);
    enum2sv_ldap_op[3] = make_constant("LDAP_OP_SEARCH_REQUEST", 22, LDAP_OP_SEARCH_REQUEST);
    enum2sv_ldap_op[4] = make_constant("LDAP_OP_SEARCH_ENTRY_RESPONSE", 29, LDAP_OP_SEARCH_ENTRY_RESPONSE);
    enum2sv_ldap_op[5] = make_constant("LDAP_OP_SEARCH_DONE_RESPONSE", 28, LDAP_OP_SEARCH_DONE_RESPONSE);
    enum2sv_ldap_op[6] = make_constant("LDAP_OP_MODIFY_REQUEST", 22, LDAP_OP_MODIFY_REQUEST);
    enum2sv_ldap_op[7] = make_constant("LDAP_OP_MODIFY_RESPONSE", 23, LDAP_OP_MODIFY_RESPONSE);
    enum2sv_ldap_op[8] = make_constant("LDAP_OP_ADD_REQUEST", 19, LDAP_OP_ADD_REQUEST);
    enum2sv_ldap_op[9] = make_constant("LDAP_OP_ADD_RESPONSE", 20, LDAP_OP_ADD_RESPONSE);
    enum2sv_ldap_op[10] = make_constant("LDAP_OP_DELETE_REQUEST", 22, LDAP_OP_DELETE_REQUEST);
    enum2sv_ldap_op[11] = make_constant("LDAP_OP_DELETE_RESPONSE", 23, LDAP_OP_DELETE_RESPONSE);
    enum2sv_ldap_op[12] = make_constant("LDAP_OP_MODIFY_DN_REQUEST", 25, LDAP_OP_MODIFY_DN_REQUEST);
    enum2sv_ldap_op[13] = make_constant("LDAP_OP_MODIFY_DN_RESPONSE", 26, LDAP_OP_MODIFY_DN_RESPONSE);
    enum2sv_ldap_op[14] = make_constant("LDAP_OP_COMPARE_REQUEST", 23, LDAP_OP_COMPARE_REQUEST);
    enum2sv_ldap_op[15] = make_constant("LDAP_OP_COMPARE_RESPONSE", 24, LDAP_OP_COMPARE_RESPONSE);
    enum2sv_ldap_op[16] = make_constant("LDAP_OP_ABANDON_REQUEST", 23, LDAP_OP_ABANDON_REQUEST);
    enum2sv_ldap_op[17] = make_constant("LDAP_OP_17", 10, 17);
    enum2sv_ldap_op[18] = make_constant("LDAP_OP_18", 10, 18);
    enum2sv_ldap_op[19] = make_constant("LDAP_OP_SEARCH_REFERENCE_RESPONSE", 33, LDAP_OP_SEARCH_REFERENCE_RESPONSE);
    enum2sv_ldap_op[20] = make_constant("LDAP_OP_20", 10, 20);
    enum2sv_ldap_op[21] = make_constant("LDAP_OP_21", 10, 21);
    enum2sv_ldap_op[22] = make_constant("LDAP_OP_22", 10, 22);
    enum2sv_ldap_op[23] = make_constant("LDAP_OP_EXTENDED_REQUEST", 24, LDAP_OP_EXTENDED_REQUEST);
    enum2sv_ldap_op[24] = make_constant("LDAP_OP_EXTENDED_RESPONSE", 25, LDAP_OP_EXTENDED_RESPONSE);
    enum2sv_ldap_op[25] = make_constant("LDAP_OP_INTERMEDIATE_RESPONSE", 29, LDAP_OP_INTERMEDIATE_RESPONSE);

    enum2sv_ldap_scope[0] = make_constant("LDAP_SCOPE_BASE_OBJECT", 22, LDAP_SCOPE_BASE_OBJECT);
    enum2sv_ldap_scope[1] = make_constant("LDAP_SCOPE_SINGLE_LEVEL", 23, LDAP_SCOPE_SINGLE_LEVEL);
    enum2sv_ldap_scope[2] = make_constant("LDAP_SCOPE_WHOLE_SUBTREE", 24, LDAP_SCOPE_WHOLE_SUBTREE);

}
SV *ldap_auth2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 4) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_auth[ix];
    return sv;
}

SV *ldap_deref_aliases2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 4) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_deref_aliases[ix];
    return sv;
}

SV *ldap_error2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 72) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_error[ix];
    return sv;
}

SV *ldap_filter2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 10) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_filter[ix];
    return sv;
}

SV *ldap_modop2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 3) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_modop[ix];
    return sv;
}

SV *ldap_op2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 26) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_op[ix];
    return sv;
}

SV *ldap_scope2sv_noinc(I32 ix) {
    SV *sv;
    if (ix >= 3) {
        return newSViv(ix);
    }
    sv = enum2sv_ldap_scope[ix];
    return sv;
}

