[asterisk-commits] dvossel: branch dvossel/awesomehooks r286866 - in /team/dvossel/awesomehooks:...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 14 17:24:35 CDT 2010
Author: dvossel
Date: Tue Sep 14 17:24:32 2010
New Revision: 286866
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=286866
Log:
awesomehook.c skeleton
Added:
team/dvossel/awesomehooks/main/awesomehook.c (with props)
Modified:
team/dvossel/awesomehooks/include/asterisk/awesomehook.h
Modified: team/dvossel/awesomehooks/include/asterisk/awesomehook.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/awesomehooks/include/asterisk/awesomehook.h?view=diff&rev=286866&r1=286865&r2=286866
==============================================================================
--- team/dvossel/awesomehooks/include/asterisk/awesomehook.h (original)
+++ team/dvossel/awesomehooks/include/asterisk/awesomehook.h Tue Sep 14 17:24:32 2010
@@ -59,22 +59,6 @@
*/
typedef int (*ast_awesomehook_destroy_callback)(struct ast_awesomehook *awesomehook);
-struct ast_awesomehook {
- ast_mutex_t lock;
- /*! Current awesomehook status. */
- enum ast_awesomehook_status status;
- /*! The last event type that went to the awesomehook event callback */
- enum ast_awesomehook_event last_event;
- /*! This pointer holds any stateful data an application wishes to store. */
- void *datastore;
- /*! This pointer to ast_channel the awesomehook is attached to. */
- struct ast_channel chan;
- /*! Pointer to the registered event callback function. */
- ast_awesomehook_event_callback event_cb;
- /*! Pointer to the registered destruction callback function. */
- ast_awesomehook_destroy_callback destroy_cb;
-};
-
/*!
* \brief Initialize a new awesomehook structure.
*
@@ -82,8 +66,11 @@
* event occurs on the awesomehook.
* \param destroy_cb is option. This function is called immediately before the
* awesomehook is destroyed so cleanup can occur.
+ *
+ * \retval pointer to allocated awesomehook on Success, NULL on failure.
*/
-int ast_awesomehook_alloc(ast_awesomehook_event_callback event_cb,
+struct ast_awesomehook *ast_awesomehook_alloc(
+ ast_awesomehook_event_callback event_cb,
ast_awesomehook_destroy_callback destroy_cb);
/*!
@@ -125,7 +112,7 @@
* \param awesomehook to mark for detachment.
* \retval 0 success, -1 failure
*/
-int ast_awesomehook_destroy(struct ast_awesomehook);
+int ast_awesomehook_destroy(struct ast_awesomehook *awesomehoook);
/*!
* \brief Return the status of an awesomehook.
Added: team/dvossel/awesomehooks/main/awesomehook.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/awesomehooks/main/awesomehook.c?view=auto&rev=286866
==============================================================================
--- team/dvossel/awesomehooks/main/awesomehook.c (added)
+++ team/dvossel/awesomehooks/main/awesomehook.c Tue Sep 14 17:24:32 2010
@@ -1,0 +1,95 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * David Vossel <dvossel 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 Awesomehooks Architecture
+ *
+ * \author David Vossel <dvossel at digium.com>
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/channel.h"
+#include "asterisk/lock.h"
+#include "asterisk/linkedlists.h"
+#include "asterisk/awesomehook.h"
+#include "asterisk/frame.h"
+
+
+struct ast_awesomehook {
+ ast_mutex_t lock;
+ /*! Current awesomehook status. */
+ enum ast_awesomehook_status status;
+ /*! The last event type that went to the awesomehook event callback */
+ enum ast_awesomehook_event last_event;
+ /*! This pointer holds any stateful data an application wishes to store. */
+ void *datastore;
+ /*! This pointer to ast_channel the awesomehook is attached to. */
+ struct ast_channel chan;
+ /*! Pointer to the registered event callback function. */
+ ast_awesomehook_event_callback event_cb;
+ /*! Pointer to the registered destruction callback function. */
+ ast_awesomehook_destroy_callback destroy_cb;
+};
+
+struct ast_awesomehook *ast_awesomehook_alloc(
+ ast_awesomehook_event_callback event_cb,
+ ast_awesomehook_destroy_callback destroy_cb)
+{
+
+ return NULL;
+}
+
+int ast_awesomehook_attach(struct ast_channel *chan)
+{
+
+ return 0;
+}
+
+int ast_awesomehook_signal_cleanup(struct ast_awesomehook *awesomehook)
+{
+
+ return 0;
+}
+
+int ast_awesomehook_destroy(struct ast_awesomehook *awesomehook)
+{
+
+ return 0;
+}
+
+enum ast_awesomehook_status ast_awesomehook_get_status(struct ast_awesomehook *awesomehook)
+{
+
+ return 0;
+}
+
+int ast_awesomehook_set_datastore(struct ast_awesomehook *awesomehook, void *data)
+{
+
+ return 0;
+}
+
+void *ast_awesomehook_get_datastore(struct ast_awesomehook *awesomehook)
+{
+
+ return NULL;
+}
Propchange: team/dvossel/awesomehooks/main/awesomehook.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/dvossel/awesomehooks/main/awesomehook.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/dvossel/awesomehooks/main/awesomehook.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list