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; SPAGAIN;
if (count != 1) { if (count != 1) {
croak("Big trouble in back_search\n"); croak("Big trouble in back_add\n");
} }
return_code = POPi; return_code = POPi;
@ -72,6 +72,6 @@ perl_back_add(
NULL, NULL, NULL, NULL ); 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 ); return( 0 );
} }

View File

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

View File

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

View File

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

View File

@ -25,8 +25,8 @@ perl_back_delete(
Backend *be, Backend *be,
Connection *conn, Connection *conn,
Operation *op, Operation *op,
const char *dn, struct berval *dn,
const char *ndn struct berval *ndn
) )
{ {
int len; int len;
@ -42,7 +42,7 @@ perl_back_delete(
PUSHMARK(sp); PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref ); XPUSHs( perl_back->pb_obj_ref );
XPUSHs(sv_2mortal(newSVpv( dn , 0 ))); XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0 )));
PUTBACK; PUTBACK;
@ -70,6 +70,6 @@ perl_back_delete(
NULL, NULL, NULL, NULL ); 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 ); return( 0 );
} }

View File

@ -6,7 +6,7 @@ LDAP_BEGIN_DECL
extern BI_init perl_back_initialize; extern BI_init perl_back_initialize;
extern BI_open perl_back_open; 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_destroy perl_back_destroy;
extern BI_db_init perl_back_db_init; 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_db_destroy = perl_back_db_destroy;
bi->bi_op_bind = perl_back_bind; 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_search = perl_back_search;
bi->bi_op_compare = perl_back_compare; bi->bi_op_compare = perl_back_compare;
bi->bi_op_modify = perl_back_modify; bi->bi_op_modify = perl_back_modify;

View File

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

View File

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

View File

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