summaryrefslogtreecommitdiff
path: root/src/bin/psql/mbprint.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-03-18 22:15:44 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-03-18 22:15:44 +0000
commitcf1cf8964925cd36dc7bf034a968a4e44ede382a (patch)
treef80bcdd31d3af6f1783ea382e277130db22d6093 /src/bin/psql/mbprint.c
parent9384dc6e597baf53d3aa07343163ec7011e6181a (diff)
Make the printing code somewhat more independent by not relying on
functions and global variables from the rest of psql. Also clean up some data type mismatches created by the last pager patch.
Diffstat (limited to 'src/bin/psql/mbprint.c')
-rw-r--r--src/bin/psql/mbprint.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bin/psql/mbprint.c b/src/bin/psql/mbprint.c
index c91b71c9c5b..692f60bf775 100644
--- a/src/bin/psql/mbprint.c
+++ b/src/bin/psql/mbprint.c
@@ -3,14 +3,13 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/mbprint.c,v 1.5 2002/10/03 17:09:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/mbprint.c,v 1.6 2003/03/18 22:15:44 petere Exp $
*/
#include "postgres_fe.h"
#include "mbprint.h"
#include "mb/pg_wchar.h"
-#include "settings.h"
/*
* This is an implementation of wcwidth() and wcswidth() as defined in
@@ -310,9 +309,9 @@ mb_utf_validate(unsigned char *pwcs)
*/
int
-pg_wcswidth(unsigned char *pwcs, size_t len)
+pg_wcswidth(unsigned char *pwcs, size_t len, int encoding)
{
- if (pset.encoding == PG_UTF8)
+ if (encoding == PG_UTF8)
return mb_utf_wcswidth(pwcs, len);
else
{
@@ -325,9 +324,9 @@ pg_wcswidth(unsigned char *pwcs, size_t len)
}
unsigned char *
-mbvalidate(unsigned char *pwcs)
+mbvalidate(unsigned char *pwcs, int encoding)
{
- if (pset.encoding == PG_UTF8)
+ if (encoding == PG_UTF8)
return mb_utf_validate(pwcs);
else
{