1 #ifndef ACTIONS_H_INCLUDED
2 #define ACTIONS_H_INCLUDED
3 #define ACTIONS_H_VERSION "$Id: actions.h,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
4 /*********************************************************************
6 * File : $Source: /cvsroot/ijbswa/current/src/actions.h,v $
8 * Purpose : Declares functions to work with actions files
9 * Functions declared include: FIXME
11 * Copyright : Written by and Copyright (C) 2001 the SourceForge
12 * Privoxy team. http://www.privoxy.org/
14 * Based on the Internet Junkbuster originally written
15 * by and Copyright (C) 1997 Anonymous Coders and
16 * Junkbusters Corporation. http://www.junkbusters.com
18 * This program is free software; you can redistribute it
19 * and/or modify it under the terms of the GNU General
20 * Public License as published by the Free Software
21 * Foundation; either version 2 of the License, or (at
22 * your option) any later version.
24 * This program is distributed in the hope that it will
25 * be useful, but WITHOUT ANY WARRANTY; without even the
26 * implied warranty of MERCHANTABILITY or FITNESS FOR A
27 * PARTICULAR PURPOSE. See the GNU General Public
28 * License for more details.
30 * The GNU General Public License should be included with
31 * this file. If not, you can view it at
32 * http://www.gnu.org/copyleft/gpl.html
33 * or write to the Free Software Foundation, Inc., 59
34 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 * Revision 2.0 2002/06/04 14:34:21 jongfoster
39 * Moving source files to src/
41 * Revision 1.12 2002/05/06 07:56:50 oes
42 * Made actions_to_html independent of FEATURE_CGI_EDIT_ACTIONS
44 * Revision 1.11 2002/04/30 11:14:52 oes
45 * Made csp the first parameter in *action_to_html
47 * Revision 1.10 2002/04/26 12:53:33 oes
48 * - actions_to_html signature change
49 * - current_action_to_text: renamed to current_action_to_html
50 * and signature change
52 * Revision 1.9 2002/03/26 22:29:54 swa
53 * we have a new homepage!
55 * Revision 1.8 2002/03/24 13:25:43 swa
56 * name change related issues
58 * Revision 1.7 2002/03/16 23:54:06 jongfoster
59 * Adding graceful termination feature, to help look for memory leaks.
60 * If you enable this (which, by design, has to be done by hand
61 * editing config.h) and then go to http://i.j.b/die, then the program
62 * will exit cleanly after the *next* request. It should free all the
63 * memory that was used.
65 * Revision 1.6 2001/10/23 21:30:30 jongfoster
66 * Adding error-checking to selected functions.
68 * Revision 1.5 2001/10/14 21:58:22 jongfoster
69 * Adding support for the CGI-based editor:
70 * - Exported get_actions()
71 * - Added new function free_alias_list()
72 * - Added support for {{settings}} and {{description}} blocks
73 * in the actions file. They are currently ignored.
74 * - Added restriction to only one {{alias}} block which must appear
75 * first in the file, to simplify the editor's rewriting rules.
76 * - Note that load_actions_file() is no longer used by the CGI-based
77 * editor, but some of the other routines in this file are.
79 * Revision 1.4 2001/09/16 15:47:37 jongfoster
80 * First version of CGI-based edit interface. This is very much a
81 * work-in-progress, and you can't actually use it to edit anything
82 * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
85 * Revision 1.3 2001/09/14 00:17:32 jongfoster
86 * Tidying up memory allocation. New function init_action().
88 * Revision 1.2 2001/07/29 19:01:11 jongfoster
89 * Changed _FILENAME_H to FILENAME_H_INCLUDED.
90 * Added forward declarations for needed structures.
92 * Revision 1.1 2001/05/31 21:16:46 jongfoster
93 * Moved functions to process the action list into this new file.
96 *********************************************************************/
105 struct current_action_spec;
111 * This structure is used to hold user-defined aliases
115 const char * name; /**< Alias name. */
116 struct action_spec action[1]; /**< Alias value. */
117 struct action_alias * next; /**< Next alias in list */
121 extern jb_err get_actions (char *line,
122 struct action_alias * alias_list,
123 struct action_spec *cur_action);
124 extern void free_alias_list(struct action_alias *alias_list);
126 extern void init_action(struct action_spec *dest);
127 extern void free_action(struct action_spec *src);
128 extern jb_err merge_actions (struct action_spec *dest,
129 const struct action_spec *src);
130 extern jb_err copy_action (struct action_spec *dest,
131 const struct action_spec *src);
132 extern char * actions_to_text (struct action_spec *action);
133 extern char * actions_to_html (struct client_state *csp,
134 struct action_spec *action);
135 extern void init_current_action (struct current_action_spec *dest);
136 extern void free_current_action (struct current_action_spec *src);
137 extern jb_err merge_current_action (struct current_action_spec *dest,
138 const struct action_spec *src);
139 extern char * current_action_to_html(struct client_state *csp,
140 struct current_action_spec *action);
142 extern jb_err get_action_token(char **line, char **name, char **value);
143 extern void unload_actions_file(void *file_data);
144 extern int load_actions_file(struct client_state *csp);
146 #ifdef FEATURE_GRACEFUL_TERMINATION
147 void unload_current_actions_file(void);
151 /* Revision control strings from this header and associated .c file */
152 extern const char actions_rcs[];
153 extern const char actions_h_rcs[];
159 #endif /* ndef ACTIONS_H_INCLUDED */