[asterisk-commits] twilson: branch twilson/config_work r366504 - in /team/twilson/config_work: a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 14 18:07:45 CDT 2012


Author: twilson
Date: Mon May 14 18:07:41 2012
New Revision: 366504

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=366504
Log:
Add the snapshot alloc function to the CONFIG_INFO_STANDARD macro

Modified:
    team/twilson/config_work/apps/app_skel.c
    team/twilson/config_work/include/asterisk/config_options.h
    team/twilson/config_work/main/udptl.c

Modified: team/twilson/config_work/apps/app_skel.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/apps/app_skel.c?view=diff&rev=366504&r1=366503&r2=366504
==============================================================================
--- team/twilson/config_work/apps/app_skel.c (original)
+++ team/twilson/config_work/apps/app_skel.c Mon May 14 18:07:41 2012
@@ -163,9 +163,8 @@
 
 static AO2_GLOBAL_OBJ_STATIC(globals, 1);
 
-CONFIG_INFO_STANDARD(cfg_info, "app_skel.conf", globals,
+CONFIG_INFO_STANDARD(cfg_info, "app_skel.conf", globals, skel_config_alloc,
 	.types = { &general_options, &private_options, NULL },
-	.snapshot_alloc = skel_config_alloc,
 );
 
 static void skel_global_config_destructor(void *obj)

Modified: team/twilson/config_work/include/asterisk/config_options.h
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/include/asterisk/config_options.h?view=diff&rev=366504&r1=366503&r2=366504
==============================================================================
--- team/twilson/config_work/include/asterisk/config_options.h (original)
+++ team/twilson/config_work/include/asterisk/config_options.h Mon May 14 18:07:41 2012
@@ -154,10 +154,14 @@
 /*! \def CONFIG_INFO_STANDARD
  * \brief Declare an aco_info struct with default module and preload values
  * \param name The name of the struct
+ * \param fn The filename of the config
+ * \param arr The global object array for holding the user-defined config object
+ * \param alloc The allocater for the user-defined config object
+ *
  * Example:
  * \code
- * static AO2_GLOBAL_OBJ_STATIC(globals, NUM_GLOBALS);
- * CONFIG_INFO_STANDARD(cfg_info, "app_skel.conf", globals,
+ * static AO2_GLOBAL_OBJ_STATIC(globals, 1);
+ * CONFIG_INFO_STANDARD(cfg_info, "app_skel.conf", globals, skel_config_alloc,
  *     .pre_apply_config = skel_pre_apply_config,
  * );
  * ...
@@ -168,11 +172,12 @@
  * aco_info_destroy(&cfg_info);
  * \endcode
  */
-#define CONFIG_INFO_STANDARD(name, fn, arr, ...) \
+#define CONFIG_INFO_STANDARD(name, fn, arr, alloc, ...) \
 static struct aco_info name = { \
 	.module = AST_MODULE, \
 	.filename = fn, \
 	.global_obj = &arr.global, \
+	.snapshot_alloc = alloc, \
 	__VA_ARGS__ \
 };
 

Modified: team/twilson/config_work/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/main/udptl.c?view=diff&rev=366504&r1=366503&r2=366504
==============================================================================
--- team/twilson/config_work/main/udptl.c (original)
+++ team/twilson/config_work/main/udptl.c Mon May 14 18:07:41 2012
@@ -201,9 +201,8 @@
 	.category = "general",
 };
 
-CONFIG_INFO_STANDARD(cfg_info, "udptl.conf", globals,
+CONFIG_INFO_STANDARD(cfg_info, "udptl.conf", globals, udptl_snapshot_alloc,
 	.types = { &general_options, NULL },
-	.snapshot_alloc = udptl_snapshot_alloc,
 	.pre_apply_config = udptl_pre_apply_config,
 );
 




More information about the asterisk-commits mailing list