mirror of https://github.com/postgres/postgres
3 new files and two patches for the plperl subdir. These changes add the ability for plperl functions to call 'elog'. It also sets up the frame work to allow me to add access to the SPI functions. -- Mark HollomonREL7_0_PATCHES
parent
1380921e65
commit
c5b02a7a26
@ -0,0 +1,74 @@ |
||||
/* system stuff */ |
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
#include <stdarg.h> |
||||
#include <unistd.h> |
||||
#include <fcntl.h> |
||||
#include <string.h> |
||||
#include <setjmp.h> |
||||
|
||||
/* postgreSQL stuff */ |
||||
#include "executor/spi.h" |
||||
#include "commands/trigger.h" |
||||
#include "utils/elog.h" |
||||
#include "utils/builtins.h" |
||||
#include "fmgr.h" |
||||
#include "access/heapam.h" |
||||
|
||||
#include "tcop/tcopprot.h" |
||||
#include "utils/syscache.h" |
||||
#include "catalog/pg_proc.h" |
||||
#include "catalog/pg_type.h" |
||||
|
||||
/* perl stuff */ |
||||
/* |
||||
* Evil Code Alert |
||||
* |
||||
* both posgreSQL and perl try to do 'the right thing' |
||||
* and provide union semun if the platform doesn't define |
||||
* it in a system header. |
||||
* psql uses HAVE_UNION_SEMUN |
||||
* perl uses HAS_UNION_SEMUN |
||||
* together, they cause compile errors. |
||||
* If we need it, the psql headers above will provide it. |
||||
* So we tell perl that we have it. |
||||
*/ |
||||
#ifndef HAS_UNION_SEMUN |
||||
#define HAS_UNION_SEMUN |
||||
#endif |
||||
|
||||
#include "EXTERN.h" |
||||
#include "perl.h" |
||||
#include "XSUB.h" |
||||
|
||||
#include "eloglvl.h" |
||||
|
||||
|
||||
|
||||
MODULE = SPI PREFIX = elog_ |
||||
|
||||
PROTOTYPES: ENABLE |
||||
VERSIONCHECK: DISABLE |
||||
|
||||
void |
||||
elog_elog(level, message) |
||||
int level |
||||
char* message |
||||
CODE: |
||||
if (level > 0) |
||||
return; |
||||
else |
||||
elog(level, message); |
||||
|
||||
|
||||
int |
||||
elog_NOIND() |
||||
|
||||
int |
||||
elog_DEBUG() |
||||
|
||||
int |
||||
elog_ERROR() |
||||
|
||||
int |
||||
elog_NOTICE() |
||||
@ -0,0 +1,25 @@ |
||||
#include "utils/elog.h" |
||||
|
||||
/*
|
||||
* This kludge is necessary because of the conflicting |
||||
* definitions of 'DEBUG' between postgres and perl. |
||||
* we'll live. |
||||
*/ |
||||
|
||||
#include "eloglvl.h" |
||||
|
||||
int elog_DEBUG(void) { |
||||
return DEBUG; |
||||
} |
||||
|
||||
int elog_ERROR(void) { |
||||
return ERROR; |
||||
} |
||||
|
||||
int elog_NOIND(void) { |
||||
return NOIND; |
||||
} |
||||
|
||||
int elog_NOTICE(void) { |
||||
return NOTICE; |
||||
} |
||||
@ -0,0 +1,8 @@ |
||||
|
||||
int elog_DEBUG(void) ; |
||||
|
||||
int elog_ERROR(void) ; |
||||
|
||||
int elog_NOIND(void) ; |
||||
|
||||
int elog_NOTICE(void); |
||||
Loading…
Reference in new issue