]> git.sur5r.net Git - openldap/blob - servers/slapd/back-perl/perl_back.h
slight improvements; doesn't work yet
[openldap] / servers / slapd / back-perl / perl_back.h
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1999-2004 The OpenLDAP Foundation.
5  * Portions Copyright 1999 John C. Quillan.
6  * Portions Copyright 2002 myinternet Limited.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted only as authorized by the OpenLDAP
11  * Public License.
12  *
13  * A copy of this license is available in file LICENSE in the
14  * top-level directory of the distribution or, alternatively, at
15  * <http://www.OpenLDAP.org/license.html>.
16  */
17
18 #ifndef PERL_BACK_H
19 #define PERL_BACK_H 1
20
21 LDAP_BEGIN_DECL
22
23 /*
24  * From Apache mod_perl: test for Perl version.
25  */
26
27 #if defined(pTHX_) || (PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 6))
28 #define PERL_IS_5_6
29 #endif
30
31 #define EVAL_BUF_SIZE 500
32
33 extern ldap_pvt_thread_mutex_t  perl_interpreter_mutex;
34
35 #ifdef PERL_IS_5_6
36 /* We should be using the PL_errgv, I think */
37 /* All the old style variables are prefixed with PL_ now */
38 # define errgv  PL_errgv
39 # define na     PL_na
40 #endif
41
42 #ifdef HAVE_WIN32_ASPERL
43 /* pTHX is needed often now */
44 # define PERL_INTERPRETER                       my_perl
45 # define PERL_BACK_XS_INIT_PARAMS               pTHX
46 # define PERL_BACK_BOOT_DYNALOADER_PARAMS       pTHX, CV *cv
47 #else
48 # define PERL_INTERPRETER                       perl_interpreter
49 # define PERL_BACK_XS_INIT_PARAMS               void
50 # define PERL_BACK_BOOT_DYNALOADER_PARAMS       CV *cv
51 #endif
52
53 extern PerlInterpreter *PERL_INTERPRETER;
54
55
56 typedef struct perl_backend_instance {
57         char    *pb_module_name;
58         SV      *pb_obj_ref;
59         int     pb_filter_search_results;
60 } PerlBackend;
61
62 LDAP_END_DECL
63
64 #include "external.h"
65
66 #endif