Support for both static and dynamically generated CGI pages.
[privoxy.git] / project.h
index 5446bb7..c1770d4 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,6 +1,6 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
-#define PROJECT_H_VERSION "$Id: project.h,v 1.25 2001/07/29 18:43:08 jongfoster Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.29 2001/09/13 23:29:43 jongfoster Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
  *
  * Revisions   :
  *    $Log: project.h,v $
+ *    Revision 1.29  2001/09/13 23:29:43  jongfoster
+ *    Defining FORWARD_SPEC_INITIALIZER
+ *
+ *    Revision 1.28  2001/09/13 23:05:50  jongfoster
+ *    Changing the string paramater to the header parsers a "const".
+ *
+ *    Revision 1.27  2001/08/05 16:06:20  jongfoster
+ *    Modifiying "struct map" so that there are now separate header and
+ *    "map_entry" structures.  This means that functions which modify a
+ *    map no longer need to return a pointer to the modified map.
+ *    Also, it no longer reverses the order of the entries (which may be
+ *    important with some advanced template substitutions).
+ *
+ *    Revision 1.26  2001/07/30 22:08:36  jongfoster
+ *    Tidying up #defines:
+ *    - All feature #defines are now of the form FEATURE_xxx
+ *    - Permanently turned off WIN_GUI_EDIT
+ *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
+ *
  *    Revision 1.25  2001/07/29 18:43:08  jongfoster
  *    Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
  *    ANSI C rules.
@@ -299,11 +318,17 @@ struct list /* FIXME: Why not separate entries and header? */
    struct list *next;
 };
 
+struct map_entry
+{
+   const char *name;
+   const char *value;
+   struct map_entry *next;
+};
+
 struct map
 {
-  char *name;
-  char *value;
-  struct map *next;
+   struct map_entry *first;
+   struct map_entry *last;
 };
 
 struct http_request
@@ -328,7 +353,9 @@ struct http_response
   char *head;             /* Formatted http response head */
   int   head_length;      /* Length of http response head */
   char *body;             /* HTTP document body */
-  int   content_length;   /* Length of body, REQUIRED if binary body*/
+  int   content_length;   /* Length of body, REQUIRED if binary body */
+  int   is_static;        /* Nonzero if the content will never change and
+                           * should be cached by the broser (e.g. images) */
 };
 
 /* A URL pattern */
@@ -356,6 +383,11 @@ struct url_spec
    regex_t *preg;      /* Regex for matching path part                      */
 #endif
 };
+#ifdef REGEX
+#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL }
+#else /* ifndef REGEX */
+#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0 }
+#endif /* ndef REGEX */
 
 /* Constants for host part matching in URLs */
 #define ANCHOR_LEFT  1
@@ -592,7 +624,7 @@ struct parsers
 {
    char *str;
    char  len;
-   char *(*parser)(const struct parsers *, char *, struct client_state *);
+   char *(*parser)(const struct parsers *, const char *, struct client_state *);
 };
 
 struct cgi_dispatcher
@@ -670,6 +702,8 @@ struct forward_spec
    /* For the linked list */
    struct forward_spec *next;
 };
+#define FORWARD_SPEC_INITIALIZER { URL_SPEC_INITIALIZER, 0, NULL, 0, NULL, 0, NULL }
+
 
 struct re_filterfile_spec
 {