[asterisk-commits] qwell: branch group/ast_storage r66875 -
/team/group/ast_storage/main/storage.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri Jun 1 09:20:39 MST 2007
Author: qwell
Date: Fri Jun 1 11:20:38 2007
New Revision: 66875
URL: http://svn.digium.com/view/asterisk?view=rev&rev=66875
Log:
Add create/free for the null storage engine.
Modified:
team/group/ast_storage/main/storage.c
Modified: team/group/ast_storage/main/storage.c
URL: http://svn.digium.com/view/asterisk/team/group/ast_storage/main/storage.c?view=diff&rev=66875&r1=66874&r2=66875
==============================================================================
--- team/group/ast_storage/main/storage.c (original)
+++ team/group/ast_storage/main/storage.c Fri Jun 1 11:20:38 2007
@@ -34,6 +34,25 @@
#include "asterisk/module.h"
static AST_RWLIST_HEAD_STATIC(storage_engines, ast_storage_be);
+
+struct ast_storage_null {
+ const struct ast_storage_be *be;
+};
+
+const struct ast_storage_be null_se;
+
+static struct ast_storage *se_create_null(const char *uri)
+{
+ struct ast_storage_null *nst = ast_calloc(1, sizeof(struct ast_storage_null));
+ nst->be = &null_se;
+ return ((struct ast_storage *)nst);
+}
+
+static int se_free_null(struct ast_storage *st)
+{
+ free(st);
+ return 0;
+}
int __ast_register_storage(const struct ast_storage_be *e, struct ast_module *mod)
{
@@ -267,6 +286,8 @@
const struct ast_storage_be null_se = {
.name = "null",
+ .create = se_create_null,
+ .free = se_free_null,
};
int ast_storage_engine_init(void)
More information about the asterisk-commits
mailing list