Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
wctype.c File Reference
#include <string.h>
#include <wctype.h>
Include dependency graph for wctype.c:

Go to the source code of this file.

Functions

wctype_t wctype (const char *s)
 

Function Documentation

◆ wctype()

wctype_t wctype ( const char *  s)

Definition at line 4 of file wctype.c.

5 {
6  wctype_t i;
7  const char* p;
8  /* order must match! */
9  static const char names[] = "alnum\0"
10  "alpha\0"
11  "blank\0"
12  "cntrl\0"
13  "digit\0"
14  "graph\0"
15  "lower\0"
16  "print\0"
17  "punct\0"
18  "space\0"
19  "upper\0"
20  "xdigit";
21  for(i = 1, p = names; *p; i++, p += 6)
22  {
23  if(*s == *p && !strcmp(s, p))
24  {
25  return i;
26  }
27  }
28  return 0;
29 }
int strcmp(const char *s1, const char *s2)
Compares two null-terminated byte strings lexicographically.
Definition: strcmp.c:12
unsigned long wctype_t
Definition: wctype.h:12

References strcmp().