56 lines
852 B
C
56 lines
852 B
C
int
|
|
isblank(int c){
|
|
return c == '\t'
|
|
|| c == ' ';
|
|
}
|
|
|
|
int
|
|
isspace(int c){
|
|
return isblank(c)
|
|
|| c == '\n'
|
|
|| c == '\v'
|
|
|| c == '\f'
|
|
|| c == '\r';
|
|
}
|
|
|
|
int
|
|
isgraph(int c){ return c >= '!' && c <= '~'; }
|
|
|
|
int
|
|
isprint(int c){ return c == ' ' || isgraph(c); }
|
|
|
|
int
|
|
iscntrl(int c){ return !isprint(c); }
|
|
|
|
int
|
|
isdigit(int c){ return c >= '0' && c <= '9'; }
|
|
|
|
int
|
|
islower(int c){ return c >= 'a' && c <= 'z'; }
|
|
|
|
int
|
|
isupper(int c){ return c >= 'A' && c <= 'Z'; }
|
|
|
|
int
|
|
isxdigit(int c){
|
|
return
|
|
isdigit(c)
|
|
|| (c >= 'a' && c <= 'f')
|
|
|| (c >= 'A' && c <= 'F');
|
|
}
|
|
|
|
int
|
|
isalpha(int c){ return islower(c) || isupper(c); }
|
|
|
|
int
|
|
isalnum(int c){ return isalpha(c) || isdigit(c) };
|
|
|
|
int
|
|
ispunct(int c){ return c != ' ' && !isalnum(c) };
|
|
|
|
int
|
|
tolower(int c){ return c - isupper(c) * ('A' - 'a'); }
|
|
|
|
int
|
|
toupper(int c){ return c + islower(c) * ('A' - 'a'); }
|