diff options
author | Dmitri Pal <dpal@redhat.com> | 2010-08-02 21:44:15 -0400 |
---|---|---|
committer | Dmitri Pal <dpal@redhat.com> | 2010-08-10 12:51:32 -0400 |
commit | 1e137bae0f30ff57636a2c9489992050e5a9515a (patch) | |
tree | 492dc7596afb5b14957f0f453c1132298dba53a6 /common/ini/ini_config_priv.h | |
parent | 3f87dcf6c1986e031807ca1afb2cdc3e9e40e1de (diff) | |
download | sssd-1e137bae0f30ff57636a2c9489992050e5a9515a.tar.gz sssd-1e137bae0f30ff57636a2c9489992050e5a9515a.tar.xz sssd-1e137bae0f30ff57636a2c9489992050e5a9515a.zip |
[INI] 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 'common/ini/ini_config_priv.h')
-rw-r--r-- | common/ini/ini_config_priv.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/common/ini/ini_config_priv.h b/common/ini/ini_config_priv.h index 9dff6cd..9185e14 100644 --- a/common/ini/ini_config_priv.h +++ b/common/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, |