diff options
| author | Bruce Momjian <bruce@momjian.us> | 2001-11-05 17:46:40 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2001-11-05 17:46:40 +0000 |
| commit | ea08e6cd5542cb269ecd3e735f1dfa3bb61fbc4f (patch) | |
| tree | bf6b60c08be3ddf5a40e110e8276dc2d45b1431c /src/interfaces/libpq | |
| parent | 34153b205265e2e831c1e3ee02be0fc88fa41710 (diff) | |
| download | postgresql-ea08e6cd5542cb269ecd3e735f1dfa3bb61fbc4f.tar.gz | |
New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
Diffstat (limited to 'src/interfaces/libpq')
| -rw-r--r-- | src/interfaces/libpq/fe-auth.c | 12 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-auth.h | 6 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-connect.c | 8 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-misc.c | 6 | ||||
| -rw-r--r-- | src/interfaces/libpq/libpq-fe.h | 415 | ||||
| -rw-r--r-- | src/interfaces/libpq/libpq-int.h | 14 | ||||
| -rw-r--r-- | src/interfaces/libpq/pqexpbuffer.h | 4 | ||||
| -rw-r--r-- | src/interfaces/libpq/pqsignal.c | 4 | ||||
| -rw-r--r-- | src/interfaces/libpq/pqsignal.h | 4 |
9 files changed, 237 insertions, 236 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c index 8cfc1d940f..f5f1ab6804 100644 --- a/src/interfaces/libpq/fe-auth.c +++ b/src/interfaces/libpq/fe-auth.c @@ -10,7 +10,7 @@ * exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes). * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.62 2001/10/25 05:50:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.63 2001/11/05 17:46:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -86,17 +86,17 @@ static const struct authsvc authsvcs[] = { #ifdef KRB4 {"krb4", STARTUP_KRB4_MSG, 1}, {"kerberos", STARTUP_KRB4_MSG, 1}, -#endif /* KRB4 */ +#endif /* KRB4 */ #ifdef KRB5 {"krb5", STARTUP_KRB5_MSG, 1}, {"kerberos", STARTUP_KRB5_MSG, 1}, -#endif /* KRB5 */ +#endif /* KRB5 */ {UNAUTHNAME, STARTUP_MSG, #if defined(KRB4) || defined(KRB5) 0 #else /* !(KRB4 || KRB5) */ 1 -#endif /* !(KRB4 || KRB5) */ +#endif /* !(KRB4 || KRB5) */ }, {"password", STARTUP_PASSWORD_MSG, 0} }; @@ -231,7 +231,7 @@ pg_krb4_sendauth(char *PQerrormsg, int sock, } return STATUS_OK; } -#endif /* KRB4 */ +#endif /* KRB4 */ #ifdef KRB5 /* @@ -431,7 +431,7 @@ pg_krb5_sendauth(char *PQerrormsg, int sock, return ret; } -#endif /* KRB5 */ +#endif /* KRB5 */ static int pg_local_sendauth(char *PQerrormsg, PGconn *conn) diff --git a/src/interfaces/libpq/fe-auth.h b/src/interfaces/libpq/fe-auth.h index 979ac078b5..8036158e07 100644 --- a/src/interfaces/libpq/fe-auth.h +++ b/src/interfaces/libpq/fe-auth.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: fe-auth.h,v 1.14 2001/10/28 06:26:12 momjian Exp $ + * $Id: fe-auth.h,v 1.15 2001/11/05 17:46:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -31,7 +31,7 @@ #define DEFAULT_CLIENT_AUTHSVC UNAUTHNAME #else /* KRB4 || KRB5 */ #define DEFAULT_CLIENT_AUTHSVC "kerberos" -#endif /* KRB4 || KRB5 */ +#endif /* KRB4 || KRB5 */ extern int fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname, const char *password, char *PQerrormsg); @@ -42,4 +42,4 @@ extern char *fe_getauthname(char *PQerrormsg); #define PG_KRB4_VERSION "PGVER4.1" /* at most KRB_SENDAUTH_VLEN chars */ #define PG_KRB5_VERSION "PGVER5.1" -#endif /* FE_AUTH_H */ +#endif /* FE_AUTH_H */ diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index fa000f3959..b6d40303d7 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.179 2001/10/28 06:26:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.180 2001/11/05 17:46:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -147,7 +147,7 @@ static const struct EnvironmentOptions { const char *envName, *pgName; -} EnvironmentOptions[] = +} EnvironmentOptions[] = { /* common user-interface settings */ @@ -672,7 +672,7 @@ update_db_info(PGconn *conn) return 0; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* ---------- @@ -1822,7 +1822,7 @@ PQsetenv(PGconn *conn) flag = PQsetenvPoll(conn); } } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 2257cbd47b..66c142ce17 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -25,7 +25,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.59 2001/10/28 06:26:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.60 2001/11/05 17:46:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -830,7 +830,7 @@ PQenv2encoding(void) { return 0; } -#endif /* MULTIBYTE */ +#endif /* MULTIBYTE */ #ifdef ENABLE_NLS @@ -847,7 +847,7 @@ libpq_gettext(const char *msgid) return dgettext("libpq", msgid); } -#endif /* ENABLE_NLS */ +#endif /* ENABLE_NLS */ #ifdef WIN32 /* diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index 3681737774..074aebf419 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-fe.h,v 1.78 2001/11/02 20:51:27 tgl Exp $ + * $Id: libpq-fe.h,v 1.79 2001/11/05 17:46:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -35,68 +35,68 @@ extern "C" /* Application-visible enum types */ -typedef enum -{ - /* - * Although you may decide to change this list in some way, values - * which become unused should never be removed, nor should - * constants be redefined - that would break compatibility with - * existing code. - */ - CONNECTION_OK, - CONNECTION_BAD, - /* Non-blocking mode only below here */ - - /* - * The existence of these should never be relied upon - they - * should only be used for user feedback or similar purposes. - */ - CONNECTION_STARTED, /* Waiting for connection to be made. */ - CONNECTION_MADE, /* Connection OK; waiting to send. */ - CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the - * postmaster. */ - CONNECTION_AUTH_OK, /* Received authentication; waiting for - * backend startup. */ - CONNECTION_SETENV /* Negotiating environment. */ -} ConnStatusType; - -typedef enum -{ - PGRES_POLLING_FAILED = 0, - PGRES_POLLING_READING, /* These two indicate that one may */ - PGRES_POLLING_WRITING, /* use select before polling again. */ - PGRES_POLLING_OK, - PGRES_POLLING_ACTIVE /* Can call poll function immediately. */ -} PostgresPollingStatusType; - -typedef enum -{ - PGRES_EMPTY_QUERY = 0, - PGRES_COMMAND_OK, /* a query command that doesn't return - * anything was executed properly by the - * backend */ - PGRES_TUPLES_OK, /* a query command that returns tuples was - * executed properly by the backend, - * PGresult contains the result tuples */ - PGRES_COPY_OUT, /* Copy Out data transfer in progress */ - PGRES_COPY_IN, /* Copy In data transfer in progress */ - PGRES_BAD_RESPONSE, /* an unexpected response was recv'd from - * the backend */ - PGRES_NONFATAL_ERROR, - PGRES_FATAL_ERROR -} ExecStatusType; + typedef enum + { + /* + * Although you may decide to change this list in some way, values + * which become unused should never be removed, nor should + * constants be redefined - that would break compatibility with + * existing code. + */ + CONNECTION_OK, + CONNECTION_BAD, + /* Non-blocking mode only below here */ + + /* + * The existence of these should never be relied upon - they + * should only be used for user feedback or similar purposes. + */ + CONNECTION_STARTED, /* Waiting for connection to be made. */ + CONNECTION_MADE, /* Connection OK; waiting to send. */ + CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the + * postmaster. */ + CONNECTION_AUTH_OK, /* Received authentication; waiting for + * backend startup. */ + CONNECTION_SETENV /* Negotiating environment. */ + } ConnStatusType; + + typedef enum + { + PGRES_POLLING_FAILED = 0, + PGRES_POLLING_READING, /* These two indicate that one may */ + PGRES_POLLING_WRITING, /* use select before polling again. */ + PGRES_POLLING_OK, + PGRES_POLLING_ACTIVE /* Can call poll function immediately. */ + } PostgresPollingStatusType; + + typedef enum + { + PGRES_EMPTY_QUERY = 0, + PGRES_COMMAND_OK, /* a query command that doesn't return + * anything was executed properly by the + * backend */ + PGRES_TUPLES_OK, /* a query command that returns tuples was + * executed properly by the backend, + * PGresult contains the result tuples */ + PGRES_COPY_OUT, /* Copy Out data transfer in progress */ + PGRES_COPY_IN, /* Copy In data transfer in progress */ + PGRES_BAD_RESPONSE, /* an unexpected response was recv'd from + * the backend */ + PGRES_NONFATAL_ERROR, + PGRES_FATAL_ERROR + } ExecStatusType; /* PGconn encapsulates a connection to the backend. * The contents of this struct are not supposed to be known to applications. */ -typedef struct pg_conn PGconn; + typedef struct pg_conn PGconn; /* PGresult encapsulates the result of a query (or more precisely, of a single * SQL command --- a query string given to PQsendQuery can contain multiple * commands and thus return multiple PGresult objects). * The contents of this struct are not supposed to be known to applications. */ -typedef struct pg_result PGresult; + typedef struct pg_result PGresult; /* PGnotify represents the occurrence of a NOTIFY message. * Ideally this would be an opaque typedef, but it's so simple that it's @@ -104,35 +104,35 @@ typedef struct pg_result PGresult; * NOTE: in Postgres 6.4 and later, the be_pid is the notifying backend's, * whereas in earlier versions it was always your own backend's PID. */ -typedef struct pgNotify -{ - char relname[NAMEDATALEN]; /* name of relation - * containing data */ - int be_pid; /* process id of backend */ -} PGnotify; + typedef struct pgNotify + { + char relname[NAMEDATALEN]; /* name of relation + * containing data */ + int be_pid; /* process id of backend */ + } PGnotify; /* PQnoticeProcessor is the function type for the notice-message callback. */ -typedef void (*PQnoticeProcessor) (void *arg, const char *message); + typedef void (*PQnoticeProcessor) (void *arg, const char *message); /* Print options for PQprint() */ -typedef char pqbool; + typedef char pqbool; -typedef struct _PQprintOpt -{ - pqbool header; /* print output field headings and row - * count */ - pqbool align; /* fill align the fields */ - pqbool standard; /* old brain dead format */ - pqbool html3; /* output html tables */ - pqbool expanded; /* expand tables */ - pqbool pager; /* use pager for output if needed */ - char *fieldSep; /* field separator */ - char *tableOpt; /* insert to HTML <table ...> */ - char *caption; /* HTML <caption> */ - char **fieldName; /* null terminated array of repalcement - * field names */ -} PQprintOpt; + typedef struct _PQprintOpt + { + pqbool header; /* print output field headings and row + * count */ + pqbool align; /* fill align the fields */ + pqbool standard; /* old brain dead format */ + pqbool html3; /* output html tables */ + pqbool expanded; /* expand tables */ + pqbool pager; /* use pager for output if needed */ + char *fieldSep; /* field separator */ + char *tableOpt; /* insert to HTML <table ...> */ + char *caption; /* HTML <caption> */ + char **fieldName; /* null terminated array of repalcement + * field names */ + } PQprintOpt; /* ---------------- * Structure for the conninfo parameter definitions returned by PQconndefaults @@ -142,35 +142,35 @@ typedef struct _PQprintOpt * will release both the val strings and the PQconninfoOption array itself. * ---------------- */ -typedef struct _PQconninfoOption -{ - char *keyword; /* The keyword of the option */ - char *envvar; /* Fallback environment variable name */ - char *compiled; /* Fallback compiled in default value */ - char *val; /* Option's current value, or NULL */ - char *label; /* Label for field in connect dialog */ - char *dispchar; /* Character to display for this field in - * a connect dialog. Values are: "" - * Display entered value as is "*" - * Password field - hide value "D" Debug - * option - don't show by default */ - int dispsize; /* Field size in characters for dialog */ -} PQconninfoOption; + typedef struct _PQconninfoOption + { + char *keyword; /* The keyword of the option */ + char *envvar; /* Fallback environment variable name */ + char *compiled; /* Fallback compiled in default value */ + char *val; /* Option's current value, or NULL */ + char *label; /* Label for field in connect dialog */ + char *dispchar; /* Character to display for this field in + * a connect dialog. Values are: "" + * Display entered value as is "*" + * Password field - hide value "D" Debug + * option - don't show by default */ + int dispsize; /* Field size in characters for dialog */ + } PQconninfoOption; /* ---------------- * PQArgBlock -- structure for PQfn() arguments * ---------------- */ -typedef struct -{ - int len; - int isint; - union + typedef struct { - int *ptr; /* can't use void (dec compiler barfs) */ - int integer; - } u; -} PQArgBlock; + int len; + int isint; + union + { + int *ptr; /* can't use void (dec compiler barfs) */ + int integer; + } u; + } PQArgBlock; /* ---------------- * Exported functions of libpq @@ -181,197 +181,198 @@ typedef struct /* make a new client connection to the backend */ /* Asynchronous (non-blocking) */ -extern PGconn *PQconnectStart(const char *conninfo); -extern PostgresPollingStatusType PQconnectPoll(PGconn *conn); + extern PGconn *PQconnectStart(const char *conninfo); + extern PostgresPollingStatusType PQconnectPoll(PGconn *conn); /* Synchronous (blocking) */ -extern PGconn *PQconnectdb(const char *conninfo); -extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport, - const char *pgoptions, const char *pgtty, - const char *dbName, - const char *login, const char *pwd); + extern PGconn *PQconnectdb(const char *conninfo); + extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport, + const char *pgoptions, const char *pgtty, + const char *dbName, + const char *login, const char *pwd); #define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \ PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL) /* close the current connection and free the PGconn data structure */ -extern void PQfinish(PGconn *conn); + extern void PQfinish(PGconn *conn); /* get info about connection options known to PQconnectdb */ -extern PQconninfoOption *PQconndefaults(void); + extern PQconninfoOption *PQconndefaults(void); /* free the data structure returned by PQconndefaults() */ -extern void PQconninfoFree(PQconninfoOption *connOptions); + extern void PQconninfoFree(PQconninfoOption *connOptions); /* * close the current connection and restablish a new one with the same * parameters */ /* Asynchronous (non-blocking) */ -extern int PQresetStart(PGconn *conn); -extern PostgresPollingStatusType PQresetPoll(PGconn *conn); + extern int PQresetStart(PGconn *conn); + extern PostgresPollingStatusType PQresetPoll(PGconn *conn); /* Synchronous (blocking) */ -extern void PQreset(PGconn *conn); + extern void PQreset(PGconn *conn); /* issue a cancel request */ -extern int PQrequestCancel(PGconn *conn); + extern int PQrequestCancel(PGconn *conn); /* Accessor functions for PGconn objects */ -extern char *PQdb(const PGconn *conn); -extern char *PQuser(const PGconn *conn); -extern char *PQpass(const PGconn *conn); -extern char *PQhost(const PGconn *conn); -extern char *PQport(const PGconn *conn); -extern char *PQtty(const PGconn *conn); -extern char *PQoptions(const PGconn *conn); -extern ConnStatusType PQstatus(const PGconn *conn); -extern char *PQerrorMessage(const PGconn *conn); -extern int PQsocket(const PGconn *conn); -extern int PQbackendPID(const PGconn *conn); -extern int PQclientEncoding(const PGconn *conn); -extern int PQsetClientEncoding(PGconn *conn, const char *encoding); + extern char *PQdb(const PGconn *conn); + extern char *PQuser(const PGconn *conn); + extern char *PQpass(const PGconn *conn); + extern char *PQhost(const PGconn *conn); + extern char *PQport(const PGconn *conn); + extern char *PQtty(const PGconn *conn); + extern char *PQoptions(const PGconn *conn); + extern ConnStatusType PQstatus(const PGconn *conn); + extern char *PQerrorMessage(const PGconn *conn); + extern int PQsocket(const PGconn *conn); + extern int PQbackendPID(const PGconn *conn); + extern int PQclientEncoding(const PGconn *conn); + extern int PQsetClientEncoding(PGconn *conn, const char *encoding); #ifdef USE_SSL /* Get the SSL structure associated with a connection */ -extern SSL *PQgetssl(PGconn *conn); + extern SSL *PQgetssl(PGconn *conn); #endif /* Enable/disable tracing */ -extern void PQtrace(PGconn *conn, FILE *debug_port); -extern void PQuntrace(PGconn *conn); + extern void PQtrace(PGconn *conn, FILE *debug_port); + extern void PQuntrace(PGconn *conn); /* Override default notice processor */ -extern PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, - PQnoticeProcessor proc, - void *arg); + extern PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, + PQnoticeProcessor proc, + void *arg); /* === in fe-exec.c === */ /* Quoting strings before inclusion in queries. */ -extern size_t PQescapeString(char *to, const char *from, size_t length); -extern unsigned char *PQescapeBytea(unsigned char *bintext, size_t binlen, - size_t *bytealen); + extern size_t PQescapeString(char *to, const char *from, size_t length); + extern unsigned char *PQescapeBytea(unsigned char *bintext, size_t binlen, + size_t *bytealen); /* Simple synchronous query */ -extern PGresult *PQexec(PGconn *conn, const char *query); -extern PGnotify *PQnotifies(PGconn *conn); -extern void PQfreeNotify(PGnotify *notify); + extern PGresult *PQexec(PGconn *conn, const char *query); + extern PGnotify *PQnotifies(PGconn *conn); + extern void PQfreeNotify(PGnotify *notify); /* Interface for multiple-result or asynchronous queries */ -extern int PQsendQuery(PGconn *conn, const char *query); -extern PGresult *PQgetResult(PGconn *conn); + extern int PQsendQuery(PGconn *conn, const char *query); + extern PGresult *PQgetResult(PGconn *conn); /* Routines for managing an asychronous query */ -extern int PQisBusy(PGconn *conn); -extern int PQconsumeInput(PGconn *conn); + extern int PQisBusy(PGconn *conn); + extern int PQconsumeInput(PGconn *conn); /* Routines for copy in/out */ -extern int PQgetline(PGconn *conn, char *string, int length); -extern int PQputline(PGconn *conn, const char *string); -extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize); -extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes); -extern int PQendcopy(PGconn *conn); + extern int PQgetline(PGconn *conn, char *string, int length); + extern int PQputline(PGconn *conn, const char *string); + extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize); + extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes); + extern int PQendcopy(PGconn *conn); /* Set blocking/nonblocking connection to the backend */ -extern int PQsetnonblocking(PGconn *conn, int arg); -extern int PQisnonblocking(const PGconn *conn); + extern int PQsetnonblocking(PGconn *conn, int arg); + extern int PQisnonblocking(const PGconn *conn); /* Force the write buffer to be written (or at least try) */ -extern int PQflush(PGconn *conn); + extern int PQflush(PGconn *conn); /* * "Fast path" interface --- not really recommended for application * use */ -extern PGresult *PQfn(PGconn *conn, - int fnid, - int *result_buf, - int *result_len, - int result_is_int, - const PQArgBlock *args, - int nargs); + extern PGresult *PQfn(PGconn *conn, + int fnid, + int *result_buf, + int *result_len, + int result_is_int, + const PQArgBlock *args, + int nargs); /* Accessor functions for PGresult objects */ -extern ExecStatusType PQresultStatus(const PGresult *res); -extern char *PQresStatus(ExecStatusType status); -extern char *PQresultErrorMessage(const PGresult *res); -extern int PQntuples(const PGresult *res); -extern int PQnfields(const PGresult *res); -extern int PQbinaryTuples(const PGresult *res); -extern char *PQfname(const PGresult *res, int field_num); -extern int PQfnumber(const PGresult *res, const char *field_name); -extern Oid PQftype(const PGresult *res, int field_num); -extern int PQfsize(const PGresult *res, int field_num); -extern int PQfmod(const PGresult *res, int field_num); -extern char *PQcmdStatus(PGresult *res); -extern char *PQoidStatus(const PGresult *res); /* old and ugly */ -extern Oid PQoidValue(const PGresult *res); /* new and improved */ -extern char *PQcmdTuples(PGresult *res); -extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num); -extern int PQgetlength(const PGresult *res, int tup_num, int field_num); -extern int PQgetisnull(const PGresult *res, int tup_num, int field_num); + extern ExecStatusType PQresultStatus(const PGresult *res); + extern char *PQresStatus(ExecStatusType status); + extern char *PQresultErrorMessage(const PGresult *res); + extern int PQntuples(const PGresult *res); + extern int PQnfields(const PGresult *res); + extern int PQbinaryTuples(const PGresult *res); + extern char *PQfname(const PGresult *res, int field_num); + extern int PQfnumber(const PGresult *res, const char *field_name); + extern Oid PQftype(const PGresult *res, int field_num); + extern int PQfsize(const PGresult *res, int field_num); + extern int PQfmod(const PGresult *res, int field_num); + extern char *PQcmdStatus(PGresult *res); + extern char *PQoidStatus(const PGresult *res); /* old and ugly */ + extern Oid PQoidValue(const PGresult *res); /* new and improved */ + extern char *PQcmdTuples(PGresult *res); + extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num); + extern int PQgetlength(const PGresult *res, int tup_num, int field_num); + extern int PQgetisnull(const PGresult *res, int tup_num, int field_num); /* Delete a PGresult */ -extern void PQclear(PGresult *res); + extern void PQclear(PGresult *res); /* * Make an empty PGresult with given status (some apps find this * useful). If conn is not NULL and status indicates an error, the * conn's errorMessage is copied. */ -extern PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status); + extern PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status); /* === in fe-print.c === */ -extern void PQprint(FILE *fout, /* output stream */ - const PGresult *res, - const PQprintOpt *ps); /* option structure */ + extern void PQprint(FILE *fout, /* output stream */ + const PGresult *res, + const PQprintOpt *ps); /* option structure */ /* * really old printing routines */ -extern void PQdisplayTuples(const PGresult *res, - FILE *fp, /* where to send the output */ - int fillAlign, /* pad the fields with - * spaces */ - const char *fieldSep, /* field separator */ - int printHeader, /* display headers? */ - int quiet); - -extern void PQprintTuples(const PGresult *res, - FILE *fout, /* output stream */ - int printAttName, /* print attribute names */ - int terseOutput, /* delimiter bars */ - int width); /* width of column, if - * 0, use variable width */ + extern void PQdisplayTuples(const PGresult *res, + FILE *fp, /* where to send the + * output */ + int fillAlign, /* pad the fields with + * spaces */ + const char *fieldSep, /* field separator */ + int printHeader, /* display headers? */ + int quiet); + + extern void PQprintTuples(const PGresult *res, + FILE *fout, /* output stream */ + int printAttName, /* print attribute names */ + int terseOutput, /* delimiter bars */ + int width); /* width of column, if + * 0, use variable width */ /* === in fe-lobj.c === */ /* Large-object access routines */ -extern int lo_open(PGconn *conn, Oid lobjId, int mode); -extern int lo_close(PGconn *conn, int fd); -extern int lo_read(PGconn *conn, int fd, char *buf, size_t len); -extern int lo_write(PGconn *conn, int fd, char *buf, size_t len); -extern int lo_lseek(PGconn *conn, int fd, int offset, int whence); -extern Oid lo_creat(PGconn *conn, int mode); -extern int lo_tell(PGconn *conn, int fd); -extern int lo_unlink(PGconn *conn, Oid lobjId); -extern Oid lo_import(PGconn *conn, const char *filename); -extern int lo_export(PGconn *conn, Oid lobjId, const char *filename); + extern int lo_open(PGconn *conn, Oid lobjId, int mode); + extern int lo_close(PGconn *conn, int fd); + extern int lo_read(PGconn *conn, int fd, char *buf, size_t len); + extern int lo_write(PGconn *conn, int fd, char *buf, size_t len); + extern int lo_lseek(PGconn *conn, int fd, int offset, int whence); + extern Oid lo_creat(PGconn *conn, int mode); + extern int lo_tell(PGconn *conn, int fd); + extern int lo_unlink(PGconn *conn, Oid lobjId); + extern Oid lo_import(PGconn *conn, const char *filename); + extern int lo_export(PGconn *conn, Oid lobjId, const char *filename); /* === in fe-misc.c === */ /* Determine length of multibyte encoded char at *s */ -extern int PQmblen(const unsigned char *s, int encoding); + extern int PQmblen(const unsigned char *s, int encoding); /* Get encoding id from environment variable PGCLIENTENCODING */ -extern int PQenv2encoding(void); + extern int PQenv2encoding(void); #ifdef __cplusplus } #endif -#endif /* LIBPQ_FE_H */ +#endif /* LIBPQ_FE_H */ diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 7001740d75..e4efc5e2e3 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -12,7 +12,7 @@ * 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.43 2001/11/02 20:51:27 tgl Exp $ + * $Id: libpq-int.h,v 1.44 2001/11/05 17:46:38 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ typedef struct pgresAttDesc Oid typid; /* type id */ int typlen; /* type size */ int atttypmod; /* type-specific modifier info */ -} PGresAttDesc; +} PGresAttDesc; /* Data for a single attribute of a single tuple */ @@ -108,7 +108,7 @@ typedef struct pgresAttValue int len; /* length in bytes of the value */ char *value; /* actual value, plus terminating zero * byte */ -} PGresAttValue; +} PGresAttValue; struct pg_result { @@ -165,7 +165,7 @@ typedef enum PGASYNC_READY, /* result ready for PQgetResult */ PGASYNC_COPY_IN, /* Copy In data transfer in progress */ PGASYNC_COPY_OUT /* Copy Out data transfer in progress */ -} PGAsyncStatusType; +} PGAsyncStatusType; /* PGSetenvStatusType defines the state of the PQSetenv state machine */ typedef enum @@ -176,7 +176,7 @@ typedef enum SETENV_STATE_ENCODINGS_SEND, /* About to send an "encodings" query */ SETENV_STATE_ENCODINGS_WAIT, /* Waiting for query to complete */ SETENV_STATE_IDLE -} PGSetenvStatusType; +} PGSetenvStatusType; /* large-object-access data ... allocated only if large-object code is used. */ typedef struct pgLobjfuncs @@ -189,7 +189,7 @@ typedef struct pgLobjfuncs Oid fn_lo_tell; /* OID of backend function lo_tell */ Oid fn_lo_read; /* OID of backend function LOread */ Oid fn_lo_write; /* OID of backend function LOwrite */ -} PGlobjfuncs; +} PGlobjfuncs; /* PGconn stores all the state data associated with a single connection * to a backend. @@ -365,4 +365,4 @@ __attribute__((format_arg(1))); #define SOCK_STRERROR strerror #endif -#endif /* LIBPQ_INT_H */ +#endif /* LIBPQ_INT_H */ diff --git a/src/interfaces/libpq/pqexpbuffer.h b/src/interfaces/libpq/pqexpbuffer.h index 1435b502b7..4ffc63eb8e 100644 --- a/src/interfaces/libpq/pqexpbuffer.h +++ b/src/interfaces/libpq/pqexpbuffer.h @@ -18,7 +18,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pqexpbuffer.h,v 1.9 2001/10/28 06:26:12 momjian Exp $ + * $Id: pqexpbuffer.h,v 1.10 2001/11/05 17:46:38 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -161,4 +161,4 @@ extern void appendPQExpBufferChar(PQExpBuffer str, char ch); extern void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen); -#endif /* PQEXPBUFFER_H */ +#endif /* PQEXPBUFFER_H */ diff --git a/src/interfaces/libpq/pqsignal.c b/src/interfaces/libpq/pqsignal.c index 526601fd28..224778f443 100644 --- a/src/interfaces/libpq/pqsignal.c +++ b/src/interfaces/libpq/pqsignal.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.13 2001/01/24 19:43:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.14 2001/11/05 17:46:38 momjian Exp $ * * NOTES * This shouldn't be in libpq, but the monitor and some other @@ -39,5 +39,5 @@ pqsignal(int signo, pqsigfunc func) if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; -#endif /* !HAVE_POSIX_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ } diff --git a/src/interfaces/libpq/pqsignal.h b/src/interfaces/libpq/pqsignal.h index d36165b4f7..b4ca6402c0 100644 --- a/src/interfaces/libpq/pqsignal.h +++ b/src/interfaces/libpq/pqsignal.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pqsignal.h,v 1.12 2001/10/28 06:26:12 momjian Exp $ + * $Id: pqsignal.h,v 1.13 2001/11/05 17:46:38 momjian Exp $ * * NOTES * This shouldn't be in libpq, but the monitor and some other @@ -24,4 +24,4 @@ typedef void (*pqsigfunc) (int); extern pqsigfunc pqsignal(int signo, pqsigfunc func); -#endif /* PQSIGNAL_H */ +#endif /* PQSIGNAL_H */ |
