[asterisk-commits] junky: branch junky/cli-tls r212995 - /team/junky/cli-tls/main/logger.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 18 17:27:36 CDT 2009


Author: junky
Date: Tue Aug 18 17:27:31 2009
New Revision: 212995

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=212995
Log:
switch the hardcoded values to enum, as proposed to reviewboard.


Modified:
    team/junky/cli-tls/main/logger.c

Modified: team/junky/cli-tls/main/logger.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/main/logger.c?view=diff&rev=212995&r1=212994&r2=212995
==============================================================================
--- team/junky/cli-tls/main/logger.c (original)
+++ team/junky/cli-tls/main/logger.c Tue Aug 18 17:27:31 2009
@@ -230,11 +230,16 @@
 	AST_LIST_ENTRY(logger_filter_list_item) next;
 };
 
+enum ast_cli_filter_type {
+	AST_CLI_FILTER_CHAN_NAME	= 1,
+	AST_CLI_FILTER_CID_NUM		= 2,
+	AST_CLI_FILTER_ACCOUNTCODE	= 3,
+};
 
 /* Structure for the cli filter */
 struct ast_cli_filter {
 	char *name;					/*!< Name of the filter */
-	int type;					/*!< Type of the filter currently, only 0 is used */
+	enum ast_cli_filter_type type;
 	AST_LIST_ENTRY(ast_cli_filter) filter_list;	/*!< pointer to the next element */
 };
 /* List used to store all cli filters entered by the user */
@@ -1215,13 +1220,13 @@
 
         /* Keywords are matched with filter type here */
         if (!strcmp(keyword,"name")) {
-                filter->type = 1;
+                filter->type = AST_CLI_FILTER_CHAN_NAME;
         } else if (!strcmp(keyword,"cid_num")) {
-                filter->type = 2;
+                filter->type = AST_CLI_FILTER_CID_NUM;
         } else if (!strcmp(keyword, "accountcode")) {
-                filter->type = 3;
+                filter->type = AST_CLI_FILTER_ACCOUNTCODE;
         } else {
-                filter->type = 1;
+                filter->type = AST_CLI_FILTER_CHAN_NAME;
         }
 
         ast_free(keyword);




More information about the asterisk-commits mailing list