Commit Graph

23 Commits

Author SHA1 Message Date
Andrew Bettison
52106b5026 Move DEBUGF() from "log.h" to "debug.h"
Include "debug.h" in lots of places (not all)
New macro IDEBUGF() for indirect debug flag, used in HTTP server
2015-07-13 18:24:04 +09:30
Andrew Bettison
ccece93309 Refactor "conf_schema.h" to fix compile warnings
In STRUCT() and ARRAY() declarations, change the optional "validator"
arg from taking a bare function name to enclose the function name in
VALIDATOR(function)
2014-08-14 16:40:30 +09:30
Andrew Bettison
21f51965c1 Overhaul Makefile and header files
Make .o files in separate subdirectories for servald and library
Factor struct __sourceloc and __WHENCE__ from "log.h" into "whence.h"
Factor sid_t etc from "serval.h" into "serval_types.h"
Factor rhizome_bid_t etc from "rhizome.h" into "rhizome_types.h"
Do not include "serval.h" in library sources
Add log_stderr.c and logMessage.c for stand-alone executables
2014-05-26 15:36:26 +09:30
Andrew Bettison
5d741361ea Fix -Wsign-compare warnings: make loop counters unsigned 2013-12-10 16:21:23 +10:30
Andrew Bettison
30b2059608 Fix -Wunused-parameter warnings
New UNUSED(param) macro suppresses the warning for a specific parameter

In some cases, removed the unused parameters.  In others, used the
parameter in a DEBUGF() or assert() statement to document the intent.
2013-12-09 18:22:18 +10:30
Andrew Bettison
76d7743efc Silence clang warnings 2013-04-11 13:46:09 +09:30
Andrew Bettison
a822dca2fa Improve config schema macros and log options
Add STRUCT_ASSIGN macro to config schema

Document STRUCT_DEFAULT and STRUCT_ASSIGN in block comments

Move 'log.file_xxx' options to 'log.file.xxx'
2013-04-05 15:00:54 +10:30
Andrew Bettison
d3d6fa4547 Add log format config options for file and stderr
Upgrade configuration schema macros to allow optional "default label"
argument to SUB_STRUCT and VALUE_SUB_STRUCT elements.

New STRUCT_DEFAULT section declares alternative STRUCT default values
with a label.
2013-03-26 16:11:31 +10:30
Andrew Bettison
54ce857cff Improve config schema declaration
Remove array key SORTED flag; all arrays are now sorted by key

Use representation's comparison function for sorting arrays, not
a schema-supplied comparison function.
2013-03-01 15:27:28 +10:30
Andrew Bettison
2ac35bfdf7 Remove unconditional DEBUG logging 2013-02-28 17:57:25 +10:30
Andrew Bettison
ae787339ec Improve "config dump" command
All STRUCT cf_fmt_config_xxx() functions omit invalid values, silently
if the invalid value is the default, otherwise with a non-CFOK return
value.

The "config dump --full" option includes all options with valid values,
otherwise omits options having default values.
2013-02-28 15:18:48 +10:30
Andrew Bettison
5939aa9edc Add config cf_cmp_ functions 2013-02-27 18:11:18 +10:30
Andrew Bettison
46eeacb823 Improve new "config dump" command
No more SEGV.  Omits invalid (default) values.  Logs unconditional DEBUG
output, to be removed before merging into development.  Still missing
cf_cmp_ functions to prune out default values.

Improved config Object Model iterator logic to barf on internal NULL
nodes.
2013-02-27 16:26:07 +10:30
Andrew Bettison
6eb08ae805 Add new "config dump" command - not working yet
Add cf_fmt_xxx() functions for converting configuration structs into a
config object model tree.
2013-02-26 18:09:08 +10:30
Andrew Bettison
14ce5af688 Refactor configuration schema code
Replace 'parsefunc' (cf_opt_foo) function arguments in schema
declarations with 'repr' (foo) names, which are used to declare
cf_opt_foo and cf_fmt_foo.
2013-02-25 17:23:44 +10:30
Andrew Bettison
d65608720b Fix new config bug - ARRAY default initialisation
New ARRAY VALUE_*_STRUCT elements were not being initialised to default before
calling the STRUCT's parse function.
2012-12-10 14:03:46 +10:30
Andrew Bettison
b4f6aa5ea2 Improve 'config schema' output to include NODE parsing functions 2012-12-07 10:57:05 +10:30
Andrew Bettison
21509e0b67 Add 'config schema' command to dump schema
That was easy.
2012-12-06 17:54:30 +10:30
Andrew Bettison
caa209fc1d Integrate new config into servald
Not passing any tests yet, but compiles and links and simple uses do not
SEGV.
2012-12-04 14:12:28 +10:30
Andrew Bettison
4aac3637ed Improve new config code, SORTED and NO_DUPLICATE flags
Config Object Model parser now returns bitmask result of CFxxx flags and only
allocates root node if the config file is non-empty.

Added emalloc_zero().
2012-11-30 12:32:30 +10:30
Andrew Bettison
3686a4ade4 Improve new config code to use "log.h"
With all the __whence/__WHENCE__ goodness, ready for integration into servald.
2012-11-29 16:44:06 +10:30
Andrew Bettison
f654d435b1 Rename some new config source and header files 2012-11-29 16:12:03 +10:30
Andrew Bettison
2853d346f1 Re-organise new config code some more
Split into several source .c files, leave throw-away code in config_test.c.
2012-11-29 16:07:34 +10:30