#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
-#define PROJECT_H_VERSION "$Id: project.h,v 1.27 2001/08/05 16:06:20 jongfoster Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.30 2001/09/13 23:52:00 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
*
* Revisions :
* $Log: project.h,v $
+ * Revision 1.30 2001/09/13 23:52:00 jongfoster
+ * Support for both static and dynamically generated CGI pages
+ *
+ * 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
#define HADDR_PORT 8000
+/* Forward defs for various structures */
+
/* Need this for struct client_state */
struct configuration_spec;
+
/* Generic linked list of strings */
-struct list /* FIXME: Why not separate entries and header? */
+
+struct list_entry
+{
+ const char *str;
+ struct list_entry *next;
+};
+
+struct list
{
- char * str; /* valid in an entry */
- struct list *last; /* valid in header */
- struct list *next;
+ struct list_entry *first;
+ struct list_entry *last;
};
+
+/* A map from a string to another string */
+
struct map_entry
{
const char *name;
struct map_entry *last;
};
+
struct http_request
{
char *cmd;
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 */
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
/* 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
{