1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
2003-12-07 03:25:01 +08:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2017-01-04 04:36:47 +08:00
|
|
|
* Copyright 1999-2017 The OpenLDAP Foundation.
|
2003-12-07 03:25:01 +08:00
|
|
|
* Portions Copyright 1999 John C. Quillan.
|
|
|
|
* Portions Copyright 2002 myinternet Limited.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
2003-05-25 11:56:57 +08:00
|
|
|
*/
|
2003-12-07 03:25:01 +08:00
|
|
|
|
1999-01-14 14:33:09 +08:00
|
|
|
#ifndef PERL_BACK_H
|
|
|
|
#define PERL_BACK_H 1
|
|
|
|
|
2004-04-27 15:23:04 +08:00
|
|
|
#include <EXTERN.h>
|
|
|
|
#include <perl.h>
|
|
|
|
#undef _ /* #defined by both Perl and ac/localize.h */
|
|
|
|
#include "asperl_undefs.h"
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#include "slap.h"
|
|
|
|
|
1999-01-14 14:33:09 +08:00
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
|
|
|
/*
|
2003-03-13 09:58:26 +08:00
|
|
|
* From Apache mod_perl: test for Perl version.
|
1999-01-14 14:33:09 +08:00
|
|
|
*/
|
2003-03-13 09:58:26 +08:00
|
|
|
|
2003-03-13 10:01:14 +08:00
|
|
|
#if defined(pTHX_) || (PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 6))
|
2002-04-16 11:47:39 +08:00
|
|
|
#define PERL_IS_5_6
|
|
|
|
#endif
|
|
|
|
|
1999-01-14 14:33:09 +08:00
|
|
|
#define EVAL_BUF_SIZE 500
|
|
|
|
|
1999-01-28 12:34:55 +08:00
|
|
|
extern ldap_pvt_thread_mutex_t perl_interpreter_mutex;
|
1999-01-14 14:33:09 +08:00
|
|
|
|
2003-03-13 09:58:26 +08:00
|
|
|
#ifdef PERL_IS_5_6
|
2002-04-16 12:25:44 +08:00
|
|
|
/* We should be using the PL_errgv, I think */
|
|
|
|
/* All the old style variables are prefixed with PL_ now */
|
|
|
|
# define errgv PL_errgv
|
|
|
|
# define na PL_na
|
2011-02-04 23:00:10 +08:00
|
|
|
#else
|
|
|
|
# define call_method(m, f) perl_call_method(m, f)
|
2011-02-04 23:03:16 +08:00
|
|
|
# define eval_pv(m, f) perl_eval_pv(m, f)
|
2011-02-04 23:00:10 +08:00
|
|
|
# define ERRSV GvSV(errgv)
|
2002-04-16 12:25:44 +08:00
|
|
|
#endif
|
|
|
|
|
2004-04-27 15:23:04 +08:00
|
|
|
#if defined( HAVE_WIN32_ASPERL ) || defined( USE_ITHREADS )
|
2002-04-16 12:25:44 +08:00
|
|
|
/* pTHX is needed often now */
|
|
|
|
# define PERL_INTERPRETER my_perl
|
|
|
|
# define PERL_BACK_XS_INIT_PARAMS pTHX
|
|
|
|
# define PERL_BACK_BOOT_DYNALOADER_PARAMS pTHX, CV *cv
|
|
|
|
#else
|
|
|
|
# define PERL_INTERPRETER perl_interpreter
|
|
|
|
# define PERL_BACK_XS_INIT_PARAMS void
|
|
|
|
# define PERL_BACK_BOOT_DYNALOADER_PARAMS CV *cv
|
2011-02-05 08:51:18 +08:00
|
|
|
# define PERL_SET_CONTEXT(i)
|
2002-04-16 12:25:44 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
extern PerlInterpreter *PERL_INTERPRETER;
|
|
|
|
|
|
|
|
|
1999-01-14 14:33:09 +08:00
|
|
|
typedef struct perl_backend_instance {
|
2011-02-05 01:07:35 +08:00
|
|
|
char *pb_module_name;
|
2011-02-04 23:00:10 +08:00
|
|
|
BerVarray pb_module_path;
|
|
|
|
BerVarray pb_module_config;
|
2002-04-16 11:47:39 +08:00
|
|
|
SV *pb_obj_ref;
|
|
|
|
int pb_filter_search_results;
|
1999-01-14 14:33:09 +08:00
|
|
|
} PerlBackend;
|
|
|
|
|
|
|
|
LDAP_END_DECL
|
|
|
|
|
2004-11-11 08:39:19 +08:00
|
|
|
#include "proto-perl.h"
|
1999-02-05 17:03:47 +08:00
|
|
|
|
2004-11-11 08:39:19 +08:00
|
|
|
#endif /* PERL_BACK_H */
|