summaryrefslogtreecommitdiff
path: root/src/shared/dlt_config_file_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/dlt_config_file_parser.c')
-rw-r--r--src/shared/dlt_config_file_parser.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/shared/dlt_config_file_parser.c b/src/shared/dlt_config_file_parser.c
index b123ebf..009a093 100644
--- a/src/shared/dlt_config_file_parser.c
+++ b/src/shared/dlt_config_file_parser.c
@@ -505,7 +505,8 @@ int dlt_config_file_get_num_sections(const DltConfigFile *file, int *num)
return -1;
/*
- * Note: this number is also containing General section
+ * Note: Since General section could be used in configuration file,
+ * this number could be also containing General section.
*/
*num = file->num_sections;
@@ -548,3 +549,18 @@ int dlt_config_file_get_value(const DltConfigFile *file,
dlt_vlog(LOG_WARNING, "Entry does not exist in section: %s\n", key);
return -1;
}
+
+int dlt_config_file_check_section_name_exists(const DltConfigFile *file,
+ const char *name)
+{
+ int ret = 0;
+
+ if ((file == NULL) || (file->num_sections <= 0) || (name == NULL))
+ return -1;
+
+ ret = dlt_config_file_find_section(file, name);
+ if (ret == -1)
+ return ret;
+
+ return 0;
+}