summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-11-02 17:35:30 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-11-02 17:39:52 +0100
commitc339d9775d1df19fdbbafc57486f7cd51af6b7fb (patch)
treee0689a930c57e861641308340165d9f7431ab24e /src/shared/util.h
parent0901758558506273c0b7553dc3cae587f2b94290 (diff)
util : fallback to plain ASCII drawing if locale is not UTF-8
When printing cgroup and sysfs hierarchies, avoid using UTF-8 box drawing characters if the locale is not UTF-8. https://bugzilla.redhat.com/show_bug.cgi?id=871153
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index b979b0e89f..e387b1268a 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -600,3 +600,12 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
void *arg);
bool is_locale_utf8(void);
+
+typedef enum DrawSpecialChar {
+ DRAW_BOX_VERT,
+ DRAW_BOX_VERT_AND_RIGHT,
+ DRAW_BOX_UP_AND_RIGHT,
+ DRAW_TRIANGULAR_BULLET,
+ _DRAW_SPECIAL_CHAR_MAX
+} DrawSpecialChar;
+const char *draw_special_char(DrawSpecialChar ch);