summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-connect.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-09-03 02:10:56 +0000
committerBruce Momjian <bruce@momjian.us>1998-09-03 02:10:56 +0000
commitf71d0cf64ebd53fc277adddfd81c9913badb92ba (patch)
treedfb56c71e84e52703f11c5c233461369baad2d0d /src/interfaces/libpq/fe-connect.c
parentbcc15f15e10630b2624a1610d61bedb88e4c4901 (diff)
Attached is a patch to remove the definitions of libpq's internal
structs from libpq-fe.h, as we previously discussed. There turned out to be sloppy coding practices in more places than I had realized :-(, but all in all I think it was a well-worth-while exercise. I ended up adding several routines to libpq's API in order to respond to application requirements that were exposed by this work. I owe the docs crew updates for libpq.sgml to describe these changes. I'm way too tired to work on the docs tonight, however. This is the last major change I intend to submit for 6.4. I do want to see if I can make libpgtcl work with Tcl 8.0 before we go final, but hopefully that will be a minor bug fix.
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r--src/interfaces/libpq/fe-connect.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 85a95c9727a..5d244fa838f 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.80 1998/09/01 04:40:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.81 1998/09/03 02:10:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1385,6 +1385,14 @@ PQuser(PGconn *conn)
}
char *
+PQpass(PGconn *conn)
+{
+ if (!conn)
+ return (char *) NULL;
+ return conn->pgpass;
+}
+
+char *
PQhost(PGconn *conn)
{
if (!conn)
@@ -1393,11 +1401,11 @@ PQhost(PGconn *conn)
}
char *
-PQoptions(PGconn *conn)
+PQport(PGconn *conn)
{
if (!conn)
return (char *) NULL;
- return conn->pgoptions;
+ return conn->pgport;
}
char *
@@ -1409,11 +1417,11 @@ PQtty(PGconn *conn)
}
char *
-PQport(PGconn *conn)
+PQoptions(PGconn *conn)
{
if (!conn)
return (char *) NULL;
- return conn->pgport;
+ return conn->pgoptions;
}
ConnStatusType
@@ -1442,6 +1450,14 @@ PQsocket(PGconn *conn)
return conn->sock;
}
+int
+PQbackendPID(PGconn *conn)
+{
+ if (!conn || conn->status != CONNECTION_OK)
+ return 0;
+ return conn->be_pid;
+}
+
void
PQtrace(PGconn *conn, FILE *debug_port)
{