summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-03-31 22:46:58 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-03-31 22:46:58 +0200
commitd8b0c45812890670943becd45383f75d57056e52 (patch)
tree055375c12586e9f38f19ce5281f0a2c54de92226 /compat.c
parent1fa71087c9d754b687d52059ee88ca82b45ec1eb (diff)
new version
lots of things changed, but cleanup todo. changelog and consistent stream of small updates will come in the future. Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/compat.c b/compat.c
deleted file mode 100644
index 1530bd5..0000000
--- a/compat.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-int
-xstrcasecmp(const char *_l, const char *_r) {
- const unsigned char *l = (void *)_l, *r = (void *)_r;
- for(; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
- return tolower(*l) - tolower(*r);
-}
-
-int
-xstrncasecmp(const char *_l, const char *_r, size_t n) {
- const unsigned char *l=(void *)_l, *r=(void *)_r;
- if(!n--)
- return 0;
- for(; *l && *r && n && (*l == *r || tolower(*l) == tolower(*r)); l++, r++, n--);
- return tolower(*l) - tolower(*r);
-}
-
-void *
-xstrdup(const char *s) {
- size_t len = strlen(s) + 1;
- void *p = malloc(len);
- if(p)
- memcpy(p, s, len);
- return p;
-}
-
-int
-xmkdir(const char *path, mode_t mode) {
-/* TODO: fix for mingw */
-#if MINGW
- return mkdir(path);
-#else
- return mkdir(path, mode);
-#endif
-}