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

View File

@@ -187,9 +187,6 @@ prepare_socket(int family)
int on_off = 1;
port_number = CNF_GetCommandPort();
if (port_number < 0) {
port_number = DEFAULT_CANDM_PORT;
}
sock_fd = socket(family, SOCK_DGRAM, 0);
if (sock_fd < 0) {