1 /* vi: set sw=4 ts=4: */
3 * Licensed under the GPL version 2, see the file LICENSE in this tarball.
14 #if !ENABLE_FEATURE_ASSUME_UNICODE
16 # define unicode_strlen(string) strlen(string)
17 # define unicode_status UNICODE_OFF
18 # define init_unicode() ((void)0)
22 size_t FAST_FUNC unicode_strlen(const char *string);
24 UNI_FLAG_PAD = (1 << 0),
26 typedef struct uni_stat_t {
28 unsigned unicode_count;
29 unsigned unicode_width;
31 //UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src);
32 //UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags);
33 char* FAST_FUNC unicode_conv_to_printable(uni_stat_t *stats, const char *src);
34 char* FAST_FUNC unicode_conv_to_printable_maxwidth(uni_stat_t *stats, const char *src, unsigned maxwidth);
35 char* FAST_FUNC unicode_conv_to_printable_fixedwidth(uni_stat_t *stats, const char *src, unsigned width);
37 # if ENABLE_LOCALE_SUPPORT
41 extern uint8_t unicode_status;
42 void init_unicode(void) FAST_FUNC;
46 /* Homegrown Unicode support. It knows only C and Unicode locales. */
48 # if !ENABLE_FEATURE_CHECK_UNICODE_IN_ENV
49 # define unicode_status UNICODE_ON
50 # define init_unicode() ((void)0)
52 extern uint8_t unicode_status;
53 void init_unicode(void) FAST_FUNC;
59 /* Prevent name collisions */
60 # define wint_t bb_wint_t
61 # define mbstate_t bb_mbstate_t
62 # define mbstowcs bb_mbstowcs
63 # define wcstombs bb_wcstombs
64 # define wcrtomb bb_wcrtomb
65 # define iswspace bb_iswspace
66 # define iswalnum bb_iswalnum
67 # define iswpunct bb_iswpunct
68 # define wcwidth bb_wcwidth
70 typedef int32_t wint_t;
75 size_t mbstowcs(wchar_t *dest, const char *src, size_t n) FAST_FUNC;
76 size_t wcstombs(char *dest, const wchar_t *src, size_t n) FAST_FUNC;
77 size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps) FAST_FUNC;
78 int iswspace(wint_t wc) FAST_FUNC;
79 int iswalnum(wint_t wc) FAST_FUNC;
80 int iswpunct(wint_t wc) FAST_FUNC;
83 # endif /* !LOCALE_SUPPORT */
85 #endif /* FEATURE_ASSUME_UNICODE */