OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-newlib/] [newlib-1.17.0/] [newlib/] [libc/] [ctype/] [iswctype.c] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jlechner
/*
2
FUNCTION
3
        <<iswctype>>---extensible wide-character test
4
 
5
INDEX
6
        iswctype
7
 
8
ANSI_SYNOPSIS
9
        #include <wctype.h>
10
        int iswctype(wint_t <[c]>, wctype_t <[desc]>);
11
 
12
TRAD_SYNOPSIS
13
        #include <wctype.h>
14
        int iswctype(<[c]>, <[desc]>)
15
        wint_t <[c]>;
16
        wctype_t <[desc]>;
17
 
18
DESCRIPTION
19
<<iswctype>> is a function which classifies wide-character values using the
20
wide-character test specified by <[desc]>.
21
 
22
RETURNS
23
<<iswctype>> returns non-zero if and only if <[c]> matches the test specified by <[desc]>.
24
If <[desc]> is unknown, zero is returned.
25
 
26
PORTABILITY
27
<<iswctype>> is C99.
28
 
29
No supporting OS subroutines are required.
30
*/
31
#include <_ansi.h>
32
#include <wctype.h>
33
#include "local.h"
34
 
35
int
36
_DEFUN(iswctype,(c, desc), wint_t c _AND wctype_t desc)
37
{
38
  switch (desc)
39
    {
40
    case WC_ALNUM:
41
      return iswalnum (c);
42
    case WC_ALPHA:
43
      return iswalpha (c);
44
    case WC_BLANK:
45
      return iswblank (c);
46
    case WC_CNTRL:
47
      return iswcntrl (c);
48
    case WC_DIGIT:
49
      return iswdigit (c);
50
    case WC_GRAPH:
51
      return iswgraph (c);
52
    case WC_LOWER:
53
      return iswlower (c);
54
    case WC_PRINT:
55
      return iswprint (c);
56
    case WC_PUNCT:
57
      return iswpunct (c);
58
    case WC_SPACE:
59
      return iswspace (c);
60
    case WC_UPPER:
61
      return iswupper (c);
62
    case WC_XDIGIT:
63
      return iswxdigit (c);
64
    default:
65
      return 0; /* eliminate warning */
66
    }
67
 
68
  /* otherwise unknown */
69
  return 0;
70
}
71
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.