Tue, 02 Oct 2012 10:49:25 +0200
added multi-directory support
fixed parser bug in directory parser locking argument number 1024
fixed freed memory access on settings structure
/* * arguments.c * * Created on: 15.09.2011 * Author: Mike */ #include "arguments.h" int checkArgument(const char* arg, const char* expected) { int len = strlen(expected); int ret = 0; if (arg[0] == '-') { if (arg[1] != '-') { for (int t = 0 ; t < len ; t++) { ret |= (strchr(arg, expected[t]) > 0) << t; } } } return ret; } bool registerArgument(int* reg, int mask) { bool ret = (*reg & mask) > 0; *reg |= mask; return ret; } bool checkParamOpt(int* paropt) { bool ret = *paropt == 0; *paropt = 1; return ret; } void parseCSL(char* csl, string_list_t* list) { if (csl != NULL) { char* finder = strtok(csl, ","); while (finder != NULL) { add_string(list, finder); finder = strtok(NULL, ","); } } }