summaryrefslogtreecommitdiffstats
path: root/common/ini/ini_config.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-09-28 09:36:00 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-05 10:32:09 -0400
commite3a794633b02411c3d3adc4443e98541f045f41a (patch)
tree258c48cff793720fd22be1246c97ed0eafbce69d /common/ini/ini_config.h
parent70b0f90d49bc5b89d700c4275641d5133b8a2ee0 (diff)
downloadsssd-e3a794633b02411c3d3adc4443e98541f045f41a.tar.gz
sssd-e3a794633b02411c3d3adc4443e98541f045f41a.tar.xz
sssd-e3a794633b02411c3d3adc4443e98541f045f41a.zip
INI Add config_from_fd() to ini_config
Patch adds ability to read configuration using already open file descriptor. Started by Steve G and refined a bit by me.
Diffstat (limited to 'common/ini/ini_config.h')
-rw-r--r--common/ini/ini_config.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/common/ini/ini_config.h b/common/ini/ini_config.h
index 1fee48ac0..5ae49814a 100644
--- a/common/ini/ini_config.h
+++ b/common/ini/ini_config.h
@@ -97,23 +97,42 @@ const char *validation_error_str(int parsing_error);
/* Read configuration information from a file */
int config_from_file(const char *application, /* Name of the application - will be used as name of the collection */
- const char *config_file, /* Name of the config file - if NULL the collection will be empty */
+ const char *config_filename, /* 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 errors, warnings or best effort (don't break) */
struct collection_item **error_list); /* List of errors for a file */
+/* Read configuration information from a file descriptor */
+int config_from_fd(const char *application, /* Name of the application - will be used as name of the collection */
+ int fd, /* Previously opened file descriptor for the config file */
+ const char *config_source, /* Name of the file being parsed, for use when printing the error list */
+ struct collection_item **ini_config, /* If *ini_config is NULL a new ini object will be allocated*/
+ 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 */
+
/* Read configuration information from a file with extra collection of line numbers */
int config_from_file_with_lines(
const char *application, /* Name of the application - will be used as name of the collection */
- const char *config_file, /* Name of the config file - if NULL the collection will be empty */
+ const char *config_filename, /* 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 errors, warnings or best effort (don't break) */
struct collection_item **error_list, /* List of errors for a file */
struct collection_item **lines); /* Collection of pairs where key is the key and value is line number */
+/* Read configuration information from a file descriptor with extra collection of line numbers */
+int config_from_fd_with_lines(
+ const char *application, /* Name of the application - will be used as name of the collection */
+ int fd, /* Previously opened file descriptor for the config file */
+ const char *config_source, /* Name of the file being parsed, for use when printing the error list */
+ 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 errors, warnings or best effort (don't break) */
+ struct collection_item **error_list, /* List of errors for a file */
+ struct collection_item **lines); /* Collection of pairs where key is the key and value is line number */
+
/* Read default config file and then overwrite it with a specific one from the directory */
int config_for_app(const char *application, /* Name of the application that will be used to get config for */