diff options
Diffstat (limited to 'ndb/src/cw/cpcd/common.cpp')
-rw-r--r-- | ndb/src/cw/cpcd/common.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index cb1c0c37183..53c0e4d5a64 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -96,66 +96,3 @@ insert_file(const char * filename, class Properties& p){ if(f) fclose(f); return res; } - -int -parse_config_file(struct getargs args[], int num_arg, const Properties& p){ - Properties::Iterator it(&p); - for(const char * name = it.first(); name != 0; name = it.next()){ - bool found = false; - for(int i = 0; i<num_arg; i++){ - if(strcmp(name, args[i].long_name) != 0) - continue; - - found = true; - - const char * tmp; - p.get(name, &tmp); - - int t = 1; - - switch(args[i].type){ - case arg_integer:{ - int val = atoi(tmp); - if(args[i].value){ - *((int*)args[i].value) = val; - } - } - break; - case arg_string: - if(args[i].value){ - *((const char**)args[i].value) = tmp; - } - break; - case arg_negative_flag: - t = 0; - case arg_flag: - if(args[i].value){ - if(!strcasecmp(tmp, "y") || - !strcasecmp(tmp, "on") || - !strcasecmp(tmp, "true") || - !strcasecmp(tmp, "1")){ - *((int*)args[i].value) = t; - } - if(!strcasecmp(tmp, "n") || - !strcasecmp(tmp, "off") || - !strcasecmp(tmp, "false") || - !strcasecmp(tmp, "0")){ - *((int*)args[i].value) = t; - } - } - t = 1; - break; - case arg_strings: - case arg_double: - case arg_collect: - case arg_counter: - break; - } - } - if(!found) { - printf("Unknown parameter: %s\n", name); - return 1; - } - } - return 0; -} |