[PATCH 2/6] psql: Add table formats for ASCII and UTF-8 - Mailing list pgsql-hackers

From Roger Leigh
Subject [PATCH 2/6] psql: Add table formats for ASCII and UTF-8
Date
Msg-id 1250956790-18404-3-git-send-email-rleigh@debian.org
Whole thread Raw
In response to [PATCH 1/6] psql: Abstract table formatting characters used for different line types.  (Roger Leigh <rleigh@debian.org>)
List pgsql-hackers
Signed-off-by: Roger Leigh <rleigh@debian.org>
---src/bin/psql/print.c |   24 ++++++++++++++++++++++++1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 7505cd4..9dec77d 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -356,6 +356,30 @@ print_unaligned_vertical(const printTableContent *cont, FILE *fout)/* Aligned text
*//********************/
+static const printTextFormat asciiformat =
+{
+    {
+        { "+", "+", "+" },
+        { "+", "+", "+" },
+        { "+", "+", "+" }
+    },
+    "-",
+    "|"
+};
+
+static const struct printTextFormat utf8format =
+{
+    {
+      /* ┌, ┬, ┐ */
+      { "\342\224\214", "\342\224\254", "\342\224\220" },
+      /* ├, ┼, ┤ */
+      { "\342\224\234", "\342\224\274", "\342\224\244" },
+      /* └, ┴, ┘ */
+      { "\342\224\224", "\342\224\264", "\342\224\230" }
+    },
+    "\342\224\200", /* ─ */
+    "\342\224\202"  /* │ */
+};/* draw "line" */static void
-- 
1.6.3.3



pgsql-hackers by date:

Previous
From: Roger Leigh
Date:
Subject: [PATCH 9/9] psql: print_aligned_vertical: Correct indentation
Next
From: Roger Leigh
Date:
Subject: [PATCH 8/9] psql: print_aligned_vertical_line: Correct alignment