From ba86864699997b0da780e15fd6be33c8a556e927 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 17 Jan 2016 17:16:03 -0600 Subject: Extend utf8 fontmetrics so ps can use them. Also, I forgot to check in uuid_show() last time. --- lib/lib.c | 11 +++++++++++ lib/lib.h | 5 ++++- lib/linestack.c | 36 +++++++++++++++++++++++++++++------- 3 files changed, 44 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/lib.c b/lib/lib.c index 871eda7e..955960ca 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -988,3 +988,14 @@ void create_uuid(char *uuid) // should never collide with anybody actually using a macaddr. uuid[11] |= 128; } + +char *show_uuid(char *uuid) +{ + char *out = libbuf; + int i; + + for (i=0; i<16; i++) out+=sprintf(out, "-%02x"+!(0x550&(1<width) str += utf8skip(str, len-width); + if (len>width) len = width; + + // Left pad if right justified + if (padto>0 && apad>len) printf("%*s", apad-len, ""); + crunch_str(&str, len, stdout, 0); + if (padto<0 && apad>len) printf("%*s", apad-len, ""); - s = start; - if (len > width) crunch_str(&s, len-width, 0, 0); - return crunch_str(&s, width, stdout, 0); + return (apad > len) ? apad : len; } -- cgit v1.2.3