Skip to content

Commit 94a7105

Browse files
author
Michael Meskes
committed
Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury.
Bumped library version to 6.1.
1 parent 6a78d75 commit 94a7105

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,4 +2331,7 @@ Sun, 02 Mar 2008 11:50:48 +0100
23312331
Thu, 20 Mar 2008 16:54:27 +0100
23322332

23332333
- Changed statement escaping to not escape continuation line markers.
2334-
- Bumped ecpg version number to 4.4.1.
2334+
- Bumped ecpg version to 4.4.1.
2335+
- Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury.
2336+
- Bumped ecpglib version to 6.1.
2337+

src/interfaces/ecpg/ecpglib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.54 2008/01/01 19:45:59 momjian Exp $
8+
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.54.2.1 2008/03/20 16:30:14 meskes Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
1515

1616
NAME= ecpg
1717
SO_MAJOR_VERSION= 6
18-
SO_MINOR_VERSION= 0
18+
SO_MINOR_VERSION= 1
1919
DLTYPE= library
2020

2121
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \

src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.48 2007/11/15 21:14:45 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.48.2.1 2008/03/20 16:30:14 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -565,3 +565,13 @@ ECPGdisconnect(int lineno, const char *connection_name)
565565

566566
return true;
567567
}
568+
569+
PGconn* ECPGget_PGconn(const char *connection_name)
570+
{
571+
struct connection * con;
572+
573+
con=ecpg_get_connection(connection_name);
574+
if (con==NULL) return NULL;
575+
576+
return con->connection;
577+
}

src/interfaces/ecpg/include/ecpglib.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* this is a small part of c.h since we don't want to leak all postgres
33
* definitions into ecpg programs
4-
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.74.2.1 2008/02/15 12:11:02 meskes Exp $
4+
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.74.2.2 2008/03/20 16:30:14 meskes Exp $
55
*/
66

77
#ifndef _ECPGLIB_H
@@ -47,11 +47,13 @@ bool ECPGdo(const int, const int, const int, const char *, const bool, const in
4747
bool ECPGtrans(int, const char *, const char *);
4848
bool ECPGdisconnect(int, const char *);
4949
bool ECPGprepare(int, const char *, const int, const char *, const char *);
50-
bool ECPGdeallocate(int, int, const char *connection_name, const char *name);
51-
bool ECPGdeallocate_all(int, int, const char *connection_name);
52-
char *ECPGprepared_statement(const char *connection_name, const char *name, int);
50+
bool ECPGdeallocate(int, int, const char *, const char *);
51+
bool ECPGdeallocate_all(int, int, const char *);
52+
char *ECPGprepared_statement(const char *, const char *, int);
53+
PGconn *ECPGget_PGconn(const char *);
5354

54-
char *ECPGerrmsg(void);
55+
56+
char *ECPGerrmsg(void);
5557

5658
/* print an error message */
5759
void sqlprint(void);
@@ -63,18 +65,17 @@ void sqlprint(void);
6365

6466
/* dynamic SQL */
6567

66-
bool ECPGdo_descriptor(int line, const char *connection,
67-
const char *descriptor, const char *query);
68-
bool ECPGdeallocate_desc(int line, const char *name);
69-
bool ECPGallocate_desc(int line, const char *name);
68+
bool ECPGdo_descriptor(int, const char *, const char *, const char *);
69+
bool ECPGdeallocate_desc(int, const char *);
70+
bool ECPGallocate_desc(int, const char *);
7071
bool ECPGget_desc_header(int, const char *, int *);
71-
bool ECPGget_desc(int, const char *, int,...);
72+
bool ECPGget_desc(int, const char *, int, ...);
7273
bool ECPGset_desc_header(int, const char *, int);
73-
bool ECPGset_desc(int, const char *, int,...);
74+
bool ECPGset_desc(int, const char *, int, ...);
7475

7576
void ECPGset_noind_null(enum ECPGttype, void *);
7677
bool ECPGis_noind_null(enum ECPGttype, void *);
77-
bool ECPGdescribe(int, bool, const char *,...);
78+
bool ECPGdescribe(int, bool, const char *, ...);
7879

7980
/* dynamic result allocation */
8081
void ECPGfree_auto_mem(void);

0 commit comments

Comments
 (0)