diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-03 14:40:18 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-03 14:40:18 +0000 |
commit | 1f1cd70424b9591d2b54d62b4337ff37d730299d (patch) | |
tree | a3df2369072edcd89ef1430136406bc59bc6d821 /include | |
parent | 9a0381430f7c040e8da7442ade1e6a3df987ca00 (diff) |
Expand datastores to add the notion of inheritance. This will be needed for
the conversion of IAX2 variables from the current custom method to ast_storage.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@57691 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 55596b147..1f7f3934a 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -153,7 +153,9 @@ extern "C" { #include "asterisk/linkedlists.h" #include "asterisk/stringfields.h" #include "asterisk/compiler.h" +#include <limits.h> +#define DATASTORE_INHERIT_FOREVER INT_MAX #define AST_MAX_FDS 10 /* @@ -185,6 +187,7 @@ struct ast_generator { /*! \brief Structure for a data store type */ struct ast_datastore_info { const char *type; /*!< Type of data store */ + void *(*duplicate)(void *data); /*!< Duplicate item data (used for inheritance) */ void (*destroy)(void *data); /*!< Destroy function */ }; @@ -193,6 +196,7 @@ struct ast_datastore { char *uid; /*!< Unique data store identifier */ void *data; /*!< Contained data */ const struct ast_datastore_info *info; /*!< Data store type information */ + unsigned int inheritance; /*!< Number of levels this item will continue to be inherited */ AST_LIST_ENTRY(ast_datastore) entry; /*!< Used for easy linking */ }; @@ -608,6 +612,9 @@ struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_inf /*! \brief Free a channel datastore structure */ int ast_channel_datastore_free(struct ast_datastore *datastore); +/*! \brief Inherit datastores from a parent to a child. */ +int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to); + /*! \brief Add a datastore to a channel */ int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore); |