megadrive_test1
annotate src/libc/ctype.c @ 7:8253942b0a1a
in the middle of something
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 19 Feb 2017 14:00:26 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@6 | 1 int isalpha(int c); |
nuclear@6 | 2 int isdigit(int c); |
nuclear@6 | 3 int islower(int c); |
nuclear@6 | 4 int isupper(int c); |
nuclear@6 | 5 |
nuclear@6 | 6 |
nuclear@6 | 7 int isalnum(int c) |
nuclear@6 | 8 { |
nuclear@6 | 9 return isalpha(c) || isdigit(c); |
nuclear@6 | 10 } |
nuclear@6 | 11 |
nuclear@6 | 12 int isalpha(int c) |
nuclear@6 | 13 { |
nuclear@6 | 14 return isupper(c) || islower(c); |
nuclear@6 | 15 } |
nuclear@6 | 16 |
nuclear@6 | 17 int isblank(int c) |
nuclear@6 | 18 { |
nuclear@6 | 19 return c == ' ' || c == '\t'; |
nuclear@6 | 20 } |
nuclear@6 | 21 |
nuclear@6 | 22 int isdigit(int c) |
nuclear@6 | 23 { |
nuclear@6 | 24 return c >= '0' && c <= '9'; |
nuclear@6 | 25 } |
nuclear@6 | 26 |
nuclear@6 | 27 int isupper(int c) |
nuclear@6 | 28 { |
nuclear@6 | 29 return c >= 'A' && c <= 'Z'; |
nuclear@6 | 30 } |
nuclear@6 | 31 |
nuclear@6 | 32 int islower(int c) |
nuclear@6 | 33 { |
nuclear@6 | 34 return c >= 'a' && c <= 'z'; |
nuclear@6 | 35 } |
nuclear@6 | 36 |
nuclear@6 | 37 int isgraph(int c) |
nuclear@6 | 38 { |
nuclear@6 | 39 return c > ' ' && c <= '~'; |
nuclear@6 | 40 } |
nuclear@6 | 41 |
nuclear@6 | 42 int isprint(int c) |
nuclear@6 | 43 { |
nuclear@6 | 44 return isgraph(c) || c == ' '; |
nuclear@6 | 45 } |
nuclear@6 | 46 |
nuclear@6 | 47 int isspace(int c) |
nuclear@6 | 48 { |
nuclear@6 | 49 return isblank(c) || c == '\f' || c == '\n' || c == '\r' || c == '\v'; |
nuclear@6 | 50 } |
nuclear@6 | 51 |
nuclear@6 | 52 int toupper(int c) |
nuclear@6 | 53 { |
nuclear@6 | 54 return islower(c) ? (c + ('A' - 'a')) : c; |
nuclear@6 | 55 } |
nuclear@6 | 56 |
nuclear@6 | 57 int tolower(int c) |
nuclear@6 | 58 { |
nuclear@6 | 59 return isupper(c) ? (c + ('A' - 'a')) : c; |
nuclear@6 | 60 } |