[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase1_step1 r298330 - in /team/dvossel/f...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 14 10:20:36 CST 2010


Author: dvossel
Date: Tue Dec 14 10:20:32 2010
New Revision: 298330

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=298330
Log:
Fixes some formatting issues, creation of a return value enum

Modified:
    team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h
    team/dvossel/fixtheworld_phase1_step1/main/format.c

Modified: team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h?view=diff&rev=298330&r1=298329&r2=298330
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h (original)
+++ team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h Tue Dec 14 10:20:32 2010
@@ -121,6 +121,12 @@
     struct ast_format_attr *fattr;
 };
 
+enum ast_format_cmp_res {
+	AST_FORMAT_CMP_IDENTICAL = 0,
+	AST_FORMAT_CMP_NO_UNION,
+	AST_FORMAT_CMP_SUBSET,
+};
+
 /*! \brief A format must register an attribute interface if it requires the use of the format attributes void pointer */
 struct ast_format_attr_interface {
     /*! format type */
@@ -128,10 +134,11 @@
 
     /*! \brief Determine if format_attr 1 is a subset of format_attr 2.
      *
-     * \retval 0, structure 1 has capabilities not present in structure 2
-     * \retval 1, structures are identical
-     * \retval 2, structure 1 is a subset of the capabilities in structure 2.*/
-    int (* const format_attr_cmp)(struct ast_format_attr *fattr1, struct ast_format_attr *fattr2);
+     * \retval AST_FORMAT_ATTR_NO_UNION, structure 1 has capabilities not present in structure 2
+     * \retval AST_FORMAT_ATTR_IDENTICAL, structures are identical
+     * \retval AST_FORMAT_ATTR_SUBSET, structure 1 is a subset of the capabilities in structure 2.
+	 */
+    enum ast_format_attr_cmp_res (* const format_attr_cmp)(struct ast_format_attr *fattr1, struct ast_format_attr *fattr2);
 
     /*! \brief Get joint attributes of same format type if they exist.
      *
@@ -144,7 +151,8 @@
     void (* const format_attr_set)(struct ast_format_attr *format_attr, va_list ap);
 };
 
-/*! \brief This function is used to set an ast_format object to represent a media format
+/*!
+ * \brief This function is used to set an ast_format object to represent a media format
  * with optional format attributes represented by format specific key value pairs.
  *
  * \details Example usage.
@@ -157,11 +165,13 @@
  *      AST_FORMAT2_SILK_RATE, 8000,
  *      AST_FORMAT2_ATTR_END);
  *
- * \return Pointer to ast_format object.
+ * \return Pointer to ast_format object, same pointer that is passed in
+ * by the first argument.
  */
 struct ast_format *ast_format_set(struct ast_format *format, enum ast_format_id id, va_list ap);
 
-/*! \brief This function is used to set an ast_format object to represent a media format
+/*!
+ * \brief This function is used to set an ast_format object to represent a media format
  * with optional capability attributes represented by format specific key value pairs.
  *
  * \details Example usage. Is this SILK format capable of 8khz
@@ -172,15 +182,17 @@
  */
 int ast_format_isset(struct ast_format *format,  va_list ap);
 
-/*! \brief Compare ast_formats structures
- *
- * retval -1, format1 is not identical to format2.
- * retval 0, both structures are identical
- * retval 1, Of same format type, and format2 is a subset of the attributes present in format1
- */
-int ast_format_cmp(struct ast_format *format1, struct ast_format format2);
-
-/*! \brief Find joint format attributes of two ast_format
+/*!
+ * \brief Compare ast_formats structures
+ *
+ * \retval AST_FORMAT_ATTR_NO_UNION, structure 1 has capabilities not present in structure 2
+ * \retval AST_FORMAT_ATTR_IDENTICAL, structures are identical
+ * \retval AST_FORMAT_ATTR_SUBSET, structure 1 is a subset of the capabilities in structure 2.
+ */
+enum ast_format_cmp_res ast_format_cmp(struct ast_format *format1, struct ast_format format2);
+
+/*!
+ * \brief Find joint format attributes of two ast_format
  * structures containing the same uid and return the union in the
  * result structure.
  *
@@ -196,7 +208,8 @@
  */
 int ast_format_attr_reg_interface(struct ast_format_attr_interface *interface);
 
-/*! \brief unregister format_attr interface with core.
+/*!
+ * \brief unregister format_attr interface with core.
  *
  * \retval 0 success
  * \retval -1 failure

Modified: team/dvossel/fixtheworld_phase1_step1/main/format.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step1/main/format.c?view=diff&rev=298330&r1=298329&r2=298330
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/main/format.c (original)
+++ team/dvossel/fixtheworld_phase1_step1/main/format.c Tue Dec 14 10:20:32 2010
@@ -41,7 +41,7 @@
 	return 0;
 }
 
-int ast_format_cmp(struct ast_format *format1, struct ast_format format2)
+enum ast_format_cmp_res ast_format_cmp(struct ast_format *format1, struct ast_format format2)
 {
 	return 0;
 }




More information about the asterisk-commits mailing list