diff options
author | Dmitri Pal <dpal@redhat.com> | 2010-08-02 21:44:15 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-09-22 14:57:53 -0400 |
commit | a54a8e53a97d104490966e36d40e9b0b419ad050 (patch) | |
tree | 0bffb1517c4daaa645a917d1938e067a44696322 /ini/ini_config_priv.h | |
parent | fbaa3ff3a5e45bffea373d0bea4ccd206db37a45 (diff) | |
download | ding-libs-a54a8e53a97d104490966e36d40e9b0b419ad050.tar.gz ding-libs-a54a8e53a97d104490966e36d40e9b0b419ad050.tar.xz ding-libs-a54a8e53a97d104490966e36d40e9b0b419ad050.zip |
Introducing configuration file object
The patch contains two major pieces of work:
* The beginning of the new INI interface
significantly re-thought and reworked.
* The implementation of the file object.
Parsing was adjusted to use this object.
Diffstat (limited to 'ini/ini_config_priv.h')
-rw-r--r-- | ini/ini_config_priv.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/ini/ini_config_priv.h b/ini/ini_config_priv.h index 9dff6cd..9185e14 100644 --- a/ini/ini_config_priv.h +++ b/ini/ini_config_priv.h @@ -25,15 +25,51 @@ #include "collection.h" /* Configuration object */ -struct configobj { +struct ini_cfgobj { /* For now just a collection */ struct collection_item *cfg; - /* Boundary ? */ + /* Boundary */ + uint32_t boundary; /*... */ /* Statistics? Timestamps? When created? Modified? - TBD */ /*... */ }; + +/* Configuration file object */ +struct ini_cfgfile { + /***********************************/ + /* Externally controlled variables */ + /***********************************/ + /* File name for the configuration file */ + char *filename; + /* File stream */ + FILE *file; + /* File descriptor that is passed in */ + int fd; + /* Error level */ + int error_level; + /* Collision flags - define how to merge things */ + uint32_t collision_flags; + /* Collision flags - define how to merge things */ + uint32_t metadata_flags; + /**********************/ + /* Internal variables */ + /**********************/ + /* Collection of errors detected during parsing */ + struct collection_item *error_list; + /* Metadata about the file */ + struct collection_item *metadata; + /* Count of error lines */ + unsigned count; +}; + +/* Parsing error */ +struct ini_parse_error { + unsigned line; + int error; +}; + /* Internal cleanup callback */ void ini_cleanup_cb(const char *property, int property_len, |