From: Fabian Keil Date: Wed, 29 Feb 2012 19:31:12 +0000 (+0000) Subject: Use an enum for the type of the action value. X-Git-Tag: v_3_0_20~417 X-Git-Url: http://www.privoxy.org/gitweb/templates.html?a=commitdiff_plain;h=14da7221ea6fd8e051eeceecbe31b81e0368f1c8;p=privoxy.git Use an enum for the type of the action value. --- diff --git a/actions.c b/actions.c index b9c63af9..cd8e8e71 100644 --- a/actions.c +++ b/actions.c @@ -1,4 +1,4 @@ -const char actions_rcs[] = "$Id: actions.c,v 1.75 2011/12/31 14:49:58 fabiankeil Exp $"; +const char actions_rcs[] = "$Id: actions.c,v 1.76 2011/12/31 14:50:20 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.c,v $ @@ -69,11 +69,13 @@ const char actions_h_rcs[] = ACTIONS_H_VERSION; * an enumerated type (well, the preprocessor equivalent). Here are * the values: */ -#define AV_NONE 0 /* +opt -opt */ -#define AV_ADD_STRING 1 /* +stropt{string} */ -#define AV_REM_STRING 2 /* -stropt */ -#define AV_ADD_MULTI 3 /* +multiopt{string} +multiopt{string2} */ -#define AV_REM_MULTI 4 /* -multiopt{string} -multiopt */ +enum action_value_type { + AV_NONE = 0, /* +opt -opt */ + AV_ADD_STRING = 1, /* +stropt{string} */ + AV_REM_STRING = 2, /* -stropt */ + AV_ADD_MULTI = 3, /* +multiopt{string} +multiopt{string2} */ + AV_REM_MULTI = 4 /* -multiopt{string} -multiopt */ +}; /* * We need a structure to hold the name, flag changes, @@ -84,7 +86,7 @@ struct action_name const char * name; unsigned long mask; /* a bit set to "0" = remove action */ unsigned long add; /* a bit set to "1" = add action */ - int takes_value; /* an AV_... constant */ + enum action_value_type takes_value; /* an AV_... constant */ int index; /* index into strings[] or multi[] */ };