summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/compat.c29
-rw-r--r--common/compat.h8
2 files changed, 37 insertions, 0 deletions
diff --git a/common/compat.c b/common/compat.c
index 67d3997..c6138d0 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -232,6 +232,7 @@ atexitv(voidfunc func, void* data)
#endif /* HAVE_ATEXITV */
+
#ifndef HAVE_XCALLOC
void*
@@ -244,3 +245,31 @@ xcalloc(size_t size)
}
#endif /* HAVE_XCALLOC */
+
+
+#ifndef HAVE_STRLWR
+
+void strlwr(char* data)
+{
+ while(*data)
+ {
+ *data = tolower(*data);
+ data++;
+ }
+}
+
+#endif /* HAVE_STRLWR */
+
+
+#ifndef HAVE_STRUPR
+
+void strupr(char* data)
+{
+ while(*data)
+ {
+ *data = toupper(*data);
+ data++;
+ }
+}
+
+#endif /* HAVE_STRUPR */
diff --git a/common/compat.h b/common/compat.h
index 12ffad6..8aaef66 100644
--- a/common/compat.h
+++ b/common/compat.h
@@ -77,4 +77,12 @@ void atexitv(void (*func)(void*), void* data);
void* xcalloc(size_t size);
#endif
+#ifndef HAVE_STRLWR
+void strlwr(char* data);
+#endif
+
+#ifndef HAVE_STRUPR
+void strupr(char* data);
+#endif
+
#endif /* __COMPAT_H__ */