Initial ascii-only versions
This commit is contained in:
parent
62218ac1be
commit
92b4f1b83a
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isalnum(int c) {
|
||||||
|
return (isalpha(c) || isdigit(c));
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isalpha(int c) {
|
||||||
|
return (isupper(c) || islower(c));
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isascii(int c) {
|
||||||
|
return (c >= 0 && c <= 0177);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isblank(int c) {
|
||||||
|
return (c == ' ' || c == '\t');
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int iscntrl(int c) {
|
||||||
|
return ((c >= 0 && c < 32) || c == 127);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isdigit(int c) {
|
||||||
|
return (c <= '9' && c >= '0');
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isgraph(int c) {
|
||||||
|
return (isalnum(c) || ispunct(c));
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int islower(int c) {
|
||||||
|
return (c >= 'a' && c <= 'z');
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isprint(int c) {
|
||||||
|
return (isgraph(c) || c == ' ');
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int ispunct(int c) {
|
||||||
|
return (c < 128 && !(isalnum(c) || iscntrl(c)));
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int isspace(int c) {
|
||||||
|
switch(c) {
|
||||||
|
case ' ':
|
||||||
|
case '\f':
|
||||||
|
case '\n':
|
||||||
|
case '\r':
|
||||||
|
case '\t':
|
||||||
|
case '\v': return 1;
|
||||||
|
default: return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isupper(int c) {
|
||||||
|
return (c >= 'A' && c <= 'Z');
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int isxdigit(int c) {
|
||||||
|
return (isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'));
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int toascii(int c) {
|
||||||
|
return (c & 0x7f)
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int tolower(int c) {
|
||||||
|
return (c + 32);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
int tolower(int c) {
|
||||||
|
return (c - 32);
|
||||||
|
}
|
Loading…
Reference in New Issue