perl_back.h revision 1.1.1.2
1/*	$NetBSD: perl_back.h,v 1.1.1.2 2010/03/08 02:14:20 lukem Exp $	*/
2
3/* OpenLDAP: pkg/ldap/servers/slapd/back-perl/perl_back.h,v 1.15.2.4 2009/01/22 00:01:09 kurt Exp */
4/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 *
6 * Copyright 1999-2009 The OpenLDAP Foundation.
7 * Portions Copyright 1999 John C. Quillan.
8 * Portions Copyright 2002 myinternet Limited.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted only as authorized by the OpenLDAP
13 * Public License.
14 *
15 * A copy of this license is available in file LICENSE in the
16 * top-level directory of the distribution or, alternatively, at
17 * <http://www.OpenLDAP.org/license.html>.
18 */
19
20#ifndef PERL_BACK_H
21#define PERL_BACK_H 1
22
23#include <EXTERN.h>
24#include <perl.h>
25#undef _	/* #defined by both Perl and ac/localize.h */
26#include "asperl_undefs.h"
27
28#include "portable.h"
29
30#include "slap.h"
31
32LDAP_BEGIN_DECL
33
34/*
35 * From Apache mod_perl: test for Perl version.
36 */
37
38#if defined(pTHX_) || (PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 6))
39#define PERL_IS_5_6
40#endif
41
42#define EVAL_BUF_SIZE 500
43
44extern ldap_pvt_thread_mutex_t  perl_interpreter_mutex;
45
46#ifdef PERL_IS_5_6
47/* We should be using the PL_errgv, I think */
48/* All the old style variables are prefixed with PL_ now */
49# define errgv	PL_errgv
50# define na	PL_na
51#endif
52
53#if defined( HAVE_WIN32_ASPERL ) || defined( USE_ITHREADS )
54/* pTHX is needed often now */
55# define PERL_INTERPRETER			my_perl
56# define PERL_BACK_XS_INIT_PARAMS		pTHX
57# define PERL_BACK_BOOT_DYNALOADER_PARAMS	pTHX, CV *cv
58#else
59# define PERL_INTERPRETER			perl_interpreter
60# define PERL_BACK_XS_INIT_PARAMS		void
61# define PERL_BACK_BOOT_DYNALOADER_PARAMS	CV *cv
62#endif
63
64extern PerlInterpreter *PERL_INTERPRETER;
65
66
67typedef struct perl_backend_instance {
68	char	*pb_module_name;
69	SV	*pb_obj_ref;
70	int	pb_filter_search_results;
71} PerlBackend;
72
73LDAP_END_DECL
74
75#include "proto-perl.h"
76
77#endif /* PERL_BACK_H */
78