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