]> granicus.if.org Git - postgresql/blobdiff - src/interfaces/libpq/libpq-int.h
Use CONNECTION_OK to determine whether startup phase is complete.
[postgresql] / src / interfaces / libpq / libpq-int.h
index 2943f23830fb8085b7300f78e8278e4de737363b..7d8848e3e9e9fea1e3f488c3e0991278985f0293 100644 (file)
@@ -9,10 +9,10 @@
  *       more likely to break across PostgreSQL releases than code that uses
  *       only the official API.
  *
- * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
+ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: libpq-int.h,v 1.24 2000/05/27 03:39:33 momjian Exp $
+ * $Id: libpq-int.h,v 1.35 2001/07/06 19:04:23 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,6 +21,7 @@
 #define LIBPQ_INT_H
 
 /* We assume libpq-fe.h has already been included. */
+#include "postgres_fe.h"
 
 /* include stuff common to fe and be */
 #include "libpq/pqcomm.h"
@@ -203,6 +204,9 @@ struct pg_conn
                                                                 * numbers-and-dots notation. Takes
                                                                 * precedence over above. */
        char       *pgport;                     /* the server's communication port */
+       char       *pgunixsocket;       /* the Unix-domain socket that the server
+                                                                * is listening on; if NULL, uses a
+                                                                * default constructed from pgport */
        char       *pgtty;                      /* tty on which the backend messages is
                                                                 * displayed (NOT ACTUALLY USED???) */
        char       *pgoptions;          /* options to start the backend with */
@@ -263,6 +267,7 @@ struct pg_conn
 
 #ifdef USE_SSL
        bool            allow_ssl_try;  /* Allowed to try SSL negotiation */
+       bool            require_ssl;    /* Require SSL to make connection */
        SSL                *ssl;                        /* SSL status, if have SSL connection */
 #endif
 
@@ -308,6 +313,7 @@ extern void pqClearAsyncResult(PGconn *conn);
   * necessarily any error.
   */
 extern int     pqGetc(char *result, PGconn *conn);
+extern int     pqPutc(char c, PGconn *conn);
 extern int     pqGets(PQExpBuffer buf, PGconn *conn);
 extern int     pqPuts(const char *s, PGconn *conn);
 extern int     pqGetnchar(char *s, size_t len, PGconn *conn);
@@ -331,19 +337,10 @@ extern int        pqWriteReady(PGconn *conn);
 #define DefaultAuthtype                  ""
 #define DefaultPassword                  ""
 
-/* supply an implementation of strerror() macro if system doesn't have it */
-#ifndef strerror
-#if defined(sun) && defined(__sparc__) && !defined(__SVR4)
-extern char *sys_errlist[];
-
-#define strerror(A) (sys_errlist[(A)])
-#endif  /* sunos4 */
-#endif  /* !strerror */
-
 /*
  * this is so that we can check is a connection is non-blocking internally
  * without the overhead of a function call
  */
-#define pqIsnonblocking(conn)  (conn->nonblocking)
+#define pqIsnonblocking(conn)  ((conn)->nonblocking)
 
 #endif  /* LIBPQ_INT_H */