summaryrefslogtreecommitdiffstats
path: root/ini/ini_config.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-04-08 17:27:44 -0400
committerSimo Sorce <ssorce@redhat.com>2009-04-09 15:52:48 -0400
commit7a4629f520bb3da6e349909f90489cac16745b0e (patch)
treec104cb2c1d561150fbc624ebfc166bb6edb933b8 /ini/ini_config.h
parentcfde3e8b06ff4939ebf2f8c03c0cbc17f1efd725 (diff)
downloadding-libs-7a4629f520bb3da6e349909f90489cac16745b0e.tar.gz
ding-libs-7a4629f520bb3da6e349909f90489cac16745b0e.tar.xz
ding-libs-7a4629f520bb3da6e349909f90489cac16745b0e.zip
INI component: Fixed issues introduced by cleanup.
Added a few new functions. Cleaned code that was subject to conditional build. Fixed the floating point conversion. Keep const values as const.
Diffstat (limited to 'ini/ini_config.h')
-rw-r--r--ini/ini_config.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/ini/ini_config.h b/ini/ini_config.h
index 21b912b..2a9aa52 100644
--- a/ini/ini_config.h
+++ b/ini/ini_config.h
@@ -54,11 +54,6 @@
#define ERR_MAXPARSE ERR_LONGKEY
-#ifdef HAVE_INI_BEST_EFFORT /* Ignore bad lines in the INI files */
-#define RET_BEST_EFFORT RET_INVALID
-#else
-#define RET_BEST_EFFORT RET_ERROR
-#endif
/* Internal sizes */
/* FIXME - make them configurable via config.h */
@@ -79,7 +74,7 @@ int config_from_file(const char *application, /* Name of the appli
const char *config_file, /* Name of the config file - if NULL the collection will be empty */
struct collection_item **ini_config, /* If *ini_config is NULL a new ini object will be allocated, */
/* otherwise the one that is pointed to will be updated. */
- int error_level, /* Error level - break for erros, warnings or best effort (don't break) */
+ int error_level, /* Error level - break for errors, warnings or best effort (don't break) */
struct collection_item **error_list); /* List of errors for a file */
@@ -125,10 +120,10 @@ unsigned long get_ulong_config_value(struct collection_item *item, int strict, u
double get_double_config_value(struct collection_item *item, int strict, double def, int *error);
unsigned char get_bool_config_value(struct collection_item *item, unsigned char def, int *error);
-/* Function get_string_config_value returns pointer to the string out of item.
- * If 'dup' is not 0 it makes a copyof the string otherwise it does not.
- */
-char *get_string_config_value(struct collection_item *item, int dup, int *error);
+/* Function get_string_config_value returns a newly allocated pointer to the string out of item.*/
+char *get_string_config_value(struct collection_item *item, int *error);
+/* Function returns the string stored in the item */
+const char *get_const_string_config_value(struct collection_item *item, int *error);
/* A get_bin_value and get_xxx_array functions allocate memory.
* It is the responsibility of the caller to free it after use.
@@ -151,10 +146,15 @@ char **get_string_config_array(struct collection_item *item, char *sep, int *siz
/* Array of long values - separators are detected automatically. */
/* The length of the allocated array is returned in "size" */
long *get_long_config_array(struct collection_item *item, int *size, int *error);
+/* Array of double values - separators are detected automatically. */
+/* The length of the allocated array is returned in "size" */
+double *get_double_config_array(struct collection_item *item, int *size, int *error);
/* Special function to free string config array */
void free_string_config_array(char **str_config);
/* Special function to free long config array */
void free_long_config_array(long *array);
+/* Special function to free double config array */
+void free_double_config_array(double *array);
#endif