[asterisk-commits] kmoore: branch kmoore/stasis-bridging-channel_events r387861 - in /team/kmoor...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 7 16:17:49 CDT 2013


Author: kmoore
Date: Tue May  7 16:17:47 2013
New Revision: 387861

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387861
Log:
Multiple revisions 387805,387828

........
  r387805 | root | 2013-05-07 13:17:41 -0500 (Tue, 07 May 2013) | 14 lines
  
  Multiple revisions 387802-387803
  
  ........
    r387802 | qwell | 2013-05-07 12:53:50 -0500 (Tue, 07 May 2013) | 1 line
    
    Fix build breakage, from LOW_MEMORY fix.
  ........
    r387803 | dlee | 2013-05-07 13:12:26 -0500 (Tue, 07 May 2013) | 1 line
    
    Better explained the depths of reference stealing.
  ........
  
  Merged revisions 387802-387803 from file:///srv/subversion/repos/asterisk/trunk
........
  r387828 | root | 2013-05-07 14:17:53 -0500 (Tue, 07 May 2013) | 21 lines
  
  Multiple revisions 387824-387825
  
  ........
    r387824 | dlee | 2013-05-07 13:30:55 -0500 (Tue, 07 May 2013) | 7 lines
    
    Minor fixups to Doxygen comments.
    
    The \example tags marks an entire file as an example, not a code snippet.
    ........
    
    Merged revisions 387823 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
    r387825 | dlee | 2013-05-07 13:32:34 -0500 (Tue, 07 May 2013) | 4 lines
    
    Fixed up \example marker in lock.h Doxygen comment.
    
    The \example tags marks an entire file as an example, not a code snippet.
  ........
  
  Merged revisions 387824-387825 from file:///srv/subversion/repos/asterisk/trunk
........

Merged revisions 387805,387828 from http://svn.asterisk.org/svn/asterisk/team/group/bridge_construction

Modified:
    team/kmoore/stasis-bridging-channel_events/   (props changed)
    team/kmoore/stasis-bridging-channel_events/include/asterisk.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/json.h
    team/kmoore/stasis-bridging-channel_events/include/asterisk/lock.h
    team/kmoore/stasis-bridging-channel_events/main/manager.c
    team/kmoore/stasis-bridging-channel_events/res/res_config_pgsql.c

Propchange: team/kmoore/stasis-bridging-channel_events/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/kmoore/stasis-bridging-channel_events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May  7 16:17:47 2013
@@ -1,1 +1,1 @@
-/team/group/bridge_construction:1-387796
+/team/group/bridge_construction:1-387859

Modified: team/kmoore/stasis-bridging-channel_events/include/asterisk.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/include/asterisk.h?view=diff&rev=387861&r1=387860&r2=387861
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/include/asterisk.h (original)
+++ team/kmoore/stasis-bridging-channel_events/include/asterisk.h Tue May  7 16:17:47 2013
@@ -127,27 +127,6 @@
 char *ast_complete_source_filename(const char *partial, int n);
 
 /*!
- * \since 12
- * \brief A \ref stasis topic which publishes messages regarding system changes
- *
- * \retval \ref stasis_topic for system level changes
- * \retval NULL on error
- */
-struct stasis_topic *ast_system_topic(void);
-
-/*!
- * \since 12
- * \brief A \ref stasis_message_type for network changes
- *
- * \retval NULL on error
- * \retval \ref stasis_message_type for network changes
- *
- * \note Messages of this type should always be issued on and expected from
- *       the \ref ast_system_topic \ref stasis topic
- */
-struct stasis_message_type *ast_network_change_type(void);
-
-/*!
  * \brief Register/unregister a source code file with the core.
  * \param file the source file name
  * \param version the version string (typically a SVN revision keyword string)
@@ -221,6 +200,27 @@
 #define ast_mark(a, b) do { } while (0)
 #endif /* LOW_MEMORY */
 
+/*!
+ * \since 12
+ * \brief A \ref stasis topic which publishes messages regarding system changes
+ *
+ * \retval \ref stasis_topic for system level changes
+ * \retval NULL on error
+ */
+struct stasis_topic *ast_system_topic(void);
+
+/*!
+ * \since 12
+ * \brief A \ref stasis_message_type for network changes
+ *
+ * \retval NULL on error
+ * \retval \ref stasis_message_type for network changes
+ *
+ * \note Messages of this type should always be issued on and expected from
+ *       the \ref ast_system_topic \ref stasis topic
+ */
+struct stasis_message_type *ast_network_change_type(void);
+
 /*! \brief
  * Definition of various structures that many asterisk files need,
  * but only because they need to know that the type exists.

Modified: team/kmoore/stasis-bridging-channel_events/include/asterisk/json.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/include/asterisk/json.h?view=diff&rev=387861&r1=387860&r2=387861
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/include/asterisk/json.h (original)
+++ team/kmoore/stasis-bridging-channel_events/include/asterisk/json.h Tue May  7 16:17:47 2013
@@ -24,9 +24,54 @@
  * \brief Asterisk JSON abstraction layer.
  * \since 12.0.0
  *
- * This is a very thin wrapper around the Jansson API. For more details on it, see its
- * docs at http://www.digip.org/jansson/doc/2.4/apiref.html.
-
+ * This is a very thin wrapper around the Jansson API. For more details on it,
+ * see its docs at http://www.digip.org/jansson/doc/2.4/apiref.html.
+ *
+ * Rather than provide the multiple ways of doing things that the Jansson API
+ * does, the Asterisk wrapper is always reference-stealing, and always NULL
+ * safe.
+ *
+ * And by always, I mean that the reference is stolen even if the function
+ * fails. This avoids lots of conditional logic, and also avoids having to track
+ * zillions of local variables when building complex JSON objects. You can
+ * instead chain \c ast_json_* calls together safely and only worry about
+ * cleaning up the root object.
+ *
+ * In the cases where you have a need to introduce intermediate objects, just
+ * wrap them with json_ref() when passing them to other \c ast_json_*()
+ * functions.
+ *
+ * \code
+ *	// Example of how to use the Asterisk JSON API
+ *	static struct ast_json *foo(void) {
+ *		RAII_VAR(struct ast_json *, array, NULL, ast_json_unref);
+ *		RAII_VAR(struct ast_json *, obj, NULL, ast_json_unref);
+ *		int i, res;
+ *
+ *		array = ast_json_array_create();
+ *		if (!array) { return NULL; }
+ *
+ *		for (i = 0; i < 10; ++i) {
+ *			// NULL safety and object stealing means calls can
+ *			// be chained together directly.
+ *			res = ast_json_array_append(array,
+ *				ast_json_integer_create(i));
+ *			if (res != 0) { return NULL; }
+ *		}
+ *
+ *		obj = ast_json_object_create();
+ *		if (!obj) { return NULL; }
+ *
+ *		// If you already have an object reference, ast_json_ref()
+ *		// can be used inline to bump the ref before passing it along
+ *		// to a ref-stealing call
+ *		res = ast_json_object_set(obj, "foo", ast_json_ref(array));
+ *		if (!res) { return NULL; }
+ *
+ *		return obj;
+ *	}
+ * \endcode
+ *
  * \author David M. Lee, II <dlee at digium.com>
  */
 

Modified: team/kmoore/stasis-bridging-channel_events/include/asterisk/lock.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/include/asterisk/lock.h?view=diff&rev=387861&r1=387860&r2=387861
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/include/asterisk/lock.h (original)
+++ team/kmoore/stasis-bridging-channel_events/include/asterisk/lock.h Tue May  7 16:17:47 2013
@@ -569,7 +569,7 @@
  * the lock. When the lock goes out of scope, it will automatically
  * be unlocked.
  *
- * \example
+ * \code
  * int some_function(struct ast_channel *chan)
  * {
  *     SCOPED_LOCK(lock, chan, ast_channel_lock, ast_channel_unlock);
@@ -580,6 +580,7 @@
  *
  *     return -1;
  * }
+ * \endcode
  *
  * In the above example, neither return path requires explicit unlocking
  * of the channel.

Modified: team/kmoore/stasis-bridging-channel_events/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/main/manager.c?view=diff&rev=387861&r1=387860&r2=387861
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/main/manager.c (original)
+++ team/kmoore/stasis-bridging-channel_events/main/manager.c Tue May  7 16:17:47 2013
@@ -4716,7 +4716,7 @@
 	return 0;
 }
 
-/*
+/*!
  * \brief Manager command to add an event filter to a manager session
  * \see For more details look at manager_add_filter
  */
@@ -4750,10 +4750,9 @@
 	return 0;
 }
 
-/*
+/*!
  * \brief Add an event filter to a manager session
  *
- * \param s               manager session to modify filters on
  * \param filter_pattern  Filter syntax to add, see below for syntax
  *
  * \return FILTER_ALLOC_FAILED   Memory allocation failure
@@ -4764,9 +4763,12 @@
  * Filter can be any valid regular expression
  * Filter can be a valid regular expression prefixed with !, which will add the filter as a black filter
  *
- * \example filter_pattern = "Event: Newchannel"
- * \example filter_pattern = "Event: New.*"
- * \example filter_pattern = "!Channel: DAHDI.*"
+ * Examples:
+ * \code
+ *   filter_pattern = "Event: Newchannel"
+ *   filter_pattern = "Event: New.*"
+ *   filter_pattern = "!Channel: DAHDI.*"
+ * \endcode
  *
  */
 static enum add_filter_result manager_add_filter(const char *filter_pattern, struct ao2_container *whitefilters, struct ao2_container *blackfilters) {

Modified: team/kmoore/stasis-bridging-channel_events/res/res_config_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/res/res_config_pgsql.c?view=diff&rev=387861&r1=387860&r2=387861
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/res/res_config_pgsql.c (original)
+++ team/kmoore/stasis-bridging-channel_events/res/res_config_pgsql.c Tue May  7 16:17:47 2013
@@ -198,7 +198,7 @@
  *  \return -1 on query failure
  *  \return 0 on success
  *
- *  \example
+ *  \code
  *	int i, rows;
  *	PGresult *result;
  *	char *field_name, *field_type, *field_len, *field_notnull, *field_default;
@@ -213,7 +213,7 @@
  *		field_notnull = PQgetvalue(result, i, 3);
  *		field_default = PQgetvalue(result, i, 4);
  *	}
- *
+ *  \endcode
  */
 static int pgsql_exec(const char *database, const char *tablename, const char *sql, PGresult **result)
 {




More information about the asterisk-commits mailing list