00001 #ifndef ACTIONS_H_INCLUDED
00002 #define ACTIONS_H_INCLUDED
00003 #define ACTIONS_H_VERSION "$Id: actions.h,v 2.1 2002/06/04 17:55:24 jongfoster Exp $"
00004 /* ******************************************************************
00005 * $Source: /cvsroot/ijbswa/current/src/actions.h,v $
00006 * ******************************************************************
00007 *
00008 * Written by and Copyright (C) 2001 the SourceForge
00009 * Privoxy team. http://www.privoxy.org/
00010 *
00011 * Based on the Internet Junkbuster originally written
00012 * by and Copyright (C) 1997 Anonymous Coders and
00013 * Junkbusters Corporation. http://www.junkbusters.com
00014 *
00015 * This program is free software; you can redistribute it
00016 * and/or modify it under the terms of the GNU General
00017 * Public License as published by the Free Software
00018 * Foundation; either version 2 of the License, or (at
00019 * your option) any later version.
00020 *
00021 * This program is distributed in the hope that it will
00022 * be useful, but WITHOUT ANY WARRANTY; without even the
00023 * implied warranty of MERCHANTABILITY or FITNESS FOR A
00024 * PARTICULAR PURPOSE. See the GNU General Public
00025 * License for more details.
00026 *
00027 * The GNU General Public License should be included with
00028 * this file. If not, you can view it at
00029 * http://www.gnu.org/copyleft/gpl.html
00030 * or write to the Free Software Foundation, Inc., 59
00031 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00032 *
00033 * *****************************************************************/
00034 /**
00035 * @file
00036 *
00037 * Declares functions to work with actions files
00038 * Functions declared include: FIXME
00039 *
00040 *
00041 * $Log: actions.h,v $
00042 * Revision 2.1 2002/06/04 17:55:24 jongfoster
00043 * Adding comments
00044 *
00045 * Revision 2.0 2002/06/04 14:34:21 jongfoster
00046 * Moving source files to src/
00047 *
00048 * Revision 1.12 2002/05/06 07:56:50 oes
00049 * Made actions_to_html independent of FEATURE_CGI_EDIT_ACTIONS
00050 *
00051 * Revision 1.11 2002/04/30 11:14:52 oes
00052 * Made csp the first parameter in *action_to_html
00053 *
00054 * Revision 1.10 2002/04/26 12:53:33 oes
00055 * - actions_to_html signature change
00056 * - current_action_to_text: renamed to current_action_to_html
00057 * and signature change
00058 *
00059 * Revision 1.9 2002/03/26 22:29:54 swa
00060 * we have a new homepage!
00061 *
00062 * Revision 1.8 2002/03/24 13:25:43 swa
00063 * name change related issues
00064 *
00065 * Revision 1.7 2002/03/16 23:54:06 jongfoster
00066 * Adding graceful termination feature, to help look for memory leaks.
00067 * If you enable this (which, by design, has to be done by hand
00068 * editing config.h) and then go to http://i.j.b/die, then the program
00069 * will exit cleanly after the *next* request. It should free all the
00070 * memory that was used.
00071 *
00072 * Revision 1.6 2001/10/23 21:30:30 jongfoster
00073 * Adding error-checking to selected functions.
00074 *
00075 * Revision 1.5 2001/10/14 21:58:22 jongfoster
00076 * Adding support for the CGI-based editor:
00077 * - Exported get_actions()
00078 * - Added new function free_alias_list()
00079 * - Added support for {{settings}} and {{description}} blocks
00080 * in the actions file. They are currently ignored.
00081 * - Added restriction to only one {{alias}} block which must appear
00082 * first in the file, to simplify the editor's rewriting rules.
00083 * - Note that load_actions_file() is no longer used by the CGI-based
00084 * editor, but some of the other routines in this file are.
00085 *
00086 * Revision 1.4 2001/09/16 15:47:37 jongfoster
00087 * First version of CGI-based edit interface. This is very much a
00088 * work-in-progress, and you can't actually use it to edit anything
00089 * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
00090 * to have any effect.
00091 *
00092 * Revision 1.3 2001/09/14 00:17:32 jongfoster
00093 * Tidying up memory allocation. New function init_action().
00094 *
00095 * Revision 1.2 2001/07/29 19:01:11 jongfoster
00096 * Changed _FILENAME_H to FILENAME_H_INCLUDED.
00097 * Added forward declarations for needed structures.
00098 *
00099 * Revision 1.1 2001/05/31 21:16:46 jongfoster
00100 * Moved functions to process the action list into this new file.
00101 *
00102 *
00103 */
00104 /* *****************************************************************/
00105
00106
00107 #ifdef __cplusplus
00108 extern "C" {
00109 #endif
00110
00111
00112 struct action_spec;
00113 struct current_action_spec;
00114 struct client_state;
00115
00116
00117
00118 /**
00119 * This structure is used to hold user-defined aliases
00120 */
00121 struct action_alias
00122 {
00123 const char * name; /**< Alias name. */
00124 struct action_spec action[1]; /**< Alias value. */
00125 struct action_alias * next; /**< Next alias in list */
00126 };
00127
00128
00129 extern jb_err get_actions (char *line,
00130 struct action_alias * alias_list,
00131 struct action_spec *cur_action);
00132 extern void free_alias_list(struct action_alias *alias_list);
00133
00134 extern void init_action(struct action_spec *dest);
00135 extern void free_action(struct action_spec *src);
00136 extern jb_err merge_actions (struct action_spec *dest,
00137 const struct action_spec *src);
00138 extern jb_err copy_action (struct action_spec *dest,
00139 const struct action_spec *src);
00140 extern char * actions_to_text (struct action_spec *action);
00141 extern char * actions_to_html (struct client_state *csp,
00142 struct action_spec *action);
00143 extern void init_current_action (struct current_action_spec *dest);
00144 extern void free_current_action (struct current_action_spec *src);
00145 extern jb_err merge_current_action (struct current_action_spec *dest,
00146 const struct action_spec *src);
00147 extern char * current_action_to_html(struct client_state *csp,
00148 struct current_action_spec *action);
00149
00150 extern jb_err get_action_token(char **line, char **name, char **value);
00151 extern void unload_actions_file(void *file_data);
00152 extern int load_actions_file(struct client_state *csp);
00153
00154 #ifdef FEATURE_GRACEFUL_TERMINATION
00155 void unload_current_actions_file(void);
00156 #endif
00157
00158
00159 /* Revision control strings from this header and associated .c file */
00160
00161 /** Version information about actions.c. */
00162 extern const char actions_rcs[];
00163
00164 /** Version information about actions.h. */
00165 extern const char actions_h_rcs[];
00166
00167 #ifdef __cplusplus
00168 } /* extern "C" */
00169 #endif
00170
00171 #endif /* ndef ACTIONS_H_INCLUDED */
00172
00173 /*
00174 Local Variables:
00175 tab-width: 3
00176 end:
00177 */
00178
1.2.15