Rev 4874 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4874 | Rev 4921 | ||
---|---|---|---|
Line 17... | Line 17... | ||
17 | #endif |
17 | #endif |
Line 18... | Line 18... | ||
18 | 18 | ||
19 | int |
19 | int |
20 | _DEFUN (_mbtowc_r, (r, pwc, s, n, state), |
20 | _DEFUN (_mbtowc_r, (r, pwc, s, n, state), |
21 | struct _reent *r _AND |
21 | struct _reent *r _AND |
22 | wchar_t *pwc _AND |
22 | wchar_t *__restrict pwc _AND |
23 | const char *s _AND |
23 | const char *__restrict s _AND |
24 | size_t n _AND |
24 | size_t n _AND |
25 | mbstate_t *state) |
25 | mbstate_t *state) |
26 | { |
26 | { |
27 | return __mbtowc (r, pwc, s, n, __locale_charset (), state); |
27 | return __mbtowc (r, pwc, s, n, __locale_charset (), state); |
Line 76... | Line 76... | ||
76 | * Where possible, switches to JIS are grouped with proceding JIS characters and switches |
76 | * Where possible, switches to JIS are grouped with proceding JIS characters and switches |
77 | * to ASCII are grouped with preceding JIS characters. Thus, maximum returned length |
77 | * to ASCII are grouped with preceding JIS characters. Thus, maximum returned length |
78 | * is 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. |
78 | * is 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. |
79 | *************************************************************************************/ |
79 | *************************************************************************************/ |
Line -... | Line 80... | ||
- | 80 | ||
80 | 81 | #ifndef __CYGWIN__ |
|
81 | static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { |
82 | static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { |
82 | /* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ |
83 | /* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ |
83 | /* ASCII */ { A_ESC, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII }, |
84 | /* ASCII */ { A_ESC, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII }, |
84 | /* JIS */ { J_ESC, JIS_1, JIS_1, JIS_1, JIS_1, JIS_1, INV, JIS_1, INV }, |
85 | /* JIS */ { J_ESC, JIS_1, JIS_1, JIS_1, JIS_1, JIS_1, INV, JIS_1, INV }, |
Line 97... | Line 98... | ||
97 | /* A_ESC_DL */{ COPY_A, COPY_A, COPY_A, NOOP, NOOP, COPY_A, COPY_A, COPY_A, COPY_A}, |
98 | /* A_ESC_DL */{ COPY_A, COPY_A, COPY_A, NOOP, NOOP, COPY_A, COPY_A, COPY_A, COPY_A}, |
98 | /* JIS_1 */ { ERROR, COPY_J2, COPY_J2, COPY_J2, COPY_J2, COPY_J2, ERROR, COPY_J2, ERROR }, |
99 | /* JIS_1 */ { ERROR, COPY_J2, COPY_J2, COPY_J2, COPY_J2, COPY_J2, ERROR, COPY_J2, ERROR }, |
99 | /* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, |
100 | /* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, |
100 | /* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, MAKE_A, MAKE_A, ERROR, ERROR, ERROR }, |
101 | /* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, MAKE_A, MAKE_A, ERROR, ERROR, ERROR }, |
101 | }; |
102 | }; |
- | 103 | #endif /* !__CYGWIN__ */ |
|
Line 102... | Line 104... | ||
102 | 104 | ||
103 | /* we override the mbstate_t __count field for more complex encodings and use it store a state value */ |
105 | /* we override the mbstate_t __count field for more complex encodings and use it store a state value */ |
Line 104... | Line 106... | ||
104 | #define __state __count |
106 | #define __state __count |