From 19bbdd68a491721dd4aeff7cacea51148ce3a9b9 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Fri, 24 Oct 2008 13:55:48 +0000 Subject: add logging function added @todo tags for what needs to be finished --- (limited to 'utility/config.c') diff --git a/utility/config.c b/utility/config.c index d3a6ca5..ccdc6e5 100644 --- a/utility/config.c +++ b/utility/config.c @@ -23,19 +23,6 @@ static apr_status_t config_set_string(config_t *cfg, config_opt_t *opt, return APR_SUCCESS; } -static apr_status_t config_set_int(config_t *cfg, config_opt_t *opt, int argc, - const char **argv) __attribute__ ((__unused__)); -static apr_status_t config_set_int(config_t *cfg, config_opt_t *opt, int argc, - const char **argv) -{ - int offset = (int)(long)opt->data; - int *data = (int *)((void *)cfg + offset); - if (argc != 2) - return APR_EINVAL; - *data = apr_atoi64(argv[1]); - return APR_SUCCESS; -} - static apr_status_t config_set_flag(config_t *cfg, config_opt_t *opt, int argc, const char **argv) { @@ -329,6 +316,24 @@ config_t *config_create(apr_pool_t *p) return cfg; } +apr_status_t config_check(config_t *cfg) +{ + apr_status_t ret = APR_SUCCESS; + if (!cfg->dbdriver || !cfg->dbparams) { + printf("Database configuration is missing\n"); + ret = APR_EINVAL; + } + if (!cfg->table) { + printf("No Log Table defined\n"); + ret = APR_EINVAL; + } + if (apr_is_empty_array(cfg->output_fields)) { + printf("No Output Fields Defined\n"); + ret = APR_EINVAL; + } + return ret; +} + static int config_merge(void *rec, const char *key, const char *value) { config_t *cfg = (config_t *)rec; -- cgit v0.9.2