[clhp-cvs] CVS update: clhp/package.lisp clhp/mod_clhp.c clhp/clhp.lisp clhp/cgi.lisp clhp/ChangeLog

Anthony Ventimiglia aventimiglia at common-lisp.net
Thu Nov 13 19:37:41 UTC 2003


Update of /project/clhp/cvsroot/clhp
In directory common-lisp.net:/tmp/cvs-serv10767

Modified Files:
	package.lisp mod_clhp.c clhp.lisp cgi.lisp ChangeLog 
Log Message:
Removed HEADER and INCLUDE functions, because they were not working
properly. mod_clhp generates a simple header. In the future, CLHP will
have to get control of this again, for doing things like setting
cookies and redirections.

Date: Thu Nov 13 14:37:41 2003
Author: aventimiglia

Index: clhp/package.lisp
diff -u clhp/package.lisp:1.3 clhp/package.lisp:1.4
--- clhp/package.lisp:1.3	Wed Nov 12 17:41:55 2003
+++ clhp/package.lisp	Thu Nov 13 14:37:41 2003
@@ -1,4 +1,4 @@
-#+cmu (ext:file-comment "$Id: package.lisp,v 1.3 2003/11/12 22:41:55 aventimiglia Exp $")
+#+cmu (ext:file-comment "$Id: package.lisp,v 1.4 2003/11/13 19:37:41 aventimiglia Exp $")
 ;;
 ;; CLHP the Common Lisp Hypertext Preprocessor
 ;; (C) 2003 Anthony J Ventimiglia
@@ -25,8 +25,8 @@
 (defpackage #:net.common-lisp.aventimiglia.clhp
   (:nicknames #:clhp #:cgi)		; The CGI will go away eventually
   (:use #:cl #:ext)
-  (:export #:*server-env* #:*query-vars* #:header #:debug #:init
-	   #:parse #:*clhp-version* #:echo #:include #:xml-element
+  (:export #:*server-env* #:*query-vars* #:debug #:init
+	   #:parse #:*clhp-version* #:echo #:xml-element
 	   #:make-xml-element #:copy-xml-element #:xml-element-attributes
 	   #:xml-element-name #:xml-element-contents #:xml-element-p #:tag
 	   #:require


Index: clhp/mod_clhp.c
diff -u clhp/mod_clhp.c:1.4 clhp/mod_clhp.c:1.5
--- clhp/mod_clhp.c:1.4	Wed Nov 12 16:57:40 2003
+++ clhp/mod_clhp.c	Thu Nov 13 14:37:41 2003
@@ -1,4 +1,4 @@
-/* $Id: mod_clhp.c,v 1.4 2003/11/12 21:57:40 aventimiglia Exp $
+/* $Id: mod_clhp.c,v 1.5 2003/11/13 19:37:41 aventimiglia Exp $
    
   CLHP the Common Lisp Hypertext Preprocessor
   (C) 2003 Anthony J Ventimiglia
@@ -82,6 +82,13 @@
   ap_add_common_vars ( req );
   ap_add_cgi_vars ( req );
   child.req = req;
+
+  // First we should check if the document exists
+  // But for now...
+  req->content_type = "text/html";
+  ap_table_set ( req->headers_out, "X-Powered-By", 
+		 "CLHP Common Lisp Hypertext Preprocessor" );
+  ap_send_http_header ( req );
 
   if ( ! ap_bspawn_child ( req->pool, run_lisp, (void *) &child,
 			   kill_always, &lisp_out, &lisp_in, NULL ))


Index: clhp/clhp.lisp
diff -u clhp/clhp.lisp:1.20 clhp/clhp.lisp:1.21
--- clhp/clhp.lisp:1.20	Thu Nov 13 00:10:40 2003
+++ clhp/clhp.lisp	Thu Nov 13 14:37:41 2003
@@ -1,5 +1,5 @@
 (ext:file-comment
- "$Id: clhp.lisp,v 1.20 2003/11/13 05:10:40 aventimiglia Exp $")
+ "$Id: clhp.lisp,v 1.21 2003/11/13 19:37:41 aventimiglia Exp $")
 ;;
 ;; CLHP the Common Lisp Hypertext Preprocessor
 ;; (C) 2003 Anthony J Ventimiglia
@@ -29,7 +29,7 @@
 ;; will override the CVS keyword
 (defconstant *CLHP-VERSION*
   #.(or nil				; Set this for releases
-	(let* ((trimmed (string-trim "$ Date:" "$Date: 2003/11/13 05:10:40 $"))
+	(let* ((trimmed (string-trim "$ Date:" "$Date: 2003/11/13 19:37:41 $"))
 	       (date (subseq trimmed 0 (search " " trimmed))))
 	  (concatenate 'string
 		       (subseq date 0 4)
@@ -72,18 +72,6 @@
   (use-package :cgi)
   (use-package :clhp)
   (init)
-  (header :content-type
-	      :text/html
-	      :extra
-	      '(#.(format
-		   nil
-		   "X-Powered-By: CLHP/~a Common Lisp Hypertext Preprocessor"
-		   *CLHP-VERSION*)))
-  (include file-name))
-
-(defun include (file-name)
-  "parse FILE-NAME as a CLHP file, this is essentially the same as
-PARSE, only it does not output headers."
   ;; We'll read the whole thing here into a buffer, then send it to
   ;; PARSE-BUFFER to recursively process it
   (handler-bind


Index: clhp/cgi.lisp
diff -u clhp/cgi.lisp:1.14 clhp/cgi.lisp:1.15
--- clhp/cgi.lisp:1.14	Tue Oct 21 12:57:27 2003
+++ clhp/cgi.lisp	Thu Nov 13 14:37:41 2003
@@ -1,4 +1,4 @@
-#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.14 2003/10/21 16:57:27 aventimiglia Exp $")
+#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.15 2003/11/13 19:37:41 aventimiglia Exp $")
 ;;
 ;; CLHP the Common Lisp Hypertext Preprocessor
 ;; (C) 2003 Anthony J Ventimiglia
@@ -42,28 +42,6 @@
   "A hash-table of all variables passed through a GET or POST method, the
 key is a string, and all values are stored in string form.")
 
-;; This will obviously be improved upon to handle different content
-;; types, but for now it's just a stub to print plain text pages. It
-;; is set up so it will only work the first time it is called, any
-;; furthur calls will not do a thing
-(let ((done nil))
-  (defun header (&key (content-type 'text/plain) extra)
-    "This is the first output function that should be called by a CGI
-program, it print the proper CGI header. The :CONTENT-TYPE field can
-be a symbol, or a string, if whitespace is required.
-
-The :EXTRA key is used for any additional headers, it should be an a
-list of strings, where each string will be printed on it's own line
-exactly as it is passed, for example (HEADER :EXTRA
-\"Content-Language: en\").
-
-See RFC 2616 for more info"
-    (when (not done)
-      (dolist (header extra)
-	(format t "~a~%" header))
-      (format t "Content-type: ~a~%~%" content-type)
-      (setf done t))))
-
 ;; This sets the main variables, since the library is already part of the lisp
 ;; core, we can't use an eval-when, I may eventually make a cgi:init that also
 ;; prints the header. 
@@ -217,7 +195,6 @@
 (defun handle-general-error (condition)
   "A generic error handler function, this will basicall just print a
 text header, echoing the error-message."
-  (header :content-type :text/plain)
   (format t "CL-CGI: ~A~%" (error-message condition))
   (quit))
 


Index: clhp/ChangeLog
diff -u clhp/ChangeLog:1.27 clhp/ChangeLog:1.28
--- clhp/ChangeLog:1.27	Wed Nov 12 23:57:44 2003
+++ clhp/ChangeLog	Thu Nov 13 14:37:41 2003
@@ -1,4 +1,17 @@
-2003-11-12  Anthony Ventimiglia  <ant at afghan.dogpound>
+2003-11-13  Anthony Ventimiglia  <aventimiglia at common-lisp.net>
+
+	* cgi.lisp, clhp.lisp, package.lisp: Removed HEADER, since it is
+	no longer used. Removed INCLUDE, moved it's functionality into
+	PARSE, since HEADER no longer exists, there's no need for the two
+	of them.
+
+	* mod_clhp.c: module generates the headers, since CLHP was not
+	doing it properly, For now this works, but eventually we'll need
+	to have clhp do it since we may want to modify headers or set
+	cookies using CLHP. I guess Apache will have to pass
+	req->headers_out to Lisp and CLHP will have to send them.
+
+2003-11-12  Anthony Ventimiglia  <aventimiglia at common-lisp.net>
 
 	* Makefile: Removed pretty much all traces of old cgi based clhp
 
@@ -289,9 +302,9 @@
 2003-09-17 16:21  <aventimiglia at common-lisp.net>
 
 	* clhp.lisp: Wrote a nice little reader macro to make cvs
-	  versioning automatic, the $Date: 2003/11/13 04:57:44 $ keyword is parsed to make a 8
+	  versioning automatic, the $Date: 2003/11/13 19:37:41 $ keyword is parsed to make a 8
 	  digit number YYYYMMDD with the suffix "cvs" addedd, so a CVS
-	  release with a $Date: 2003/11/13 04:57:44 $ of 2003/09/15 ends up with a
+	  release with a $Date: 2003/11/13 19:37:41 $ of 2003/09/15 ends up with a
 	  *CLHP-VERSION* of "20030915cvs"
 
 2003-09-17 14:47  <aventimiglia at common-lisp.net>
@@ -300,4 +313,4 @@
 	  that will aide in compiling lisp in a mkae freindly way by
 	  passing a non-zero exit code when compilation fails
 
-$Id: ChangeLog,v 1.27 2003/11/13 04:57:44 aventimiglia Exp $
\ No newline at end of file
+$Id: ChangeLog,v 1.28 2003/11/13 19:37:41 aventimiglia Exp $
\ No newline at end of file





More information about the Clhp-cvs mailing list