PKUOS - Pintos
Pintos source browser for PKU Operating System course
ctype.h
Go to the documentation of this file.
1#ifndef __LIB_CTYPE_H
2#define __LIB_CTYPE_H
3
4static inline int islower (int c) { return c >= 'a' && c <= 'z'; }
5static inline int isupper (int c) { return c >= 'A' && c <= 'Z'; }
6static inline int isalpha (int c) { return islower (c) || isupper (c); }
7static inline int isdigit (int c) { return c >= '0' && c <= '9'; }
8static inline int isalnum (int c) { return isalpha (c) || isdigit (c); }
9static inline int isxdigit (int c) {
10 return isdigit (c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
11}
12static inline int isspace (int c) {
13 return (c == ' ' || c == '\f' || c == '\n'
14 || c == '\r' || c == '\t' || c == '\v');
15}
16static inline int isblank (int c) { return c == ' ' || c == '\t'; }
17static inline int isgraph (int c) { return c > 32 && c < 127; }
18static inline int isprint (int c) { return c >= 32 && c < 127; }
19static inline int iscntrl (int c) { return (c >= 0 && c < 32) || c == 127; }
20static inline int isascii (int c) { return c >= 0 && c < 128; }
21static inline int ispunct (int c) {
22 return isprint (c) && !isalnum (c) && !isspace (c);
23}
24
25static inline int tolower (int c) { return isupper (c) ? c - 'A' + 'a' : c; }
26static inline int toupper (int c) { return islower (c) ? c - 'a' + 'A' : c; }
27
28#endif /**< lib/ctype.h */
static int islower(int c)
Definition: ctype.h:4
static int isupper(int c)
Definition: ctype.h:5
static int tolower(int c)
Definition: ctype.h:25
static int iscntrl(int c)
Definition: ctype.h:19
static int isascii(int c)
Definition: ctype.h:20
static int isalnum(int c)
Definition: ctype.h:8
static int isgraph(int c)
Definition: ctype.h:17
static int isspace(int c)
Definition: ctype.h:12
static int isblank(int c)
Definition: ctype.h:16
static int isprint(int c)
Definition: ctype.h:18
static int isalpha(int c)
Definition: ctype.h:6
static int ispunct(int c)
Definition: ctype.h:21
static int toupper(int c)
lib/ctype.h
Definition: ctype.h:26
static int isdigit(int c)
Definition: ctype.h:7
static int isxdigit(int c)
Definition: ctype.h:9