Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.6 KB
|
Rev | Line | |
---|
[444] | 1 | /* |
---|
| 2 | FUNCTION |
---|
| 3 | <<iswctype>>, <<iswctype_l>>---extensible wide-character test |
---|
| 4 | |
---|
| 5 | INDEX |
---|
| 6 | iswctype |
---|
| 7 | |
---|
| 8 | INDEX |
---|
| 9 | iswctype_l |
---|
| 10 | |
---|
| 11 | SYNOPSIS |
---|
| 12 | #include <wctype.h> |
---|
| 13 | int iswctype(wint_t <[c]>, wctype_t <[desc]>); |
---|
| 14 | |
---|
| 15 | #include <wctype.h> |
---|
| 16 | int iswctype_l(wint_t <[c]>, wctype_t <[desc]>, locale_t <[locale]>); |
---|
| 17 | |
---|
| 18 | DESCRIPTION |
---|
| 19 | <<iswctype>> is a function which classifies wide-character values using the |
---|
| 20 | wide-character test specified by <[desc]>. |
---|
| 21 | |
---|
| 22 | <<iswctype_l>> is like <<iswctype>> but performs the check based on the |
---|
| 23 | locale specified by the locale object locale. If <[locale]> is |
---|
| 24 | LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined. |
---|
| 25 | |
---|
| 26 | RETURNS |
---|
| 27 | <<iswctype>>, <<iswctype_l>> return non-zero if and only if <[c]> matches |
---|
| 28 | the test specified by <[desc]>. If <[desc]> is unknown, zero is returned. |
---|
| 29 | |
---|
| 30 | PORTABILITY |
---|
| 31 | <<iswctype>> is C99. |
---|
| 32 | <<iswctype_l>> is POSIX-1.2008. |
---|
| 33 | |
---|
| 34 | No supporting OS subroutines are required. |
---|
| 35 | */ |
---|
| 36 | #include <_ansi.h> |
---|
| 37 | #include <wctype.h> |
---|
| 38 | #include "local.h" |
---|
| 39 | |
---|
| 40 | int |
---|
| 41 | iswctype (wint_t c, wctype_t desc) |
---|
| 42 | { |
---|
| 43 | switch (desc) |
---|
| 44 | { |
---|
| 45 | case WC_ALNUM: |
---|
| 46 | return iswalnum (c); |
---|
| 47 | case WC_ALPHA: |
---|
| 48 | return iswalpha (c); |
---|
| 49 | case WC_BLANK: |
---|
| 50 | return iswblank (c); |
---|
| 51 | case WC_CNTRL: |
---|
| 52 | return iswcntrl (c); |
---|
| 53 | case WC_DIGIT: |
---|
| 54 | return iswdigit (c); |
---|
| 55 | case WC_GRAPH: |
---|
| 56 | return iswgraph (c); |
---|
| 57 | case WC_LOWER: |
---|
| 58 | return iswlower (c); |
---|
| 59 | case WC_PRINT: |
---|
| 60 | return iswprint (c); |
---|
| 61 | case WC_PUNCT: |
---|
| 62 | return iswpunct (c); |
---|
| 63 | case WC_SPACE: |
---|
| 64 | return iswspace (c); |
---|
| 65 | case WC_UPPER: |
---|
| 66 | return iswupper (c); |
---|
| 67 | case WC_XDIGIT: |
---|
| 68 | return iswxdigit (c); |
---|
| 69 | default: |
---|
| 70 | return 0; /* eliminate warning */ |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | /* otherwise unknown */ |
---|
| 74 | return 0; |
---|
| 75 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.