* c/ldap.c (scsh_ldap_unbind_s): got rid of superfluos type check
(scsh_ldap_abandon): ditto (scsh_ldap_add): ditto (scsh_ldap_compare_s): ditto (scsh_ldap_count_entries): ditto (scsh_ldap_count_messages): ditto (scsh_ldap_count_references): ditto (scsh_ldap_delete): ditto (scsh_ldap_first_entry): ditto (scsh_ldap_first_message): ditto (scsh_ldap_first_reference): ditto (scsh_ldap_get_dn): ditto (scsh_ldap_get_values): ditto (scsh_ldap_memfree): ditto (scsh_ldap_modify): ditto (scsh_ldap_msgfree): ditto (scsh_ldap_msgid): ditto (scsh_ldap_msgtype): ditto (scsh_ldap_next_entry): ditto (scsh_ldap_next_message): ditto (scsh_ldap_next_reference): ditto (scsh_ldap_search_s): ditto, and filter may be NULL (scsh_ldap_search_st): ditto
This commit is contained in:
parent
a56a9ae9e9
commit
2c6c2e5a18
39
c/ldap.c
39
c/ldap.c
|
@ -80,7 +80,6 @@ s48_value scsh_ldap_sasl_bind_s(s48_value ldap, s48_value dn,
|
|||
|
||||
s48_value scsh_ldap_unbind_s(s48_value ldap)
|
||||
{
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
return s48_enter_integer(ldap_unbind_s(scsh_extract_ldap(ldap)));
|
||||
}
|
||||
|
||||
|
@ -104,14 +103,12 @@ s48_value scsh_ldap_result_error(s48_value ldap, s48_value res)
|
|||
|
||||
s48_value scsh_ldap_memfree(s48_value ldap)
|
||||
{
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
ldap_memfree(scsh_extract_ldap(ldap));
|
||||
return S48_UNSPECIFIC;
|
||||
}
|
||||
|
||||
s48_value scsh_ldap_msgfree(s48_value ldapmsg)
|
||||
{
|
||||
FFIT_CHECK_RECORD_TYPE(ldapmsg, scsh_ldapmessage_record_type);
|
||||
ldap_msgfree(scsh_extract_ldapmessage(ldapmsg));
|
||||
return S48_UNSPECIFIC;
|
||||
}
|
||||
|
@ -138,13 +135,12 @@ s48_value scsh_ldap_search_s(s48_value ldap, s48_value base,
|
|||
S48_DECLARE_GC_PROTECT(7);
|
||||
|
||||
S48_GC_PROTECT_7(ldap, base, scope, filter, attrs, attrsonly, res);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
|
||||
a = ffit_extract_list_of_strings(attrs);
|
||||
r = ldap_search_s(scsh_extract_ldap(ldap),
|
||||
S48_FALSE_P(base) ? NULL : s48_extract_string(base),
|
||||
s48_extract_integer(scope),
|
||||
s48_extract_string(filter),
|
||||
S48_FALSE_P(filter) ? NULL : s48_extract_string(filter),
|
||||
a,
|
||||
S48_TRUE_P(attrsonly),
|
||||
msg);
|
||||
|
@ -169,7 +165,6 @@ s48_value scsh_ldap_search_st(s48_value ldap, s48_value base,
|
|||
|
||||
S48_GC_PROTECT_9(ldap, base, scope, filter, attrs, attrsonly, res,
|
||||
timeout_sec, timeout_usec);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
|
||||
timeout.tv_sec = s48_extract_integer(timeout_sec);
|
||||
timeout.tv_usec = s48_extract_integer(timeout_usec);
|
||||
|
@ -193,7 +188,7 @@ s48_value scsh_ldap_compare_s(s48_value ldap, s48_value dn,
|
|||
S48_DECLARE_GC_PROTECT(5);
|
||||
|
||||
S48_GC_PROTECT_5(ldap, dn, attr, value, res);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
|
||||
r = ldap_compare_s(scsh_extract_ldap(ldap), s48_extract_string(dn),
|
||||
s48_extract_string(attr), s48_extract_string(value));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -210,9 +205,6 @@ s48_value scsh_ldap_count_entries(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
|
||||
r = ldap_count_entries(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -225,8 +217,6 @@ s48_value scsh_ldap_first_entry(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
|
||||
lm_new = ldap_first_entry(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
|
@ -240,8 +230,6 @@ s48_value scsh_ldap_next_entry(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
|
||||
lm_new = ldap_next_entry(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
|
@ -255,8 +243,6 @@ s48_value scsh_ldap_first_message(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
first = ldap_first_message(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -269,8 +255,6 @@ s48_value scsh_ldap_next_message(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
next = ldap_next_message(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -283,8 +267,6 @@ s48_value scsh_ldap_count_messages(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
c = ldap_count_messages(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -297,8 +279,6 @@ s48_value scsh_ldap_first_reference(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
new_lm = ldap_first_reference(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -311,8 +291,6 @@ s48_value scsh_ldap_next_reference(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
new_lm = ldap_next_reference(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -325,8 +303,6 @@ s48_value scsh_ldap_count_references(s48_value ldap, s48_value lm)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, lm);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
c = ldap_count_references(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(lm));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -375,7 +351,6 @@ s48_value scsh_ldap_msgtype(s48_value lm)
|
|||
{
|
||||
int r;
|
||||
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
r = ldap_msgtype(scsh_extract_ldapmessage(lm));
|
||||
return (r == -1) ? S48_FALSE : s48_enter_integer(r);
|
||||
}
|
||||
|
@ -384,7 +359,6 @@ s48_value scsh_ldap_msgid(s48_value lm)
|
|||
{
|
||||
int r;
|
||||
|
||||
FFIT_CHECK_RECORD_TYPE(lm, scsh_ldapmessage_record_type);
|
||||
r = ldap_msgid(scsh_extract_ldapmessage(lm));
|
||||
return (r == -1) ? S48_FALSE : s48_enter_integer(r);
|
||||
}
|
||||
|
@ -397,8 +371,6 @@ s48_value scsh_ldap_get_dn(s48_value ldap, s48_value entry)
|
|||
S48_DECLARE_GC_PROTECT(3);
|
||||
|
||||
S48_GC_PROTECT_3(ldap, entry, res);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(entry, scsh_ldapmessage_record_type);
|
||||
s = ldap_get_dn(scsh_extract_ldap(ldap), scsh_extract_ldapmessage(entry));
|
||||
res = (s == NULL) ? S48_FALSE : s48_enter_string(s);
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -458,9 +430,6 @@ s48_value scsh_ldap_get_values(s48_value ldap, s48_value entry,
|
|||
S48_DECLARE_GC_PROTECT(4);
|
||||
|
||||
S48_GC_PROTECT_4(ldap, entry, attr, res);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
FFIT_CHECK_RECORD_TYPE(entry, scsh_ldapmessage_record_type);
|
||||
|
||||
val = ldap_get_values(scsh_extract_ldap(ldap),
|
||||
scsh_extract_ldapmessage(entry),
|
||||
s48_extract_string(attr));
|
||||
|
@ -477,7 +446,6 @@ s48_value scsh_ldap_modify(s48_value ldap, s48_value dn, s48_value mods)
|
|||
S48_DECLARE_GC_PROTECT(3);
|
||||
|
||||
S48_GC_PROTECT_3(ldap, dn, mods);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
r = ldap_modify_s(scsh_extract_ldap(ldap), s48_extract_string(dn),
|
||||
scsh_extract_ldapmod_vector(mods));
|
||||
S48_GC_UNPROTECT();
|
||||
|
@ -490,7 +458,6 @@ s48_value scsh_ldap_add(s48_value ldap, s48_value dn, s48_value mods)
|
|||
S48_DECLARE_GC_PROTECT(3);
|
||||
|
||||
S48_GC_PROTECT_3(ldap, dn, mods);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
if (!S48_VECTOR_P(mods))
|
||||
s48_raise_argument_type_error(mods);
|
||||
|
||||
|
@ -506,7 +473,6 @@ s48_value scsh_ldap_delete(s48_value ldap, s48_value dn)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, dn);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
r = ldap_delete_s(scsh_extract_ldap(ldap), s48_extract_string(dn));
|
||||
S48_GC_UNPROTECT();
|
||||
return s48_enter_integer(r);
|
||||
|
@ -518,7 +484,6 @@ s48_value scsh_ldap_abandon(s48_value ldap, s48_value msgid)
|
|||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2(ldap, msgid);
|
||||
FFIT_CHECK_RECORD_TYPE(ldap, scsh_ldap_record_type);
|
||||
r = ldap_abandon(scsh_extract_ldap(ldap), s48_extract_integer(msgid));
|
||||
S48_GC_UNPROTECT();
|
||||
return s48_enter_integer(r);
|
||||
|
|
Loading…
Reference in New Issue