summaryrefslogtreecommitdiffstatsabout
path: root/utility/util.c
diff options
context:
space:
mode:
authorEdward Rudd <urkle@outoforder.cc>2008-10-22 12:40:58 (GMT)
committer Edward Rudd <urkle@outoforder.cc>2008-10-22 12:40:58 (GMT)
commit0ddd719a72469f732a881c93d4c804e9aca787fe (patch)
treee05821ff5a6ad0f00d63f23090ce4f2ec19bef75 /utility/util.c
parentcc75ebf7e8560a69a6847f0260cce4772fff440a (diff)
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)
Diffstat (limited to 'utility/util.c')
-rw-r--r--utility/util.c28
1 files changed, 28 insertions, 0 deletions
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 @@
1#include "util.h"
2#include "apr_strings.h"
3#include "apr_lib.h"
4
5
6char *lowerstr(apr_pool_t *pool, const char *input)
7{
8 char *temp;
9 char *itr;
10 temp = apr_pstrdup(pool, input);
11 for (itr=temp; *itr!='\0'; itr++) {
12 *itr = apr_tolower(*itr);
13 }
14 return temp;
15}
16
17void line_chomp(char *str)
18{
19 int len;
20 // chomp off newline
21 len = strlen(str);
22 if (len) {
23 while (str[len-1] == '\r' || str[len-1] == '\n') {
24 str[len-1] = '\0';
25 len--;
26 }
27 }
28}