summaryrefslogtreecommitdiffstats
path: root/ini/ini_configobj.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2012-12-24 17:45:00 -0500
committerOndrej Kos <okos@redhat.com>2013-01-24 08:34:51 +0100
commit6823d7104cca0f8ac22ed9432ee8a2f1a0d9124a (patch)
tree51c9c817e8335c0001f3c012819760bfcf6a1681 /ini/ini_configobj.h
parentfa00e2e16e5c1d3ac56f1bbd3a84875642d0bb39 (diff)
downloadding-libs-6823d7104cca0f8ac22ed9432ee8a2f1a0d9124a.tar.gz
ding-libs-6823d7104cca0f8ac22ed9432ee8a2f1a0d9124a.tar.xz
ding-libs-6823d7104cca0f8ac22ed9432ee8a2f1a0d9124a.zip
More interface refactoring
I also realized that error list processing should not be bound to the file object. This patch corrects that by moving the error_list and corresponding count from file object to the config object. Things updated by the patch: 1. The internal variables are moved from file obj to config obj. 2. The external header is updated to reflect the change 3. Functions are moved from file obj module to config obj module. 4. Parser code is updated because error validation was in the wrong place 5. Unit test is adjusted to get error list from the right object. I had to adjust the copy function for the config object. Copy function does not copy over the error list.
Diffstat (limited to 'ini/ini_configobj.h')
-rw-r--r--ini/ini_configobj.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/ini/ini_configobj.h b/ini/ini_configobj.h
index 5e8d95b..16f6499 100644
--- a/ini/ini_configobj.h
+++ b/ini/ini_configobj.h
@@ -526,11 +526,11 @@ void ini_config_file_destroy(struct ini_cfgfile *file_ctx);
* how many parsing errors were found during last
* parsing operation.
*
- * @param[in] file_ctx Configuration file object.
+ * @param[in] ini_config Configuration object.
*
* @return Number of errors.
*/
-unsigned ini_config_error_count(struct ini_cfgfile *file_ctx);
+unsigned ini_config_error_count(struct ini_cfgobj *ini_config);
/**
* @brief Get array of parsing errors
@@ -541,14 +541,14 @@ unsigned ini_config_error_count(struct ini_cfgfile *file_ctx);
* Array can be referenced as a normal array of strings.
* The NULL entry indicates the end of the array.
*
- * @param[in] file_ctx Configuration file object.
+ * @param[in] ini_config Configuration object.
* @param[out] errors Array of error strings.
*
* @return 0 - Success.
* @return EINVAL - Invalid parameter.
* @return ENOMEM - No memory.
*/
-int ini_config_get_errors(struct ini_cfgfile *file_ctx,
+int ini_config_get_errors(struct ini_cfgobj *ini_config,
char ***errors);
/**
@@ -693,6 +693,7 @@ int ini_config_parse(struct ini_cfgfile *file_ctx,
* @brief Create a copy of the configuration object
*
* Function creates a deep copy of all the configuration data.
+ * Error list created during parsing is not copied over.
*
* @param[in] ini_config Original configuration object.
* @param[out] ini_new A new configuration object.