1 /* |
|
2 * settings.c |
|
3 * |
|
4 * Created on: 15.09.2011 |
|
5 * Author: Mike |
|
6 */ |
|
7 |
|
8 #include "settings.h" |
|
9 |
|
10 settings_t* new_settings_t() { |
|
11 settings_t *settings = malloc(sizeof(settings_t)); |
|
12 if (settings != NULL) { |
|
13 #ifdef _WIN32 |
|
14 settings->fileSeparator = '\\'; |
|
15 #else |
|
16 settings->fileSeparator = '/'; |
|
17 #endif /* _WIN32 */ |
|
18 settings->recursive = false; |
|
19 settings->matchesOnly = false; |
|
20 settings->includeSuffixes = new_string_list_t(); |
|
21 settings->excludeSuffixes = new_string_list_t(); |
|
22 settings->verbose = true; |
|
23 settings->bfileHeuristics = new_bfile_heuristics_t(); |
|
24 settings->confusing_lnlen = false; |
|
25 settings->regex = new_regex_parser_t(); |
|
26 } |
|
27 |
|
28 return settings; |
|
29 } |
|
30 |
|
31 void destroy_settings_t(settings_t* settings) { |
|
32 destroy_regex_parser_t(settings->regex); |
|
33 destroy_string_list_t(settings->includeSuffixes); |
|
34 destroy_string_list_t(settings->excludeSuffixes); |
|
35 destroy_bfile_heuristics_t(settings->bfileHeuristics); |
|
36 free(settings); |
|
37 } |
|