[asterisk-commits] kpfleming: trunk r49727 - in /trunk: include/asterisk/ main/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 5 16:58:53 MST 2007


Author: kpfleming
Date: Fri Jan  5 17:58:53 2007
New Revision: 49727

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49727
Log:
a little more const-ification

Modified:
    trunk/include/asterisk/config.h
    trunk/main/config.c
    trunk/main/manager.c

Modified: trunk/include/asterisk/config.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/config.h?view=diff&rev=49727&r1=49726&r2=49727
==============================================================================
--- trunk/include/asterisk/config.h (original)
+++ trunk/include/asterisk/config.h Fri Jan  5 17:58:53 2007
@@ -176,15 +176,15 @@
 
 struct ast_category *ast_category_new(const char *name);
 void ast_category_append(struct ast_config *config, struct ast_category *cat);
-int ast_category_delete(struct ast_config *cfg, char *category);
+int ast_category_delete(struct ast_config *cfg, const char *category);
 void ast_category_destroy(struct ast_category *cat);
 struct ast_variable *ast_category_detach_variables(struct ast_category *cat);
 void ast_category_rename(struct ast_category *cat, const char *name);
 
 struct ast_variable *ast_variable_new(const char *name, const char *value);
 void ast_variable_append(struct ast_category *category, struct ast_variable *variable);
-int ast_variable_delete(struct ast_category *category, char *variable, char *match);
-int ast_variable_update(struct ast_category *category, char *variable, char *value, char *match);
+int ast_variable_delete(struct ast_category *category, const char *variable, const char *match);
+int ast_variable_update(struct ast_category *category, const char *variable, const char *value, const char *match);
 
 int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator);
 

Modified: trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/trunk/main/config.c?view=diff&rev=49727&r1=49726&r2=49727
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Fri Jan  5 17:58:53 2007
@@ -425,7 +425,7 @@
 	return config;
 }
 
-int ast_variable_delete(struct ast_category *category, char *variable, char *match)
+int ast_variable_delete(struct ast_category *category, const char *variable, const char *match)
 {
 	struct ast_variable *cur, *prev=NULL, *curn;
 	int res = -1;
@@ -474,7 +474,7 @@
 	return res;
 }
 
-int ast_variable_update(struct ast_category *category, char *variable, char *value, char *match)
+int ast_variable_update(struct ast_category *category, const char *variable, const char *value, const char *match)
 {
 	struct ast_variable *cur, *prev=NULL, *newer;
 	newer = ast_variable_new(variable, value);
@@ -525,7 +525,7 @@
 	return 0;
 }
 
-int ast_category_delete(struct ast_config *cfg, char *category)
+int ast_category_delete(struct ast_config *cfg, const char *category)
 {
 	struct ast_category *prev=NULL, *cat;
 	cat = cfg->root;

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=49727&r1=49726&r2=49727
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Fri Jan  5 17:58:53 2007
@@ -1047,13 +1047,13 @@
 			}
 		} else if (!strcasecmp(action, "delcat")) {
 			if (!ast_strlen_zero(cat))
-				ast_category_delete(cfg, (char *) cat);
+				ast_category_delete(cfg, cat);
 		} else if (!strcasecmp(action, "update")) {
 			if (!ast_strlen_zero(cat) && !ast_strlen_zero(var) && (category = ast_category_get(cfg, cat)))
-				ast_variable_update(category, (char *) var, (char *) value, (char *) match);
+				ast_variable_update(category, var, value, match);
 		} else if (!strcasecmp(action, "delete")) {
 			if (!ast_strlen_zero(cat) && !ast_strlen_zero(var) && (category = ast_category_get(cfg, cat)))
-				ast_variable_delete(category, (char *) var, (char *) match);
+				ast_variable_delete(category, var, match);
 		} else if (!strcasecmp(action, "append")) {
 			if (!ast_strlen_zero(cat) && !ast_strlen_zero(var) &&
 				(category = ast_category_get(cfg, cat)) &&



More information about the asterisk-commits mailing list