X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-perl%2Fperl_back.h;h=fe1b9a635754b332a96a1f1cbf191d3bf2de280f;hb=d4124e0e031f5b76a80f9c25a04146d334bcf898;hp=cb105577e35044ccc1b95c8881abef563012f3cf;hpb=7127e0887cfd03f096ecf335b36d78fdb49815cd;p=openldap diff --git a/servers/slapd/back-perl/perl_back.h b/servers/slapd/back-perl/perl_back.h index cb105577e3..fe1b9a6357 100644 --- a/servers/slapd/back-perl/perl_back.h +++ b/servers/slapd/back-perl/perl_back.h @@ -1,24 +1,66 @@ /* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 1999-2008 The OpenLDAP Foundation. + * 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 + * . + */ + #ifndef PERL_BACK_H #define PERL_BACK_H 1 +#include +#include +#undef _ /* #defined by both Perl and ac/localize.h */ +#include "asperl_undefs.h" + +#include "portable.h" + +#include "slap.h" + LDAP_BEGIN_DECL /* - * From Apache mod_perl: test for Perl version.[ja + * From Apache mod_perl: test for Perl version. */ -#ifdef pTHX_ + +#if defined(pTHX_) || (PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 6)) #define PERL_IS_5_6 #endif #define EVAL_BUF_SIZE 500 -#ifdef pTHX_ -#define PERL_IS_5_6 +extern ldap_pvt_thread_mutex_t perl_interpreter_mutex; + +#ifdef PERL_IS_5_6 +/* 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 #endif -extern PerlInterpreter *perl_interpreter; -extern ldap_pvt_thread_mutex_t perl_interpreter_mutex; +#if defined( HAVE_WIN32_ASPERL ) || defined( USE_ITHREADS ) +/* 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 +#endif + +extern PerlInterpreter *PERL_INTERPRETER; + typedef struct perl_backend_instance { char *pb_module_name; @@ -28,6 +70,6 @@ typedef struct perl_backend_instance { LDAP_END_DECL -#include "external.h" +#include "proto-perl.h" -#endif +#endif /* PERL_BACK_H */