Back to index

openldap  2.4.31
perl_back.h
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 #ifndef PERL_BACK_H
00019 #define PERL_BACK_H 1
00020 
00021 #include <EXTERN.h>
00022 #include <perl.h>
00023 #undef _      /* #defined by both Perl and ac/localize.h */
00024 #include "asperl_undefs.h"
00025 
00026 #include "portable.h"
00027 
00028 #include "slap.h"
00029 
00030 LDAP_BEGIN_DECL
00031 
00032 /*
00033  * From Apache mod_perl: test for Perl version.
00034  */
00035 
00036 #if defined(pTHX_) || (PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 6))
00037 #define PERL_IS_5_6
00038 #endif
00039 
00040 #define EVAL_BUF_SIZE 500
00041 
00042 extern ldap_pvt_thread_mutex_t  perl_interpreter_mutex;
00043 
00044 #ifdef PERL_IS_5_6
00045 /* We should be using the PL_errgv, I think */
00046 /* All the old style variables are prefixed with PL_ now */
00047 # define errgv       PL_errgv
00048 # define na   PL_na
00049 #else
00050 # define call_method(m, f)  perl_call_method(m, f)
00051 # define eval_pv(m, f)      perl_eval_pv(m, f)
00052 # define ERRSV       GvSV(errgv)
00053 #endif
00054 
00055 #if defined( HAVE_WIN32_ASPERL ) || defined( USE_ITHREADS )
00056 /* pTHX is needed often now */
00057 # define PERL_INTERPRETER                 my_perl
00058 # define PERL_BACK_XS_INIT_PARAMS         pTHX
00059 # define PERL_BACK_BOOT_DYNALOADER_PARAMS pTHX, CV *cv
00060 #else
00061 # define PERL_INTERPRETER                 perl_interpreter
00062 # define PERL_BACK_XS_INIT_PARAMS         void
00063 # define PERL_BACK_BOOT_DYNALOADER_PARAMS CV *cv
00064 # define PERL_SET_CONTEXT(i)
00065 #endif
00066 
00067 extern PerlInterpreter *PERL_INTERPRETER;
00068 
00069 
00070 typedef struct perl_backend_instance {
00071        char *pb_module_name;
00072        BerVarray pb_module_path;
00073        BerVarray pb_module_config;
00074        SV     *pb_obj_ref;
00075        int    pb_filter_search_results;
00076 } PerlBackend;
00077 
00078 LDAP_END_DECL
00079 
00080 #include "proto-perl.h"
00081 
00082 #endif /* PERL_BACK_H */