+/*********************************************************************
+ *
+ * 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;
+
+}
+
+