aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/libpq/fe-misc.c')
-rw-r--r--src/interfaces/libpq/fe-misc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index 52bf28b6123..512633ca0fc 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -24,7 +24,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.16 1998/07/03 04:24:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.17 1998/08/09 02:59:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -50,6 +50,10 @@
#include "postgres.h"
#include "libpq-fe.h"
+#define DONOTICE(conn,message) \
+ ((*(conn)->noticeHook) ((conn)->noticeArg, (message)))
+
+
/* --------------------------------------------------------------------- */
/* pqGetc:
get a character from the connection
@@ -218,7 +222,9 @@ pqGetInt(int *result, int bytes, PGconn *conn)
*result = (int) ntohl(tmp4);
break;
default:
- fprintf(stderr, "** int size %d not supported\n", bytes);
+ sprintf(conn->errorMessage,
+ "pqGetInt: int size %d not supported\n", bytes);
+ DONOTICE(conn, conn->errorMessage);
return EOF;
}
@@ -252,7 +258,9 @@ pqPutInt(int value, int bytes, PGconn *conn)
return EOF;
break;
default:
- fprintf(stderr, "** int size %d not supported\n", bytes);
+ sprintf(conn->errorMessage,
+ "pqPutInt: int size %d not supported\n", bytes);
+ DONOTICE(conn, conn->errorMessage);
return EOF;
}
@@ -265,7 +273,7 @@ pqPutInt(int value, int bytes, PGconn *conn)
/* --------------------------------------------------------------------- */
/* pqReadReady: is select() saying the file is ready to read?
*/
-static int
+int
pqReadReady(PGconn *conn)
{
fd_set input_mask;