Reducing length of URLs
[privoxy.git] / actions.h
1 #ifndef ACTIONS_H_INCLUDED
2 #define ACTIONS_H_INCLUDED
3 #define ACTIONS_H_VERSION "$Id: actions.h,v 1.5 2001/10/14 21:58:22 jongfoster Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/actions.h,v $
7  *
8  * Purpose     :  Declares functions to work with actions files
9  *                Functions declared include: FIXME
10  *
11  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
12  *                IJBSWA team.  http://ijbswa.sourceforge.net
13  *
14  *                Based on the Internet Junkbuster originally written
15  *                by and Copyright (C) 1997 Anonymous Coders and 
16  *                Junkbusters Corporation.  http://www.junkbusters.com
17  *
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.
23  *
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.
29  *
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.
35  *
36  * Revisions   :
37  *    $Log: actions.h,v $
38  *    Revision 1.5  2001/10/14 21:58:22  jongfoster
39  *    Adding support for the CGI-based editor:
40  *    - Exported get_actions()
41  *    - Added new function free_alias_list()
42  *    - Added support for {{settings}} and {{description}} blocks
43  *      in the actions file.  They are currently ignored.
44  *    - Added restriction to only one {{alias}} block which must appear
45  *      first in the file, to simplify the editor's rewriting rules.
46  *    - Note that load_actions_file() is no longer used by the CGI-based
47  *      editor, but some of the other routines in this file are.
48  *
49  *    Revision 1.4  2001/09/16 15:47:37  jongfoster
50  *    First version of CGI-based edit interface.  This is very much a
51  *    work-in-progress, and you can't actually use it to edit anything
52  *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
53  *    to have any effect.
54  *
55  *    Revision 1.3  2001/09/14 00:17:32  jongfoster
56  *    Tidying up memory allocation. New function init_action().
57  *
58  *    Revision 1.2  2001/07/29 19:01:11  jongfoster
59  *    Changed _FILENAME_H to FILENAME_H_INCLUDED.
60  *    Added forward declarations for needed structures.
61  *
62  *    Revision 1.1  2001/05/31 21:16:46  jongfoster
63  *    Moved functions to process the action list into this new file.
64  *
65  *
66  *********************************************************************/
67 \f
68
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72
73
74 struct action_spec;
75 struct current_action_spec;
76 struct client_state;
77
78
79
80 /* This structure is used to hold user-defined aliases */
81 struct action_alias
82 {
83    const char * name;
84    struct action_spec action[1];
85    struct action_alias * next;
86 };
87
88
89 extern jb_err get_actions (char *line, 
90                            struct action_alias * alias_list,
91                            struct action_spec *cur_action);
92 extern void free_alias_list(struct action_alias *alias_list);
93
94 extern void init_action(struct action_spec *dest);
95 extern void free_action(struct action_spec *src);
96 extern jb_err merge_actions (struct action_spec *dest, 
97                              const struct action_spec *src);
98 extern jb_err copy_action (struct action_spec *dest, 
99                            const struct action_spec *src);
100 extern char * actions_to_text     (struct action_spec *action);
101 #ifdef FEATURE_CGI_EDIT_ACTIONS
102 extern char * actions_to_html     (struct action_spec *action);
103 #endif /* def FEATURE_CGI_EDIT_ACTIONS */
104
105 extern void init_current_action     (struct current_action_spec *dest);
106 extern void free_current_action     (struct current_action_spec *src);
107 extern jb_err merge_current_action  (struct current_action_spec *dest, 
108                                      const struct action_spec *src);
109 extern char * current_action_to_text(struct current_action_spec *action);
110
111 extern jb_err get_action_token(char **line, char **name, char **value);
112 extern void unload_actions_file(void *file_data);
113 extern int load_actions_file(struct client_state *csp);
114
115
116
117 /* Revision control strings from this header and associated .c file */
118 extern const char actions_rcs[];
119 extern const char actions_h_rcs[];
120
121 #ifdef __cplusplus
122 } /* extern "C" */
123 #endif
124
125 #endif /* ndef ACTIONS_H_INCLUDED */
126
127 /*
128   Local Variables:
129   tab-width: 3
130   end:
131 */
132