[asterisk-commits] kmoore: branch kmoore/cel_cleanup r393024 - in /team/kmoore/cel_cleanup: incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 26 16:58:00 CDT 2013


Author: kmoore
Date: Wed Jun 26 16:57:59 2013
New Revision: 393024

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393024
Log:
Do some naming cleanup

Modified:
    team/kmoore/cel_cleanup/include/asterisk/cel.h
    team/kmoore/cel_cleanup/main/cel.c
    team/kmoore/cel_cleanup/tests/test_cel.c

Modified: team/kmoore/cel_cleanup/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/include/asterisk/cel.h?view=diff&rev=393024&r1=393023&r2=393024
==============================================================================
--- team/kmoore/cel_cleanup/include/asterisk/cel.h (original)
+++ team/kmoore/cel_cleanup/include/asterisk/cel.h Wed Jun 26 16:57:59 2013
@@ -264,7 +264,7 @@
 struct stasis_topic *ast_cel_topic(void);
 
 /*! \brief A structure to hold CEL global configuration options */
-struct ast_cel_config {
+struct ast_cel_general_config {
 	AST_DECLARE_STRING_FIELDS(
 		AST_STRING_FIELD(date_format); /*!< The desired date format for logging */
 	);
@@ -279,7 +279,7 @@
  * \retval NULL on error
  * \retval The new CEL configuration object
  */
-void *ast_cel_config_alloc(void);
+void *ast_cel_general_config_alloc(void);
 
 /*!
  * \since 12
@@ -291,7 +291,7 @@
  * \retval NULL on error
  * \retval The current CEL configuration
  */
-struct ast_cel_config *ast_cel_get_config(void);
+struct ast_cel_general_config *ast_cel_get_config(void);
 
 /*!
  * \since 12
@@ -299,7 +299,7 @@
  *
  * \param config The new CEL configuration
  */
-void ast_cel_set_config(struct ast_cel_config *config);
+void ast_cel_set_config(struct ast_cel_general_config *config);
 
 struct ast_channel_snapshot;
 /*!

Modified: team/kmoore/cel_cleanup/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/main/cel.c?view=diff&rev=393024&r1=393023&r2=393024
==============================================================================
--- team/kmoore/cel_cleanup/main/cel.c (original)
+++ team/kmoore/cel_cleanup/main/cel.c Wed Jun 26 16:57:59 2013
@@ -181,19 +181,19 @@
 static struct ao2_container *linkedids;
 
 /*! \brief Destructor for cel_config */
-static void ast_cel_config_dtor(void *obj)
-{
-	struct ast_cel_config *cfg = obj;
+static void cel_general_config_dtor(void *obj)
+{
+	struct ast_cel_general_config *cfg = obj;
 	ast_string_field_free_memory(cfg);
 	ao2_cleanup(cfg->apps);
 	cfg->apps = NULL;
 }
 
-void *ast_cel_config_alloc(void)
-{
-	RAII_VAR(struct ast_cel_config *, cfg, NULL, ao2_cleanup);
-
-	if (!(cfg = ao2_alloc(sizeof(*cfg), ast_cel_config_dtor))) {
+void *ast_cel_general_config_alloc(void)
+{
+	RAII_VAR(struct ast_cel_general_config *, cfg, NULL, ao2_cleanup);
+
+	if (!(cfg = ao2_alloc(sizeof(*cfg), cel_general_config_dtor))) {
 		return NULL;
 	}
 
@@ -211,7 +211,7 @@
 
 /*! \brief A container that holds all config-related information */
 struct cel_config {
-	struct ast_cel_config *general;
+	struct ast_cel_general_config *general;
 };
 
 
@@ -233,7 +233,7 @@
 		return NULL;
 	}
 
-	if (!(cfg->general = ast_cel_config_alloc())) {
+	if (!(cfg->general = ast_cel_general_config_alloc())) {
 		return NULL;
 	}
 
@@ -241,7 +241,7 @@
 	return cfg;
 }
 
-/*! \brief An aco_type structure to link the "general" category to the ast_cel_config type */
+/*! \brief An aco_type structure to link the "general" category to the ast_cel_general_config type */
 static struct aco_type general_option = {
 	.type = ACO_GLOBAL,
 	.name = "general",
@@ -549,7 +549,7 @@
 
 static int events_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
 {
-	struct ast_cel_config *cfg = obj;
+	struct ast_cel_general_config *cfg = obj;
 	char *events = ast_strdupa(var->value);
 	char *cur_event;
 
@@ -579,7 +579,7 @@
 
 static int apps_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
 {
-	struct ast_cel_config *cfg = obj;
+	struct ast_cel_general_config *cfg = obj;
 	char *apps = ast_strdupa(var->value);
 	char *cur_app;
 
@@ -1537,8 +1537,8 @@
 		return -1;
 	}
 
-	aco_option_register(&cel_cfg_info, "enable", ACO_EXACT, general_options, "no", OPT_BOOL_T, 1, FLDSET(struct ast_cel_config, enable));
-	aco_option_register(&cel_cfg_info, "dateformat", ACO_EXACT, general_options, "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_cel_config, date_format));
+	aco_option_register(&cel_cfg_info, "enable", ACO_EXACT, general_options, "no", OPT_BOOL_T, 1, FLDSET(struct ast_cel_general_config, enable));
+	aco_option_register(&cel_cfg_info, "dateformat", ACO_EXACT, general_options, "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_cel_general_config, date_format));
 	aco_option_register_custom(&cel_cfg_info, "apps", ACO_EXACT, general_options, "", apps_handler, 0);
 	aco_option_register_custom(&cel_cfg_info, "events", ACO_EXACT, general_options, "", events_handler, 0);
 
@@ -1576,14 +1576,14 @@
 	return cel_topic;
 }
 
-struct ast_cel_config *ast_cel_get_config(void)
+struct ast_cel_general_config *ast_cel_get_config(void)
 {
 	RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
 	ao2_ref(mod_cfg->general, +1);
 	return mod_cfg->general;
 }
 
-void ast_cel_set_config(struct ast_cel_config *config)
+void ast_cel_set_config(struct ast_cel_general_config *config)
 {
 	RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
 	ao2_cleanup(mod_cfg->general);

Modified: team/kmoore/cel_cleanup/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/tests/test_cel.c?view=diff&rev=393024&r1=393023&r2=393024
==============================================================================
--- team/kmoore/cel_cleanup/tests/test_cel.c (original)
+++ team/kmoore/cel_cleanup/tests/test_cel.c Wed Jun 26 16:57:59 2013
@@ -53,10 +53,10 @@
 #define CHANNEL_TECH_NAME "CELTestChannel"
 
 /*! \brief A placeholder for Asterisk's 'real' CEL configuration */
-static struct ast_cel_config *saved_config;
+static struct ast_cel_general_config *saved_config;
 
 /*! \brief The CEL config used for CEL unit tests */
-static struct ast_cel_config *cel_test_config;
+static struct ast_cel_general_config *cel_test_config;
 
 /*! \brief A channel technology used for the unit tests */
 static struct ast_channel_tech test_cel_chan_tech = {
@@ -1387,7 +1387,7 @@
 static int load_module(void)
 {
 	/* build the test config */
-	cel_test_config = ast_cel_config_alloc();
+	cel_test_config = ast_cel_general_config_alloc();
 	if (!cel_test_config) {
 		return -1;
 	}




More information about the asterisk-commits mailing list