]> git.sur5r.net Git - openldap/blob - servers/slapd/back-perl/compare.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / servers / slapd / back-perl / compare.c
1 /* $OpenLDAP$ */
2 /*
3  *       Copyright 1999, John C. Quillan, All rights reserved.
4  *
5  *       Redistribution and use in source and binary forms are permitted only
6  *       as authorized by the OpenLDAP Public License.  A copy of this
7  *       license is available at http://www.OpenLDAP.org/license.html or
8  *       in file LICENSE in the top-level directory of the distribution.
9  */
10
11 #include "portable.h"
12
13 #include <stdio.h>
14 /*      #include <ac/types.h>
15         #include <ac/socket.h>
16 */
17
18 #include <EXTERN.h>
19 #include <perl.h>
20
21 #include "slap.h"
22 #include "perl_back.h"
23
24 /**********************************************************
25  *
26  * Compare
27  *
28  **********************************************************/
29
30 perl_back_compare(
31         Backend *be,
32         Connection      *conn,
33         Operation       *op,
34         char    *dn,
35         Ava             *ava
36 )
37 {
38         int return_code;
39         int count;
40
41         PerlBackend *perl_back = (PerlBackend *)be->be_private;
42
43         send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
44                 NULL, "not yet implemented", NULL, NULL );
45
46 #ifdef notdef
47         ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );  
48
49         {
50                 dSP; ENTER; SAVETMPS;
51
52                 PUSHMARK(sp);
53                 XPUSHs( perl_back->pb_obj_ref );
54                 XPUSHs(sv_2mortal(newSVpv( dn , 0)));
55                 /* XPUSHs(sv_2mortal(newSVpv( cred->bv_val , cred->bv_len))); */
56                 PUTBACK;
57
58                 count = perl_call_method("bind", G_SCALAR);
59
60                 SPAGAIN;
61
62                 if (count != 1) {
63                         croak("Big trouble in back_search\n");
64                 }
65
66                 return_code = POPi;
67                                                          
68                 PUTBACK; FREETMPS; LEAVE;
69         }
70
71         ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );        
72
73         if( return_code != 0 ) {
74                 send_ldap_result( conn, op, LDAP_COMPARE_TRUE, NULL, NULL );
75
76         } else {
77                 send_ldap_result( conn, op, LDAP_COMPARE_FALSE, NULL, NULL );
78         }
79 #endif
80
81         Debug( LDAP_DEBUG_ANY, "Here BIND\n", 0, 0, 0 );
82
83         return (0);
84 }
85