summaryrefslogtreecommitdiff
path: root/src/bin/psql/print.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-11-11 00:10:14 +0000
committerBruce Momjian <bruce@momjian.us>1999-11-11 00:10:14 +0000
commit2a24ec6f167a21ef074609e165d77f1f7c715259 (patch)
tree579eb1fde3baf6cf0edd60d62e3c5bf7a60698cf /src/bin/psql/print.h
parentc6c60302ba45ac89440ec7e2a4e1c5de3a1a61c2 (diff)
downloadpostgresql-2a24ec6f167a21ef074609e165d77f1f7c715259.tar.gz
In the spirit of TODO item
* Add use of 'const' for varibles in source tree (which is misspelled, btw.) I went through the front-end libpq code and did so. This affects in particular the various accessor functions (such as PQdb() and PQgetvalue()) as well as, by necessity, the internal helpers they use. I have been really thorough in that regard, perhaps some people will find it annoying that things like char * foo = PQgetvalue(res, 0, 0) will generate a warning. On the other hand it _should_ generate one. This is no real compatibility break, although a few clients will have to be fixed to suppress warnings. (Which again would be in the spirit of the above TODO.) In addition I replaced some int's by size_t's and removed some warnings (and generated some new ones -- grmpf!). Also I rewrote PQoidStatus (so it actually honors the const!) and supplied a new function PQoidValue that returns a proper Oid type. This is only front-end stuff, none of the communicaton stuff was touched. The psql patch also adds some new consts to honor the new libpq situation, as well as fixes a fatal condition that resulted when using the -V (--version) option and there is no database listening. So, to summarize, the psql you should definitely put in (with or without the libpq). If you think I went too far with the const-mania in libpq, let me know and I'll make adjustments. If you approve it, I will also update the docs. -Peter -- Peter Eisentraut Sernanders vaeg 10:115
Diffstat (limited to 'src/bin/psql/print.h')
-rw-r--r--src/bin/psql/print.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index 64d0271f50..5b1c7671b1 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -44,7 +44,8 @@ typedef struct _printTableOpt
* - align is an 'l' or an 'r' for every column, if the output format needs it.
* (You must specify this long enough. Otherwise anything could happen.)
*/
-void printTable(const char *title, char **headers, char **cells, char **footers,
+void printTable(const char *title, const char * const * headers,
+ const char * const * cells, const char * const * footers,
const char *align,
const printTableOpt * opt, FILE *fout);
@@ -66,7 +67,7 @@ typedef struct _printQueryOpt
* It calls the printTable above with all the things set straight.
*/
void
- printQuery(PGresult *result, const printQueryOpt * opt, FILE *fout);
+printQuery(const PGresult *result, const printQueryOpt * opt, FILE *fout);
#endif /* PRINT_H */