[asterisk-commits] file: branch file/sorcery r377921 - in /team/file/sorcery: include/asterisk/ ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Dec 12 13:56:21 CST 2012
Author: file
Date: Wed Dec 12 13:56:18 2012
New Revision: 377921
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377921
Log:
Add the skeleton files.
Added:
team/file/sorcery/include/asterisk/sorcery.h (with props)
team/file/sorcery/main/sorcery.c (with props)
Added: team/file/sorcery/include/asterisk/sorcery.h
URL: http://svnview.digium.com/svn/asterisk/team/file/sorcery/include/asterisk/sorcery.h?view=auto&rev=377921
==============================================================================
--- team/file/sorcery/include/asterisk/sorcery.h (added)
+++ team/file/sorcery/include/asterisk/sorcery.h Wed Dec 12 13:56:18 2012
@@ -1,0 +1,97 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2012, Digium, Inc.
+ *
+ * Joshua Colp <jcolp at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ * \brief Sorcery Data Access Layer API
+ * \author Joshua Colp <jcolp at digium.com>
+ * \ref AstSorcery
+ */
+
+/*!
+ * \page AstSorcery Data Access Layer API
+ *
+ * Sorcery is a unifying data access layer which utilizies the configuration framework,
+ * realtime, and astdb to allow object creation, retrieval, updating, and deletion.
+ */
+
+#ifndef _ASTERISK_SORCERY_H
+#define _ASTERISK_SORCERY_H
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/*! \brief Interface for a sorcery wizard */
+struct ast_sorcery_wizard {
+};
+
+/*! \brief Forward declaration for the sorcery main structure */
+struct ast_sorcery;
+
+/*!
+ * \brief Register a sorcery wizard
+ *
+ * \param name Name of the provider
+ * \param provider Pointer to a wizard interface
+ * \param module Pointer to the module implementing the interface
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_sorcery_wizard_register(const char *name, const struct ast_sorcery_wizard *wizard, struct ast_module *module);
+
+/*!
+ * \brief Unregister a sorcery wizard
+ *
+ * \param name Name of the wizard
+ * \param provider Pointer to the wizard interface
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_sorcery_wizard_unregister(const char *name, const struct ast_sorcery_wizard *wizard);
+
+/*!
+ * \brief Allocate a new sorcery structure
+ *
+ * \param name Optional name of the module using the sorcery API, used for explicit object->wizard mappings
+ *
+ * \retval non-NULL success
+ * \retval NULL if allocation failed
+ */
+struct ast_sorcery *ast_sorcery_alloc(const char *name);
+
+/*!
+ * \brief Increase the reference count of a sorcery structure
+ *
+ * \param sorcery Pointer to a sorcery structure
+ */
+void ast_sorcery_ref(struct ast_sorcery *sorcery);
+
+/*!
+ * \brief Decrease the reference count of a sorcery structure
+ *
+ * \param sorcery Pointer to a sorcery structure
+ */
+void ast_sorcery_unref(struct ast_sorcery *sorcery);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* _ASTERISK_SORCERY_H */
Propchange: team/file/sorcery/include/asterisk/sorcery.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/file/sorcery/include/asterisk/sorcery.h
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/file/sorcery/include/asterisk/sorcery.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/file/sorcery/main/sorcery.c
URL: http://svnview.digium.com/svn/asterisk/team/file/sorcery/main/sorcery.c?view=auto&rev=377921
==============================================================================
--- team/file/sorcery/main/sorcery.c (added)
+++ team/file/sorcery/main/sorcery.c Wed Dec 12 13:56:18 2012
@@ -1,0 +1,64 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2012, Digium, Inc.
+ *
+ * Joshua Colp <jcolp at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief Sorcery Data Access Layer API
+ *
+ * \author Joshua Colp <jcolp at digium.com>
+ */
+
+/*** MODULEINFO
+ <support_level>core</support_level>
+ ***/
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/logger.h"
+#include "asterisk/sorcery.h"
+#include "asterisk/astobj2.h"
+
+/*! \brief Registered sorcery wizards */
+struct ao2_container *wizards;
+
+int ast_sorcery_wizard_register(const char *name, const struct ast_sorcery_wizard *wizard, struct ast_module *module)
+{
+ return -1;
+}
+
+int ast_sorcery_wizard_unregister(const char *name, const struct ast_sorcery_wizard *wizard)
+{
+ return -1;
+}
+
+struct ast_sorcery *ast_sorcery_alloc(const char *name)
+{
+ return NULL;
+}
+
+void ast_sorcery_ref(struct ast_sorcery *sorcery)
+{
+ ao2_ref(sorcery, +1);
+}
+
+void ast_sorcery_unref(struct ast_sorcery *sorcery)
+{
+ ao2_ref(sorcery, -1);
+}
Propchange: team/file/sorcery/main/sorcery.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/file/sorcery/main/sorcery.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/file/sorcery/main/sorcery.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list