settings.c

Fri, 16 Sep 2011 09:59:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 16 Sep 2011 09:59:20 +0200
changeset 13
51b1ba3776b1
parent 11
06cbd0ec003d
child 16
bc9a0fefd892
permissions
-rw-r--r--

changed makefile to auto-include any source file

10
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 /*
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 * settings.c
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 *
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 * Created on: 15.09.2011
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 * Author: beckermi
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 */
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 #include "settings.h"
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 settings_t* new_settings_t() {
11
06cbd0ec003d Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5
Mike Becker <universe@uap-core.de>
parents: 10
diff changeset
11 settings_t *settings = malloc(sizeof(settings_t));
10
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 if (settings != NULL) {
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 #ifdef _WIN32
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 settings->fileSeparator = '\\';
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 #else
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 settings->fileSeparator = '/';
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 #endif /* _WIN32 */
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 settings->recursive = false;
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 settings->includeSuffixes = false;
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 settings->matchesOnly = false;
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 settings->suffixList = new_suffix_list_t();
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 }
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 return settings;
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 }
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 void destroy_settings_t(settings_t* settings) {
11
06cbd0ec003d Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5
Mike Becker <universe@uap-core.de>
parents: 10
diff changeset
28 free(settings->suffixList);
10
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29 free(settings);
ecf787666f44 refactored sources
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30 }

mercurial