author | Bruce Momjian | |
Thu, 12 Jun 2003 07:52:51 +0000 (07:52 +0000) | ||
committer | Bruce Momjian | |
Thu, 12 Jun 2003 07:52:51 +0000 (07:52 +0000) |
src/bin/psql/common.c | patch | blob | blame | history | |
src/bin/psql/print.c | patch | blob | blame | history | |
src/bin/psql/print.h | patch | blob | blame | history |
", pset.queryFout);
center>", fout);
+ fputs("
\"center\">", fout);
| \n", fout); html_escaped_print(*ptr, fout);
fputs(" }
for (i = 0, ptr = cells; *ptr; i++, ptr++)
{
if (i % col_count == 0)
- fputs(" + fputs(" - fprintf(fout, " ", opt_align[(i) % col_count] == 'r' ? "right" : "left");
| - if ((*ptr)[strspn(*ptr, " \t")] == '\0') /* is string only
- * whitespace? */
- fputs(" ", fout);
+ fprintf(fout, "
", opt_align[(i) % col_count] == 'r' ? "right" : "left");
| \n", fout);+ if ((*ptr)[strspn(*ptr, " \t")] == '\0') /* is string only whitespace? */
+ fputs(" ", fout);
else
html_escaped_print(*ptr, fout);
fputs(" /* print footers */
- if (footers && !opt_barebones)
+ if (!opt_barebones && footers && *footers)
+ {
+ fputs("
", fout); for (ptr = footers; *ptr; ptr++)
{
html_escaped_print(*ptr, fout);
- fputs("
\n", fout); + fputs("
/>\n", fout); }
-
+ fputs("", fout);
+ }
fputc('\n', fout);
}
unsigned int record = 1;
const char *const * ptr;
- fprintf(fout, "
/* print footers */
- if (footers && !opt_barebones)
+ if (!opt_barebones && footers && *footers)
+ {
+ fputs("
", fout); for (ptr = footers; *ptr; ptr++)
{
html_escaped_print(*ptr, fout);
- fputs("
\n", fout); + fputs("
/>\n", fout); }
-
+ fputs("", fout);
+ }
fputc('\n', fout);
}
char *align;
int i;
+
/* extract headers */
nfields = PQnfields(result);
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index e0ce3401d383b00bcb450ec2fb0533ab13e95069..a70e7858bbe741abb137968254ac81e82f185338 100644 (file)
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/print.h,v 1.16 2003/03/18 22:15:44 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/print.h,v 1.17 2003/06/12 07:52:51 momjian Exp $
*/
#ifndef PRINT_H
#define PRINT_H
extern FILE *PageOutput(int lines, unsigned short int pager);
+extern void html_escaped_print(const char *in, FILE *fout);
enum printFormat
{
|
---|