From 1fe43cb40fb54412528b7538718a457d2167c603 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 4 Apr 2006 19:42:19 +0000 Subject: Add support for simpler create options. --- common/compat.c | 29 +++++++++++++++++++++++++++++ common/compat.h | 8 ++++++++ 2 files changed, 37 insertions(+) (limited to 'common') 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__ */ -- cgit v1.2.3