1
/*-------------------------------------------------------------------------
4
* Common include file for PL/Perl files
6
* This should be included _AFTER_ postgres.h and system include files
8
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
9
* Portions Copyright (c) 1995, Regents of the University of California
11
* src/pl/plperl/plperl.h
17
/* stop perl headers from hijacking stdio and other stuff on Windows */
19
#define WIN32IO_IS_STDIO
21
* isnan is defined in both the perl and mingw headers. We don't use it,
22
* so this just clears up the compile warning.
30
* Supply a value of PERL_UNUSED_DECL that will satisfy gcc - the one
31
* perl itself supplies doesn't seem to.
34
#define PERL_UNUSED_DECL __attribute__ ((unused))
38
* Sometimes perl carefully scribbles on our *printf macros.
39
* So we undefine them here and redefine them after it's done its dirty deed.
42
#ifdef USE_REPL_SNPRINTF
48
/* required for perl API */
53
/* put back our snprintf and vsnprintf */
54
#ifdef USE_REPL_SNPRINTF
62
#define vsnprintf(...) pg_vsnprintf(__VA_ARGS__)
63
#define snprintf(...) pg_snprintf(__VA_ARGS__)
65
#define vsnprintf pg_vsnprintf
66
#define snprintf pg_snprintf
68
#endif /* USE_REPL_SNPRINTF */
70
/* perl version and platform portability */
72
#define NEED_newRV_noinc
73
#define NEED_sv_2pv_flags
76
/* perl may have a different width of "bool", don't buy it */
81
/* supply HeUTF8 if it's missing - ppport.h doesn't supply it, unfortunately */
83
#define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
84
SvUTF8(HeKEY_sv(he)) : \
88
/* declare routines from plperl.c for access by .xs files */
89
HV *plperl_spi_exec(char *, int);
90
void plperl_return_next(SV *);
91
SV *plperl_spi_query(char *);
92
SV *plperl_spi_fetchrow(char *);
93
SV *plperl_spi_prepare(char *, int, SV **);
94
HV *plperl_spi_exec_prepared(char *, HV *, int, SV **);
95
SV *plperl_spi_query_prepared(char *, int, SV **);
96
void plperl_spi_freeplan(char *);
97
void plperl_spi_cursor_close(char *);
98
char *plperl_sv_to_literal(SV *, char *);
102
#endif /* PL_PERL_H */