summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-01-28 00:17:38 +0000
committerStef Walter <stef@memberwebs.com>2006-01-28 00:17:38 +0000
commitfbfb057e8bed90f73850d8e871e4d70e8fa705ce (patch)
tree920c2a626ddd185176d1d8c14be7b1d7497451d1 /daemon
parentae2e52d578ca1dd78e31beed4c63a9b17ce3bb60 (diff)
Standardize the string functions and search for them properly when configuring on different OSs.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/Makefile.am2
-rw-r--r--daemon/config.c11
-rw-r--r--daemon/rrd-update.c1
-rw-r--r--daemon/rrdbotd.c3
-rw-r--r--daemon/snmp-engine.c1
-rw-r--r--daemon/snmp-help.c1
-rw-r--r--daemon/usuals.h2
7 files changed, 9 insertions, 12 deletions
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 18b1217..fbc275d 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -5,7 +5,7 @@ rrdbotd_SOURCES = rrdbotd.c rrdbotd.h config.c usuals.h \
snmp-help.c snmp-engine.c rrd-update.c \
../common/server-mainloop.c ../common/server-mainloop.h \
../common/sock-any.h ../common/sock-any.c \
- ../common/stringx.h ../common/stringx.c \
+ ../common/compat.h ../common/compat.c \
../common/hash.h ../common/hash.c \
../mib/parse.c
rrdbotd_CFLAGS = -I${top_srcdir}/common/ -I${top_srcdir}/bsnmp/ -I${top_srcdir} \
diff --git a/daemon/config.c b/daemon/config.c
index 39c5a37..9b38bcb 100644
--- a/daemon/config.c
+++ b/daemon/config.c
@@ -42,7 +42,6 @@
#include <syslog.h>
#include <dirent.h>
-#include "stringx.h"
#include "rrdbotd.h"
/*
@@ -410,7 +409,7 @@ read_config_file(const char* configfile)
config[len + 1] = 0;
/* Remove nasty dos line endings */
- remove_cr(config);
+ strcln(config, '\r');
rb_messagex(LOG_DEBUG, "read config file: %s", configfile);
return config;
@@ -439,7 +438,7 @@ parse_config_file(const char* configfile, config_ctx *ctx)
p = next; /* Do this before cleaning below */
next = t + 1;
- t = trim_start(p);
+ t = strbtrim(p);
/* Continuation line (had spaces at start) */
if(p < t && *t)
@@ -482,7 +481,7 @@ parse_config_file(const char* configfile, config_ctx *ctx)
errx(2, "%s: invalid config header: %s", ctx->confname, p);
*t = 0;
- header = trim_space(p + 1);
+ header = strtrim(p + 1);
continue;
}
@@ -495,8 +494,8 @@ parse_config_file(const char* configfile, config_ctx *ctx)
*t = 0;
t++;
- name = trim_space(p);
- value = trim_space(t);
+ name = strtrim(p);
+ value = strtrim(t);
}
if(name && value)
diff --git a/daemon/rrd-update.c b/daemon/rrd-update.c
index d088e07..295eea6 100644
--- a/daemon/rrd-update.c
+++ b/daemon/rrd-update.c
@@ -43,7 +43,6 @@
#include <syslog.h>
#include <unistd.h>
-#include "stringx.h"
#include "rrdbotd.h"
#define MAX_NUMLEN 40
diff --git a/daemon/rrdbotd.c b/daemon/rrdbotd.c
index 94212b5..a9171e8 100644
--- a/daemon/rrdbotd.c
+++ b/daemon/rrdbotd.c
@@ -46,7 +46,6 @@
#include <bsnmp/asn1.h>
#include <bsnmp/snmp.h>
-#include "stringx.h"
#include "rrdbotd.h"
/* The default command line options */
@@ -172,7 +171,7 @@ rb_vmessage(int level, int err, const char* msg, va_list ap)
/* Cleanup the message a little */
strlcpy(buf, msg, MAX_MSGLEN);
- trim_end(buf);
+ stretrim(buf);
if(err)
{
diff --git a/daemon/snmp-engine.c b/daemon/snmp-engine.c
index c0af083..66cc047 100644
--- a/daemon/snmp-engine.c
+++ b/daemon/snmp-engine.c
@@ -43,7 +43,6 @@
#include <bsnmp/asn1.h>
#include <bsnmp/snmp.h>
-#include "stringx.h"
#include "rrdbotd.h"
#include "server-mainloop.h"
diff --git a/daemon/snmp-help.c b/daemon/snmp-help.c
index 4ae7cb1..31f8dc6 100644
--- a/daemon/snmp-help.c
+++ b/daemon/snmp-help.c
@@ -43,7 +43,6 @@
#include <bsnmp/asn1.h>
#include <bsnmp/snmp.h>
-#include "stringx.h"
#include "rrdbotd.h"
/* Whether we print warnings when loading MIBs or not */
diff --git a/daemon/usuals.h b/daemon/usuals.h
index f83a117..5fece3f 100644
--- a/daemon/usuals.h
+++ b/daemon/usuals.h
@@ -50,6 +50,8 @@
#include <errno.h>
#include <string.h>
+#include "compat.h"
+
#ifndef NULL
#define NULL 0
#endif