Refactor command parsing

- normalize command line before parsing
- compare whole words
- check for missing/extra arguments in config parsing
- use strdup for string allocation
- share code for reporting syntax errors
- avoid using function pointers
- cleanup the code a bit
This commit is contained in:
Miroslav Lichvar
2013-05-09 17:29:37 +02:00
parent 182ec04e24
commit 0f8def4ca4
6 changed files with 706 additions and 628 deletions

2
main.c
View File

@@ -284,7 +284,7 @@ go_daemon(void)
int main
(int argc, char **argv)
{
char *conf_file = NULL;
const char *conf_file = DEFAULT_CONF_FILE;
char *user = NULL;
int debug = 0, nofork = 0;
int do_init_rtc = 0, restarted = 0;