[PATCH 1/6] psql: Abstract table formatting characters used for different line types.

From: Roger Leigh <rleigh(at)debian(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Roger Leigh <rleigh(at)debian(dot)org>
Subject: [PATCH 1/6] psql: Abstract table formatting characters used for different line types.
Date: 2009-08-22 15:59:45
Message-ID: 1250956790-18404-2-git-send-email-rleigh@debian.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

printTextLineFormat describes the characters used to draw vertical
lines across a horizontal rule at the left side, middle and right hand
side. These are included in the formatting for an entire table
(printTextFormat). The printTextRule enum is used as an offset into
the printTextFormat line rules (lrule), allowing specification of line
styles for the top, middle and bottom horizontal lines in a table.
The other printTextFormat members, hrule and vrule define the
formatting needed to draw horizontal and vertical rules.

Signed-off-by: Roger Leigh <rleigh(at)debian(dot)org>
---
src/bin/psql/print.h | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index 55122d7..ffca5d4 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -95,6 +95,27 @@ typedef struct printQueryOpt
* gettext on col i */
} printQueryOpt;

+typedef struct printTextLineFormat
+{
+ const char *leftvrule;
+ const char *midvrule;
+ const char *rightvrule;
+} printTextLineFormat;
+
+typedef struct printTextFormat
+{
+ printTextLineFormat lrule[3];
+ const char *hrule;
+ const char *vrule;
+} printTextFormat;
+
+typedef enum printTextRule
+{
+ PRINT_RULE_TOP,
+ PRINT_RULE_MIDDLE,
+ PRINT_RULE_BOTTOM
+} printTextRule;
+

extern FILE *PageOutput(int lines, unsigned short int pager);
extern void ClosePager(FILE *pagerpipe);
--
1.6.3.3

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roger Leigh 2009-08-22 15:59:46 [PATCH 2/6] psql: Add table formats for ASCII and UTF-8
Previous Message Roger Leigh 2009-08-22 15:59:44 Unicode UTF-8 table formatting for psql text output