Initial commit of current C compiler sources, partly rebranded but not yet properly cleaned up!

This commit is contained in:
2025-06-04 03:45:05 +10:00
parent 6e217b2669
commit 7f74463109
33 changed files with 18135 additions and 0 deletions

74
fakelibc/ctype.h Normal file
View File

@@ -0,0 +1,74 @@
#ifndef _FAKELIBC_CTYPE_H
#define _FAKELIBC_CTYPE_H
/*
#define isspace fake_isspace
#define isdigit fake_isdigit
#define isxdigit fake_isxdigit
#define isalpha fake_isalpha
#define isalnum fake_isalnum
#define isprint fake_isprint
#define ispunct fake_ispunct
static int fake_isspace(int ch) {
return (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n');
}
static int fake_isdigit(int ch) {
return (ch >= '0') && (ch <= '9');
}
static int fake_isxdigit(int ch) {
return isdigit(ch) || ((ch >= 'a') && (ch <= 'f')) || ((ch >= 'A') && (ch <= 'F'));
}
static int fake_isalpha(int ch) {
return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'));
}
static int fake_isalnum(int ch) {
return isalpha(ch) || isdigit(ch);
}
static int fake_isprint(int ch) {
return isalnum(ch) || isspace(ch) || ispunct(ch);
}
static int fake_ispunct(int ch) {
switch (ch) {
case ',':
case '<':
case '.':
case '>':
case '/':
case '?':
case ';':
case ':':
case '\'':
case '\"':
case '[':
case ']':
case '{':
case '}':
case '`':
case '~':
case '@':
case '#':
case '$':
case '%':
case '^':
case '&':
case '*':
case '(':
case ')':
case '-':
case '_':
case '=':
case '+':
return 1;
default:
return 0;
}
}
*/
/* From ifndef at top of file: */
#endif