Skip to content

Commit 7f34bdd

Browse files
committed
More sync ups...
1 parent 2d6dec8 commit 7f34bdd

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/interfaces/libpq/libpq-fe.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: libpq-fe.h,v 1.5 1996/07/31 18:40:12 scrappy Exp $
9+
* $Id: libpq-fe.h,v 1.5.2.1 1996/08/28 01:13:37 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -45,7 +45,7 @@ typedef enum {
4545
} ExecStatusType;
4646

4747
/* string descriptions of the ExecStatusTypes */
48-
extern char* pgresStatus[];
48+
extern const char* pgresStatus[];
4949

5050
/*
5151
* POSTGRES backend dependent Constants.
@@ -83,6 +83,9 @@ typedef struct pgresAttDesc {
8383
For binary tuples, the first four bytes of the value is the size,
8484
and the bytes afterwards are the value. The binary value is
8585
not guaranteed to be null-terminated. In fact, it can have embedded nulls*/
86+
87+
#define NULL_LEN (-1) /* pg_result len for NULL value */
88+
8689
typedef struct pgresAttValue {
8790
int len; /* length in bytes of the value */
8891
char *value; /* actual value */
@@ -144,8 +147,8 @@ typedef struct _PQprintOpt PQprintOpt;
144147

145148
/* === in fe-connect.c === */
146149
/* make a new client connection to the backend */
147-
extern PGconn* PQsetdb(char* pghost, char* pgport, char* pgoptions,
148-
char* pgtty, char* dbName);
150+
extern PGconn* PQsetdb(const char* pghost, const char* pgport, const char* pgoptions,
151+
const char* pgtty, const char* dbName);
149152
/* close the current connection and free the PGconn data structure */
150153
extern void PQfinish(PGconn* conn);
151154
/* close the current connection and restablish a new one with the same
@@ -163,27 +166,28 @@ extern void PQtrace(PGconn *conn, FILE* debug_port);
163166
extern void PQuntrace(PGconn *conn);
164167

165168
/* === in fe-exec.c === */
166-
extern PGresult* PQexec(PGconn* conn, char* query);
169+
extern PGresult* PQexec(PGconn* conn, const char* query);
167170
extern int PQgetline(PGconn *conn, char* string, int length);
168171
extern int PQendcopy(PGconn *conn);
169-
extern void PQputline(PGconn *conn, char* string);
172+
extern void PQputline(PGconn *conn, const char* string);
170173
extern ExecStatusType PQresultStatus(PGresult* res);
171174
extern int PQntuples(PGresult *res);
172175
extern int PQnfields(PGresult *res);
173176
extern char* PQfname(PGresult *res, int field_num);
174-
extern int PQfnumber(PGresult *res, char* field_name);
177+
extern int PQfnumber(PGresult *res, const char* field_name);
175178
extern Oid PQftype(PGresult *res, int field_num);
176179
extern int2 PQfsize(PGresult *res, int field_num);
177180
extern char* PQcmdStatus(PGresult *res);
178-
extern char* PQoidStatus(PGresult *res);
181+
extern const char* PQoidStatus(PGresult *res);
179182
extern char* PQgetvalue(PGresult *res, int tup_num, int field_num);
180183
extern int PQgetlength(PGresult *res, int tup_num, int field_num);
184+
extern int PQgetisnull(PGresult *res, int tup_num, int field_num);
181185
extern void PQclear(PGresult* res);
182186
/* PQdisplayTuples() is a better version of PQprintTuples() */
183187
extern void PQdisplayTuples(PGresult *res,
184188
FILE *fp, /* where to send the output */
185189
int fillAlign, /* pad the fields with spaces */
186-
char *fieldSep, /* field separator */
190+
const char *fieldSep, /* field separator */
187191
int printHeader, /* display headers? */
188192
int quiet);
189193
extern void PQprintTuples(PGresult* res,
@@ -207,7 +211,7 @@ extern PGresult* PQfn(PGconn* conn,
207211
int nargs);
208212
/* === in fe-auth.c === */
209213
extern MsgType fe_getauthsvc(char* PQerrormsg);
210-
extern void fe_setauthsvc(char *name, char* PQerrormsg);
214+
extern void fe_setauthsvc(const char *name, char* PQerrormsg);
211215
extern char *fe_getauthname(char* PQerrormsg);
212216

213217
/* === in fe-misc.c === */
@@ -217,8 +221,8 @@ extern char *fe_getauthname(char* PQerrormsg);
217221
*/
218222
extern int pqGets(char* s, int maxlen, FILE* stream, FILE* debug);
219223
extern int pqGetnchar(char* s, int maxlen, FILE* stream, FILE* debug);
220-
extern int pqPutnchar(char* s, int maxlen, FILE* stream, FILE* debug);
221-
extern int pqPuts(char* s, FILE* stream, FILE* debug );
224+
extern int pqPutnchar(const char* s, int maxlen, FILE* stream, FILE* debug);
225+
extern int pqPuts(const char* s, FILE* stream, FILE* debug );
222226
extern int pqGetc(FILE* stream, FILE *debug);
223227
/* get a n-byte integer from the stream into result */
224228
/* returns 0 if successful */

0 commit comments

Comments
 (0)