From 0ddd719a72469f732a881c93d4c804e9aca787fe Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Wed, 22 Oct 2008 12:40:58 +0000 Subject: added more config options included PCRE wrapper from httpd more complete log parser code. fixed NASTY bug with setting values in the hash tables (Need to DUP the strings before setting the keys) --- (limited to 'utility/util.c') diff --git a/utility/util.c b/utility/util.c new file mode 100644 index 0000000..ef3ea68 --- /dev/null +++ b/utility/util.c @@ -0,0 +1,28 @@ +#include "util.h" +#include "apr_strings.h" +#include "apr_lib.h" + + +char *lowerstr(apr_pool_t *pool, const char *input) +{ + char *temp; + char *itr; + temp = apr_pstrdup(pool, input); + for (itr=temp; *itr!='\0'; itr++) { + *itr = apr_tolower(*itr); + } + return temp; +} + +void line_chomp(char *str) +{ + int len; + // chomp off newline + len = strlen(str); + if (len) { + while (str[len-1] == '\r' || str[len-1] == '\n') { + str[len-1] = '\0'; + len--; + } + } +} -- cgit v0.9.2