summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-03-11 22:55:16 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-03-11 22:55:16 +0000
commitd02f74ebfe5354833d304c47c77849dcfd604cfe (patch)
tree044b5e038aebbcadb348b2b79dc47b6fea73339e /include
parentc89a4be6e7764e69458181da254454832221e92d (diff)
An offhand comment from Russell made me realize that the configuration file
caching would not work properly for users.conf and any other file read from more than one place. I needed to add the filename which requested the config file to get it to work properly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/config.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/asterisk/config.h b/include/asterisk/config.h
index 4757d5126..793bb89ff 100644
--- a/include/asterisk/config.h
+++ b/include/asterisk/config.h
@@ -64,7 +64,7 @@ struct ast_variable {
char stuff[0];
};
-typedef struct ast_config *config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config, struct ast_flags flags, const char *suggested_include_file);
+typedef struct ast_config *config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config, struct ast_flags flags, const char *suggested_include_file, const char *who_asked);
typedef struct ast_variable *realtime_var_get(const char *database, const char *table, va_list ap);
typedef struct ast_config *realtime_multi_get(const char *database, const char *table, va_list ap);
typedef int realtime_update(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap);
@@ -86,6 +86,7 @@ struct ast_config_engine {
/*! \brief Load a config file
* \param filename path of file to open. If no preceding '/' character, path is considered relative to AST_CONFIG_DIR
* Create a config structure from a given configuration file.
+ * \param who_asked The module which is making this request.
* \param flags Optional flags:
* CONFIG_FLAG_WITHCOMMENTS - load the file with comments intact;
* CONFIG_FLAG_FILEUNCHANGED - check the file mtime and return CONFIG_STATUS_FILEUNCHANGED if the mtime is the same; or
@@ -94,7 +95,9 @@ struct ast_config_engine {
* \retval an ast_config data structure on success
* \retval NULL on error
*/
-struct ast_config *ast_config_load(const char *filename, struct ast_flags flags);
+struct ast_config *ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags);
+
+#define ast_config_load(filename, flags) ast_config_load2(filename, __FILE__, flags)
/*! \brief Destroys a config
* \param config pointer to config data structure
@@ -282,7 +285,7 @@ int ast_variable_update(struct ast_category *category, const char *variable,
int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator);
-struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl_file);
+struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl_file, const char *who_asked);
/*! \brief Support code to parse config file arguments
*