want to autogenerate stuff.
[privoxy.git] / actions.c
index 113024e..9e3f24d 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -1,4 +1,4 @@
-const char actions_rcs[] = "$Id: actions.c,v 1.21 2002/01/17 20:54:44 jongfoster Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.23 2002/03/07 03:46:16 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/actions.c,v $
@@ -33,6 +33,15 @@ const char actions_rcs[] = "$Id: actions.c,v 1.21 2002/01/17 20:54:44 jongfoster
  *
  * Revisions   :
  *    $Log: actions.c,v $
+ *    Revision 1.23  2002/03/07 03:46:16  oes
+ *    Fixed compiler warnings
+ *
+ *    Revision 1.22  2002/01/21 00:27:02  jongfoster
+ *    Allowing free_action(NULL).
+ *    Moving the functions that #include actionlist.h to the end of the file,
+ *    because the Visual C++ 97 debugger gets extremely confused if you try
+ *    to debug any code that comes after them in the file.
+ *
  *    Revision 1.21  2002/01/17 20:54:44  jongfoster
  *    Renaming free_url to free_url_spec, since it frees a struct url_spec.
  *
@@ -573,16 +582,16 @@ jb_err get_actions(char *line,
                {
                   /* append multi string. */
 
-                  struct list * remove = cur_action->multi_remove[action->index];
-                  struct list * add    = cur_action->multi_add[action->index];
+                  struct list * remove_p = cur_action->multi_remove[action->index];
+                  struct list * add_p    = cur_action->multi_add[action->index];
 
                   if ((value == NULL) || (*value == '\0'))
                   {
                      return JB_ERR_PARSE;
                   }
 
-                  list_remove_item(remove, value);
-                  err = enlist_unique(add, value, 0);
+                  list_remove_item(remove_p, value);
+                  err = enlist_unique(add_p, value, 0);
                   if (err)
                   {
                      return err;
@@ -593,8 +602,8 @@ jb_err get_actions(char *line,
                {
                   /* remove multi string. */
 
-                  struct list * remove = cur_action->multi_remove[action->index];
-                  struct list * add    = cur_action->multi_add[action->index];
+                  struct list * remove_p = cur_action->multi_remove[action->index];
+                  struct list * add_p    = cur_action->multi_add[action->index];
 
                   if ( (value == NULL) || (*value == '\0')
                      || ((*value == '*') && (value[1] == '\0')) )
@@ -604,8 +613,8 @@ jb_err get_actions(char *line,
                       *
                       * Remove *ALL*.
                       */
-                     list_remove_all(remove);
-                     list_remove_all(add);
+                     list_remove_all(remove_p);
+                     list_remove_all(add_p);
                      cur_action->multi_remove_all[action->index] = 1;
                   }
                   else
@@ -615,13 +624,13 @@ jb_err get_actions(char *line,
                      if ( !cur_action->multi_remove_all[action->index] )
                      {
                         /* there isn't a catch-all in the remove list already */
-                        err = enlist_unique(remove, value, 0);
+                        err = enlist_unique(remove_p, value, 0);
                         if (err)
                         {
                            return err;
                         }
                      }
-                     list_remove_item(add, value);
+                     list_remove_item(add_p, value);
                   }
                   break;
                }
@@ -798,6 +807,33 @@ void free_current_action (struct current_action_spec *src)
 }
 
 
+static struct file_list *current_actions_file  = NULL;
+
+
+#ifdef FEATURE_GRACEFUL_TERMINATION
+/*********************************************************************
+ *
+ * Function    :  unload_current_actions_file
+ *
+ * Description :  Unloads current actions file - reset to state at
+ *                beginning of program.
+ *
+ * Parameters  :  None
+ *
+ * Returns     :  N/A
+ *
+ *********************************************************************/
+void unload_current_actions_file(void)
+{
+   if (current_actions_file)
+   {
+      current_actions_file->unloader = unload_actions_file;
+      current_actions_file = NULL;
+   }
+}
+#endif /* FEATURE_GRACEFUL_TERMINATION */
+
+
 /*********************************************************************
  *
  * Function    :  unload_actions_file
@@ -868,7 +904,6 @@ void free_alias_list(struct action_alias *alias_list)
  *********************************************************************/
 int load_actions_file(struct client_state *csp)
 {
-   static struct file_list *current_actions_file  = NULL;
 
    /*
     * Parser mode.