summaryrefslogtreecommitdiff
path: root/pith/charconv
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2013-05-31 17:16:44 -0600
committerEduardo Chappa <chappa@washington.edu>2013-05-31 17:16:44 -0600
commita46157ba61f2c65f88b42abb31db60c4a714f87b (patch)
treee37bc41ad2f57b3fd2bad310576cc155a58ca6b7 /pith/charconv
parent81e994d7907f850506ddc248f84761a54995e58c (diff)
downloadalpine-a46157ba61f2c65f88b42abb31db60c4a714f87b.tar.xz
* somehow all.patch got here. Reversing.
Diffstat (limited to 'pith/charconv')
-rw-r--r--pith/charconv/utf8.c50
-rw-r--r--pith/charconv/utf8.h1
2 files changed, 0 insertions, 51 deletions
diff --git a/pith/charconv/utf8.c b/pith/charconv/utf8.c
index bca0d26b..411e1ddd 100644
--- a/pith/charconv/utf8.c
+++ b/pith/charconv/utf8.c
@@ -1049,56 +1049,6 @@ utf8_width(char *str)
/*
- * Returns the screen cells width of the UTF-8 string argument, treating tabs
- * in a special way.
- */
-unsigned
-utf8_widthis(char *str)
-{
- unsigned width = 0;
- int this_width;
- UCS ucs;
- unsigned long remaining_octets;
- char *readptr;
-
- if(!(str && *str))
- return(width);
-
- readptr = str;
- remaining_octets = readptr ? strlen(readptr) : 0;
-
- while(remaining_octets > 0 && *readptr){
-
- ucs = (UCS) utf8_get((unsigned char **) &readptr, &remaining_octets);
-
- if(ucs & U8G_ERROR){
- /*
- * This should not happen, but do something to handle it anyway.
- * Treat each character as a single width character, which is what should
- * probably happen when we actually go to write it out.
- */
- remaining_octets--;
- readptr++;
- this_width = 1;
- }
- else{
- this_width = (ucs == TAB) ? ((~width & 0x07) + 1) : wcellwidth(ucs);
-
- /*
- * If this_width is -1 that means we can't print this character
- * with our current locale. Writechar will print a '?'.
- */
- if(this_width < 0)
- this_width = 1;
- }
-
- width += (unsigned) this_width;
- }
-
- return(width);
-}
-
-/*
* Copy UTF-8 characters from src into dst.
* This is intended to be used if you want to truncate a string at
* the start instead of the end. For example, you have a long string
diff --git a/pith/charconv/utf8.h b/pith/charconv/utf8.h
index 09a2a95c..d22a8a7c 100644
--- a/pith/charconv/utf8.h
+++ b/pith/charconv/utf8.h
@@ -81,7 +81,6 @@ UCS *ucs4_strncat(UCS *ucs4dst, UCS *ucs4src, size_t n);
UCS *ucs4_strchr(UCS *s, UCS c);
UCS *ucs4_strrchr(UCS *s, UCS c);
unsigned utf8_width(char *);
-unsigned utf8_widthis(char *);
size_t utf8_to_width_rhs(char *, char *, size_t, unsigned);
int utf8_snprintf(char *, size_t, char *, ...);
size_t utf8_to_width(char *, char *, size_t, unsigned, unsigned *);