kern

annotate src/klibc/ctype.c @ 71:c7bd6ec7b946

changed test_proc to modify memory after the fork in order to try out copy-on-write, by pushing the result of getpid on the stack.
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 13 Oct 2011 05:22:35 +0300
parents
children
rev   line source
nuclear@2 1 #include "ctype.h"
nuclear@2 2
nuclear@2 3 int isalnum(int c)
nuclear@2 4 {
nuclear@2 5 return isalpha(c) || isdigit(c);
nuclear@2 6 }
nuclear@2 7
nuclear@2 8 int isalpha(int c)
nuclear@2 9 {
nuclear@2 10 return isupper(c) || islower(c);
nuclear@2 11 }
nuclear@2 12
nuclear@2 13 int isblank(int c)
nuclear@2 14 {
nuclear@2 15 return c == ' ' || c == '\t';
nuclear@2 16 }
nuclear@2 17
nuclear@2 18 int isdigit(int c)
nuclear@2 19 {
nuclear@2 20 return c >= '0' && c <= '9';
nuclear@2 21 }
nuclear@2 22
nuclear@2 23 int isupper(int c)
nuclear@2 24 {
nuclear@2 25 return c >= 'A' && c <= 'Z';
nuclear@2 26 }
nuclear@2 27
nuclear@2 28 int islower(int c)
nuclear@2 29 {
nuclear@2 30 return c >= 'a' && c <= 'z';
nuclear@2 31 }
nuclear@2 32
nuclear@2 33 int isgraph(int c)
nuclear@2 34 {
nuclear@2 35 return c > ' ' && c <= '~';
nuclear@2 36 }
nuclear@2 37
nuclear@2 38 int isprint(int c)
nuclear@2 39 {
nuclear@2 40 return isgraph(c) || c == ' ';
nuclear@2 41 }
nuclear@2 42
nuclear@2 43 int isspace(int c)
nuclear@2 44 {
nuclear@2 45 return isblank(c) || c == '\f' || c == '\n' || c == '\r' || c == '\v';
nuclear@2 46 }
nuclear@2 47
nuclear@2 48 int toupper(int c)
nuclear@2 49 {
nuclear@2 50 return islower(c) ? (c + ('A' - 'a')) : c;
nuclear@2 51 }
nuclear@2 52
nuclear@2 53 int tolower(int c)
nuclear@2 54 {
nuclear@2 55 return isupper(c) ? (c + ('A' - 'a')) : c;
nuclear@2 56 }