-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.25 2002/04/03 22:28:03 gliptak Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.26 2002/04/04 00:36:36 gliptak Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
*
* Revisions :
* $Log: cgisimple.c,v $
+ * Revision 1.26 2002/04/04 00:36:36 gliptak
+ * always use pcre for matching
+ *
* Revision 1.25 2002/04/03 22:28:03 gliptak
* Removed references to gnu_regex
*
#include "loadcfg.h"
#include "parsers.h"
#include "urlmatch.h"
+#include "errlog.h"
const char cgisimple_h_rcs[] = CGISIMPLE_H_VERSION;
*
*********************************************************************/
jb_err cgi_transparent_image(struct client_state *csp,
- struct http_response *rsp,
- const struct map *parameters)
+ struct http_response *rsp,
+ const struct map *parameters)
{
rsp->body = bindup(image_blank_data, image_blank_length);
rsp->content_length = image_blank_length;
}
+/*********************************************************************
+ *
+ * Function : cgi_send_stylesheet
+ *
+ * Description : CGI function that sends a css stylesheet found
+ * in the cgi-style.css template
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ * 2 : rsp = http_response data structure for output
+ * 3 : parameters = map of cgi parameters
+ *
+ * CGI Parameters : None
+ *
+ * Returns : JB_ERR_OK on success
+ * JB_ERR_MEMORY on out-of-memory error.
+ *
+ *********************************************************************/
+jb_err cgi_send_stylesheet(struct client_state *csp,
+ struct http_response *rsp,
+ const struct map *parameters)
+{
+ jb_err err;
+
+ assert(csp);
+ assert(rsp);
+
+ err = template_load(csp, &rsp->body, "cgi-style.css");
+
+ if (err == JB_ERR_FILE)
+ {
+ /*
+ * No way to tell user; send empty stylesheet
+ */
+ log_error(LOG_LEVEL_ERROR, "Could not find cgi-style.css template");
+ }
+ else if (err)
+ {
+ return err; /* JB_ERR_MEMORY */
+ }
+
+ if (enlist(rsp->headers, "Content-Type: text/css"))
+ {
+ return JB_ERR_MEMORY;
+ }
+
+ return JB_ERR_OK;
+
+}
+
+
/*********************************************************************
*
* Function : cgi_show_version
while ((s != NULL) && fgets(buf, sizeof(buf), fp))
{
string_join (&s, html_encode(buf));
- string_append(&s, "<br>");
}
fclose(fp);
#ifndef CGISIMPLE_H_INCLUDED
#define CGISIMPLE_H_INCLUDED
-#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.9 2002/03/24 13:25:43 swa Exp $"
+#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.10 2002/03/26 22:29:54 swa Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.h,v $
*
* Revisions :
* $Log: cgisimple.h,v $
+ * Revision 1.10 2002/03/26 22:29:54 swa
+ * we have a new homepage!
+ *
* Revision 1.9 2002/03/24 13:25:43 swa
* name change related issues
*
struct http_response *rsp,
const struct map *parameters);
extern jb_err cgi_transparent_image (struct client_state *csp,
- struct http_response *rsp,
- const struct map *parameters);
+ struct http_response *rsp,
+ const struct map *parameters);
+extern jb_err cgi_send_stylesheet(struct client_state *csp,
+ struct http_response *rsp,
+ const struct map *parameters);
#ifdef FEATURE_GRACEFUL_TERMINATION
extern jb_err cgi_die (struct client_state *csp,