3 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #ifndef __DEF_CONFIG_H_
18 #define __DEF_CONFIG_H_
22 /* Configuration default values */
23 /* note: 0 means unlimited */
24 #define SYSTEM_MAX_USE 0
25 #define SYSTEM_KEEP_FREE 0
26 #define MAX_RETENTION_SEC 0
27 #define MAX_CRASH_DUMP 0
29 #define DUMP_SO_INFO 1
31 #define LEGACY_NOTIFICATION 0
33 #define CRASH_SECTION "CrashManager"
35 /* ExcludePaths section name must be lowercase with iniparser 3.x.
37 * This is to workaround for iniparser 3.x bug, where loaded strings
38 * are converted to lowercase, but query string is not, precisely
39 * getsecnkeys() does strcmp(lowercase-key-in-db, user-provided-str).
41 #define EXCLUDEPATHS_SECTION "excludepaths"
44 REP_TYPE_INVALID = -1,
47 REP_TYPE_DEFAULT = REP_TYPE_FULL,
50 typedef struct config {
54 bool legacy_notification;
55 enum ReportType report_type;
58 int max_retention_sec;
62 char *crash_root_path;
72 bool config_init(config_t *c, const char *const path);
73 void config_free(config_t *c);
75 bool config_is_path_excluded(config_t *c, const char *const path);