Resyncing HEAD with v_3_0_branch for two OSX fixes:
[privoxy.git] / src / actionlist.h
1 /*********************************************************************
2  *
3  * File        :  $Source: /cvsroot/ijbswa/current/src/actionlist.h,v $
4  *
5  * Purpose     :  Master list of supported actions.
6  *                Not really a header, since it generates code.
7  *                This is included (3 times!) from actions.c
8  *                Each time, the following macros are defined to
9  *                suitable values beforehand:
10  *                    DEFINE_ACTION_MULTI()
11  *                    DEFINE_ACTION_STRING()
12  *                    DEFINE_ACTION_BOOL()
13  *                    DEFINE_ACTION_ALIAS
14  *
15  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
16  *                Privoxy team. http://www.privoxy.org/
17  *
18  *                Based on the Internet Junkbuster originally written
19  *                by and Copyright (C) 1997 Anonymous Coders and 
20  *                Junkbusters Corporation.  http://www.junkbusters.com
21  *
22  *                This program is free software; you can redistribute it 
23  *                and/or modify it under the terms of the GNU General
24  *                Public License as published by the Free Software
25  *                Foundation; either version 2 of the License, or (at
26  *                your option) any later version.
27  *
28  *                This program is distributed in the hope that it will
29  *                be useful, but WITHOUT ANY WARRANTY; without even the
30  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
31  *                PARTICULAR PURPOSE.  See the GNU General Public
32  *                License for more details.
33  *
34  *                The GNU General Public License should be included with
35  *                this file.  If not, you can view it at
36  *                http://www.gnu.org/copyleft/gpl.html
37  *                or write to the Free Software Foundation, Inc., 59
38  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39  *
40  * Revisions   :
41  *    $Log: actionlist.h,v $
42  *    Revision 2.1  2002/09/04 14:52:18  oes
43  *    Synced with the stable branch:
44  *       Revision 1.17.2.1  2002/08/02 12:50:47  oes
45  *       Consistency with docs: Change default name for action from hide-referer to hide-referrer
46  *
47  *    Revision 2.0  2002/06/04 14:34:21  jongfoster
48  *    Moving source files to src/
49  *
50  *    Revision 1.17  2002/05/14 21:25:55  oes
51  *    Renamed prevent-(setting/reading)-cookies to crunch-(incoming/outgoing)-cookies
52  *
53  *    Revision 1.16  2002/04/24 02:15:18  oes
54  *    Renamed actions as discussed, Aliased old action names to new ones.
55  *
56  *    Revision 1.15  2002/03/26 22:29:54  swa
57  *    we have a new homepage!
58  *
59  *    Revision 1.14  2002/03/24 16:32:08  jongfoster
60  *    Removing logo option
61  *
62  *    Revision 1.13  2002/03/24 15:23:33  jongfoster
63  *    Name changes
64  *
65  *    Revision 1.12  2002/03/24 13:25:43  swa
66  *    name change related issues
67  *
68  *    Revision 1.11  2002/03/12 01:42:49  oes
69  *    Introduced modular filters
70  *
71  *    Revision 1.10  2002/03/08 18:19:14  jongfoster
72  *    Adding +image-blocker{pattern} option to edit interface
73  *
74  *    Revision 1.9  2001/11/22 21:58:41  jongfoster
75  *    Adding action +no-cookies-keep
76  *
77  *    Revision 1.8  2001/10/10 16:42:52  oes
78  *    Fixed a bug, Added +limit-connect string action
79  *
80  *    Revision 1.7  2001/10/07 15:33:59  oes
81  *    Introduced a +no-compression action
82  *    Introduced a +downgrade action
83  *
84  *    Revision 1.6  2001/09/16 15:47:37  jongfoster
85  *    First version of CGI-based edit interface.  This is very much a
86  *    work-in-progress, and you can't actually use it to edit anything
87  *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
88  *    to have any effect.
89  *
90  *    Revision 1.5  2001/07/18 12:27:03  oes
91  *    Changed deanimate-gifs to string action
92  *
93  *    Revision 1.4  2001/07/13 13:52:12  oes
94  *     - Formatting
95  *     - Introduced new action ACTION_DEANIMATE
96  *
97  *    Revision 1.3  2001/06/07 23:03:56  jongfoster
98  *    Added standard comment at top of file.
99  *
100  *
101  *********************************************************************/
102 \f
103
104 #if !(defined(DEFINE_ACTION_BOOL) && defined(DEFINE_ACTION_MULTI) && defined(DEFINE_ACTION_STRING))
105 #error Please define lots of macros before including "actionlist.h".
106 #endif /* !defined(all the DEFINE_ACTION_xxx macros) */
107
108 #ifndef DEFINE_CGI_PARAM_RADIO
109 #define DEFINE_CGI_PARAM_RADIO(name, bit, index, value, is_default)
110 #define DEFINE_CGI_PARAM_CUSTOM(name, bit, index, default_val)
111 #define DEFINE_CGI_PARAM_NO_RADIO(name, bit, index, default_val)
112 #endif /* ndef DEFINE_CGI_PARAM_RADIO */
113
114 DEFINE_ACTION_MULTI      ("add-header",                 ACTION_MULTI_ADD_HEADER)
115 DEFINE_ACTION_BOOL       ("block",                      ACTION_BLOCK)
116 DEFINE_ACTION_BOOL       ("crunch-incoming-cookies",    ACTION_NO_COOKIE_SET)
117 DEFINE_ACTION_BOOL       ("crunch-outgoing-cookies",    ACTION_NO_COOKIE_READ)
118 DEFINE_ACTION_STRING     ("deanimate-gifs",             ACTION_DEANIMATE,       ACTION_STRING_DEANIMATE)
119 DEFINE_CGI_PARAM_RADIO   ("deanimate-gifs",             ACTION_DEANIMATE,       ACTION_STRING_DEANIMATE,     "first", 0)
120 DEFINE_CGI_PARAM_RADIO   ("deanimate-gifs",             ACTION_DEANIMATE,       ACTION_STRING_DEANIMATE,     "last",  1)
121 DEFINE_ACTION_BOOL       ("downgrade-http-version",     ACTION_DOWNGRADE)
122 DEFINE_ACTION_BOOL       ("fast-redirects",             ACTION_FAST_REDIRECTS)
123 DEFINE_ACTION_MULTI      ("filter",                     ACTION_MULTI_FILTER)
124 DEFINE_ACTION_BOOL       ("handle-as-image",            ACTION_IMAGE)
125 DEFINE_ACTION_BOOL       ("hide-forwarded-for-headers", ACTION_HIDE_FORWARDED)
126 DEFINE_ACTION_STRING     ("hide-from-header",           ACTION_HIDE_FROM,       ACTION_STRING_FROM)
127 DEFINE_CGI_PARAM_RADIO   ("hide-from-header",           ACTION_HIDE_FROM,       ACTION_STRING_FROM,          "block", 1)
128 DEFINE_CGI_PARAM_CUSTOM  ("hide-from-header",           ACTION_HIDE_FROM,       ACTION_STRING_FROM,          "spam_me_senseless@sittingduck.xyz")
129 DEFINE_ACTION_STRING     ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER)
130 DEFINE_CGI_PARAM_RADIO   ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "forge", 1)
131 DEFINE_CGI_PARAM_RADIO   ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "block", 0)
132 DEFINE_CGI_PARAM_CUSTOM  ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "http://www.google.com/")
133 DEFINE_ACTION_STRING     ("hide-user-agent",            ACTION_HIDE_USER_AGENT, ACTION_STRING_USER_AGENT)
134 DEFINE_CGI_PARAM_NO_RADIO("hide-user-agent",            ACTION_HIDE_USER_AGENT, ACTION_STRING_USER_AGENT,    "Privoxy/3.0 (Anonymous)")
135 DEFINE_ACTION_BOOL       ("kill-popups",                ACTION_NO_POPUPS)
136 DEFINE_ACTION_STRING     ("limit-connect",              ACTION_LIMIT_CONNECT,   ACTION_STRING_LIMIT_CONNECT)
137 DEFINE_CGI_PARAM_NO_RADIO("limit-connect",              ACTION_LIMIT_CONNECT,   ACTION_STRING_LIMIT_CONNECT,  "443")
138 DEFINE_ACTION_BOOL       ("prevent-compression",        ACTION_NO_COMPRESSION)
139 DEFINE_ACTION_BOOL       ("send-vanilla-wafer",         ACTION_VANILLA_WAFER)
140 DEFINE_ACTION_MULTI      ("send-wafer",                 ACTION_MULTI_WAFER)
141 DEFINE_ACTION_BOOL       ("session-cookies-only",       ACTION_NO_COOKIE_KEEP)
142 DEFINE_ACTION_STRING     ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER)
143 DEFINE_CGI_PARAM_RADIO   ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER, "pattern", 1)
144 DEFINE_CGI_PARAM_RADIO   ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER, "blank", 0)
145 DEFINE_CGI_PARAM_CUSTOM  ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER,  CGI_PREFIX "show-banner?type=pattern")
146
147
148 #if DEFINE_ACTION_ALIAS
149
150 /* 
151  * Alternative spellings
152  */
153 DEFINE_ACTION_BOOL       ("kill-popup",      ACTION_NO_POPUPS)
154 DEFINE_ACTION_STRING     ("hide-referer",   ACTION_HIDE_REFERER,    ACTION_STRING_REFERER)
155 DEFINE_ACTION_BOOL       ("prevent-keeping-cookies", ACTION_NO_COOKIE_KEEP)
156
157 /* 
158  * Pre-3.0 compatibility
159  */
160 DEFINE_ACTION_BOOL       ("no-cookie-read",          ACTION_NO_COOKIE_READ)
161 DEFINE_ACTION_BOOL       ("no-cookie-set",           ACTION_NO_COOKIE_SET)
162 DEFINE_ACTION_BOOL       ("prevent-reading-cookies", ACTION_NO_COOKIE_READ)
163 DEFINE_ACTION_BOOL       ("prevent-setting-cookies", ACTION_NO_COOKIE_SET)
164 DEFINE_ACTION_BOOL       ("downgrade",               ACTION_DOWNGRADE)
165 DEFINE_ACTION_BOOL       ("hide-forwarded",          ACTION_HIDE_FORWARDED)
166 DEFINE_ACTION_STRING     ("hide-from",               ACTION_HIDE_FROM,       ACTION_STRING_FROM)
167 DEFINE_ACTION_BOOL       ("image",                   ACTION_IMAGE)
168 DEFINE_ACTION_STRING     ("image-blocker",           ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER)
169 DEFINE_ACTION_BOOL       ("no-compression",          ACTION_NO_COMPRESSION)
170 DEFINE_ACTION_BOOL       ("no-cookies-keep",         ACTION_NO_COOKIE_KEEP)
171 DEFINE_ACTION_BOOL       ("no-cookies-read",         ACTION_NO_COOKIE_READ)
172 DEFINE_ACTION_BOOL       ("no-cookies-set",          ACTION_NO_COOKIE_SET)
173 DEFINE_ACTION_BOOL       ("no-popups",               ACTION_NO_POPUPS)
174 DEFINE_ACTION_BOOL       ("vanilla-wafer",           ACTION_VANILLA_WAFER)
175 DEFINE_ACTION_MULTI      ("wafer",                   ACTION_MULTI_WAFER)
176 #endif /* if DEFINE_ACTION_ALIAS */
177
178 #undef DEFINE_ACTION_MULTI
179 #undef DEFINE_ACTION_STRING
180 #undef DEFINE_ACTION_BOOL
181 #undef DEFINE_ACTION_ALIAS
182 #undef DEFINE_CGI_PARAM_CUSTOM
183 #undef DEFINE_CGI_PARAM_RADIO
184 #undef DEFINE_CGI_PARAM_NO_RADIO
185