From 5c8c9f5e3123334e4816f1b26141daa85c77b504 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 13 Feb 2020 11:24:29 +0900 Subject: regexp: More removal from unused utf8 functions. Signed-off-by: NIIBE Yutaka --- regexp/utf8.h | 59 ----------------------------------------------------------- 1 file changed, 59 deletions(-) (limited to 'regexp/utf8.h') diff --git a/regexp/utf8.h b/regexp/utf8.h index 841b806f1..7b62d5539 100644 --- a/regexp/utf8.h +++ b/regexp/utf8.h @@ -28,17 +28,11 @@ int utf8_fromunicode(char *p, unsigned uc); #include /* No utf-8 support. 1 byte = 1 char */ -#define utf8_strlen(S, B) ((B) < 0 ? (int)strlen(S) : (B)) -#define utf8_strwidth(S, B) utf8_strlen((S), (B)) #define utf8_tounicode(S, CP) (*(CP) = (unsigned char)*(S), 1) #define utf8_getchars(CP, C) (*(CP) = (C), 1) #define utf8_upper(C) toupper(C) -#define utf8_title(C) toupper(C) -#define utf8_lower(C) tolower(C) #define utf8_index(C, I) (I) #define utf8_charlen(C) 1 -#define utf8_prev_len(S, L) 1 -#define utf8_width(C) 1 #else #if !defined(JIM_BOOTSTRAP) @@ -53,25 +47,6 @@ int utf8_fromunicode(char *p, unsigned uc); */ int utf8_charlen(int c); -/** - * Returns the number of characters in the utf-8 - * string of the given byte length. - * - * Any bytes which are not part of an valid utf-8 - * sequence are treated as individual characters. - * - * The string *must* be null terminated. - * - * Does not support unicode code points > \u1fffff - */ -int utf8_strlen(const char *str, int bytelen); - -/** - * Calculates the display width of the first 'charlen' characters in 'str'. - * See utf8_width() - */ -int utf8_strwidth(const char *str, int charlen); - /** * Returns the byte index of the given character in the utf-8 string. * @@ -98,46 +73,12 @@ int utf8_index(const char *str, int charindex); */ int utf8_tounicode(const char *str, int *uc); -/** - * Returns the number of bytes before 'str' that the previous - * utf-8 character sequence starts (which may be the middle of a sequence). - * - * Looks back at most 'len' bytes backwards, which must be > 0. - * If no start char is found, returns -len - */ -int utf8_prev_len(const char *str, int len); - /** * Returns the upper-case variant of the given unicode codepoint. * * Unicode code points > \uffff are returned unchanged. */ int utf8_upper(int uc); - -/** - * Returns the title-case variant of the given unicode codepoint. - * - * If none, returns utf8_upper(). - * - * Unicode code points > \uffff are returned unchanged. - */ -int utf8_title(int uc); - -/** - * Returns the lower-case variant of the given unicode codepoint. - * - * NOTE: Use utf8_upper() in preference for case-insensitive matching. - * - * Unicode code points > \uffff are returned unchanged. - */ -int utf8_lower(int uc); - -/** - * Returns the width (in characters) of the given unicode codepoint. - * This is 1 for normal letters and 0 for combining characters and 2 for wide characters. - */ -int utf8_width(int ch); - #endif /* JIM_BOOTSTRAP */ #endif -- cgit v1.2.3