From: Michael Meskes Date: Thu, 20 Mar 2008 16:30:14 +0000 (+0000) Subject: Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=9a19c52b2869b823801a9918cd57adccbeab5e70;p=users%2Fbernd%2Fpostgres.git Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury. Bumped library version to 6.1. --- diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index c7f569693f..a1f5364458 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -2331,4 +2331,7 @@ Sun, 02 Mar 2008 11:50:48 +0100 Thu, 20 Mar 2008 16:54:27 +0100 - Changed statement escaping to not escape continuation line markers. - - Bumped ecpg version number to 4.4.1. + - Bumped ecpg version to 4.4.1. + - Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury. + - Bumped ecpglib version to 6.1. + diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile index df214c4553..3567c92128 100644 --- a/src/interfaces/ecpg/ecpglib/Makefile +++ b/src/interfaces/ecpg/ecpglib/Makefile @@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global NAME= ecpg SO_MAJOR_VERSION= 6 -SO_MINOR_VERSION= 0 +SO_MINOR_VERSION= 1 DLTYPE= library override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \ diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index 209dcf1487..cf4b001b63 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -565,3 +565,13 @@ ECPGdisconnect(int lineno, const char *connection_name) return true; } + +PGconn* ECPGget_PGconn(const char *connection_name) +{ + struct connection * con; + + con=ecpg_get_connection(connection_name); + if (con==NULL) return NULL; + + return con->connection; +} diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h index d2706538bc..50016efe59 100644 --- a/src/interfaces/ecpg/include/ecpglib.h +++ b/src/interfaces/ecpg/include/ecpglib.h @@ -47,11 +47,13 @@ bool ECPGdo(const int, const int, const int, const char *, const bool, const in bool ECPGtrans(int, const char *, const char *); bool ECPGdisconnect(int, const char *); bool ECPGprepare(int, const char *, const int, const char *, const char *); -bool ECPGdeallocate(int, int, const char *connection_name, const char *name); -bool ECPGdeallocate_all(int, int, const char *connection_name); -char *ECPGprepared_statement(const char *connection_name, const char *name, int); +bool ECPGdeallocate(int, int, const char *, const char *); +bool ECPGdeallocate_all(int, int, const char *); +char *ECPGprepared_statement(const char *, const char *, int); +PGconn *ECPGget_PGconn(const char *); -char *ECPGerrmsg(void); + +char *ECPGerrmsg(void); /* print an error message */ void sqlprint(void); @@ -63,18 +65,17 @@ void sqlprint(void); /* dynamic SQL */ -bool ECPGdo_descriptor(int line, const char *connection, - const char *descriptor, const char *query); -bool ECPGdeallocate_desc(int line, const char *name); -bool ECPGallocate_desc(int line, const char *name); +bool ECPGdo_descriptor(int, const char *, const char *, const char *); +bool ECPGdeallocate_desc(int, const char *); +bool ECPGallocate_desc(int, const char *); bool ECPGget_desc_header(int, const char *, int *); -bool ECPGget_desc(int, const char *, int,...); +bool ECPGget_desc(int, const char *, int, ...); bool ECPGset_desc_header(int, const char *, int); -bool ECPGset_desc(int, const char *, int,...); +bool ECPGset_desc(int, const char *, int, ...); void ECPGset_noind_null(enum ECPGttype, void *); bool ECPGis_noind_null(enum ECPGttype, void *); -bool ECPGdescribe(int, bool, const char *,...); +bool ECPGdescribe(int, bool, const char *, ...); /* dynamic result allocation */ void ECPGfree_auto_mem(void);