diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2002-11-22 03:05:27 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2002-11-22 03:05:27 +0000 |
commit | c386ddb4d8a1b076d94ebe8b85ca5d0dd124892b (patch) | |
tree | e30c9d77393721491f4a3a42e223980352b72ff8 /extra/locale/gen_wc8bit.c | |
parent | 2b8a8dc7144328f301390f13fa560d29a410e34f (diff) |
Ok... here's the summary:
Hopefully locale support will build when cross compiling now. Collation is
still not supported, but that's what I'm currently working on. In the
next couple of days, I'll probably put up a couple of files for download
that will save people the trouble of generating all the glibc locales.
Added *wprintf functions, although they currently don't support floating
point. That will be fixed when I rewrite _dtostr... or possibly before.
Added the wcsto{inttype} functions.
Added iconv() and a mini iconv utility. The require locale support and
only provide for conversions involving the various unicode encodings
{ UCS-4*, UCS-2*, UTF-32*, UTF-16*, UTF-8 }, the 8-bit codesets built
with the locale data, and the internal WCHAR_T.
Diffstat (limited to 'extra/locale/gen_wc8bit.c')
-rw-r--r-- | extra/locale/gen_wc8bit.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/extra/locale/gen_wc8bit.c b/extra/locale/gen_wc8bit.c index 785c3f4c0..d76c15a51 100644 --- a/extra/locale/gen_wc8bit.c +++ b/extra/locale/gen_wc8bit.c @@ -7,6 +7,14 @@ #include <wctype.h> #include <limits.h> +#ifndef __UCLIBC__ +#ifndef _WCTYPE_H +#define _WCTYPE_H +#endif +#include "../../libc/sysdeps/linux/common/bits/uClibc_ctype.h" +#endif + + /* #define CTYPE_PACKED */ #define UPLOW_IDX_SHIFT 3 /* best if 2 unpacked or 3 packed */ @@ -63,34 +71,6 @@ typedef struct { unsigned char c2wc_idx[C2WC_IDX_LEN]; } charset_data; -/* Taking advantage of the C99 mutual-exclusion guarantees for the various - * (w)ctype classes, including the descriptions of printing and control - * (w)chars, we can place each in one of the following mutually-exlusive - * subsets. Since there are less than 16, we can store the data for - * each (w)chars in a nibble. In contrast, glibc uses an unsigned int - * per (w)char, with one bit flag for each is* type. While this allows - * a simple '&' operation to determine the type vs. a range test and a - * little special handling for the "blank" and "xdigit" types in my - * approach, it also uses 8 times the space for the tables on the typical - * 32-bit archs we supported.*/ -enum { - __CTYPE_unclassified = 0, - __CTYPE_alpha_nonupper_nonlower, - __CTYPE_alpha_lower, - __CTYPE_alpha_upper_lower, - __CTYPE_alpha_upper, - __CTYPE_digit, - __CTYPE_punct, - __CTYPE_graph, - __CTYPE_print_space_nonblank, - __CTYPE_print_space_blank, - __CTYPE_space_nonblank_noncntrl, - __CTYPE_space_blank_noncntrl, - __CTYPE_cntrl_space_nonblank, - __CTYPE_cntrl_space_blank, - __CTYPE_cntrl_nonspace, -}; - int main(int argc, char **argv) { FILE *fp; |