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