summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/astdb.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/astdb.h b/include/asterisk/astdb.h
index cfbebbc30..e27a6515d 100644
--- a/include/asterisk/astdb.h
+++ b/include/asterisk/astdb.h
@@ -36,6 +36,17 @@ struct ast_db_entry {
/*!\brief Get key value specified by family/key */
int ast_db_get(const char *family, const char *key, char *out, int outlen);
+/*!\brief Get key value specified by family/key as a heap allocated string.
+ *
+ * Given a \a family and \a key, sets \a out to a pointer to a heap
+ * allocated string. In the event of an error, \a out will be set to
+ * NULL. The string must be freed by calling ast_free().
+ *
+ * \retval -1 An error occurred
+ * \retval 0 Success
+ */
+int ast_db_get_allocated(const char *family, const char *key, char **out);
+
/*!\brief Store value addressed by family/key */
int ast_db_put(const char *family, const char *key, const char *value);