drm/ast: Only warn about unsupported TX chips on Gen4 and later
[drm/drm-misc.git] / tools / include / nolibc / ctype.h
blob6f90706d06442d87e262cf36c00ce7fe61972dbf
1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /*
3 * ctype function definitions for NOLIBC
4 * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5 */
7 #ifndef _NOLIBC_CTYPE_H
8 #define _NOLIBC_CTYPE_H
10 #include "std.h"
13 * As much as possible, please keep functions alphabetically sorted.
16 static __attribute__((unused))
17 int isascii(int c)
19 /* 0x00..0x7f */
20 return (unsigned int)c <= 0x7f;
23 static __attribute__((unused))
24 int isblank(int c)
26 return c == '\t' || c == ' ';
29 static __attribute__((unused))
30 int iscntrl(int c)
32 /* 0x00..0x1f, 0x7f */
33 return (unsigned int)c < 0x20 || c == 0x7f;
36 static __attribute__((unused))
37 int isdigit(int c)
39 return (unsigned int)(c - '0') < 10;
42 static __attribute__((unused))
43 int isgraph(int c)
45 /* 0x21..0x7e */
46 return (unsigned int)(c - 0x21) < 0x5e;
49 static __attribute__((unused))
50 int islower(int c)
52 return (unsigned int)(c - 'a') < 26;
55 static __attribute__((unused))
56 int isprint(int c)
58 /* 0x20..0x7e */
59 return (unsigned int)(c - 0x20) < 0x5f;
62 static __attribute__((unused))
63 int isspace(int c)
65 /* \t is 0x9, \n is 0xA, \v is 0xB, \f is 0xC, \r is 0xD */
66 return ((unsigned int)c == ' ') || (unsigned int)(c - 0x09) < 5;
69 static __attribute__((unused))
70 int isupper(int c)
72 return (unsigned int)(c - 'A') < 26;
75 static __attribute__((unused))
76 int isxdigit(int c)
78 return isdigit(c) || (unsigned int)(c - 'A') < 6 || (unsigned int)(c - 'a') < 6;
81 static __attribute__((unused))
82 int isalpha(int c)
84 return islower(c) || isupper(c);
87 static __attribute__((unused))
88 int isalnum(int c)
90 return isalpha(c) || isdigit(c);
93 static __attribute__((unused))
94 int ispunct(int c)
96 return isgraph(c) && !isalnum(c);
99 /* make sure to include all global symbols */
100 #include "nolibc.h"
102 #endif /* _NOLIBC_CTYPE_H */