API updates, some typo fixes

This commit is contained in:
Howard Chu 2002-02-02 10:10:35 +00:00
parent 6b29def1c8
commit 73c87065fb
10 changed files with 40 additions and 42 deletions

View File

@ -52,7 +52,7 @@ perl_back_add(
SPAGAIN;
if (count != 1) {
croak("Big trouble in back_search\n");
croak("Big trouble in back_add\n");
}
return_code = POPi;
@ -72,6 +72,6 @@ perl_back_add(
NULL, NULL, NULL, NULL );
}
Debug( LDAP_DEBUG_ANY, "Here ADD\n", 0, 0, 0 );
Debug( LDAP_DEBUG_ANY, "Perl ADD\n", 0, 0, 0 );
return( 0 );
}

View File

@ -76,5 +76,3 @@ perl_back_bind(
return ( return_code );
}

View File

@ -31,9 +31,9 @@ perl_back_compare(
Backend *be,
Connection *conn,
Operation *op,
const char *dn,
const char *ndn,
Ava *ava
struct berval *dn,
struct berval *ndn,
AttributeAssertion *ava
)
{
int return_code;
@ -56,12 +56,12 @@ perl_back_compare(
/* XPUSHs(sv_2mortal(newSVpv( cred->bv_val , cred->bv_len))); */
PUTBACK;
count = perl_call_method("bind", G_SCALAR);
count = perl_call_method("compare", G_SCALAR);
SPAGAIN;
if (count != 1) {
croak("Big trouble in back_search\n");
croak("Big trouble in back_compare\n");
}
return_code = POPi;
@ -79,7 +79,7 @@ perl_back_compare(
}
#endif
Debug( LDAP_DEBUG_ANY, "Here BIND\n", 0, 0, 0 );
Debug( LDAP_DEBUG_ANY, "Perl COMPARE\n", 0, 0, 0 );
return (0);
}

View File

@ -125,7 +125,7 @@ perl_back_db_config(
/* if the module rejected it then we should reject it */
if ( return_code != 0 ) {
fprintf( stderr,
"Unknown perl backeng config: %s\n", argv[0]);
"Unknown perl backend config: %s\n", argv[0]);
exit( EXIT_FAILURE );
}
}

View File

@ -25,8 +25,8 @@ perl_back_delete(
Backend *be,
Connection *conn,
Operation *op,
const char *dn,
const char *ndn
struct berval *dn,
struct berval *ndn
)
{
int len;
@ -42,7 +42,7 @@ perl_back_delete(
PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref );
XPUSHs(sv_2mortal(newSVpv( dn , 0 )));
XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0 )));
PUTBACK;
@ -70,6 +70,6 @@ perl_back_delete(
NULL, NULL, NULL, NULL );
}
Debug( LDAP_DEBUG_ANY, "Here DELETE\n", 0, 0, 0 );
Debug( LDAP_DEBUG_ANY, "Perl DELETE\n", 0, 0, 0 );
return( 0 );
}

View File

@ -6,7 +6,7 @@ LDAP_BEGIN_DECL
extern BI_init perl_back_initialize;
extern BI_open perl_back_open;
extern BI_close perl_back_close:
extern BI_close perl_back_close;
extern BI_destroy perl_back_destroy;
extern BI_db_init perl_back_db_init;

View File

@ -85,7 +85,7 @@ perl_back_initialize(
bi->bi_db_destroy = perl_back_db_destroy;
bi->bi_op_bind = perl_back_bind;
bi->bi_op_unbind = perl_back_unbind;
bi->bi_op_unbind = 0;
bi->bi_op_search = perl_back_search;
bi->bi_op_compare = perl_back_compare;
bi->bi_op_modify = perl_back_modify;

View File

@ -26,9 +26,9 @@ perl_back_modify(
Backend *be,
Connection *conn,
Operation *op,
const char *dn,
const char *ndn,
LDAPModList *modlist
struct berval *dn,
struct berval *ndn,
Modifications *modlist
)
{
char test[500];
@ -47,12 +47,12 @@ perl_back_modify(
PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref );
XPUSHs(sv_2mortal(newSVpv( dn , 0)));
XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0)));
for (; modlist != NULL; modlist = modlist->ml_next ) {
LDAPMod *mods = &modlist->ml_mod;
for (; modlist != NULL; modlist = modlist->sml_next ) {
Modification *mods = &modlist->sml_mod;
switch ( mods->mod_op & ~LDAP_MOD_BVALUES ) {
switch ( mods->sm_op & ~LDAP_MOD_BVALUES ) {
case LDAP_MOD_ADD:
XPUSHs(sv_2mortal(newSVpv("ADD", 0 )));
break;
@ -67,13 +67,13 @@ perl_back_modify(
}
XPUSHs(sv_2mortal(newSVpv( mods->mod_type, 0 )));
XPUSHs(sv_2mortal(newSVpv( mods->sm_type.bv_val, 0 )));
for ( i = 0;
mods->mod_bvalues != NULL && mods->mod_bvalues[i] != NULL;
mods->sm_bvalues != NULL && mods->sm_bvalues[i].bv_val != NULL;
i++ )
{
XPUSHs(sv_2mortal(newSVpv( mods->mod_bvalues[i]->bv_val, 0 )));
XPUSHs(sv_2mortal(newSVpv( mods->sm_bvalues[i].bv_val, 0 )));
}
}
@ -84,7 +84,7 @@ perl_back_modify(
SPAGAIN;
if (count != 1) {
croak("Big trouble in back_search\n");
croak("Big trouble in back_modify\n");
}
return_code = POPi;

View File

@ -39,11 +39,13 @@ perl_back_modrdn(
Backend *be,
Connection *conn,
Operation *op,
const char *dn,
const char *ndn,
const char *newrdn,
struct berval *dn,
struct berval *ndn,
struct berval *newrdn,
struct berval *nnewrdn,
int deleteoldrdn,
const char *newSuperior
struct berval *newSuperior,
struct berval *nnewSuperior
)
{
int len;
@ -59,11 +61,11 @@ perl_back_modrdn(
PUSHMARK(sp) ;
XPUSHs( perl_back->pb_obj_ref );
XPUSHs(sv_2mortal(newSVpv( dn , 0 )));
XPUSHs(sv_2mortal(newSVpv( newrdn , 0 )));
XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0 )));
XPUSHs(sv_2mortal(newSVpv( newrdn->bv_val , 0 )));
XPUSHs(sv_2mortal(newSViv( deleteoldrdn )));
if ( newSuperior != NULL ) {
XPUSHs(sv_2mortal(newSVpv( newSuperior , 0 )));
XPUSHs(sv_2mortal(newSVpv( newSuperior->bv_val , 0 )));
}
PUTBACK ;
@ -72,7 +74,7 @@ perl_back_modrdn(
SPAGAIN ;
if (count != 1) {
croak("Big trouble in back_search\n") ;
croak("Big trouble in back_modrdn\n") ;
}
return_code = POPi;
@ -94,5 +96,3 @@ perl_back_modrdn(
Debug( LDAP_DEBUG_ANY, "Perl MODRDN\n", 0, 0, 0 );
return( 0 );
}

View File

@ -31,14 +31,14 @@ perl_back_search(
Backend *be,
Connection *conn,
Operation *op,
const char *base,
const char *nbase,
struct berval *base,
struct berval *nbase,
int scope,
int deref,
int sizelimit,
int timelimit,
Filter *filter,
const char *filterstr,
struct berval *filterstr,
AttributeName *attrs,
int attrsonly
)
@ -61,7 +61,7 @@ perl_back_search(
PUSHMARK(sp) ;
XPUSHs( perl_back->pb_obj_ref );
XPUSHs(sv_2mortal(newSVpv( filterstr , 0)));
XPUSHs(sv_2mortal(newSVpv( filterstr->bv_val , 0)));
XPUSHs(sv_2mortal(newSViv( sizelimit )));
XPUSHs(sv_2mortal(newSViv( timelimit )));
XPUSHs(sv_2mortal(newSViv( attrsonly )));