diff options
author | Edward Rudd <urkle@outoforder.cc> | 2008-10-24 13:55:48 (GMT) |
---|---|---|
committer | Edward Rudd <urkle@outoforder.cc> | 2008-10-24 13:55:48 (GMT) |
commit | 19bbdd68a491721dd4aeff7cacea51148ce3a9b9 (patch) | |
tree | 4e143a77f879f7baf65797c08a4e3a489b4ac755 /utility/config.c | |
parent | 50af087b9f3831285869dc8d8bf91cc3e6d5169a (diff) |
add logging function
added @todo tags for what needs to be finished
Diffstat (limited to 'utility/config.c')
-rw-r--r-- | utility/config.c | 31 |
1 files changed, 18 insertions, 13 deletions
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, | |||
23 | return APR_SUCCESS; | 23 | return APR_SUCCESS; |
24 | } | 24 | } |
25 | 25 | ||
26 | static apr_status_t config_set_int(config_t *cfg, config_opt_t *opt, int argc, | ||
27 | const char **argv) __attribute__ ((__unused__)); | ||
28 | static apr_status_t config_set_int(config_t *cfg, config_opt_t *opt, int argc, | ||
29 | const char **argv) | ||
30 | { | ||
31 | int offset = (int)(long)opt->data; | ||
32 | int *data = (int *)((void *)cfg + offset); | ||
33 | if (argc != 2) | ||
34 | return APR_EINVAL; | ||
35 | *data = apr_atoi64(argv[1]); | ||
36 | return APR_SUCCESS; | ||
37 | } | ||
38 | |||
39 | static apr_status_t config_set_flag(config_t *cfg, config_opt_t *opt, int argc, | 26 | static apr_status_t config_set_flag(config_t *cfg, config_opt_t *opt, int argc, |
40 | const char **argv) | 27 | const char **argv) |
41 | { | 28 | { |
@@ -329,6 +316,24 @@ config_t *config_create(apr_pool_t *p) | |||
329 | return cfg; | 316 | return cfg; |
330 | } | 317 | } |
331 | 318 | ||
319 | apr_status_t config_check(config_t *cfg) | ||
320 | { | ||
321 | apr_status_t ret = APR_SUCCESS; | ||
322 | if (!cfg->dbdriver || !cfg->dbparams) { | ||
323 | printf("Database configuration is missing\n"); | ||
324 | ret = APR_EINVAL; | ||
325 | } | ||
326 | if (!cfg->table) { | ||
327 | printf("No Log Table defined\n"); | ||
328 | ret = APR_EINVAL; | ||
329 | } | ||
330 | if (apr_is_empty_array(cfg->output_fields)) { | ||
331 | printf("No Output Fields Defined\n"); | ||
332 | ret = APR_EINVAL; | ||
333 | } | ||
334 | return ret; | ||
335 | } | ||
336 | |||
332 | static int config_merge(void *rec, const char *key, const char *value) | 337 | static int config_merge(void *rec, const char *key, const char *value) |
333 | { | 338 | { |
334 | config_t *cfg = (config_t *)rec; | 339 | config_t *cfg = (config_t *)rec; |