[asterisk-commits] twilson: branch twilson/res_config_sqlite3 r331311 - /team/twilson/res_config...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 9 19:20:43 CDT 2011
Author: twilson
Date: Tue Aug 9 19:20:40 2011
New Revision: 331311
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=331311
Log:
Stub out the sqlite3 config engine
Added:
team/twilson/res_config_sqlite3/res/res_config_sqlite3.c (with props)
Added: team/twilson/res_config_sqlite3/res/res_config_sqlite3.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/res_config_sqlite3/res/res_config_sqlite3.c?view=auto&rev=331311
==============================================================================
--- team/twilson/res_config_sqlite3/res/res_config_sqlite3.c (added)
+++ team/twilson/res_config_sqlite3/res/res_config_sqlite3.c Tue Aug 9 19:20:40 2011
@@ -1,0 +1,153 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2011, Terry Wilson
+ *
+ * Terry Wilson <twilson 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.
+ *
+ * Please follow coding guidelines
+ * http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
+ */
+
+/*! \file
+ *
+ * \brief SQLite 3 configuration engine
+ *
+ * \author\verbatim Terry Wilson <twilson at digium.com> \endverbatim
+ *
+ * This is a realtime configuration engine for the SQLite 3 Database
+ * \ingroup resources
+ */
+
+/*** MODULEINFO
+ <depend>sqlite3</depend>
+ <support_level>core</support_level>
+ ***/
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/module.h"
+#include "asterisk/config.h"
+
+/*** DOCUMENTATION
+ ***/
+
+static struct ast_config *sqlite3_realtime_load(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);
+static struct ast_variable *sqlite3_realtime(const char *database, const char *table, va_list ap);
+static struct ast_config *sqlite3_realtime_multi(const char *database, const char *table, va_list ap);
+static int sqlite3_realtime_update(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap);
+static int sqlite3_realtime_update2(const char *database, const char *table, va_list ap);
+static int sqlite3_realtime_store(const char *database, const char *table, va_list ap);
+static int sqlite3_realtime_destroy(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap);
+static int sqlite3_realtime_require(const char *database, const char *table, va_list ap);
+static int sqlite3_realtime_unload(const char *database, const char *table);
+
+struct ast_config_engine sqlite3_config_engine = {
+ .load_func = sqlite3_realtime_load,
+ .realtime_func = sqlite3_realtime,
+ .realtime_multi_func = sqlite3_realtime_multi,
+ .update_func = sqlite3_realtime_update,
+ .update2_func = sqlite3_realtime_update2,
+ .store_func = sqlite3_realtime_store,
+ .destroy_func = sqlite3_realtime_destroy,
+ .require_func = sqlite3_realtime_require,
+ .unload_func = sqlite3_realtime_unload,
+};
+
+/*!
+ * \return ast_config on success, NULL on failure
+ */
+static struct ast_config *sqlite3_realtime_load(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)
+{
+ return NULL;
+}
+
+/*!
+ * \return ast_variable list for single result on success, NULL on empty/failure
+ */
+static struct ast_variable *sqlite3_realtime(const char *database, const char *table, va_list ap)
+{
+ return NULL;
+}
+
+/*!
+ * \return ast_config containing possibly many results on success, NULL on empty/failure
+ */
+static struct ast_config *sqlite3_realtime_multi(const char *database, const char *table, va_list ap)
+{
+ return NULL;
+}
+
+/*!
+ * \return Number of rows affected or -1 on error
+ */
+static int sqlite3_realtime_update(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap)
+{
+ return 0;
+}
+
+/*!
+ * \return Number of rows affected or -1 on error
+ */
+static int sqlite3_realtime_update2(const char *database, const char *table, va_list ap)
+{
+ return 0;
+}
+
+/*!
+ * \return Number of rows affected or -1 on error
+ */
+static int sqlite3_realtime_store(const char *database, const char *table, va_list ap)
+{
+ return 0;
+}
+
+/*!
+ * \return Number of rows affected or -1 on error
+ */
+static int sqlite3_realtime_destroy(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap)
+{
+ return 0;
+}
+
+/*!
+ * \retval 0 Required fields met specified standards
+ * \retval -1 One or more fields was missing or insufficient
+ */
+static int sqlite3_realtime_require(const char *database, const char *table, va_list ap)
+{
+ return 0;
+}
+
+/*!
+ * \retval 0 If any cache was purged
+ * \retval -1 If no cache was found
+ */
+static int sqlite3_realtime_unload(const char *database, const char *table)
+{
+ return 0;
+}
+
+static int unload_module(void)
+{
+ return 0;
+}
+
+static int load_module(void)
+{
+ return AST_MODULE_LOAD_SUCCESS;
+}
+
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SQLite 3 realtime config engine");
Propchange: team/twilson/res_config_sqlite3/res/res_config_sqlite3.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/twilson/res_config_sqlite3/res/res_config_sqlite3.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/twilson/res_config_sqlite3/res/res_config_sqlite3.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list