diff options
author | Alex Auvolat <alex@adnab.me> | 2016-07-15 22:39:04 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2016-07-15 22:39:04 +0200 |
commit | 7a1ea510a9fc43ccbc257601b149a90920332e13 (patch) | |
tree | 75ac252bb8ce029c62d6834e4ca927f59eaf5769 /src/common/include | |
parent | d415aca695956c79110c88fa58c12bf55c0e2163 (diff) | |
download | kogata-7a1ea510a9fc43ccbc257601b149a90920332e13.tar.gz kogata-7a1ea510a9fc43ccbc257601b149a90920332e13.zip |
Add Lua source, not compiled yet as libc/libm functions remain unimplemented
Diffstat (limited to 'src/common/include')
-rw-r--r-- | src/common/include/ctype.h | 18 | ||||
-rw-r--r-- | src/common/include/debug.h | 8 | ||||
-rw-r--r-- | src/common/include/malloc.h | 1 | ||||
-rw-r--r-- | src/common/include/string.h | 9 |
4 files changed, 32 insertions, 4 deletions
diff --git a/src/common/include/ctype.h b/src/common/include/ctype.h new file mode 100644 index 0000000..9808c9f --- /dev/null +++ b/src/common/include/ctype.h @@ -0,0 +1,18 @@ +#pragma once + +int isalnum(int c); +int isalpha(int c); +int isdigit(int c); +int isxdigit(int c); +int isspace(int c); +int isprint(int c); +int isupper(int c); +int islower(int c); +int ispunct(int c); +int isgraph(int c); +int iscntrl(int c); + +int toupper(int c); +int tolower(int c); + +/* vim: set sts=0 ts=4 sw=4 tw=0 noet :*/ diff --git a/src/common/include/debug.h b/src/common/include/debug.h index 285343c..2db5a80 100644 --- a/src/common/include/debug.h +++ b/src/common/include/debug.h @@ -3,14 +3,14 @@ #include <stddef.h> #include <stdint.h> -void panic(const char* message, const char* file, int line) +void sys_panic(const char* message, const char* file, int line) __attribute__((__noreturn__)); -void panic_assert(const char* assertion, const char* file, int line) +void sys_panic_assert(const char* assertion, const char* file, int line) __attribute__((__noreturn__)); -#define PANIC(s) panic(s, __FILE__, __LINE__); -#define ASSERT(s) { if (!(s)) panic_assert(#s, __FILE__, __LINE__); } +#define PANIC(s) sys_panic(s, __FILE__, __LINE__); +#define ASSERT(s) { if (!(s)) sys_panic_assert(#s, __FILE__, __LINE__); } void dbg_print(const char* str); void dbg_printf(const char* format, ...); diff --git a/src/common/include/malloc.h b/src/common/include/malloc.h index ec29d69..e55c25e 100644 --- a/src/common/include/malloc.h +++ b/src/common/include/malloc.h @@ -8,5 +8,6 @@ void* malloc(size_t sz); void free(void* ptr); void* calloc(size_t nmemb, size_t sz); +void* realloc(void* ptr, size_t sz); /* vim: set ts=4 sw=4 tw=0 noet :*/ diff --git a/src/common/include/string.h b/src/common/include/string.h index e655f2c..d38bbb6 100644 --- a/src/common/include/string.h +++ b/src/common/include/string.h @@ -20,4 +20,13 @@ int strncmp(const char *s1, const char *s2, size_t n); char *strdup(const char* str); char *strndup(const char* str, size_t count); +//TODO +int strcoll(const char *s1, const char *s2); +size_t strspn(const char *s, const char *accept); +char *strstr(const char *haystack, const char *needle); +char* strerror(int errnum); +char *strpbrk(const char *s, const char *accept); +void *memchr(const void *s, int c, size_t n); + + /* vim: set ts=4 sw=4 tw=0 noet :*/ |