Welcome to mirror list, hosted at ThFree Co, Russian Federation.

iswctype.c « ctype « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fbf5da7be31f4488de153821691172eb70dfbecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
FUNCTION
	<<iswctype>>---extensible wide-character test

INDEX
	iswctype

ANSI_SYNOPSIS
	#include <wctype.h>
	int iswctype(wint_t <[c]>, wctype_t <[desc]>);

TRAD_SYNOPSIS
	#include <wctype.h>
	int iswctype(<[c]>, <[desc]>)
	wint_t <[c]>;
	wctype_t <[desc]>;

DESCRIPTION
<<iswctype>> is a function which classifies wide-character values using the
wide-character test specified by <[desc]>.

RETURNS
<<iswctype>> returns non-zero if and only if <[c]> matches the test specified by <[desc]>.
If <[desc]> is unknown, zero is returned.

PORTABILITY
<<iswctype>> is C99.

No supporting OS subroutines are required.
*/
#include <_ansi.h>
#include <wctype.h>
#include "local.h"

int
_DEFUN(iswctype,(c, desc), wint_t c _AND wctype_t desc)
{
  switch (desc)
    {
    case WC_ALNUM:
      return iswalnum (c);
    case WC_ALPHA:
      return iswalpha (c);
    case WC_BLANK:
      return iswblank (c);
    case WC_CNTRL:
      return iswcntrl (c);
    case WC_DIGIT:
      return iswdigit (c);
    case WC_GRAPH:
      return iswgraph (c);
    case WC_LOWER:
      return iswlower (c);
    case WC_PRINT:
      return iswprint (c);
    case WC_PUNCT:
      return iswpunct (c);
    case WC_SPACE:
      return iswspace (c);
    case WC_UPPER:
      return iswupper (c);
    case WC_XDIGIT:
      return iswxdigit (c);
    default:
    }

  /* otherwise unknown */
  return 0;
}