Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
ctype.h
Go to the documentation of this file.
1/*
2
3MIT License
4
5Copyright (c) 2026 PCSX-Redux authors
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26
27#pragma once
28
29static __inline__ int isascii(int c) { return (c & 0x80) == 0; }
30static __inline__ int isblank(int c) { return c == ' ' || c == '\t'; }
31static __inline__ int isdigit(int c) { return c >= '0' && c <= '9'; }
32static __inline__ int iscntrl(int c) { return c < 32; }
33static __inline__ int islower(int c) { return c >= 'a' && c <= 'z'; }
34static __inline__ int isspace(int c) {
35 return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
36}
37static __inline__ int isupper(int c) { return c >= 'A' && c <= 'Z'; }
38static __inline__ int isxdigit(int c) { return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); }
39
40static __inline__ int isalpha(int c) { return isupper(c) || islower(c); }
41static __inline__ int isalnum(int c) { return isalpha(c) || isdigit(c); }
42static __inline__ int isgraph(int c) { return !iscntrl(c) && !isspace(c); }
43static __inline__ int isprint(int c) { return !iscntrl(c); }
44static __inline__ int ispunct(int c) { return !iscntrl(c) && !isspace(c) && !isalnum(c); }
45
46static __inline__ int toupper(int c) { return islower(c) ? c & ~0x20 : c; }
47static __inline__ int tolower(int c) { return isupper(c) ? c | 0x20 : c; }
static int c
Definition syscalls.h:122