Back to index

openldap  2.4.31
delete.c
Go to the documentation of this file.
00001 /* $OpenLDAP$ */
00002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00003  *
00004  * Copyright 1999-2012 The OpenLDAP Foundation.
00005  * Portions Copyright 1999 John C. Quillan.
00006  * Portions Copyright 2002 myinternet Limited.
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted only as authorized by the OpenLDAP
00011  * Public License.
00012  *
00013  * A copy of this license is available in file LICENSE in the
00014  * top-level directory of the distribution or, alternatively, at
00015  * <http://www.OpenLDAP.org/license.html>.
00016  */
00017 
00018 #include "perl_back.h"
00019 
00020 int
00021 perl_back_delete(
00022        Operation     *op,
00023        SlapReply     *rs )
00024 {
00025        PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
00026        int count;
00027 
00028        PERL_SET_CONTEXT( PERL_INTERPRETER );
00029        ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );  
00030 
00031        {
00032               dSP; ENTER; SAVETMPS;
00033 
00034               PUSHMARK(sp);
00035               XPUSHs( perl_back->pb_obj_ref );
00036               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len )));
00037 
00038               PUTBACK;
00039 
00040               count = call_method("delete", G_SCALAR);
00041 
00042               SPAGAIN;
00043 
00044               if (count != 1) {
00045                      croak("Big trouble in perl-back_delete\n");
00046               }
00047 
00048               rs->sr_err = POPi;
00049 
00050               PUTBACK; FREETMPS; LEAVE;
00051        }
00052 
00053        ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );       
00054 
00055        send_ldap_result( op, rs );
00056 
00057        Debug( LDAP_DEBUG_ANY, "Perl DELETE\n", 0, 0, 0 );
00058        return( 0 );
00059 }