From aventimiglia at common-lisp.net Wed Oct 1 14:01:48 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 10:01:48 -0400 Subject: [clhp-cvs] CVS update: clhp/BUGS clhp/TODO Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv24710 Modified Files: TODO Added Files: BUGS Log Message: Added some documentation, including BUGS page, which should be considered part of the TODO list, only with a high priority. Date: Wed Oct 1 10:01:47 2003 Author: aventimiglia Index: clhp/TODO diff -u clhp/TODO:1.4 clhp/TODO:1.5 --- clhp/TODO:1.4 Mon Sep 29 13:05:11 2003 +++ clhp/TODO Wed Oct 1 10:01:47 2003 @@ -1,4 +1,9 @@ -$Id: TODO,v 1.4 2003/09/29 17:05:11 aventimiglia Exp $ -*- outline -*- +$Id: TODO,v 1.5 2003/10/01 14:01:47 aventimiglia Exp $ -*- outline -*- + +* Test suite + Write a test suite, in lisp that will run test on clhp components, + this will be used during development, to make sure everything is + working properly. * COMPILE-CGI This is just a convenience function that will compile and save fasl From aventimiglia at common-lisp.net Wed Oct 1 14:26:44 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 10:26:44 -0400 Subject: [clhp-cvs] CVS update: Directory change: clhp/tests Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv8903/tests Log Message: Directory /project/clhp/cvsroot/clhp/tests added to the repository Date: Wed Oct 1 10:26:44 2003 Author: aventimiglia New directory clhp/tests added From aventimiglia at common-lisp.net Wed Oct 1 14:32:46 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 10:32:46 -0400 Subject: [clhp-cvs] CVS update: clhp/clhp.lisp clhp/cgi.lisp Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv12354 Modified Files: clhp.lisp cgi.lisp Log Message: Finally got defpackage to work properly. Date: Wed Oct 1 10:32:45 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.8 clhp/clhp.lisp:1.9 --- clhp/clhp.lisp:1.8 Tue Sep 23 22:11:16 2003 +++ clhp/clhp.lisp Wed Oct 1 10:32:45 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.8 2003/09/24 02:11:16 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.9 2003/10/01 14:32:45 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -21,21 +21,16 @@ ;; email: aventimigli at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -;; This is here to make clean compilation (eval-when (:compile-toplevel) - (when (find-package :clhp) - (delete-package :clhp)) - ;; Since CGU us used and we may be building this before it's installed, - ;; We'll need to load it. (unless (find-package :cgi) (load "cgi"))) -(make-package :CLHP) - -(in-package :CLHP) -(export '(PARSE *CLHP-VERSION* ECHO INCLUDE XML-ELEMENT MAKE-XML-ELEMENT - COPY-XML-ELEMENT XML-ELEMENT-ATTRIBUTES XML-ELEMENT-NAME - XML-ELEMENT-CONTENTS XML-ELEMENT-P TAG)) +(defpackage :clhp + (:use :cgi :cl) + (:export #:parse #:*clhp-version* #:echo #:include #:xml-element + #:make-xml-element #:copy-xml-element #:xml-element-attributes + #:xml-element-name #:xml-element-contents #:xml-element-p #:tag)) +(in-package :clhp) ;; This elaborate reader macro converts the cvs Date keywords and ;; translates it into a 8 digit date code for marking the cvs version. @@ -43,7 +38,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/09/24 02:11:16 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/01 14:32:45 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.2 clhp/cgi.lisp:1.3 --- clhp/cgi.lisp:1.2 Fri Sep 19 01:57:19 2003 +++ clhp/cgi.lisp Wed Oct 1 10:32:45 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: cgi.lisp,v 1.2 2003/09/19 05:57:19 aventimiglia Exp $") + "$Id: cgi.lisp,v 1.3 2003/10/01 14:32:45 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -21,14 +21,11 @@ ;; email: aventimigli at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -;; This is here to make clean compilation -(eval-when (:compile-toplevel) - (when (find-package :cgi) - (delete-package :cgi))) +(defpackage :cgi + (:use :cl) + (:export #:*server-env* #:*query-vars* #:header #:debug #:init)) -(make-package "CGI") (in-package :cgi) -(export '(*SERVER-ENV* *QUERY-VARS* HEADER DEBUG INIT)) (defmacro make-keyword (name) "Translates a string into a keyword: (MAKE-KEYWORD \"foo\") --> From aventimiglia at common-lisp.net Wed Oct 1 14:34:11 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 10:34:11 -0400 Subject: [clhp-cvs] CVS update: clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv13933 Modified Files: ChangeLog Log Message: Finally got defpackage to work properly. Date: Wed Oct 1 10:34:10 2003 Author: aventimiglia Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.3 clhp/ChangeLog:1.4 --- clhp/ChangeLog:1.3 Tue Sep 23 22:11:16 2003 +++ clhp/ChangeLog Wed Oct 1 10:34:10 2003 @@ -1,3 +1,7 @@ +2003-10-01 + + * clhp.lisp, cgi.lisp: converted to easier defpackage construct. + 2003-09-23 * clhp.lisp: Created XML-ELEMENT structure and exported all it's From aventimiglia at common-lisp.net Wed Oct 1 19:11:34 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 15:11:34 -0400 Subject: [clhp-cvs] CVS update: clhp/TODO Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv12285 Modified Files: TODO Log Message: Beginning tests for CGI package, right now the code in tests/cgi-test.lisp has to be called interactively, but it does do some of the job Date: Wed Oct 1 15:11:33 2003 Author: aventimiglia Index: clhp/TODO diff -u clhp/TODO:1.5 clhp/TODO:1.6 --- clhp/TODO:1.5 Wed Oct 1 10:01:47 2003 +++ clhp/TODO Wed Oct 1 15:11:33 2003 @@ -1,10 +1,14 @@ -$Id: TODO,v 1.5 2003/10/01 14:01:47 aventimiglia Exp $ -*- outline -*- +$Id: TODO,v 1.6 2003/10/01 19:11:33 aventimiglia Exp $ -*- outline -*- * Test suite Write a test suite, in lisp that will run test on clhp components, this will be used during development, to make sure everything is working properly. + This is in thw works is tests/, I think I'll refine it a bit and + make it it's own package. There is still more work to be done, and + that's a whole different can of beans + * COMPILE-CGI This is just a convenience function that will compile and save fasl files with the .clcgi extension. @@ -18,7 +22,10 @@ the HTTP headers generated by CLHP. * TAG - This has to be done with a macro. + This is pretty nice right now, but I would like to implement it + possibly as a reader macro, where something like #> yields Click Me. The problem is + getting embedded reader macros to work properly. * Error handling This will be the biggest ongoing project, lets try to create every @@ -38,10 +45,13 @@ to be done in CLHP, at least not right away. * Pre-release check list -** version numbering +** version numbering VERSION in Makefile and *CLHP-VERSION* in clhp.lisp should be set. Eventually I'd like to set up a nice way to have this all happen automatically. I think the best way to do this is to make the whole build process more lisp dependent. The other option is - to go automake with it. + to go automake with it. + + The way it works now is very nice, in fact, I don't think Automake + could do it so well. From aventimiglia at common-lisp.net Wed Oct 1 19:11:34 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 15:11:34 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv12285/tests Added Files: cgi-test.lisp Log Message: Beginning tests for CGI package, right now the code in tests/cgi-test.lisp has to be called interactively, but it does do some of the job Date: Wed Oct 1 15:11:33 2003 Author: aventimiglia From aventimiglia at common-lisp.net Wed Oct 1 19:12:21 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 01 Oct 2003 15:12:21 -0400 Subject: [clhp-cvs] CVS update: clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv12708 Modified Files: ChangeLog Log Message: Date: Wed Oct 1 15:12:21 2003 Author: aventimiglia Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.4 clhp/ChangeLog:1.5 --- clhp/ChangeLog:1.4 Wed Oct 1 10:34:10 2003 +++ clhp/ChangeLog Wed Oct 1 15:12:21 2003 @@ -1,5 +1,9 @@ 2003-10-01 + * tests/cgi-test.lisp: Beginning tests for CGI package, right now + the code in tests/cgi-test.lisp has to be called interactively, + but it does do some of the job + * clhp.lisp, cgi.lisp: converted to easier defpackage construct. 2003-09-23 From aventimiglia at common-lisp.net Thu Oct 2 17:43:06 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 13:43:06 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv18549/tests Modified Files: cgi-test.lisp Log Message: (a-list-value): Convenience macro for getting the values of a-lists Date: Thu Oct 2 13:43:06 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.1 clhp/tests/cgi-test.lisp:1.2 --- clhp/tests/cgi-test.lisp:1.1 Wed Oct 1 15:11:33 2003 +++ clhp/tests/cgi-test.lisp Thu Oct 2 13:43:05 2003 @@ -109,6 +109,8 @@ ;; And ;; POST-DATA QUERY-TO-A-LIST HANDLE-GENERAL-ERROR +;; Use the following to run-tests +;; (mapcar #'run-tests *cgi-tests*) (setf *cgi-tests* (list (make-instance 'function-test-data From aventimiglia at common-lisp.net Thu Oct 2 17:43:06 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 13:43:06 -0400 Subject: [clhp-cvs] CVS update: clhp/cgi.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv18549 Modified Files: cgi.lisp ChangeLog Log Message: (a-list-value): Convenience macro for getting the values of a-lists Date: Thu Oct 2 13:43:06 2003 Author: aventimiglia Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.3 clhp/cgi.lisp:1.4 --- clhp/cgi.lisp:1.3 Wed Oct 1 10:32:45 2003 +++ clhp/cgi.lisp Thu Oct 2 13:43:06 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: cgi.lisp,v 1.3 2003/10/01 14:32:45 aventimiglia Exp $") + "$Id: cgi.lisp,v 1.4 2003/10/02 17:43:06 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -42,6 +42,10 @@ ex: (EXPLODE-STRING (\"Hello\") --> (#\H #\e #\l #\l #\o)" `(concatenate 'list ,string)) +(defmacro a-list-value (key a-list) + "returns the value from a (KEY . VALUE) A-LIST" + `(cdr (assoc ,key ,a-list))) + ;; External Symbol section (defvar *server-env* nil @@ -89,7 +93,8 @@ (setf *server-env* ext:*environment-list* *query-vars* (let ((request-method (make-keyword - (cdr (assoc :REQUEST_METHOD *server-env*))))) + (a-list-value :REQUEST_METHOD + *server-env*)))) (cond ((eql request-method :POST) (query-to-a-list (post-data))) @@ -147,8 +152,7 @@ (defun get-data () "Returns GET data (QUERY_STRING) as an exploded string" - (explode-string - (cdr (assoc :QUERY_STRING *server-env*)))) + (explode-string (a-list-value :QUERY_STRING *server-env*))) ;; The closure makes sure we don't try to read from stdin twice (let ((get-switch nil) @@ -161,7 +165,7 @@ get-switch t post-char-list (read-n-chars (read-from-string - (cdr (assoc :CONTENT_LENGTH *server-env*))))) + (a-list-value :CONTENT_LENGTH *server-env*)))) post-char-list) post-char-list))) Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.5 clhp/ChangeLog:1.6 --- clhp/ChangeLog:1.5 Wed Oct 1 15:12:21 2003 +++ clhp/ChangeLog Thu Oct 2 13:43:06 2003 @@ -1,3 +1,8 @@ +2003-10-02 + + * cgi.lisp (a-list-value): Convenience macro for getting the + values of a-lists + 2003-10-01 * tests/cgi-test.lisp: Beginning tests for CGI package, right now From aventimiglia at common-lisp.net Fri Oct 3 00:38:18 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 20:38:18 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv24566/tests Modified Files: cgi-test.lisp Log Message: * tests/cgi-test.lisp (output-function-test-data): Designed a class to test functions which print to *standard-output*. These test classes will be reused for clhp.lisp, and eventually moved into their own package. Date: Thu Oct 2 20:38:18 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.2 clhp/tests/cgi-test.lisp:1.3 --- clhp/tests/cgi-test.lisp:1.2 Thu Oct 2 13:43:05 2003 +++ clhp/tests/cgi-test.lisp Thu Oct 2 20:38:17 2003 @@ -1,4 +1,4 @@ -(ext:file-comment "$Id") +#+cmu (ext:file-comment "$Id") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -25,9 +25,19 @@ ;; These classes and methods should be a separate package +(eval-when (:load-toplevel :compile-toplevel) + (unless (find-package :cgi) + (load "library:cgi"))) + (defmacro call-if-function (form) `(when (functionp ,form) (funcall ,form))) +(defmacro test-result (result) + "Used to return results of tests for run-test methods" + ;; This will work as long as all RUN-TEST methods use DATA for their + ;; TEST-DATA object. + `(cons (test-data-symbol data) ,result)) + (defclass test-data () ((symbol :initform NIL :type symbol @@ -50,7 +60,7 @@ (defmethod run-test ((data test-data) &optional stream) "Since TEST-DATA is an abstract test class, we cannot actually use it." (declare (ignore stream)) - 'error) + (test-result :error)) (defclass function-test-data (test-data) ((test-args :initform NIL @@ -70,19 +80,56 @@ (defmethod run-test ((data function-test-data) &optional (stream *standard-output*)) - (call-if-function (test-data-pre-function data)) - (let* ((test-form (cons (test-data-symbol data) - (function-test-data-test-args data))) - (result (eval test-form))) - (format stream "~S --> ~S : " test-form result) - (if (equal result (function-test-data-result-form data)) - (format stream "OK~%") - (format stream "FAILED ~S expected~%" - (function-test-data-result-form data))) - (prog1 - result - (call-if-function (test-data-post-function data))))) + (unwind-protect + (progn + (call-if-function (test-data-pre-function data)) + (let* ((test-form (cons (test-data-symbol data) + (function-test-data-test-args data))) + (result (eval test-form))) + (format stream "~S --> ~S : " test-form result) + (test-result + (let ((test-result (function-test-data-result-form data))) + (if (equal result test-result) + (progn + (format stream "OK~%") :OK) + (progn + (format stream "FAILED ~S expected~%" test-result) :error)))))) + (call-if-function (test-data-post-function data)))) +(defclass output-function-test-data (function-test-data) + ((output :initform NIL + :type string + :reader output-function-test-data-output + :initarg :output + :documentation "A string which should be equal to the output")) + (:documentation "A subclass of function-test-data for testing macros +or functions, but this is used when thye output to *STANDARD-OUTPUT* +must be tested as well.")) + +(defmethod run-test ((data output-function-test-data) + &optional (stream *standard-output*)) + (call-if-function (test-data-pre-function data)) + (unwind-protect + (progn + (call-if-function (test-data-pre-function data)) + (let* ((test-form (cons (test-data-symbol data) + (function-test-data-test-args data))) + (output (make-array 0 :element-type 'base-char + :fill-pointer 0 :adjustable t)) + (result (with-output-to-string + (*standard-output* output) + (eval test-form)))) + (format stream "~S --> ~S ~S : " test-form output result) + (test-result + (let ((test-output (output-function-test-data-output data)) + (test-result (function-test-data-result-form data))) + (if (and (equal result test-result) + (string= output test-output)) + (progn (format stream "OK~%") :OK) + (progn (format stream "FAILED ~S ~S expected~%" test-output + test-result) :ERROR)))))) + (call-if-function (test-data-post-function data)))) + ;; Example ;(defvar list-test (make-instance 'function-test-data ; :symbol 'list @@ -95,10 +142,6 @@ (defvar *cgi-tests*) -(eval-when (:load-toplevel :compile-toplevel) - (unless (find-package :cgi) - (load "library:cgi"))) - ;; Still to be tested ;; All functions which print to stdout, I'll have to devise a test for them: ;; DEBUG HEADER @@ -110,7 +153,7 @@ ;; POST-DATA QUERY-TO-A-LIST HANDLE-GENERAL-ERROR ;; Use the following to run-tests -;; (mapcar #'run-tests *cgi-tests*) +;; (mapcar #'run-test *cgi-tests*) (setf *cgi-tests* (list (make-instance 'function-test-data @@ -152,4 +195,34 @@ :test-args nil :result-form '(#\i #\n #\d #\e #\x #\= #\f #\o #\o #\& #\t #\y #\p #\e #\= #\b #\a #\r #\% #\2 #\0 #\b - #\a #\z)))) + #\a #\z)) + (make-instance 'function-test-data + :symbol 'cgi::a-list-value + :test-args '(2 '((1 . f) (3 . g) (6 . h) (2 . y))) + :result-form 'y) + (make-instance 'output-function-test-data + :symbol 'cgi:debug + :test-args '('(list 1 2 3)) + :output (format nil + "(CGI:DEBUG: (LIST 1 2 3) --> (1 2 3))~%")) + (make-instance 'output-function-test-data + :symbol 'cgi:header + :output (format nil + "Content-type: TEXT/PLAIN~%~%") + :result-form t) + ;; We test header twice to make sure it only outputs the first + ;; time. The post-function should reset the internals of the header + ;; function so successive tests will pass, but by reloading the + ;; package, all the symbols in this list get uninterned, however + ;; they are still bound to the functions. so in order to run the + ;; tests again, you have to re evaluate this setq. This is only a + ;; problem in interactive env. if these tests are being run as a + ;; one time deal (which is the eventual goal) none of this will be + ;; a problem. + (make-instance 'output-function-test-data + :post-function #'(lambda () + (delete-package :cgi) + (fmakunbound 'cgi:header) + (load "library:cgi")) + :symbol 'cgi:header + :output ""))) From aventimiglia at common-lisp.net Fri Oct 3 00:38:18 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 20:38:18 -0400 Subject: [clhp-cvs] CVS update: clhp/cgi.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv24566 Modified Files: cgi.lisp ChangeLog Log Message: * tests/cgi-test.lisp (output-function-test-data): Designed a class to test functions which print to *standard-output*. These test classes will be reused for clhp.lisp, and eventually moved into their own package. Date: Thu Oct 2 20:38:18 2003 Author: aventimiglia Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.4 clhp/cgi.lisp:1.5 --- clhp/cgi.lisp:1.4 Thu Oct 2 13:43:06 2003 +++ clhp/cgi.lisp Thu Oct 2 20:38:18 2003 @@ -1,5 +1,4 @@ -(ext:file-comment - "$Id: cgi.lisp,v 1.4 2003/10/02 17:43:06 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.5 2003/10/03 00:38:18 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -137,7 +136,7 @@ ;; !!!!!!!!! This should most likely be tested and improved , because ;; if the CGI program is given a bogus Content-Length header, this -;; will choke +;; will choke -- In other words, it's prone to attacks (defun read-n-chars (count &optional (stream *standard-input*)) "Reads N chars from STREAM, returning a list of chars. Be careful, there is no check for EOF. This is specifically designed for POST @@ -170,7 +169,8 @@ post-char-list))) (defun query-to-a-list (get/post-data) - "Translates the char list from GET-DATA or POST-DATA into a (:KEYWORD . \"Value\" ) a-list." + "Translates the char list from GET-DATA or POST-DATA into a (:KEYWORD +. \"Value\" ) a-list." (mapcar #'(lambda (key/val-list) (let ((key/val-strings (mapcar #'implode-string Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.6 clhp/ChangeLog:1.7 --- clhp/ChangeLog:1.6 Thu Oct 2 13:43:06 2003 +++ clhp/ChangeLog Thu Oct 2 20:38:18 2003 @@ -1,5 +1,10 @@ 2003-10-02 + * tests/cgi-test.lisp (output-function-test-data): Designed a + class to test functions which print to *standard-output*. These + test classes will be reused for clhp.lisp, and eventually moved + into their own package. + * cgi.lisp (a-list-value): Convenience macro for getting the values of a-lists From aventimiglia at common-lisp.net Fri Oct 3 02:40:39 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 22:40:39 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv6192/tests Modified Files: cgi-test.lisp Log Message: * cgi.lisp, clhp.lisp (LIST-TO-A-LIST): Moved LIST-TO-A-LIST from clhp.lisp into cgi.lisp, because I need it there as part of the rewrite for QUERY-TO-A-LIST. Sooner or later I'll have to merge all this into a single package so things like this do not have to happen. * cgi.lisp (QUERY-TO-A-LIST): Rewrote this mostly to simplify it, and make it prettier (*SERVER-ENV*,*QUERY-VARS*) : Converted them to list type a-lists ((A B)(C D)) from the Cons type they had been ((A . B) (C . D)). This is quite temporary, since I plan on making them hashes soon. I basically did this because the TAG mechanism needs List type a-lists, and I wanted to reuese list-to-a-list in cgi.lisp. So as part of the rewrite to QUERY-TO-A-LIST, this ended up as a result. Date: Thu Oct 2 22:40:39 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.3 clhp/tests/cgi-test.lisp:1.4 --- clhp/tests/cgi-test.lisp:1.3 Thu Oct 2 20:38:17 2003 +++ clhp/tests/cgi-test.lisp Thu Oct 2 22:40:39 2003 @@ -184,21 +184,21 @@ (make-instance 'function-test-data :symbol 'cgi::get-data :pre-function #'(lambda () - (let ((a (assoc :query_string - cgi::*server-env*))) + (let ((a (car (assoc :query_string + cgi::*server-env*)))) (when a - (setf cgi::*server-env* - (remove a cgi::*server-env*)))) - (push (cons :query_string + (setf cgi:*server-env* + (remove a cgi:*server-env*)))) + (push (list :query_string "index=foo&type=bar%20baz") - cgi::*server-env*)) + cgi:*server-env*)) :test-args nil :result-form '(#\i #\n #\d #\e #\x #\= #\f #\o #\o #\& #\t #\y #\p #\e #\= #\b #\a #\r #\% #\2 #\0 #\b #\a #\z)) (make-instance 'function-test-data :symbol 'cgi::a-list-value - :test-args '(2 '((1 . f) (3 . g) (6 . h) (2 . y))) + :test-args '(2 '((1 f) (3 g) (6 h) (2 y))) :result-form 'y) (make-instance 'output-function-test-data :symbol 'cgi:debug From aventimiglia at common-lisp.net Fri Oct 3 02:40:39 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 22:40:39 -0400 Subject: [clhp-cvs] CVS update: clhp/clhp.lisp clhp/cgi.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv6192 Modified Files: clhp.lisp cgi.lisp ChangeLog Log Message: * cgi.lisp, clhp.lisp (LIST-TO-A-LIST): Moved LIST-TO-A-LIST from clhp.lisp into cgi.lisp, because I need it there as part of the rewrite for QUERY-TO-A-LIST. Sooner or later I'll have to merge all this into a single package so things like this do not have to happen. * cgi.lisp (QUERY-TO-A-LIST): Rewrote this mostly to simplify it, and make it prettier (*SERVER-ENV*,*QUERY-VARS*) : Converted them to list type a-lists ((A B)(C D)) from the Cons type they had been ((A . B) (C . D)). This is quite temporary, since I plan on making them hashes soon. I basically did this because the TAG mechanism needs List type a-lists, and I wanted to reuese list-to-a-list in cgi.lisp. So as part of the rewrite to QUERY-TO-A-LIST, this ended up as a result. Date: Thu Oct 2 22:40:39 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.9 clhp/clhp.lisp:1.10 --- clhp/clhp.lisp:1.9 Wed Oct 1 10:32:45 2003 +++ clhp/clhp.lisp Thu Oct 2 22:40:39 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.9 2003/10/01 14:32:45 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.10 2003/10/03 02:40:39 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -38,7 +38,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/01 14:32:45 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/03 02:40:39 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) @@ -185,19 +185,6 @@ contents name))) -(defun list-to-a-list (list &optional a-list) - "Converts a list to an a-list, pairing odd and even elements. If an -odd number of elements are in LIST, the last element is returnes as -the second value. -ex: (LIST-TO-A-LIST '(a b c d) --> '((a b)(c d)) NIL -ex: (LIST-TO-A-LIST '(1 2 3 4 5) --> '((1 2)(3 4)) 5" - (cond - ((null list) (nreverse a-list)) - ((= 1 (length list)) (values (nreverse a-list) (car list))) - (t (list-to-a-list (cddr list) - (cons (list (car list) (cadr list)) - a-list))))) - ;; This is a convenience function for MAKE-XML-ELEMENT (defun tag (&rest args) "Creates an XML-ELEMENT, where (CAR ARGS) fills the :NAME slot. If @@ -211,7 +198,7 @@ --> " (multiple-value-bind (att-list contents) - (list-to-a-list (cdr args)) + (cgi::list-to-a-list (cdr args)) (make-xml-element :name (car args) :attributes att-list :contents contents))) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.5 clhp/cgi.lisp:1.6 --- clhp/cgi.lisp:1.5 Thu Oct 2 20:38:18 2003 +++ clhp/cgi.lisp Thu Oct 2 22:40:39 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.5 2003/10/03 00:38:18 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.6 2003/10/03 02:40:39 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -43,7 +43,7 @@ (defmacro a-list-value (key a-list) "returns the value from a (KEY . VALUE) A-LIST" - `(cdr (assoc ,key ,a-list))) + `(cadr (assoc ,key ,a-list))) ;; External Symbol section @@ -65,8 +65,7 @@ ;; 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) + (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. @@ -83,13 +82,17 @@ (format t "Content-type: ~a~%~%" content-type) (setf done t)))) +(defun ca-list-to-a-list (list) + "Converts a CONS type a-list '((A . 3)(B . 4)) to a list type '((A 3)(B 4))" + (mapcar #'(lambda (cons) (list (car cons)(cdr cons))) list)) + ;; 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. (defun init () "Initialize CGI, this should be called before any globals are accessed" - (setf *server-env* ext:*environment-list* + (setf *server-env* (ca-list-to-a-list ext:*environment-list*) *query-vars* (let ((request-method (make-keyword (a-list-value :REQUEST_METHOD @@ -168,16 +171,25 @@ post-char-list) post-char-list))) +(defun list-to-a-list (list &optional a-list) + "Converts a list to an a-list, pairing odd and even elements. If an +odd number of elements are in LIST, the last element is returnes as +the second value. +ex: (LIST-TO-A-LIST '(a b c d) --> '((a b)(c d)) NIL +ex: (LIST-TO-A-LIST '(1 2 3 4 5) --> '((1 2)(3 4)) 5" + (cond + ((null list) (nreverse a-list)) + ((= 1 (length list)) (values (nreverse a-list) (car list))) + (t (list-to-a-list (cddr list) + (cons (list (car list) (cadr list)) + a-list))))) + (defun query-to-a-list (get/post-data) - "Translates the char list from GET-DATA or POST-DATA into a (:KEYWORD -. \"Value\" ) a-list." - (mapcar #'(lambda (key/val-list) - (let ((key/val-strings - (mapcar #'implode-string - (split-char-list #\= key/val-list)))) - (cons (make-keyword (car key/val-strings)) - (cadr key/val-strings)))) - (split-char-list #\& (url-decode-char-list get/post-data)))) + (list-to-a-list + (mapcar #'implode-string + (mapcan #'(lambda (c) (split-char-list #\= c)) + (split-char-list + #\& (url-decode-char-list get/post-data)))))) (defun url-decode-char-list (char-list) "Decodes encoded URL chars as per RFC 1738" Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.7 clhp/ChangeLog:1.8 --- clhp/ChangeLog:1.7 Thu Oct 2 20:38:18 2003 +++ clhp/ChangeLog Thu Oct 2 22:40:39 2003 @@ -1,11 +1,27 @@ 2003-10-02 - * tests/cgi-test.lisp (output-function-test-data): Designed a - class to test functions which print to *standard-output*. These + * cgi.lisp, clhp.lisp (LIST-TO-A-LIST): Moved LIST-TO-A-LIST from + clhp.lisp into cgi.lisp, because I need it there as part of the + rewrite for QUERY-TO-A-LIST. Sooner or later I'll have to merge + all this into a single package so things like this do not have to + happen. + + * cgi.lisp (QUERY-TO-A-LIST): Rewrote this mostly to + simplify it, and make it prettier + (*SERVER-ENV*,*QUERY-VARS*) : Converted them to list type a-lists + ((A B)(C D)) from the Cons type they had been ((A . B) (C + . D)). This is quite temporary, since I plan on making them hashes + soon. I basically did this because the TAG mechanism needs List + type a-lists, and I wanted to reuese list-to-a-list in + cgi.lisp. So as part of the rewrite to QUERY-TO-A-LIST, this ended + up as a result. + + * tests/cgi-test.lisp (OUTPUT-FUNCTION-TEST-DATA): Designed a + class to test functions which print to *STANDARD-OUTPUT*. These test classes will be reused for clhp.lisp, and eventually moved into their own package. - * cgi.lisp (a-list-value): Convenience macro for getting the + * cgi.lisp (A-LIST-VALUE): Convenience macro for getting the values of a-lists 2003-10-01 @@ -23,7 +39,7 @@ PPRINT-XML-ELEMENT, which outputs the structure as an xml tag. I also wrote TAG, which is a convenience function that makes xml-element creation a breeze. - (evaluate-code-block): Enhanced error handling facility, now + (EVALUATE-CODE-BLOCK): Enhanced error handling facility, now errors are reported and processing continues. * examples/index.clhp: Placed some examples of using TAG @@ -31,4 +47,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. - +$Id: ChangeLog,v 1.8 2003/10/03 02:40:39 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Fri Oct 3 02:44:31 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 02 Oct 2003 22:44:31 -0400 Subject: [clhp-cvs] CVS update: clhp/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv8474 Modified Files: Makefile Log Message: Date: Thu Oct 2 22:44:30 2003 Author: aventimiglia Index: clhp/Makefile diff -u clhp/Makefile:1.8 clhp/Makefile:1.9 --- clhp/Makefile:1.8 Tue Sep 23 07:13:09 2003 +++ clhp/Makefile Thu Oct 2 22:44:30 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.8 2003/09/23 11:13:09 aventimiglia Exp $ +# $Id: Makefile,v 1.9 2003/10/03 02:44:30 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -184,10 +184,10 @@ if test -f $$f ; then rm -v $$f ; fi \ done $(MAKE) -C examples clean + find -iname "*.tar.gz" -exec rm -v {} \; clean-backups: find -iname "*~" -exec rm -v {} \; clean-dist: if test -d $(TARROOT); then rm -rv $(TARROOT); fi - find -iname "*.tar.gz" -exec rm -v {} \; From aventimiglia at common-lisp.net Fri Oct 3 05:14:23 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Fri, 03 Oct 2003 01:14:23 -0400 Subject: [clhp-cvs] CVS update: clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv4163 Modified Files: ChangeLog Log Message: (SIDE-EFFECT-FUNCTION-TEST-DATA): Test class for functions to test side effects that set globals. Still don't have it working right. Also improved the run-test methods by writing some macros, there's more work to do here as well. Date: Fri Oct 3 01:14:23 2003 Author: aventimiglia Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.8 clhp/ChangeLog:1.9 --- clhp/ChangeLog:1.8 Thu Oct 2 22:40:39 2003 +++ clhp/ChangeLog Fri Oct 3 01:14:23 2003 @@ -1,3 +1,10 @@ +2003-10-03 + + * tests/cgi-test.lisp (SIDE-EFFECT-FUNCTION-TEST-DATA): Test class + for functions to test side effects that set globals. Still don't + have it working right. Also improved the run-test methods by + writing some macros, there's more work to do here as well. + 2003-10-02 * cgi.lisp, clhp.lisp (LIST-TO-A-LIST): Moved LIST-TO-A-LIST from @@ -47,4 +54,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.8 2003/10/03 02:40:39 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.9 2003/10/03 05:14:23 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Fri Oct 3 05:14:23 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Fri, 03 Oct 2003 01:14:23 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv4163/tests Modified Files: cgi-test.lisp Log Message: (SIDE-EFFECT-FUNCTION-TEST-DATA): Test class for functions to test side effects that set globals. Still don't have it working right. Also improved the run-test methods by writing some macros, there's more work to do here as well. Date: Fri Oct 3 01:14:23 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.4 clhp/tests/cgi-test.lisp:1.5 --- clhp/tests/cgi-test.lisp:1.4 Thu Oct 2 22:40:39 2003 +++ clhp/tests/cgi-test.lisp Fri Oct 3 01:14:23 2003 @@ -29,14 +29,16 @@ (unless (find-package :cgi) (load "library:cgi"))) +;; These macros Used for run-test methods (defmacro call-if-function (form) `(when (functionp ,form) (funcall ,form))) -(defmacro test-result (result) - "Used to return results of tests for run-test methods" - ;; This will work as long as all RUN-TEST methods use DATA for their - ;; TEST-DATA object. - `(cons (test-data-symbol data) ,result)) +(defmacro test-return (test &rest args) + `(cons (test-data-symbol data) + (if ,test + (progn (princ 'ok stream) (terpri) :OK) + (progn (princ 'failed stream) (format stream , at args) + (terpri) :FAILED)))) (defclass test-data () ((symbol :initform NIL @@ -57,11 +59,6 @@ (:documentation "Abstract supertype for CLASS, STRUCTURE, VARIABLE and FUNCTION test-data")) -(defmethod run-test ((data test-data) &optional stream) - "Since TEST-DATA is an abstract test class, we cannot actually use it." - (declare (ignore stream)) - (test-result :error)) - (defclass function-test-data (test-data) ((test-args :initform NIL :type list @@ -77,24 +74,6 @@ (:documentation "A class to test functions or macros, taking TEST-ARGS as a list of arguments to call the function with and expecting RESULT-FORM to be the result")) - -(defmethod run-test ((data function-test-data) - &optional (stream *standard-output*)) - (unwind-protect - (progn - (call-if-function (test-data-pre-function data)) - (let* ((test-form (cons (test-data-symbol data) - (function-test-data-test-args data))) - (result (eval test-form))) - (format stream "~S --> ~S : " test-form result) - (test-result - (let ((test-result (function-test-data-result-form data))) - (if (equal result test-result) - (progn - (format stream "OK~%") :OK) - (progn - (format stream "FAILED ~S expected~%" test-result) :error)))))) - (call-if-function (test-data-post-function data)))) (defclass output-function-test-data (function-test-data) ((output :initform NIL @@ -106,9 +85,44 @@ or functions, but this is used when thye output to *STANDARD-OUTPUT* must be tested as well.")) +(defclass side-effect-function-test-data (function-test-data) + ((var-list :initform NIL + :type list + :reader side-effect-function-test-data-var-list + :initarg :var-list + :documentation "An a-list of ((SYMBOL VALUE)) pairs. All +Symbols should be EQUAL to the VALUES after test function is +evaluated.")) + (:documentation "A subclass of function-test-data used to test +functions which have side effects of setting global variables.")) + + +(defmethod run-test ((data test-data) &optional stream) + "Since TEST-DATA is an abstract test class, we cannot actually use it." + (declare (ignore stream)) + (test-result :error)) + +;; It's important that the RUN-TEST methods below all use DATA as the +;; TEST-DATA object name, because some of the macros defined at the +;; top of the file are hard coded to use the common names. + + +(defmethod run-test ((data function-test-data) + &optional (stream *standard-output*)) + (unwind-protect + (progn + (call-if-function (test-data-pre-function data)) + (let* ((test-form (cons (test-data-symbol data) + (function-test-data-test-args data))) + (result (eval test-form))) + (format stream "~S --> ~S : " test-form result) + (let ((test-result (function-test-data-result-form data))) + (test-return (equal result test-result) + "~S expected" test-result)))) + (call-if-function (test-data-post-function data)))) + (defmethod run-test ((data output-function-test-data) &optional (stream *standard-output*)) - (call-if-function (test-data-pre-function data)) (unwind-protect (progn (call-if-function (test-data-pre-function data)) @@ -120,16 +134,34 @@ (*standard-output* output) (eval test-form)))) (format stream "~S --> ~S ~S : " test-form output result) - (test-result - (let ((test-output (output-function-test-data-output data)) - (test-result (function-test-data-result-form data))) - (if (and (equal result test-result) - (string= output test-output)) - (progn (format stream "OK~%") :OK) - (progn (format stream "FAILED ~S ~S expected~%" test-output - test-result) :ERROR)))))) + (let ((test-output (output-function-test-data-output data)) + (test-result (function-test-data-result-form data))) + (test-return (and (equal result test-result) + (string= output test-output)) + "~S -> ~S expected" test-output test-result)))) (call-if-function (test-data-post-function data)))) +(defmethod run-test ((data side-effect-function-test-data) + &optional stream) + (unwind-protect + (progn + (call-if-function (test-data-pre-function data)) + (let* ((test-form (cons (test-data-symbol data) + (function-test-data-test-args data))) + (result (eval test-form)) + (test-var-list (side-effect-function-test-data-var-list + data)) + (vars (mapcar #'(lambda (c) (car c)) test-var-list)) + (var-list (mapcar + #'(lambda (|v|) (list |v| (eval |v|))) vars))) + (format stream "~S --> ~S ~S : " + test-form result var-list) + (let ((test-result (output-function-test-data-output data))) + (test-return (and (equal result test-result) + (equal test-var-list var-list)) + "~S and ~S expected" test-result test-var-list)))) + (call-if-function (test-data-post-function data)))) + ;; Example ;(defvar list-test (make-instance 'function-test-data ; :symbol 'list @@ -138,14 +170,11 @@ ; ;* (run-test list-test) ;> (LIST 1 2 3 4 5) --> (1 2 3 4 5) : OK -;> (1 2 3 4 5) +;> (LIST . :OK ) (defvar *cgi-tests*) ;; Still to be tested -;; All functions which print to stdout, I'll have to devise a test for them: -;; DEBUG HEADER -;; ;; Functions which have side effects and no return values ;; INIT ;; @@ -192,6 +221,7 @@ (push (list :query_string "index=foo&type=bar%20baz") cgi:*server-env*)) + :post-function #'(lambda () (setq cgi:*server-env* nil)) :test-args nil :result-form '(#\i #\n #\d #\e #\x #\= #\f #\o #\o #\& #\t #\y #\p #\e #\= #\b #\a #\r #\% #\2 #\0 #\b @@ -225,4 +255,19 @@ (fmakunbound 'cgi:header) (load "library:cgi")) :symbol 'cgi:header - :output ""))) + :output "") + (make-instance 'function-test-data + :symbol 'cgi::ca-list-to-a-list + :test-args '('((a . 1)(b . 2)(c . 3))) + :result-form '((a 1)(b 2)(c 3))))) +; (make-instance 'side-effect-function-test-data +; :symbol 'cgi:init +; :pre-function #'(lambda () +; (setq ext:*environment-list* +; '((:request_method . "post") +; (:query_string . "hi=4&a=5")))) +; :post-function #'(lambda () +; (setq ext:*environment-list* "nil")) +; :result-form '(values) +; :var-list '((cgi:*server-env* t))))) +; From aventimiglia at common-lisp.net Wed Oct 8 15:43:33 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 08 Oct 2003 11:43:33 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv29753/tests Modified Files: cgi-test.lisp Log Message: (cond-bind): Addedd COND-BIND, basically it's a COND wrapped up inside a LET. Imported into clhp, and used there as well. (IF-BIND): This is similar to COND-BIND, the whole aim here is to reduce parentheses and make it all a little more readable Date: Wed Oct 8 11:43:32 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.5 clhp/tests/cgi-test.lisp:1.6 --- clhp/tests/cgi-test.lisp:1.5 Fri Oct 3 01:14:23 2003 +++ clhp/tests/cgi-test.lisp Wed Oct 8 11:43:32 2003 @@ -96,12 +96,6 @@ (:documentation "A subclass of function-test-data used to test functions which have side effects of setting global variables.")) - -(defmethod run-test ((data test-data) &optional stream) - "Since TEST-DATA is an abstract test class, we cannot actually use it." - (declare (ignore stream)) - (test-result :error)) - ;; It's important that the RUN-TEST methods below all use DATA as the ;; TEST-DATA object name, because some of the macros defined at the ;; top of the file are hard coded to use the common names. @@ -271,3 +265,6 @@ ; :result-form '(values) ; :var-list '((cgi:*server-env* t))))) ; + +(defun run () + (mapcar #'run-test *cgi-tests*)) \ No newline at end of file From aventimiglia at common-lisp.net Wed Oct 8 15:43:33 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 08 Oct 2003 11:43:33 -0400 Subject: [clhp-cvs] CVS update: clhp/clhp.lisp clhp/cgi.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv29753 Modified Files: clhp.lisp cgi.lisp ChangeLog Log Message: (cond-bind): Addedd COND-BIND, basically it's a COND wrapped up inside a LET. Imported into clhp, and used there as well. (IF-BIND): This is similar to COND-BIND, the whole aim here is to reduce parentheses and make it all a little more readable Date: Wed Oct 8 11:43:33 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.10 clhp/clhp.lisp:1.11 --- clhp/clhp.lisp:1.10 Thu Oct 2 22:40:39 2003 +++ clhp/clhp.lisp Wed Oct 8 11:43:33 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.10 2003/10/03 02:40:39 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.11 2003/10/08 15:43:33 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -27,6 +27,7 @@ (defpackage :clhp (:use :cgi :cl) + (:import-from :cgi #:cond-bind #:list-to-a-list) (:export #:parse #:*clhp-version* #:echo #:include #:xml-element #:make-xml-element #:copy-xml-element #:xml-element-attributes #:xml-element-name #:xml-element-contents #:xml-element-p #:tag)) @@ -38,7 +39,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/03 02:40:39 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/08 15:43:33 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) @@ -115,10 +116,9 @@ the elements, and dumps the rest through unscathed." (declare (type (array character 1) buffer) (type fixnum end)) - (let ((index (if in-block - (find-pi-end buffer :start start :end end) - (find-pi-start buffer :start start :end end)))) - (cond + (cond-bind ((index (if in-block + (find-pi-end buffer :start start :end end) + (find-pi-start buffer :start start :end end)))) ((>= start end) ; Done with this buffer nil) ((and in-block index) ; Found the end of a code-block @@ -135,7 +135,7 @@ :in-block t)) (in-block (signal 'parse-error)) (t ; Not in code-block no start in sight - (write-sequence buffer *standard-output* :start start :end end))))) + (write-sequence buffer *standard-output* :start start :end end)))) (defun evaluate-code-block (code-block) "Read the Lisp object represented by CODE-BLOCK, and evaluate it." @@ -198,7 +198,7 @@ --> " (multiple-value-bind (att-list contents) - (cgi::list-to-a-list (cdr args)) + (list-to-a-list (cdr args)) (make-xml-element :name (car args) :attributes att-list :contents contents))) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.6 clhp/cgi.lisp:1.7 --- clhp/cgi.lisp:1.6 Thu Oct 2 22:40:39 2003 +++ clhp/cgi.lisp Wed Oct 8 11:43:33 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.6 2003/10/03 02:40:39 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.7 2003/10/08 15:43:33 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -45,6 +45,15 @@ "returns the value from a (KEY . VALUE) A-LIST" `(cadr (assoc ,key ,a-list))) +(defmacro cond-bind ((&rest bindings) &body body) + "A COND wrapped in a Let" + `(let (, at bindings) (cond , at body))) + +(defmacro if-bind ((&rest bindings) test if else) + "An IF wrapped in a LET" + `(let (, at bindings) (if ,test ,if ,else))) + + ;; External Symbol section (defvar *server-env* nil @@ -94,14 +103,14 @@ accessed" (setf *server-env* (ca-list-to-a-list ext:*environment-list*) *query-vars* - (let ((request-method (make-keyword + (cond-bind + ((request-method (make-keyword (a-list-value :REQUEST_METHOD *server-env*)))) - (cond - ((eql request-method :POST) - (query-to-a-list (post-data))) - ((eql request-method :GET) - (query-to-a-list (get-data)))))) + ((eql request-method :POST) + (query-to-a-list (post-data))) + ((eql request-method :GET) + (query-to-a-list (get-data))))) (values)) ;; @@ -129,12 +138,12 @@ (labels ((split (char-list split-list) - (let ((position (position char char-list))) - (if (null position) + (if-bind ((position (position char char-list))) + (null position) (remove nil (nreverse (cons char-list split-list))) (split (nthcdr (1+ position) char-list) (cons (butlast char-list (- (length char-list) position)) - split-list)))))) + split-list))))) (split char-list nil))) ;; !!!!!!!!! This should most likely be tested and improved , because @@ -202,35 +211,35 @@ :message (format nil "~S is a malformed URL encoded string." (implode-string char-list)))) - (decode-next (encoded-part &optional decoded-part) - (let ((front-char (car encoded-part))) - (cond - ((null encoded-part) (nreverse decoded-part)) - ((char= #\% front-char) - (if (<= 3 (length encoded-part)) - (decode-next (cdddr encoded-part) - (cons (decode-char - (subseq encoded-part 1 3)) - decoded-part)) - (decode-error))) - ((char= #\+ front-char) - (decode-next (cdr encoded-part) - (cons #\Space decoded-part))) - (t (decode-next (cdr encoded-part) - (cons front-char decoded-part)))))) + (decode-next + (encoded-part &optional decoded-part) + (cond-bind ((front-char (car encoded-part))) + ((null encoded-part) (nreverse decoded-part)) + ((char= #\% front-char) + (if (<= 3 (length encoded-part)) + (decode-next (cdddr encoded-part) + (cons (decode-char + (subseq encoded-part 1 3)) + decoded-part)) + (decode-error))) + ((char= #\+ front-char) + (decode-next (cdr encoded-part) + (cons #\Space decoded-part))) + (t (decode-next (cdr encoded-part) + (cons front-char decoded-part))))) (hex2dec (string-num) (setf *read-base* 16) (prog1 (read-from-string string-num) (setf *read-base* 10))) (decode-char (char-code-list) - (let ((great (car char-code-list)) - (least (cadr char-code-list))) - (if (and (digit-char-p great 16) - (digit-char-p least 16)) - (code-char (hex2dec - (format nil "~a~a" great least))) - (decode-error))))) + (if-bind ((great (car char-code-list)) + (least (cadr char-code-list))) + (and (digit-char-p great 16) + (digit-char-p least 16)) + (code-char (hex2dec + (format nil "~a~a" great least))) + (decode-error)))) (decode-next char-list)))) (defun implode-string (char-list) Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.9 clhp/ChangeLog:1.10 --- clhp/ChangeLog:1.9 Fri Oct 3 01:14:23 2003 +++ clhp/ChangeLog Wed Oct 8 11:43:33 2003 @@ -1,3 +1,11 @@ +2003-10-08 + + * cgi.lisp, clhp.lisp (cond-bind): Addedd COND-BIND, basically + it's a COND wrapped up inside a LET. Imported into clhp, and used + there as well. + (IF-BIND): This is similar to COND-BIND, the whole aim here is to + reduce parentheses and make it all a little more readable + 2003-10-03 * tests/cgi-test.lisp (SIDE-EFFECT-FUNCTION-TEST-DATA): Test class @@ -54,4 +62,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.9 2003/10/03 05:14:23 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.10 2003/10/08 15:43:33 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Tue Oct 14 04:33:41 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 14 Oct 2003 00:33:41 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv11421/tests Added Files: .cvsignore Log Message: Date: Tue Oct 14 00:33:40 2003 Author: aventimiglia From aventimiglia at common-lisp.net Tue Oct 14 04:33:41 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 14 Oct 2003 00:33:41 -0400 Subject: [clhp-cvs] CVS update: clhp/examples/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp/examples In directory common-lisp.net:/tmp/cvs-serv11421/examples Added Files: .cvsignore Log Message: Date: Tue Oct 14 00:33:41 2003 Author: aventimiglia From aventimiglia at common-lisp.net Tue Oct 14 04:33:41 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 14 Oct 2003 00:33:41 -0400 Subject: [clhp-cvs] CVS update: clhp/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv11421 Added Files: .cvsignore Log Message: Date: Tue Oct 14 00:33:41 2003 Author: aventimiglia From aventimiglia at common-lisp.net Tue Oct 14 22:47:30 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 14 Oct 2003 18:47:30 -0400 Subject: [clhp-cvs] CVS update: clhp/config/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp/config In directory common-lisp.net:/tmp/cvs-serv1953/config Added Files: .cvsignore Log Message: (debug): Changed format string to ~S so objects will be printed more accuratley Date: Tue Oct 14 18:47:29 2003 Author: aventimiglia From aventimiglia at common-lisp.net Tue Oct 14 22:47:30 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 14 Oct 2003 18:47:30 -0400 Subject: [clhp-cvs] CVS update: clhp/cgi.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv1953 Modified Files: cgi.lisp ChangeLog Log Message: (debug): Changed format string to ~S so objects will be printed more accuratley Date: Tue Oct 14 18:47:30 2003 Author: aventimiglia Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.7 clhp/cgi.lisp:1.8 --- clhp/cgi.lisp:1.7 Wed Oct 8 11:43:33 2003 +++ clhp/cgi.lisp Tue Oct 14 18:47:30 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.7 2003/10/08 15:43:33 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.8 2003/10/14 22:47:30 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -33,7 +33,7 @@ (defmacro debug (expression) "Print out EXPRESSION and the result of (EVAL EXPRESSION)" - `(format t "(CGI:DEBUG: ~a --> ~a)~%" ,expression (eval ,expression))) + `(format t "(CGI:DEBUG: ~s --> ~s)~%" ,expression (eval ,expression))) (defmacro explode-string (string) "Converts a string to a list of chars, this is an aux function used Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.10 clhp/ChangeLog:1.11 --- clhp/ChangeLog:1.10 Wed Oct 8 11:43:33 2003 +++ clhp/ChangeLog Tue Oct 14 18:47:30 2003 @@ -1,3 +1,8 @@ +2003-10-14 + + * cgi.lisp (debug): Changed format string to ~S so objects will be + printed more accuratley + 2003-10-08 * cgi.lisp, clhp.lisp (cond-bind): Addedd COND-BIND, basically @@ -62,4 +67,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.10 2003/10/08 15:43:33 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.11 2003/10/14 22:47:30 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Wed Oct 15 12:50:51 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 08:50:51 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv31909/tests Modified Files: cgi-test.lisp Log Message: Fixed type with my name in copyright headers Date: Wed Oct 15 08:50:51 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.6 clhp/tests/cgi-test.lisp:1.7 --- clhp/tests/cgi-test.lisp:1.6 Wed Oct 8 11:43:32 2003 +++ clhp/tests/cgi-test.lisp Wed Oct 15 08:50:51 2003 @@ -17,7 +17,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ ;; Test suite to for the :CGI package. The aim of this is to test all From aventimiglia at common-lisp.net Wed Oct 15 12:50:52 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 08:50:52 -0400 Subject: [clhp-cvs] CVS update: clhp/examples/test.lisp clhp/examples/index.clhp clhp/examples/clhp-test.lisp clhp/examples/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp/examples In directory common-lisp.net:/tmp/cvs-serv31909/examples Modified Files: test.lisp index.clhp clhp-test.lisp Makefile Log Message: Fixed type with my name in copyright headers Date: Wed Oct 15 08:50:51 2003 Author: aventimiglia Index: clhp/examples/test.lisp diff -u clhp/examples/test.lisp:1.2 clhp/examples/test.lisp:1.3 --- clhp/examples/test.lisp:1.2 Fri Sep 19 00:49:19 2003 +++ clhp/examples/test.lisp Wed Oct 15 08:50:51 2003 @@ -15,11 +15,11 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ (ext:file-comment - "$Id: test.lisp,v 1.2 2003/09/19 04:49:19 aventimiglia Exp $") + "$Id: test.lisp,v 1.3 2003/10/15 12:50:51 aventimiglia Exp $") (cgi:init) (cgi:header :extra (list "Content-Language: en")) @@ -33,5 +33,5 @@ (cgi:debug '(cgi::post-data)) (cgi:debug '(cgi::post-data)))) -(format t "~%--------~% $Date: 2003/09/19 04:49:19 $~%") +(format t "~%--------~% $Date: 2003/10/15 12:50:51 $~%") Index: clhp/examples/index.clhp diff -u clhp/examples/index.clhp:1.5 clhp/examples/index.clhp:1.6 --- clhp/examples/index.clhp:1.5 Tue Sep 23 10:44:37 2003 +++ clhp/examples/index.clhp Wed Oct 15 08:50:51 2003 @@ -20,7 +20,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ ;; This example page is probably not representative of anything that Index: clhp/examples/clhp-test.lisp diff -u clhp/examples/clhp-test.lisp:1.2 clhp/examples/clhp-test.lisp:1.3 --- clhp/examples/clhp-test.lisp:1.2 Fri Sep 19 00:49:19 2003 +++ clhp/examples/clhp-test.lisp Wed Oct 15 08:50:51 2003 @@ -1,4 +1,4 @@ -;; $Id: clhp-test.lisp,v 1.2 2003/09/19 04:49:19 aventimiglia Exp $ +;; $Id: clhp-test.lisp,v 1.3 2003/10/15 12:50:51 aventimiglia Exp $ ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -17,7 +17,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ Index: clhp/examples/Makefile diff -u clhp/examples/Makefile:1.2 clhp/examples/Makefile:1.3 --- clhp/examples/Makefile:1.2 Thu Sep 18 16:57:29 2003 +++ clhp/examples/Makefile Wed Oct 15 08:50:51 2003 @@ -1,5 +1,24 @@ -# $Id: Makefile,v 1.2 2003/09/18 20:57:29 aventimiglia Exp $ +# $Id: Makefile,v 1.3 2003/10/15 12:50:51 aventimiglia Exp $ # +# CLHP the Common Lisp Hypertext Preprocessor +# (C) 2003 Anthony J Ventimiglia +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# email: aventimiglia at common-lisp.net +# HomePage: http://common-lisp.net/project/clhp/ # This is where lisp sources will be installed SRCDIR=/usr/lib/cmucl/source/clhp From aventimiglia at common-lisp.net Wed Oct 15 12:50:52 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 08:50:52 -0400 Subject: [clhp-cvs] CVS update: clhp/config/runclcgi.src clhp/config/lispc.lisp clhp/config/build-core.lisp clhp/config/binfmt-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/config In directory common-lisp.net:/tmp/cvs-serv31909/config Modified Files: runclcgi.src lispc.lisp build-core.lisp binfmt-test.lisp Log Message: Fixed type with my name in copyright headers Date: Wed Oct 15 08:50:52 2003 Author: aventimiglia Index: clhp/config/runclcgi.src diff -u clhp/config/runclcgi.src:1.3 clhp/config/runclcgi.src:1.4 --- clhp/config/runclcgi.src:1.3 Fri Sep 19 00:49:19 2003 +++ clhp/config/runclcgi.src Wed Oct 15 08:50:52 2003 @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# email: aventimigli at common-lisp.net +# email: aventimiglia at common-lisp.net # HomePage: http://common-lisp.net/project/clhp/ # Index: clhp/config/lispc.lisp diff -u clhp/config/lispc.lisp:1.2 clhp/config/lispc.lisp:1.3 --- clhp/config/lispc.lisp:1.2 Wed Sep 17 16:25:11 2003 +++ clhp/config/lispc.lisp Wed Oct 15 08:50:52 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: lispc.lisp,v 1.2 2003/09/17 20:25:11 aventimiglia Exp $") + "$Id: lispc.lisp,v 1.3 2003/10/15 12:50:52 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -18,7 +18,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ ;; This isn't really necessary, but it creates an exit code if there Index: clhp/config/build-core.lisp diff -u clhp/config/build-core.lisp:1.2 clhp/config/build-core.lisp:1.3 --- clhp/config/build-core.lisp:1.2 Wed Sep 17 14:19:52 2003 +++ clhp/config/build-core.lisp Wed Oct 15 08:50:52 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: build-core.lisp,v 1.2 2003/09/17 18:19:52 aventimiglia Exp $") + "$Id: build-core.lisp,v 1.3 2003/10/15 12:50:52 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -18,7 +18,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ Index: clhp/config/binfmt-test.lisp diff -u clhp/config/binfmt-test.lisp:1.2 clhp/config/binfmt-test.lisp:1.3 --- clhp/config/binfmt-test.lisp:1.2 Fri Sep 19 00:49:19 2003 +++ clhp/config/binfmt-test.lisp Wed Oct 15 08:50:52 2003 @@ -1,4 +1,4 @@ -;; $Id: binfmt-test.lisp,v 1.2 2003/09/19 04:49:19 aventimiglia Exp $ +;; $Id: binfmt-test.lisp,v 1.3 2003/10/15 12:50:52 aventimiglia Exp $ ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -17,7 +17,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ ;; From aventimiglia at common-lisp.net Wed Oct 15 12:50:52 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 08:50:52 -0400 Subject: [clhp-cvs] CVS update: clhp/start-clcgi.lisp clhp/clhp.lisp clhp/cgi.lisp clhp/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv31909 Modified Files: start-clcgi.lisp clhp.lisp cgi.lisp Makefile Log Message: Fixed type with my name in copyright headers Date: Wed Oct 15 08:50:52 2003 Author: aventimiglia Index: clhp/start-clcgi.lisp diff -u clhp/start-clcgi.lisp:1.2 clhp/start-clcgi.lisp:1.3 --- clhp/start-clcgi.lisp:1.2 Thu Sep 18 16:57:30 2003 +++ clhp/start-clcgi.lisp Wed Oct 15 08:50:52 2003 @@ -1,4 +1,4 @@ -;; $Id: start-clcgi.lisp,v 1.2 2003/09/18 20:57:30 aventimiglia Exp $ +;; $Id: start-clcgi.lisp,v 1.3 2003/10/15 12:50:52 aventimiglia Exp $ ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -17,7 +17,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ ;; This came from a hacked version of a program Paul Foley posted at Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.11 clhp/clhp.lisp:1.12 --- clhp/clhp.lisp:1.11 Wed Oct 8 11:43:33 2003 +++ clhp/clhp.lisp Wed Oct 15 08:50:52 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.11 2003/10/08 15:43:33 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.12 2003/10/15 12:50:52 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -18,7 +18,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ (eval-when (:compile-toplevel) @@ -39,7 +39,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/08 15:43:33 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/15 12:50:52 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.8 clhp/cgi.lisp:1.9 --- clhp/cgi.lisp:1.8 Tue Oct 14 18:47:30 2003 +++ clhp/cgi.lisp Wed Oct 15 08:50:52 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.8 2003/10/14 22:47:30 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.9 2003/10/15 12:50:52 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -17,7 +17,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;; -;; email: aventimigli at common-lisp.net +;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ (defpackage :cgi Index: clhp/Makefile diff -u clhp/Makefile:1.9 clhp/Makefile:1.10 --- clhp/Makefile:1.9 Thu Oct 2 22:44:30 2003 +++ clhp/Makefile Wed Oct 15 08:50:52 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 2003/10/03 02:44:30 aventimiglia Exp $ +# $Id: Makefile,v 1.10 2003/10/15 12:50:52 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# email: aventimigli at common-lisp.net +# email: aventimiglia at common-lisp.net # HomePage: http://common-lisp.net/project/clhp/ # This is where lisp sources will be installed From aventimiglia at common-lisp.net Wed Oct 15 14:05:58 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 10:05:58 -0400 Subject: [clhp-cvs] CVS update: clhp/examples/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp/examples In directory common-lisp.net:/tmp/cvs-serv10945/examples Modified Files: Makefile Log Message: Moved test-suite out of cgi-test into its own file, now I can write tests for clhp as well. Modified Makefiles to deal with the new directory. Now running make check from the toplevel runs the tests. Date: Wed Oct 15 10:05:57 2003 Author: aventimiglia Index: clhp/examples/Makefile diff -u clhp/examples/Makefile:1.3 clhp/examples/Makefile:1.4 --- clhp/examples/Makefile:1.3 Wed Oct 15 08:50:51 2003 +++ clhp/examples/Makefile Wed Oct 15 10:05:57 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2003/10/15 12:50:51 aventimiglia Exp $ +# $Id: Makefile,v 1.4 2003/10/15 14:05:57 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -57,7 +57,8 @@ all: $(BINS) -.PHONY: all clean install uninstall clean-all clean-backups check-install-path +.PHONY: all clean install uninstall clean-all clean-backups \ + check-install-path check %.x86f: %.lisp $(LISPC) $< From aventimiglia at common-lisp.net Wed Oct 15 14:05:58 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 10:05:58 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/test-suite.lisp clhp/tests/Makefile clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv10945/tests Modified Files: cgi-test.lisp Added Files: test-suite.lisp Makefile Log Message: Moved test-suite out of cgi-test into its own file, now I can write tests for clhp as well. Modified Makefiles to deal with the new directory. Now running make check from the toplevel runs the tests. Date: Wed Oct 15 10:05:57 2003 Author: aventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.7 clhp/tests/cgi-test.lisp:1.8 --- clhp/tests/cgi-test.lisp:1.7 Wed Oct 15 08:50:51 2003 +++ clhp/tests/cgi-test.lisp Wed Oct 15 10:05:56 2003 @@ -27,144 +27,12 @@ (eval-when (:load-toplevel :compile-toplevel) (unless (find-package :cgi) - (load "library:cgi"))) + (load "library:cgi")) + (unless (find-package :net.common-lisp.aventimiglia.test-suite) + (load "test-suite")) + (when (find-package :clhp) (delete-package :clhp))) -;; These macros Used for run-test methods -(defmacro call-if-function (form) - `(when (functionp ,form) (funcall ,form))) - -(defmacro test-return (test &rest args) - `(cons (test-data-symbol data) - (if ,test - (progn (princ 'ok stream) (terpri) :OK) - (progn (princ 'failed stream) (format stream , at args) - (terpri) :FAILED)))) - -(defclass test-data () - ((symbol :initform NIL - :type symbol - :reader test-data-symbol - :initarg :symbol - :documentation "The symbol name to be tested") - (pre-function :initform NIL - :type (or function nil) - :reader test-data-pre-function - :initarg :pre-function - :documentation "Function to be called prior to running tests") - (post-function :initform NIL - :type (or function nil) - :reader test-data-post-function - :initarg :post-function - :documentation "Function to be called after running tests")) - (:documentation "Abstract supertype for CLASS, STRUCTURE, VARIABLE -and FUNCTION test-data")) - -(defclass function-test-data (test-data) - ((test-args :initform NIL - :type list - :reader function-test-data-test-args - :initarg :test-args - :documentation "A list of arguments to be passed to the -function for testing") - (result-form :initform NIL - :reader function-test-data-result-form - :initarg :result-form - :documentation "The expected return value when SYMBOL -is called with TEST-ARGS")) - (:documentation "A class to test functions or macros, taking -TEST-ARGS as a list of arguments to call the function with and -expecting RESULT-FORM to be the result")) - -(defclass output-function-test-data (function-test-data) - ((output :initform NIL - :type string - :reader output-function-test-data-output - :initarg :output - :documentation "A string which should be equal to the output")) - (:documentation "A subclass of function-test-data for testing macros -or functions, but this is used when thye output to *STANDARD-OUTPUT* -must be tested as well.")) - -(defclass side-effect-function-test-data (function-test-data) - ((var-list :initform NIL - :type list - :reader side-effect-function-test-data-var-list - :initarg :var-list - :documentation "An a-list of ((SYMBOL VALUE)) pairs. All -Symbols should be EQUAL to the VALUES after test function is -evaluated.")) - (:documentation "A subclass of function-test-data used to test -functions which have side effects of setting global variables.")) - -;; It's important that the RUN-TEST methods below all use DATA as the -;; TEST-DATA object name, because some of the macros defined at the -;; top of the file are hard coded to use the common names. - - -(defmethod run-test ((data function-test-data) - &optional (stream *standard-output*)) - (unwind-protect - (progn - (call-if-function (test-data-pre-function data)) - (let* ((test-form (cons (test-data-symbol data) - (function-test-data-test-args data))) - (result (eval test-form))) - (format stream "~S --> ~S : " test-form result) - (let ((test-result (function-test-data-result-form data))) - (test-return (equal result test-result) - "~S expected" test-result)))) - (call-if-function (test-data-post-function data)))) - -(defmethod run-test ((data output-function-test-data) - &optional (stream *standard-output*)) - (unwind-protect - (progn - (call-if-function (test-data-pre-function data)) - (let* ((test-form (cons (test-data-symbol data) - (function-test-data-test-args data))) - (output (make-array 0 :element-type 'base-char - :fill-pointer 0 :adjustable t)) - (result (with-output-to-string - (*standard-output* output) - (eval test-form)))) - (format stream "~S --> ~S ~S : " test-form output result) - (let ((test-output (output-function-test-data-output data)) - (test-result (function-test-data-result-form data))) - (test-return (and (equal result test-result) - (string= output test-output)) - "~S -> ~S expected" test-output test-result)))) - (call-if-function (test-data-post-function data)))) - -(defmethod run-test ((data side-effect-function-test-data) - &optional stream) - (unwind-protect - (progn - (call-if-function (test-data-pre-function data)) - (let* ((test-form (cons (test-data-symbol data) - (function-test-data-test-args data))) - (result (eval test-form)) - (test-var-list (side-effect-function-test-data-var-list - data)) - (vars (mapcar #'(lambda (c) (car c)) test-var-list)) - (var-list (mapcar - #'(lambda (|v|) (list |v| (eval |v|))) vars))) - (format stream "~S --> ~S ~S : " - test-form result var-list) - (let ((test-result (output-function-test-data-output data))) - (test-return (and (equal result test-result) - (equal test-var-list var-list)) - "~S and ~S expected" test-result test-var-list)))) - (call-if-function (test-data-post-function data)))) - -;; Example -;(defvar list-test (make-instance 'function-test-data -; :symbol 'list -; :test-args '(1 2 3 4 5) -; :result-form '(1 2 3 4 5))) -; -;* (run-test list-test) -;> (LIST 1 2 3 4 5) --> (1 2 3 4 5) : OK -;> (LIST . :OK ) +(use-package :test-suite) (defvar *cgi-tests*) @@ -229,6 +97,10 @@ :test-args '('(list 1 2 3)) :output (format nil "(CGI:DEBUG: (LIST 1 2 3) --> (1 2 3))~%")) + (make-instance 'function-test-data + :symbol 'cgi::ca-list-to-a-list + :test-args '('((a . 1)(b . 2)(c . 3))) + :result-form '((a 1)(b 2)(c 3))) (make-instance 'output-function-test-data :symbol 'cgi:header :output (format nil @@ -249,11 +121,8 @@ (fmakunbound 'cgi:header) (load "library:cgi")) :symbol 'cgi:header - :output "") - (make-instance 'function-test-data - :symbol 'cgi::ca-list-to-a-list - :test-args '('((a . 1)(b . 2)(c . 3))) - :result-form '((a 1)(b 2)(c 3))))) + :output ""))) + ; (make-instance 'side-effect-function-test-data ; :symbol 'cgi:init ; :pre-function #'(lambda () @@ -266,5 +135,8 @@ ; :var-list '((cgi:*server-env* t))))) ; -(defun run () - (mapcar #'run-test *cgi-tests*)) \ No newline at end of file +(eval-when (load) + (unix:unix-exit (cadr (multiple-value-list (run-tests *cgi-tests*))))) + + + \ No newline at end of file From aventimiglia at common-lisp.net Wed Oct 15 14:05:58 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 10:05:58 -0400 Subject: [clhp-cvs] CVS update: clhp/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv10945 Modified Files: Makefile Log Message: Moved test-suite out of cgi-test into its own file, now I can write tests for clhp as well. Modified Makefiles to deal with the new directory. Now running make check from the toplevel runs the tests. Date: Wed Oct 15 10:05:58 2003 Author: aventimiglia Index: clhp/Makefile diff -u clhp/Makefile:1.10 clhp/Makefile:1.11 --- clhp/Makefile:1.10 Wed Oct 15 08:50:52 2003 +++ clhp/Makefile Wed Oct 15 10:05:57 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 2003/10/15 12:50:52 aventimiglia Exp $ +# $Id: Makefile,v 1.11 2003/10/15 14:05:57 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -65,7 +65,8 @@ TESTS=config/binfmt-test.clcgi DOCS=COPYING INSTALL ChangeLog NEWS README TODO -SUBDIRS=config examples +SUBDIRS=config examples tests +RECURSIVE_SUBDIRS = examples tests EXTRADIST=config/binfmt-test.lisp config/build-core.lisp config/lispc.lisp \ config/runclcgi.src examples/Makefile examples/clhp-test.lisp \ examples/index.clhp examples/test.lisp Makefile @@ -80,11 +81,13 @@ TARROOT=clhp-$(VERSION) TARBALL=$(TARROOT).tar.gz +RECURSIVE_TARGETS=clean-recursive clean-all-recursive check-recursive + all: $(LISPCBIN) $(LIBS) $(CORE) $(RUNCGI) .PHONY: all install uninstall clean clean-all clean-backups install-dirs \ install-source install-source-dirs uninstall-files uninstall-dirs \ - install-core tests clean-dist + install-core tests clean-dist $(RECURSIVE_TARGETS) check %.x86f: %.lisp $(LISPC) $< @@ -97,6 +100,8 @@ if test ! -x $$file; then $(CHMOD) -v a+x $$file ; fi \ done +check: $(CORE) check-recursive + $(LISPCBIN): config/lispc.lisp $(CORE): $(SOURCES) config/build-core.lisp @@ -175,9 +180,9 @@ tar cvf $$tarfile $(TARROOT) ; \ gzip $$tarfile -clean-all: clean clean-backups clean-dist +clean-all: clean-all-recursive clean clean-backups clean-dist -clean: +clean: clean-recursive for f in $(LIBS) $(LISPCBIN) $(CORE) $(CORE).BAK $(RUNCGI) \ $(TESTS) $(TARBALL); \ do \ @@ -186,8 +191,22 @@ $(MAKE) -C examples clean find -iname "*.tar.gz" -exec rm -v {} \; -clean-backups: +clean-backups: find -iname "*~" -exec rm -v {} \; clean-dist: if test -d $(TARROOT); then rm -rv $(TARROOT); fi + +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2 \ + dot_seen=no ; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(RECURSIVE_SUBDIRS)' ; for subdir in $$list; do \ + echo ">>>>> Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) || \ + case "$$amf" in \ + *=*) exit 1 ;; \ + *k*) exit 1 ;; \ + *) exit 1 ;; \ + esac ; \ + done \ No newline at end of file From aventimiglia at common-lisp.net Wed Oct 15 14:44:05 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 15 Oct 2003 10:44:05 -0400 Subject: [clhp-cvs] CVS update: clhp/clhp.lisp clhp/cgi.lisp clhp/TODO clhp/NEWS clhp/Makefile clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv31434 Modified Files: clhp.lisp cgi.lisp TODO NEWS Makefile ChangeLog Log Message: 0.1.1 release Date: Wed Oct 15 10:44:04 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.12 clhp/clhp.lisp:1.13 --- clhp/clhp.lisp:1.12 Wed Oct 15 08:50:52 2003 +++ clhp/clhp.lisp Wed Oct 15 10:44:04 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.12 2003/10/15 12:50:52 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.13 2003/10/15 14:44:04 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -25,7 +25,8 @@ (unless (find-package :cgi) (load "cgi"))) -(defpackage :clhp +(defpackage #:net.common-lisp.aventimiglia.clhp + (:nicknames :clhp) (:use :cgi :cl) (:import-from :cgi #:cond-bind #:list-to-a-list) (:export #:parse #:*clhp-version* #:echo #:include #:xml-element @@ -38,8 +39,8 @@ ;; by changing the NIL in the first part of the OR, a release number ;; will override the CVS keyword (defconstant *CLHP-VERSION* - #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/15 12:50:52 $")) + #.(or "0.1.1alpha" ; Set this for releases + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/15 14:44:04 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.9 clhp/cgi.lisp:1.10 --- clhp/cgi.lisp:1.9 Wed Oct 15 08:50:52 2003 +++ clhp/cgi.lisp Wed Oct 15 10:44:04 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.9 2003/10/15 12:50:52 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.10 2003/10/15 14:44:04 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -20,7 +20,8 @@ ;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -(defpackage :cgi +(defpackage #:net.common-lisp.aventimiglia.cgi + (:nicknames #:cgi) (:use :cl) (:export #:*server-env* #:*query-vars* #:header #:debug #:init)) Index: clhp/TODO diff -u clhp/TODO:1.6 clhp/TODO:1.7 --- clhp/TODO:1.6 Wed Oct 1 15:11:33 2003 +++ clhp/TODO Wed Oct 15 10:44:04 2003 @@ -1,13 +1,14 @@ -$Id: TODO,v 1.6 2003/10/01 19:11:33 aventimiglia Exp $ -*- outline -*- +$Id: TODO,v 1.7 2003/10/15 14:44:04 aventimiglia Exp $ -*- outline -*- + +* Convert *QUERY-VARS* and *SERVER-ENV* to hashes + I should probably make interface functions to access them, actually + I should make them read-only maybe encapsulate a hash in a class and + only allow reading from external functions * Test suite - Write a test suite, in lisp that will run test on clhp components, - this will be used during development, to make sure everything is - working properly. - - This is in thw works is tests/, I think I'll refine it a bit and - make it it's own package. There is still more work to be done, and - that's a whole different can of beans +** Complete suite for :cgi +** Write suite for :clhp +** Refine :test-suite * COMPILE-CGI This is just a convenience function that will compile and save fasl @@ -34,6 +35,7 @@ should not stop the entire page from parsing, it should just fail for that form, report the error (and the offendding form) and continue at the next reasonable point. + * Differences from PHP Some differences I should keep, like you can't end blocks in the Index: clhp/NEWS diff -u clhp/NEWS:1.2 clhp/NEWS:1.3 --- clhp/NEWS:1.2 Fri Sep 19 01:57:19 2003 +++ clhp/NEWS Wed Oct 15 10:44:04 2003 @@ -1,5 +1,35 @@ +$Id: NEWS,v 1.3 2003/10/15 14:44:04 aventimiglia Exp $ -*- outline -*- -Wed Sep 17 15:17:02 EDT 2003 -- CLHP package migrated from my local -server to common-lisp.net +* Wed Sep 17 15:17:02 EDT 2003 -- CLHP package migrated from my local + server to common-lisp.net -Fri Sep 19 01:56:45 EDT 2003 -- 0.1.0alpha released +* Fri Sep 19 01:56:45 EDT 2003 -- 0.1.0alpha released + +* Wed Oct 15 10:08:33 EDT 2003 -- 0.1.1alpha release + See ChangeLog for details, but here's a rundown of the new stuff: +** Converted CGI:*SERVER-ENV* and CGI:*QUERY-VARS* + In the previous version these had been cons type a-lists ((like + . this)) I've converted them to List type a-lists ((like this)), + don't get used to it though, since eventually I'll probably end up + making them into Hashtables. +** XML-ELEMENT structure + This structure along with it's PPRINT function and the TAG macro, + creating ax XML element is as east as: (TAG 'REMARK "this") +** Somewhat better error reporting. + When the parser encounters Lisp errors, it tries its best to print + a good message and take up at the next reasonable place it can. +** Internals stuff + This isn't of much interest unless you want to hack the code. +** Pakcage names + The package names were changed to more descriptive + :net.common-lisp.aventimiglia.{cgi,clhp}, but I've still retained + :CLHP and :CGI as nicknames so there is not any change to the + interface +*** Code cleanup -- working to make all this more readable. +*** Test-suite -- + The new tests/ directory contains a test-suite package and a + test for the :CGI library. I really just decided to write my own + test suite since I didn't really want to deal with learning + someone elses. In the future I'm going to write tests for :CLHP + + Index: clhp/Makefile diff -u clhp/Makefile:1.11 clhp/Makefile:1.12 --- clhp/Makefile:1.11 Wed Oct 15 10:05:57 2003 +++ clhp/Makefile Wed Oct 15 10:44:04 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.11 2003/10/15 14:05:57 aventimiglia Exp $ +# $Id: Makefile,v 1.12 2003/10/15 14:44:04 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -69,7 +69,8 @@ RECURSIVE_SUBDIRS = examples tests EXTRADIST=config/binfmt-test.lisp config/build-core.lisp config/lispc.lisp \ config/runclcgi.src examples/Makefile examples/clhp-test.lisp \ - examples/index.clhp examples/test.lisp Makefile + examples/index.clhp examples/test.lisp Makefile tests/Makefile \ + tests/cgi-test.lisp tests/test-suite.lisp DISTFILES=$(SOURCES) $(DOCS) $(EXTRADIST) Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.11 clhp/ChangeLog:1.12 --- clhp/ChangeLog:1.11 Tue Oct 14 18:47:30 2003 +++ clhp/ChangeLog Wed Oct 15 10:44:04 2003 @@ -1,3 +1,13 @@ +2003-10-15 + + * cgi.lisp, clhp.lisp: Changed real package names to a more exact + one ala java style. They still have :CGI and :CLHP for nicknames. + + * tests/test-suite.lisp (run-tests): Moved test-suite out of + cgi-test into its own file, now I can write tests for clhp as + well. Modified Makefiles to deal with the new directory. Now + running make check from the toplevel runs the tests. + 2003-10-14 * cgi.lisp (debug): Changed format string to ~S so objects will be @@ -67,4 +77,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.11 2003/10/14 22:47:30 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.12 2003/10/15 14:44:04 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Thu Oct 16 04:00:42 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 00:00:42 -0400 Subject: [clhp-cvs] CVS update: clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv15576 Modified Files: ChangeLog Log Message: * tests/test-suite.lisp: Exporting OUTPUT-FUNCTION-TEST-DATA-OUTPUT * tests/cgi-test.lisp (*CGI-TESTS*): Added tests for LIST-TO-A-LIST Date: Thu Oct 16 00:00:42 2003 Author: aventimiglia Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.12 clhp/ChangeLog:1.13 --- clhp/ChangeLog:1.12 Wed Oct 15 10:44:04 2003 +++ clhp/ChangeLog Thu Oct 16 00:00:42 2003 @@ -1,5 +1,11 @@ 2003-10-15 + * tests/test-suite.lisp: Exporting + OUTPUT-FUNCTION-TEST-DATA-OUTPUT + + * tests/cgi-test.lisp (*CGI-TESTS*): Added tests for + LIST-TO-A-LIST + * cgi.lisp, clhp.lisp: Changed real package names to a more exact one ala java style. They still have :CGI and :CLHP for nicknames. @@ -77,4 +83,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.12 2003/10/15 14:44:04 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.13 2003/10/16 04:00:42 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Thu Oct 16 04:00:42 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 00:00:42 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/test-suite.lisp clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv15576/tests Modified Files: test-suite.lisp cgi-test.lisp Log Message: * tests/test-suite.lisp: Exporting OUTPUT-FUNCTION-TEST-DATA-OUTPUT * tests/cgi-test.lisp (*CGI-TESTS*): Added tests for LIST-TO-A-LIST Date: Thu Oct 16 00:00:42 2003 Author: aventimiglia Index: clhp/tests/test-suite.lisp diff -u clhp/tests/test-suite.lisp:1.1 clhp/tests/test-suite.lisp:1.2 --- clhp/tests/test-suite.lisp:1.1 Wed Oct 15 10:05:56 2003 +++ clhp/tests/test-suite.lisp Thu Oct 16 00:00:42 2003 @@ -27,7 +27,8 @@ (:nicknames #:test-suite) (:use :cl) (:export #:run-tests #:function-test-data - #:output-function-test-data #:side-effect-function-test-data )) + #:output-function-test-data #:side-effect-function-test-data + #:output-function-test-data-output )) (in-package :test-suite) ;; These macros Used for run-test methods @@ -87,6 +88,7 @@ must be tested as well.")) (defclass side-effect-function-test-data (function-test-data) + ((var-list :initform NIL :type list :reader side-effect-function-test-data-var-list @@ -148,14 +150,14 @@ data)) (vars (mapcar #'(lambda (c) (car c)) test-var-list)) (var-list (mapcar - #'(lambda (|v|) (list |v| (eval |v|))) vars))) + #'(lambda (v) (list v (eval v))) vars))) (format stream "~S --> ~S ~S : " test-form result var-list) - (let ((test-result (output-function-test-data-output data))) + (let ((test-result (function-test-data-result-form data))) (test-return (and (equal result test-result) (equal test-var-list var-list)) "~S and ~S expected" test-result test-var-list)))) - (call-if-function (test-data-post-function data)))) + (call-if-function (test-data-post-function data)))) ;; Example ;(defvar list-test (make-instance 'function-test-data Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.8 clhp/tests/cgi-test.lisp:1.9 --- clhp/tests/cgi-test.lisp:1.8 Wed Oct 15 10:05:56 2003 +++ clhp/tests/cgi-test.lisp Thu Oct 16 00:00:42 2003 @@ -41,7 +41,7 @@ ;; INIT ;; ;; And -;; POST-DATA QUERY-TO-A-LIST HANDLE-GENERAL-ERROR +;; POST-DATA HANDLE-GENERAL-ERROR ;; Use the following to run-tests ;; (mapcar #'run-test *cgi-tests*) @@ -101,6 +101,32 @@ :symbol 'cgi::ca-list-to-a-list :test-args '('((a . 1)(b . 2)(c . 3))) :result-form '((a 1)(b 2)(c 3))) + (make-instance 'function-test-data + :symbol 'cgi::list-to-a-list + :test-args '('(1 2 3 4 5 6 7 8)) + :result-form '((1 2)(3 4)(5 6)(7 8))) + (make-instance 'function-test-data + :symbol 'cgi::list-to-a-list + :test-args '('(1 2 3 4 5 6 7 8 9)) + ;; This should be (values ((1 2) .. ) 9) the testing + ;; system hgas to be refined + :result-form '((1 2)(3 4)(5 6)(7 8))) + (make-instance 'function-test-data + :symbol 'cgi::query-to-a-list + :test-args '((cgi::explode-string + "Hello=there&no=yes&red=blue")) + :result-form '(("Hello" "there") ("no" "yes") + ("red" "blue"))) +; (make-instance 'side-effect-function-test-data +; :symbol 'cgi:init +; :pre-function #'(lambda () +; (setq ext:*environment-list* +; '((:request_method . "get") +; (:query_string . "hi=4&a=5")))) +; :post-function #'(lambda () +; (setq ext:*environment-list* nil)) +; :result-form '(values) +; :var-list '((cgi:*server-env* t))) (make-instance 'output-function-test-data :symbol 'cgi:header :output (format nil @@ -121,19 +147,9 @@ (fmakunbound 'cgi:header) (load "library:cgi")) :symbol 'cgi:header - :output ""))) + :output "") + )) -; (make-instance 'side-effect-function-test-data -; :symbol 'cgi:init -; :pre-function #'(lambda () -; (setq ext:*environment-list* -; '((:request_method . "post") -; (:query_string . "hi=4&a=5")))) -; :post-function #'(lambda () -; (setq ext:*environment-list* "nil")) -; :result-form '(values) -; :var-list '((cgi:*server-env* t))))) -; (eval-when (load) (unix:unix-exit (cadr (multiple-value-list (run-tests *cgi-tests*))))) From aventimiglia at common-lisp.net Thu Oct 16 14:55:35 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 10:55:35 -0400 Subject: [clhp-cvs] CVS update: clhp/config/binfmt-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/config In directory common-lisp.net:/tmp/cvs-serv589/config Modified Files: binfmt-test.lisp Log Message: Addedd explanation to comments Date: Thu Oct 16 10:55:35 2003 Author: aventimiglia Index: clhp/config/binfmt-test.lisp diff -u clhp/config/binfmt-test.lisp:1.3 clhp/config/binfmt-test.lisp:1.4 --- clhp/config/binfmt-test.lisp:1.3 Wed Oct 15 08:50:52 2003 +++ clhp/config/binfmt-test.lisp Thu Oct 16 10:55:34 2003 @@ -1,4 +1,4 @@ -;; $Id: binfmt-test.lisp,v 1.3 2003/10/15 12:50:52 aventimiglia Exp $ +;; $Id: binfmt-test.lisp,v 1.4 2003/10/16 14:55:34 aventimiglia Exp $ ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -21,7 +21,8 @@ ;; HomePage: http://common-lisp.net/project/clhp/ ;; -;; A short test program to make sure you have binfmt_misc support working -;; properly. +;; A short test program to make sure you have binfmt_misc support +;; working properly. In order for this to serve it's purpose, it needs +;; to be compiled, chmodded and run from the command-line (format t "binfmt_misc is working~&") From aventimiglia at common-lisp.net Thu Oct 16 16:57:25 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 12:57:25 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/clhp-test.lisp clhp/tests/test-suite.lisp clhp/tests/cgi-test.lisp clhp/tests/Makefile clhp/tests/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv1115/tests Modified Files: test-suite.lisp cgi-test.lisp Makefile .cvsignore Added Files: clhp-test.lisp Log Message: * tests/clhp-test.lisp (*CLHP-TESTS*): Wrote tests for most of :CLHP * clhp.lisp (FIND-PI-START, FIND-PI-END): Made 0 a default value for START. Date: Thu Oct 16 12:57:25 2003 Author: aventimiglia Index: clhp/tests/test-suite.lisp diff -u clhp/tests/test-suite.lisp:1.2 clhp/tests/test-suite.lisp:1.3 --- clhp/tests/test-suite.lisp:1.2 Thu Oct 16 00:00:42 2003 +++ clhp/tests/test-suite.lisp Thu Oct 16 12:57:25 2003 @@ -160,7 +160,7 @@ (call-if-function (test-data-post-function data)))) ;; Example -;(defvar list-test (make-instance 'function-test-data +;(defparameter list-test (make-instance 'function-test-data ; :symbol 'list ; :test-args '(1 2 3 4 5) ; :result-form '(1 2 3 4 5))) Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.9 clhp/tests/cgi-test.lisp:1.10 --- clhp/tests/cgi-test.lisp:1.9 Thu Oct 16 00:00:42 2003 +++ clhp/tests/cgi-test.lisp Thu Oct 16 12:57:25 2003 @@ -23,19 +23,15 @@ ;; Test suite to for the :CGI package. The aim of this is to test all ;; external, and possibly internal symbols in the package -;; These classes and methods should be a separate package - (eval-when (:load-toplevel :compile-toplevel) (unless (find-package :cgi) - (load "library:cgi")) + (load "../cgi")) (unless (find-package :net.common-lisp.aventimiglia.test-suite) (load "test-suite")) (when (find-package :clhp) (delete-package :clhp))) (use-package :test-suite) -(defvar *cgi-tests*) - ;; Still to be tested ;; Functions which have side effects and no return values ;; INIT @@ -45,7 +41,7 @@ ;; Use the following to run-tests ;; (mapcar #'run-test *cgi-tests*) -(setf *cgi-tests* +(defparameter *cgi-tests* (list (make-instance 'function-test-data :symbol 'cgi::explode-string Index: clhp/tests/Makefile diff -u clhp/tests/Makefile:1.1 clhp/tests/Makefile:1.2 --- clhp/tests/Makefile:1.1 Wed Oct 15 10:05:57 2003 +++ clhp/tests/Makefile Thu Oct 16 12:57:25 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/10/15 14:05:57 aventimiglia Exp $ +# $Id: Makefile,v 1.2 2003/10/16 16:57:25 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -31,7 +31,7 @@ LISPC=$(LISP) -noinit -load ../config/lispc -core $(CORE) -eval '(make)' TEST=$(LISP) -core $(CORE) -load PKGS=test-suite.x86f -TESTS=cgi-test.x86f +TESTS=cgi-test.x86f clhp-test.x86f all: $(TESTS) Index: clhp/tests/.cvsignore diff -u clhp/tests/.cvsignore:1.1 clhp/tests/.cvsignore:1.2 --- clhp/tests/.cvsignore:1.1 Tue Oct 14 00:33:40 2003 +++ clhp/tests/.cvsignore Thu Oct 16 12:57:25 2003 @@ -1 +1,3 @@ cgi-test.x86f +clhp-test.x86f +test-suite.x86f From aventimiglia at common-lisp.net Thu Oct 16 16:57:25 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 12:57:25 -0400 Subject: [clhp-cvs] CVS update: clhp/clhp.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv1115 Modified Files: clhp.lisp ChangeLog Log Message: * tests/clhp-test.lisp (*CLHP-TESTS*): Wrote tests for most of :CLHP * clhp.lisp (FIND-PI-START, FIND-PI-END): Made 0 a default value for START. Date: Thu Oct 16 12:57:25 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.13 clhp/clhp.lisp:1.14 --- clhp/clhp.lisp:1.13 Wed Oct 15 10:44:04 2003 +++ clhp/clhp.lisp Thu Oct 16 12:57:25 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.13 2003/10/15 14:44:04 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.14 2003/10/16 16:57:25 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -40,7 +40,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or "0.1.1alpha" ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/15 14:44:04 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/16 16:57:25 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) @@ -63,14 +63,14 @@ (attributes NIL :type list) (contents NIL :type (or string symbol cons xml-element))) -(defmacro find-pi-start (buffer &key start end) +(defmacro find-pi-start (buffer &key (start 0) end) "Find the next occurence of *PI-START* and return its index. Returns NIL if not found" (declare (type (array character 1) buffer) - (type fixnum start end)) + (type fixnum start)) `(search ,*PI-START* ,buffer :test #'string= :start2 ,start :end2 ,end)) -(defmacro find-pi-end (buffer &key start end) +(defmacro find-pi-end (buffer &key (start 0) end) (declare (type (array character 1) buffer) (type fixnum start end)) "Find the next occurence of *pi-end* and return its index. Returns Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.13 clhp/ChangeLog:1.14 --- clhp/ChangeLog:1.13 Thu Oct 16 00:00:42 2003 +++ clhp/ChangeLog Thu Oct 16 12:57:25 2003 @@ -1,3 +1,11 @@ +2003-10-16 + + * tests/clhp-test.lisp (*CLHP-TESTS*): Wrote tests for most of + :CLHP + + * clhp.lisp (FIND-PI-START, FIND-PI-END): Made 0 a default value + for START. + 2003-10-15 * tests/test-suite.lisp: Exporting @@ -83,4 +91,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.13 2003/10/16 04:00:42 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.14 2003/10/16 16:57:25 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Thu Oct 16 19:32:00 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 15:32:00 -0400 Subject: [clhp-cvs] CVS update: clhp/clhp.lisp clhp/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv19798 Modified Files: clhp.lisp Makefile Log Message: Trying to get a nice little feature where the makefile creates a CVS version ID similar to how it's done in clhp.lisp Date: Thu Oct 16 15:31:59 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.14 clhp/clhp.lisp:1.15 --- clhp/clhp.lisp:1.14 Thu Oct 16 12:57:25 2003 +++ clhp/clhp.lisp Thu Oct 16 15:31:59 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.14 2003/10/16 16:57:25 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.15 2003/10/16 19:31:59 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -39,8 +39,8 @@ ;; by changing the NIL in the first part of the OR, a release number ;; will override the CVS keyword (defconstant *CLHP-VERSION* - #.(or "0.1.1alpha" ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/16 16:57:25 $")) + #.(or nil ; Set this for releases + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/16 19:31:59 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) Index: clhp/Makefile diff -u clhp/Makefile:1.12 clhp/Makefile:1.13 --- clhp/Makefile:1.12 Wed Oct 15 10:44:04 2003 +++ clhp/Makefile Thu Oct 16 15:31:59 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.12 2003/10/15 14:44:04 aventimiglia Exp $ +# $Id: Makefile,v 1.13 2003/10/16 19:31:59 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -78,13 +78,18 @@ # real version number is based on the date of the last change to # clhp.lisp, the only place this version carries in is during # make-dist. -VERSION=0.1.1alpha +CVSID=$(shell echo \ + $$Date: 2003/10/16 19:31:59 $$ ) +#VERSION=0.1.2alpha TARROOT=clhp-$(VERSION) TARBALL=$(TARROOT).tar.gz RECURSIVE_TARGETS=clean-recursive clean-all-recursive check-recursive all: $(LISPCBIN) $(LIBS) $(CORE) $(RUNCGI) + +version: + echo $(CVSID) .PHONY: all install uninstall clean clean-all clean-backups install-dirs \ install-source install-source-dirs uninstall-files uninstall-dirs \ From aventimiglia at common-lisp.net Thu Oct 16 19:40:18 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 16 Oct 2003 15:40:18 -0400 Subject: [clhp-cvs] CVS update: clhp/Makefile Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv24854 Modified Files: Makefile Log Message: Got cvs-type versioning working, this way if someone does a "make dist" on the cvs they won't get a mislabeled version Date: Thu Oct 16 15:40:18 2003 Author: aventimiglia Index: clhp/Makefile diff -u clhp/Makefile:1.13 clhp/Makefile:1.14 --- clhp/Makefile:1.13 Thu Oct 16 15:31:59 2003 +++ clhp/Makefile Thu Oct 16 15:40:18 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.13 2003/10/16 19:31:59 aventimiglia Exp $ +# $Id: Makefile,v 1.14 2003/10/16 19:40:18 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -77,9 +77,17 @@ # This is the version for the next release, during cvs development the # real version number is based on the date of the last change to # clhp.lisp, the only place this version carries in is during -# make-dist. -CVSID=$(shell echo \ - $$Date: 2003/10/16 19:31:59 $$ ) +# make-dist. +# +# I've put a nice little trick to make sure tarballs made with make +# dist have a cvs-type versioning number. The version here in the +# makefile most likeley will not match the cvs version ID in +# clhp.lisp, since they depend on their own file's cvs date keyword. + +CVSID=$(shell echo $Date: 2003/10/16 19:40:18 $ | \ + awk '{print $$2}'| sed s/\\///g )cvs + +VERSION=$(CVSID) #VERSION=0.1.2alpha TARROOT=clhp-$(VERSION) TARBALL=$(TARROOT).tar.gz @@ -87,9 +95,6 @@ RECURSIVE_TARGETS=clean-recursive clean-all-recursive check-recursive all: $(LISPCBIN) $(LIBS) $(CORE) $(RUNCGI) - -version: - echo $(CVSID) .PHONY: all install uninstall clean clean-all clean-backups install-dirs \ install-source install-source-dirs uninstall-files uninstall-dirs \ From aventimiglia at common-lisp.net Fri Oct 17 12:58:04 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Fri, 17 Oct 2003 08:58:04 -0400 Subject: [clhp-cvs] CVS update: clhp/package.lisp clhp/clhp.asd clhp/clhp.lisp clhp/cgi.lisp clhp/TODO clhp/Makefile clhp/ChangeLog clhp/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv27650 Modified Files: clhp.lisp cgi.lisp TODO Makefile ChangeLog .cvsignore Added Files: package.lisp clhp.asd Log Message: Converted all this to an ASDF system, it's not quite battle tested, but hey, that's what this is all about. Date: Fri Oct 17 08:58:04 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.15 clhp/clhp.lisp:1.16 --- clhp/clhp.lisp:1.15 Thu Oct 16 15:31:59 2003 +++ clhp/clhp.lisp Fri Oct 17 08:58:04 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.15 2003/10/16 19:31:59 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.16 2003/10/17 12:58:04 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -21,17 +21,18 @@ ;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -(eval-when (:compile-toplevel) - (unless (find-package :cgi) - (load "cgi"))) +;(eval-when (:compile-toplevel) +; (unless (find-package :cgi) +; (load "cgi"))) + +;(defpackage #:net.common-lisp.aventimiglia.clhp +; (:nicknames :clhp) +; (:use :cgi :cl) +; (:import-from :cgi #:cond-bind #:list-to-a-list) +; (:export #:parse #:*clhp-version* #:echo #:include #:xml-element +; #:make-xml-element #:copy-xml-element #:xml-element-attributes +; #:xml-element-name #:xml-element-contents #:xml-element-p #:tag)) -(defpackage #:net.common-lisp.aventimiglia.clhp - (:nicknames :clhp) - (:use :cgi :cl) - (:import-from :cgi #:cond-bind #:list-to-a-list) - (:export #:parse #:*clhp-version* #:echo #:include #:xml-element - #:make-xml-element #:copy-xml-element #:xml-element-attributes - #:xml-element-name #:xml-element-contents #:xml-element-p #:tag)) (in-package :clhp) ;; This elaborate reader macro converts the cvs Date keywords and @@ -40,7 +41,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/16 19:31:59 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/17 12:58:04 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.10 clhp/cgi.lisp:1.11 --- clhp/cgi.lisp:1.10 Wed Oct 15 10:44:04 2003 +++ clhp/cgi.lisp Fri Oct 17 08:58:04 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.10 2003/10/15 14:44:04 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.11 2003/10/17 12:58:04 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -20,10 +20,10 @@ ;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -(defpackage #:net.common-lisp.aventimiglia.cgi - (:nicknames #:cgi) - (:use :cl) - (:export #:*server-env* #:*query-vars* #:header #:debug #:init)) +;(defpackage #:net.common-lisp.aventimiglia.cgi +; (:nicknames #:cgi) +; (:use :cl) +; (:export #:*server-env* #:*query-vars* #:header #:debug #:init)) (in-package :cgi) Index: clhp/TODO diff -u clhp/TODO:1.7 clhp/TODO:1.8 --- clhp/TODO:1.7 Wed Oct 15 10:44:04 2003 +++ clhp/TODO Fri Oct 17 08:58:04 2003 @@ -1,4 +1,6 @@ -$Id: TODO,v 1.7 2003/10/15 14:44:04 aventimiglia Exp $ -*- outline -*- +$Id: TODO,v 1.8 2003/10/17 12:58:04 aventimiglia Exp $ -*- outline -*- + +* Use ASDF for package building * Convert *QUERY-VARS* and *SERVER-ENV* to hashes I should probably make interface functions to access them, actually @@ -7,7 +9,7 @@ * Test suite ** Complete suite for :cgi -** Write suite for :clhp +** Complete suite for :clhp ** Refine :test-suite * COMPILE-CGI Index: clhp/Makefile diff -u clhp/Makefile:1.14 clhp/Makefile:1.15 --- clhp/Makefile:1.14 Thu Oct 16 15:40:18 2003 +++ clhp/Makefile Fri Oct 17 08:58:04 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.14 2003/10/16 19:40:18 aventimiglia Exp $ +# $Id: Makefile,v 1.15 2003/10/17 12:58:04 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -57,8 +57,9 @@ LISPC=$(LISP) -noinit -load config/lispc -eval '(make)' -SOURCES=cgi.lisp clhp.lisp start-clcgi.lisp -LIBS=cgi.x86f clhp.x86f start-clcgi.x86f +BUILD_CORE=config/build-core.x86f +BINS=start-clcgi.x86f +SOURCES=cgi.lisp clhp.lisp start-clcgi.lisp package.lisp clhp.asd CORE=clhp.core LISPCBIN=config/lispc.x86f RUNCGI=config/runclcgi @@ -84,7 +85,7 @@ # makefile most likeley will not match the cvs version ID in # clhp.lisp, since they depend on their own file's cvs date keyword. -CVSID=$(shell echo $Date: 2003/10/16 19:40:18 $ | \ +CVSID=$(shell echo $Date: 2003/10/17 12:58:04 $ | \ awk '{print $$2}'| sed s/\\///g )cvs VERSION=$(CVSID) @@ -94,7 +95,7 @@ RECURSIVE_TARGETS=clean-recursive clean-all-recursive check-recursive -all: $(LISPCBIN) $(LIBS) $(CORE) $(RUNCGI) +all: $(LISPCBIN) $(CORE) $(RUNCGI) $(BINS) .PHONY: all install uninstall clean clean-all clean-backups install-dirs \ install-source install-source-dirs uninstall-files uninstall-dirs \ @@ -115,8 +116,8 @@ $(LISPCBIN): config/lispc.lisp -$(CORE): $(SOURCES) config/build-core.lisp - $(LISP) -noinit -eval '(load (open "config/build-core.lisp"))' +$(CORE): $(SOURCES) $(BUILD_CORE) + $(LISP) -noinit -load "config/build-core" $(RUNCGI): $(RUNCGI).src sed 's:\(LISP=\):\1$(LISP):' < $< | \ @@ -124,7 +125,7 @@ sed 's:\(CMUCLLIB=\):\1$(LIBDIR):' > $@ install: all install-dirs install-core - for f in $(LIBS); do \ + for f in $(BINS) ; do \ $(INSTALLFILE) $$f $(LIBDIR) ; \ done $(INSTALL) $(DOCS) $(DOCDIR) @@ -194,11 +195,12 @@ clean-all: clean-all-recursive clean clean-backups clean-dist clean: clean-recursive - for f in $(LIBS) $(LISPCBIN) $(CORE) $(CORE).BAK $(RUNCGI) \ + for f in $(LISPCBIN) $(CORE) $(CORE).BAK $(RUNCGI) \ $(TESTS) $(TARBALL); \ do \ if test -f $$f ; then rm -v $$f ; fi \ done + find -iname "*.x86f" -exec rm -v {} \; $(MAKE) -C examples clean find -iname "*.tar.gz" -exec rm -v {} \; Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.14 clhp/ChangeLog:1.15 --- clhp/ChangeLog:1.14 Thu Oct 16 12:57:25 2003 +++ clhp/ChangeLog Fri Oct 17 08:58:04 2003 @@ -1,3 +1,9 @@ +2003-10-17 + + * clhp.asd, package.lisp, clhp.lisp, cgi.lisp: Converted all this + to an ASDF system, it's not quite battle tested, but hey, that's + what this is all about. + 2003-10-16 * tests/clhp-test.lisp (*CLHP-TESTS*): Wrote tests for most of @@ -91,4 +97,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.14 2003/10/16 16:57:25 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.15 2003/10/17 12:58:04 aventimiglia Exp $ \ No newline at end of file Index: clhp/.cvsignore diff -u clhp/.cvsignore:1.1 clhp/.cvsignore:1.2 --- clhp/.cvsignore:1.1 Tue Oct 14 00:33:41 2003 +++ clhp/.cvsignore Fri Oct 17 08:58:04 2003 @@ -1,4 +1,5 @@ cgi.x86f clhp.core clhp.x86f +package.x86f start-clcgi.x86f From aventimiglia at common-lisp.net Fri Oct 17 12:58:04 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Fri, 17 Oct 2003 08:58:04 -0400 Subject: [clhp-cvs] CVS update: clhp/config/build-core.lisp clhp/config/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp/config In directory common-lisp.net:/tmp/cvs-serv27650/config Modified Files: build-core.lisp .cvsignore Log Message: Converted all this to an ASDF system, it's not quite battle tested, but hey, that's what this is all about. Date: Fri Oct 17 08:58:03 2003 Author: aventimiglia Index: clhp/config/build-core.lisp diff -u clhp/config/build-core.lisp:1.3 clhp/config/build-core.lisp:1.4 --- clhp/config/build-core.lisp:1.3 Wed Oct 15 08:50:52 2003 +++ clhp/config/build-core.lisp Fri Oct 17 08:58:03 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: build-core.lisp,v 1.3 2003/10/15 12:50:52 aventimiglia Exp $") + "$Id: build-core.lisp,v 1.4 2003/10/17 12:58:03 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -37,21 +37,24 @@ (block abort (let ((output-file #p"clhp.core") - (packages '(:cgi :clhp))) - (gc-off) - - (dolist (package packages) - (when (find-package package) - (delete-package package)) - (handler-case - (load (format nil "~A" (string-downcase (string package)))) - (file-error (c) - (format - t - "There was an file-error in loading \"~A\"~%Perhaps the proper packages did not build successfully, or maybe you're mokeying around.~%" - (file-error-pathname c)) - (unix:unix-exit 1)))) +; (packages '(:cgi :clhp))) +) + (gc-off) + (asdf:operate 'asdf:load-op 'clhp) + +; (dolist (package packages) +; (when (find-package package) +; (delete-package package)) +; (handler-case +; (load (format nil "~A" (string-downcase (string package)))) +; (file-error (c) +; (format +; t +; "There was an file-error in loading \"~A\"~%Perhaps the proper packages did not build successfully, or maybe you're mokeying around.~%" +; (file-error-pathname c)) +; (unix:unix-exit 1)))) +; (when (probe-file output-file) (multiple-value-bind (ignore old new) Index: clhp/config/.cvsignore diff -u clhp/config/.cvsignore:1.1 clhp/config/.cvsignore:1.2 --- clhp/config/.cvsignore:1.1 Tue Oct 14 18:47:29 2003 +++ clhp/config/.cvsignore Fri Oct 17 08:58:03 2003 @@ -1,2 +1,3 @@ +build-core.x86f lispc.x86f runclcgi From aventimiglia at common-lisp.net Fri Oct 17 13:11:45 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Fri, 17 Oct 2003 09:11:45 -0400 Subject: [clhp-cvs] CVS update: clhp/utility.lisp clhp/clhp.lisp clhp/clhp.asd clhp/cgi.lisp clhp/ChangeLog clhp/.cvsignore Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv9555 Modified Files: clhp.lisp clhp.asd cgi.lisp ChangeLog .cvsignore Added Files: utility.lisp Log Message: * (Module): Moved COND-BIND, IF-BIND, A-LIST-VALUE, CA-LIST-TO-A-LIST, MAKE-KEYWORD, and LIST-TO-A-LIST out of cgi.lisp in here. * clhp.asd, package.lisp, clhp.lisp, cgi.lisp: Converted all this to an ASDF system, it's not quite battle tested, but hey, that's what this is all about. Date: Fri Oct 17 09:11:44 2003 Author: aventimiglia Index: clhp/clhp.lisp diff -u clhp/clhp.lisp:1.16 clhp/clhp.lisp:1.17 --- clhp/clhp.lisp:1.16 Fri Oct 17 08:58:04 2003 +++ clhp/clhp.lisp Fri Oct 17 09:11:44 2003 @@ -1,5 +1,5 @@ (ext:file-comment - "$Id: clhp.lisp,v 1.16 2003/10/17 12:58:04 aventimiglia Exp $") + "$Id: clhp.lisp,v 1.17 2003/10/17 13:11:44 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -21,18 +21,6 @@ ;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -;(eval-when (:compile-toplevel) -; (unless (find-package :cgi) -; (load "cgi"))) - -;(defpackage #:net.common-lisp.aventimiglia.clhp -; (:nicknames :clhp) -; (:use :cgi :cl) -; (:import-from :cgi #:cond-bind #:list-to-a-list) -; (:export #:parse #:*clhp-version* #:echo #:include #:xml-element -; #:make-xml-element #:copy-xml-element #:xml-element-attributes -; #:xml-element-name #:xml-element-contents #:xml-element-p #:tag)) - (in-package :clhp) ;; This elaborate reader macro converts the cvs Date keywords and @@ -41,7 +29,7 @@ ;; will override the CVS keyword (defconstant *CLHP-VERSION* #.(or nil ; Set this for releases - (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/17 12:58:04 $")) + (let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/17 13:11:44 $")) (date (subseq trimmed 0 (search " " trimmed)))) (concatenate 'string (subseq date 0 4) @@ -83,8 +71,8 @@ to use CLHP. See README for an example." (use-package :cgi) (use-package :clhp) - (cgi:init) - (cgi:header :content-type + (init) + (header :content-type :text/html :extra '(#.(format Index: clhp/clhp.asd diff -u clhp/clhp.asd:1.1 clhp/clhp.asd:1.2 --- clhp/clhp.asd:1.1 Fri Oct 17 08:58:04 2003 +++ clhp/clhp.asd Fri Oct 17 09:11:44 2003 @@ -1,5 +1,4 @@ -#+cmu (ext:file-comment "$Id: clhp.asd,v 1.1 2003/10/17 12:58:04 aventimiglia Exp $") -;; -*- lisp -*- +#+cmu (ext:file-comment "$Id: clhp.asd,v 1.2 2003/10/17 13:11:44 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -37,5 +36,6 @@ :licence "GNU Lesser General Public License" :components ((:file "package") - (:file "cgi" :depends-on ("package")) + (:file "utility" :depends-on ("package")) + (:file "cgi" :depends-on ("utility")) (:file "clhp" :depends-on ("cgi")))) Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.11 clhp/cgi.lisp:1.12 --- clhp/cgi.lisp:1.11 Fri Oct 17 08:58:04 2003 +++ clhp/cgi.lisp Fri Oct 17 09:11:44 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.11 2003/10/17 12:58:04 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.12 2003/10/17 13:11:44 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -20,17 +20,7 @@ ;; email: aventimiglia at common-lisp.net ;; HomePage: http://common-lisp.net/project/clhp/ -;(defpackage #:net.common-lisp.aventimiglia.cgi -; (:nicknames #:cgi) -; (:use :cl) -; (:export #:*server-env* #:*query-vars* #:header #:debug #:init)) - -(in-package :cgi) - -(defmacro make-keyword (name) - "Translates a string into a keyword: (MAKE-KEYWORD \"foo\") --> -:FOO" - `(read-from-string (format nil ":~a" ,name))) +(in-package :clhp) (defmacro debug (expression) "Print out EXPRESSION and the result of (EVAL EXPRESSION)" @@ -42,19 +32,6 @@ ex: (EXPLODE-STRING (\"Hello\") --> (#\H #\e #\l #\l #\o)" `(concatenate 'list ,string)) -(defmacro a-list-value (key a-list) - "returns the value from a (KEY . VALUE) A-LIST" - `(cadr (assoc ,key ,a-list))) - -(defmacro cond-bind ((&rest bindings) &body body) - "A COND wrapped in a Let" - `(let (, at bindings) (cond , at body))) - -(defmacro if-bind ((&rest bindings) test if else) - "An IF wrapped in a LET" - `(let (, at bindings) (if ,test ,if ,else))) - - ;; External Symbol section (defvar *server-env* nil @@ -92,10 +69,6 @@ (format t "Content-type: ~a~%~%" content-type) (setf done t)))) -(defun ca-list-to-a-list (list) - "Converts a CONS type a-list '((A . 3)(B . 4)) to a list type '((A 3)(B 4))" - (mapcar #'(lambda (cons) (list (car cons)(cdr cons))) list)) - ;; 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. @@ -180,19 +153,6 @@ (a-list-value :CONTENT_LENGTH *server-env*)))) post-char-list) post-char-list))) - -(defun list-to-a-list (list &optional a-list) - "Converts a list to an a-list, pairing odd and even elements. If an -odd number of elements are in LIST, the last element is returnes as -the second value. -ex: (LIST-TO-A-LIST '(a b c d) --> '((a b)(c d)) NIL -ex: (LIST-TO-A-LIST '(1 2 3 4 5) --> '((1 2)(3 4)) 5" - (cond - ((null list) (nreverse a-list)) - ((= 1 (length list)) (values (nreverse a-list) (car list))) - (t (list-to-a-list (cddr list) - (cons (list (car list) (cadr list)) - a-list))))) (defun query-to-a-list (get/post-data) (list-to-a-list Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.15 clhp/ChangeLog:1.16 --- clhp/ChangeLog:1.15 Fri Oct 17 08:58:04 2003 +++ clhp/ChangeLog Fri Oct 17 09:11:44 2003 @@ -1,5 +1,9 @@ 2003-10-17 + * (Module): Moved COND-BIND, IF-BIND, A-LIST-VALUE, + CA-LIST-TO-A-LIST, MAKE-KEYWORD, and LIST-TO-A-LIST out of + cgi.lisp in here. + * clhp.asd, package.lisp, clhp.lisp, cgi.lisp: Converted all this to an ASDF system, it's not quite battle tested, but hey, that's what this is all about. @@ -97,4 +101,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.15 2003/10/17 12:58:04 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.16 2003/10/17 13:11:44 aventimiglia Exp $ \ No newline at end of file Index: clhp/.cvsignore diff -u clhp/.cvsignore:1.2 clhp/.cvsignore:1.3 --- clhp/.cvsignore:1.2 Fri Oct 17 08:58:04 2003 +++ clhp/.cvsignore Fri Oct 17 09:11:44 2003 @@ -3,3 +3,4 @@ clhp.x86f package.x86f start-clcgi.x86f +utility.x86f From aventimiglia at common-lisp.net Sun Oct 19 01:57:14 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Sat, 18 Oct 2003 21:57:14 -0400 Subject: [clhp-cvs] CVS update: clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv16366 Modified Files: ChangeLog Log Message: Changed CGI: namespace to CLHP:, CGI: no longer is a separate package, so it's use is depreciated. Date: Sat Oct 18 21:57:14 2003 Author: aventimiglia Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.16 clhp/ChangeLog:1.17 --- clhp/ChangeLog:1.16 Fri Oct 17 09:11:44 2003 +++ clhp/ChangeLog Sat Oct 18 21:57:14 2003 @@ -1,3 +1,8 @@ +2003-10-18 + + * examples/test.lisp: Changed CGI: namespace to CLHP:, CGI: no + longer is a separate package, so it's use is depreciated. + 2003-10-17 * (Module): Moved COND-BIND, IF-BIND, A-LIST-VALUE, @@ -101,4 +106,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.16 2003/10/17 13:11:44 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.17 2003/10/19 01:57:14 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Sun Oct 19 01:57:14 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Sat, 18 Oct 2003 21:57:14 -0400 Subject: [clhp-cvs] CVS update: clhp/examples/test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/examples In directory common-lisp.net:/tmp/cvs-serv16366/examples Modified Files: test.lisp Log Message: Changed CGI: namespace to CLHP:, CGI: no longer is a separate package, so it's use is depreciated. Date: Sat Oct 18 21:57:13 2003 Author: aventimiglia Index: clhp/examples/test.lisp diff -u clhp/examples/test.lisp:1.3 clhp/examples/test.lisp:1.4 --- clhp/examples/test.lisp:1.3 Wed Oct 15 08:50:51 2003 +++ clhp/examples/test.lisp Sat Oct 18 21:57:13 2003 @@ -19,19 +19,19 @@ ;; HomePage: http://common-lisp.net/project/clhp/ (ext:file-comment - "$Id: test.lisp,v 1.3 2003/10/15 12:50:51 aventimiglia Exp $") + "$Id: test.lisp,v 1.4 2003/10/19 01:57:13 aventimiglia Exp $") -(cgi:init) -(cgi:header :extra (list "Content-Language: en")) +(clhp:init) +(clhp:header :extra (list "Content-Language: en")) -(cgi:debug 'cgi:*query-vars*) -(cgi:debug 'cgi:*server-env*) +(clhp:debug 'clhp:*query-vars*) +(clhp:debug 'clhp:*server-env*) -;; Test of CGI::GET-POST to make sure it only actually reads once. -(if (string= (cdr (assoc :REQUEST_METHOD cgi:*server-env*)) "POST") +;; Test of CLHP::GET-POST to make sure it only actually reads once. +(if (string= (cdr (assoc :REQUEST_METHOD clhp:*server-env*)) "POST") (progn - (cgi:debug '(cgi::post-data)) - (cgi:debug '(cgi::post-data)))) + (clhp:debug '(clhp::post-data)) + (clhp:debug '(clhp::post-data)))) -(format t "~%--------~% $Date: 2003/10/15 12:50:51 $~%") +(format t "~%--------~% $Date: 2003/10/19 01:57:13 $~%") From aventimiglia at common-lisp.net Tue Oct 21 03:09:21 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Mon, 20 Oct 2003 23:09:21 -0400 Subject: [clhp-cvs] CVS update: clhp/tests/test-suite.lisp clhp/tests/clhp-test.lisp clhp/tests/cgi-test.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv1666/tests Modified Files: test-suite.lisp clhp-test.lisp cgi-test.lisp Log Message: Fixed cvs keywords Date: Mon Oct 20 23:09:20 2003 Author: aventimiglia Index: clhp/tests/test-suite.lisp diff -u clhp/tests/test-suite.lisp:1.3 clhp/tests/test-suite.lisp:1.4 --- clhp/tests/test-suite.lisp:1.3 Thu Oct 16 12:57:25 2003 +++ clhp/tests/test-suite.lisp Mon Oct 20 23:09:20 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id") +#+cmu (ext:file-comment "$Id: test-suite.lisp,v 1.4 2003/10/21 03:09:20 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia Index: clhp/tests/clhp-test.lisp diff -u clhp/tests/clhp-test.lisp:1.1 clhp/tests/clhp-test.lisp:1.2 --- clhp/tests/clhp-test.lisp:1.1 Thu Oct 16 12:57:25 2003 +++ clhp/tests/clhp-test.lisp Mon Oct 20 23:09:20 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id") +#+cmu (ext:file-comment "$Id: clhp-test.lisp,v 1.2 2003/10/21 03:09:20 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia Index: clhp/tests/cgi-test.lisp diff -u clhp/tests/cgi-test.lisp:1.10 clhp/tests/cgi-test.lisp:1.11 --- clhp/tests/cgi-test.lisp:1.10 Thu Oct 16 12:57:25 2003 +++ clhp/tests/cgi-test.lisp Mon Oct 20 23:09:20 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id") +#+cmu (ext:file-comment "$Id: cgi-test.lisp,v 1.11 2003/10/21 03:09:20 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -43,19 +43,19 @@ ;; (mapcar #'run-test *cgi-tests*) (defparameter *cgi-tests* (list - (make-instance 'function-test-data - :symbol 'cgi::explode-string - :test-args '("Hello There") - :result-form '(#\H #\e #\l #\l #\o #\Space #\T #\h #\e #\r - #\e)) - (make-instance 'function-test-data - :symbol 'cgi::split-char-list - :test-args '(#\Space (cgi::explode-string "Ab CdE F")) - :result-form '((#\A #\b) (#\C #\d #\E) (#\F))) - (make-instance 'function-test-data - :symbol 'cgi::implode-string - :test-args '((cgi::explode-string "Hello")) - :result-form "Hello") +; (make-instance 'function-test-data +; :symbol 'cgi::explode-string +; :test-args '("Hello There") +; :result-form '(#\H #\e #\l #\l #\o #\Space #\T #\h #\e #\r +; #\e)) +; (make-instance 'function-test-data +; :symbol 'cgi::split-char-list +; :test-args '(#\Space (cgi::explode-string "Ab CdE F")) +; :result-form '((#\A #\b) (#\C #\d #\E) (#\F))) +; (make-instance 'function-test-data +; :symbol 'cgi::implode-string +; :test-args '((cgi::explode-string "Hello")) +; :result-form "Hello") (make-instance 'function-test-data :symbol 'cgi::url-decode-char-list :test-args '((cgi::explode-string "foo%34%2a")) From aventimiglia at common-lisp.net Tue Oct 21 04:16:58 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 21 Oct 2003 00:16:58 -0400 Subject: [clhp-cvs] CVS update: clhp/examples/test.lisp clhp/examples/index.clhp Message-ID: Update of /project/clhp/cvsroot/clhp/examples In directory common-lisp.net:/tmp/cvs-serv8963/examples Modified Files: test.lisp index.clhp Log Message: * examples/index.clhp (PRINT-HASH-TO-TABLE): Modified to work with new hash-tables * examples/test.lisp (PRINT-HASH): Modified test program to work with new hash-table * cgi.lisp (*SERVER-ENV*,*QUERY-VARS*): Converted to hashtable. Date: Tue Oct 21 00:16:58 2003 Author: aventimiglia Index: clhp/examples/test.lisp diff -u clhp/examples/test.lisp:1.4 clhp/examples/test.lisp:1.5 --- clhp/examples/test.lisp:1.4 Sat Oct 18 21:57:13 2003 +++ clhp/examples/test.lisp Tue Oct 21 00:16:58 2003 @@ -19,19 +19,28 @@ ;; HomePage: http://common-lisp.net/project/clhp/ (ext:file-comment - "$Id: test.lisp,v 1.4 2003/10/19 01:57:13 aventimiglia Exp $") + "$Id: test.lisp,v 1.5 2003/10/21 04:16:58 aventimiglia Exp $") -(clhp:init) -(clhp:header :extra (list "Content-Language: en")) +(use-package :clhp) -(clhp:debug 'clhp:*query-vars*) -(clhp:debug 'clhp:*server-env*) +(defun print-hash (table &optional (stream t)) + (declare (type hash-table table)) + (maphash #'(lambda (k v) (format stream "~S = ~S~%" k v)) table)) + +(init) +(header :extra (list "Content-Language: en")) + +(debug '*query-vars*) +(debug '*server-env*) + +(debug '(print-hash *query-vars*)) +(debug '(print-hash *server-env*)) ;; Test of CLHP::GET-POST to make sure it only actually reads once. -(if (string= (cdr (assoc :REQUEST_METHOD clhp:*server-env*)) "POST") +(if (string= (cdr (assoc :REQUEST_METHOD *server-env*)) "POST") (progn - (clhp:debug '(clhp::post-data)) - (clhp:debug '(clhp::post-data)))) + (debug '(post-data)) + (debug '(post-data)))) -(format t "~%--------~% $Date: 2003/10/19 01:57:13 $~%") +(format t "~%--------~% $Date: 2003/10/21 04:16:58 $~%") Index: clhp/examples/index.clhp diff -u clhp/examples/index.clhp:1.6 clhp/examples/index.clhp:1.7 --- clhp/examples/index.clhp:1.6 Wed Oct 15 08:50:51 2003 +++ clhp/examples/index.clhp Tue Oct 21 00:16:58 2003 @@ -27,7 +27,9 @@ ;; will actually be written, it is meant to show examples of some of ;; the possibilities CLHP will allow -(cgi:init) +(use-package :clhp) + +(init) (defun bold (str) "This is just an example (and test) to show that functions can be defined in documents. In reality, if you were working on a large site, @@ -66,27 +68,21 @@
From aventimiglia at common-lisp.net Tue Oct 21 04:16:59 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 21 Oct 2003 00:16:59 -0400 Subject: [clhp-cvs] CVS update: clhp/package.lisp clhp/cgi.lisp clhp/TODO clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv8963 Modified Files: package.lisp cgi.lisp TODO ChangeLog Log Message: * examples/index.clhp (PRINT-HASH-TO-TABLE): Modified to work with new hash-tables * examples/test.lisp (PRINT-HASH): Modified test program to work with new hash-table * cgi.lisp (*SERVER-ENV*,*QUERY-VARS*): Converted to hashtable. Date: Tue Oct 21 00:16:58 2003 Author: aventimiglia Index: clhp/package.lisp diff -u clhp/package.lisp:1.1 clhp/package.lisp:1.2 --- clhp/package.lisp:1.1 Fri Oct 17 08:58:04 2003 +++ clhp/package.lisp Tue Oct 21 00:16:58 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: package.lisp,v 1.1 2003/10/17 12:58:04 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: package.lisp,v 1.2 2003/10/21 04:16:58 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -24,7 +24,7 @@ (defpackage #:net.common-lisp.aventimiglia.clhp (:nicknames #:clhp #:cgi) ; The CGI will go away eventually - (:use #:cl) + (:use #:cl #:ext) (:export #:*server-env* #:*query-vars* #:header #:debug #:init #:parse #:*clhp-version* #:echo #:include #:xml-element #:make-xml-element #:copy-xml-element #:xml-element-attributes Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.12 clhp/cgi.lisp:1.13 --- clhp/cgi.lisp:1.12 Fri Oct 17 09:11:44 2003 +++ clhp/cgi.lisp Tue Oct 21 00:16:58 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.12 2003/10/17 13:11:44 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.13 2003/10/21 04:16:58 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -24,7 +24,7 @@ (defmacro debug (expression) "Print out EXPRESSION and the result of (EVAL EXPRESSION)" - `(format t "(CGI:DEBUG: ~s --> ~s)~%" ,expression (eval ,expression))) + `(format t "(CLHP:DEBUG: ~s --> ~s)~%" ,expression (eval ,expression))) (defmacro explode-string (string) "Converts a string to a list of chars, this is an aux function used @@ -34,18 +34,13 @@ ;; External Symbol section -(defvar *server-env* nil - "This is an a-list of all environment variables passed by the -server, the CAR of each cons in the a-list is a keyword, and all -values are stored as strings, which should be converted if -necessary. Accessing would be something like the following: (ASSOC -:REQUEST_METHOD *SERVER-ENV*)") - -(defvar *query-vars* nil - "An a-list of all variables passed through a GET or POST method, the -CAR of each cons in the a-list is a keyword, and all data is kept in -string form so conversion may be necessary. Accessing would be as -follows: (ASSOC :FOO *QUERY-VARS*)") +(defvar *server-env* (make-hash-table) + "This is a hash-table variables passed by the thw key is a keyword +and all values are stored as strings.") + +(defvar *query-vars* (make-hash-table) + "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 @@ -75,17 +70,21 @@ (defun init () "Initialize CGI, this should be called before any globals are accessed" - (setf *server-env* (ca-list-to-a-list ext:*environment-list*) - *query-vars* - (cond-bind - ((request-method (make-keyword - (a-list-value :REQUEST_METHOD - *server-env*)))) - ((eql request-method :POST) - (query-to-a-list (post-data))) - ((eql request-method :GET) - (query-to-a-list (get-data))))) - (values)) + (mapcar #'(lambda (key/val) + (setf (gethash (car key/val) *server-env*) + (cdr key/val))) + *environment-list*) + (mapcar #'(lambda (key/val-list) + (setf (gethash (car key/val-list) *query-vars*) + (cadr key/val-list))) + (cond-bind + ((request-method (make-keyword + (gethash :REQUEST_METHOD *server-env*)))) + ((eql request-method :POST) + (query-to-a-list (post-data))) + ((eql request-method :GET) + (query-to-a-list (get-data))))) + (values)) ;; ;; End of external symbols @@ -137,7 +136,7 @@ (defun get-data () "Returns GET data (QUERY_STRING) as an exploded string" - (explode-string (a-list-value :QUERY_STRING *server-env*))) + (explode-string (gethash :QUERY_STRING *server-env*))) ;; The closure makes sure we don't try to read from stdin twice (let ((get-switch nil) @@ -150,7 +149,7 @@ get-switch t post-char-list (read-n-chars (read-from-string - (a-list-value :CONTENT_LENGTH *server-env*)))) + (gethash :CONTENT_LENGTH *server-env*)))) post-char-list) post-char-list))) @@ -220,5 +219,5 @@ text header, echoing the error-message." (header :content-type :text/plain) (format t "CL-CGI: ~A~%" (error-message condition)) - (ext:quit)) + (quit)) Index: clhp/TODO diff -u clhp/TODO:1.8 clhp/TODO:1.9 --- clhp/TODO:1.8 Fri Oct 17 08:58:04 2003 +++ clhp/TODO Tue Oct 21 00:16:58 2003 @@ -1,16 +1,16 @@ -$Id: TODO,v 1.8 2003/10/17 12:58:04 aventimiglia Exp $ -*- outline -*- - -* Use ASDF for package building - -* Convert *QUERY-VARS* and *SERVER-ENV* to hashes - I should probably make interface functions to access them, actually - I should make them read-only maybe encapsulate a hash in a class and - only allow reading from external functions +$Id: TODO,v 1.9 2003/10/21 04:16:58 aventimiglia Exp $ -*- outline -*- * Test suite +** Convert all this to new deal with single package. + Maybe make separate files for each function, or group of related + or interdependant files. + ** Complete suite for :cgi ** Complete suite for :clhp ** Refine :test-suite + +* Declare Declaim and Proclaim + GO through everything and refine and type it all. * COMPILE-CGI This is just a convenience function that will compile and save fasl Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.17 clhp/ChangeLog:1.18 --- clhp/ChangeLog:1.17 Sat Oct 18 21:57:14 2003 +++ clhp/ChangeLog Tue Oct 21 00:16:58 2003 @@ -1,3 +1,15 @@ +2003-10-21 + + * examples/index.clhp (PRINT-HASH-TO-TABLE): Modified to work with + new hash-tables + +2003-10-20 + + * examples/test.lisp (PRINT-HASH): Modified test program to work + with new hash-table + + * cgi.lisp (*SERVER-ENV*,*QUERY-VARS*): Converted to hashtable. + 2003-10-18 * examples/test.lisp: Changed CGI: namespace to CLHP:, CGI: no @@ -106,4 +118,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.17 2003/10/19 01:57:14 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.18 2003/10/21 04:16:58 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Tue Oct 21 16:57:27 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 21 Oct 2003 12:57:27 -0400 Subject: [clhp-cvs] CVS update: clhp/cgi.lisp clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv5152 Modified Files: cgi.lisp ChangeLog Log Message: (*QUERY-VARS*): Fixed so test is #'equal, which will work properly with strings Date: Tue Oct 21 12:57:27 2003 Author: aventimiglia Index: clhp/cgi.lisp diff -u clhp/cgi.lisp:1.13 clhp/cgi.lisp:1.14 --- clhp/cgi.lisp:1.13 Tue Oct 21 00:16:58 2003 +++ clhp/cgi.lisp Tue Oct 21 12:57:27 2003 @@ -1,4 +1,4 @@ -#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.13 2003/10/21 04:16:58 aventimiglia Exp $") +#+cmu (ext:file-comment "$Id: cgi.lisp,v 1.14 2003/10/21 16:57:27 aventimiglia Exp $") ;; ;; CLHP the Common Lisp Hypertext Preprocessor ;; (C) 2003 Anthony J Ventimiglia @@ -38,7 +38,7 @@ "This is a hash-table variables passed by the thw key is a keyword and all values are stored as strings.") -(defvar *query-vars* (make-hash-table) +(defvar *query-vars* (make-hash-table :test 'equal) "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.") Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.18 clhp/ChangeLog:1.19 --- clhp/ChangeLog:1.18 Tue Oct 21 00:16:58 2003 +++ clhp/ChangeLog Tue Oct 21 12:57:27 2003 @@ -1,5 +1,8 @@ 2003-10-21 + * cgi.lisp (*QUERY-VARS*): Fixed so test is #'equal, which will + work properly with strings + * examples/index.clhp (PRINT-HASH-TO-TABLE): Modified to work with new hash-tables @@ -118,4 +121,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.18 2003/10/21 04:16:58 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.19 2003/10/21 16:57:27 aventimiglia Exp $ \ No newline at end of file From aventimiglia at common-lisp.net Tue Oct 21 18:48:53 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Tue, 21 Oct 2003 14:48:53 -0400 Subject: [clhp-cvs] CVS update: clhp/BUGS Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv18113 Modified Files: BUGS Log Message: Found a bug where only one variable can be bound in a LET form. Date: Tue Oct 21 14:48:53 2003 Author: aventimiglia Index: clhp/BUGS diff -u clhp/BUGS:1.1 clhp/BUGS:1.2 --- clhp/BUGS:1.1 Wed Oct 1 10:01:47 2003 +++ clhp/BUGS Tue Oct 21 14:48:52 2003 @@ -1,2 +1,10 @@ -$Id: BUGS,v 1.1 2003/10/01 14:01:47 aventimiglia Exp $ -*- outline -*- +$Id: BUGS,v 1.2 2003/10/21 18:48:52 aventimiglia Exp $ -*- outline -*- +* Let forms are not evaluated properly. + It seems that putting more than one declaration in a let binding + does not work: in other words: + + (let ((x 0)) x) Works while: + (let ((x 0) (y 1)) (+ x y)) fails. + + I'll have to dissect soon. From aventimiglia at common-lisp.net Wed Oct 29 21:34:44 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Wed, 29 Oct 2003 16:34:44 -0500 Subject: [clhp-cvs] CVS update: clhp/mod_clhp.c Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv6634 Added Files: mod_clhp.c Log Message: Working on Apache Module Date: Wed Oct 29 16:34:44 2003 Author: aventimiglia From aventimiglia at common-lisp.net Fri Oct 31 02:26:55 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 30 Oct 2003 21:26:55 -0500 Subject: [clhp-cvs] CVS update: clhp/tests/clhp-xptests.lisp Message-ID: Update of /project/clhp/cvsroot/clhp/tests In directory common-lisp.net:/tmp/cvs-serv27271/tests Added Files: clhp-xptests.lisp Log Message: This is a test file using xptest, I'm not too sure I like xptest, but it's in here none the less Date: Thu Oct 30 21:26:55 2003 Author: aventimiglia From aventimiglia at common-lisp.net Fri Oct 31 02:27:13 2003 From: aventimiglia at common-lisp.net (Anthony Ventimiglia) Date: Thu, 30 Oct 2003 21:27:13 -0500 Subject: [clhp-cvs] CVS update: clhp/Makefile clhp/ChangeLog Message-ID: Update of /project/clhp/cvsroot/clhp In directory common-lisp.net:/tmp/cvs-serv27338 Modified Files: Makefile ChangeLog Log Message: Addedd rules for mod_clhp, but it will not yet be included in the real distribution, also removed tests/ from dist tarball. Date: Thu Oct 30 21:27:12 2003 Author: aventimiglia Index: clhp/Makefile diff -u clhp/Makefile:1.15 clhp/Makefile:1.16 --- clhp/Makefile:1.15 Fri Oct 17 08:58:04 2003 +++ clhp/Makefile Thu Oct 30 21:27:11 2003 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.15 2003/10/17 12:58:04 aventimiglia Exp $ +# $Id: Makefile,v 1.16 2003/10/31 02:27:11 aventimiglia Exp $ # # CLHP the Common Lisp Hypertext Preprocessor # (C) 2003 Anthony J Ventimiglia @@ -47,6 +47,9 @@ # path to tar TAR=/bin/tar +# path to apxs +APXS=/usr/sbin/apxs + DIRMODE=0775 # mode for cmucl dirs FMODE=0664 # mode for installed files @@ -59,19 +62,25 @@ BUILD_CORE=config/build-core.x86f BINS=start-clcgi.x86f -SOURCES=cgi.lisp clhp.lisp start-clcgi.lisp package.lisp clhp.asd +APACHE_MOD=mod_clhp.so +SOURCES=cgi.lisp clhp.lisp start-clcgi.lisp package.lisp clhp.asd mod_clhp.c CORE=clhp.core LISPCBIN=config/lispc.x86f RUNCGI=config/runclcgi TESTS=config/binfmt-test.clcgi DOCS=COPYING INSTALL ChangeLog NEWS README TODO -SUBDIRS=config examples tests +DIST_SUBDIRS=config examples +NON_DIST_SUBDIRS=tests RECURSIVE_SUBDIRS = examples tests EXTRADIST=config/binfmt-test.lisp config/build-core.lisp config/lispc.lisp \ config/runclcgi.src examples/Makefile examples/clhp-test.lisp \ - examples/index.clhp examples/test.lisp Makefile tests/Makefile \ - tests/cgi-test.lisp tests/test-suite.lisp + examples/index.clhp examples/test.lisp Makefile + +NON_DIST= tests/Makefile tests/cgi-test.lisp tests/test-suite.lisp + +CLEAN_TARGETS=$(LISPCBIN) $(CORE) $(CORE).BAK $(RUNCGI) $(TESTS) $(TARBALL) \ + $(APACHE_MOD) mod_clhp.o DISTFILES=$(SOURCES) $(DOCS) $(EXTRADIST) @@ -85,7 +94,7 @@ # makefile most likeley will not match the cvs version ID in # clhp.lisp, since they depend on their own file's cvs date keyword. -CVSID=$(shell echo $Date: 2003/10/17 12:58:04 $ | \ +CVSID=$(shell echo $Date: 2003/10/31 02:27:11 $ | \ awk '{print $$2}'| sed s/\\///g )cvs VERSION=$(CVSID) @@ -97,9 +106,15 @@ all: $(LISPCBIN) $(CORE) $(RUNCGI) $(BINS) +module:$(APACHE_MOD) + +$(APACHE_MOD): mod_clhp.c + $(APXS) -c $< + .PHONY: all install uninstall clean clean-all clean-backups install-dirs \ install-source install-source-dirs uninstall-files uninstall-dirs \ - install-core tests clean-dist $(RECURSIVE_TARGETS) check + install-core tests clean-dist $(RECURSIVE_TARGETS) check \ + module-install %.x86f: %.lisp $(LISPC) $< @@ -124,6 +139,9 @@ sed 's:\(CORE=\):\1$(COREDIR)/$(CORE):' | \ sed 's:\(CMUCLLIB=\):\1$(LIBDIR):' > $@ +module-install: $(APACHE_MOD) + $(APXS) -i -a $< + install: all install-dirs install-core for f in $(BINS) ; do \ $(INSTALLFILE) $$f $(LIBDIR) ; \ @@ -179,7 +197,7 @@ $(TARBALL): $(DISTFILES) distdir=clhp-$(VERSION) ; \ if test ! -d $$distdir; then mkdir -v $$distdir ; fi ; \ - for dir in $(SUBDIRS); do \ + for dir in $(DIST_SUBDIRS); do \ if test ! -d $$distdir/$$dir; then \ mkdir -v $$distdir/$$dir ; \ fi ; \ @@ -195,8 +213,7 @@ clean-all: clean-all-recursive clean clean-backups clean-dist clean: clean-recursive - for f in $(LISPCBIN) $(CORE) $(CORE).BAK $(RUNCGI) \ - $(TESTS) $(TARBALL); \ + for f in $(CLEAN_TARGETS); \ do \ if test -f $$f ; then rm -v $$f ; fi \ done Index: clhp/ChangeLog diff -u clhp/ChangeLog:1.19 clhp/ChangeLog:1.20 --- clhp/ChangeLog:1.19 Tue Oct 21 12:57:27 2003 +++ clhp/ChangeLog Thu Oct 30 21:27:12 2003 @@ -1,3 +1,13 @@ +2003-10-30 + + * Makefile: Addedd rules for mod_clhp, but it will not yet be + included in the real distribution, also removed tests/ from dist + tarball. + +2003-10-29 + + * mod_clhp.c (Handler): Beginning work on Apache module + 2003-10-21 * cgi.lisp (*QUERY-VARS*): Fixed so test is #'equal, which will @@ -121,4 +131,4 @@ used to create tables from (CONS . TYPE) a-lists. Also added some comments. -$Id: ChangeLog,v 1.19 2003/10/21 16:57:27 aventimiglia Exp $ \ No newline at end of file +$Id: ChangeLog,v 1.20 2003/10/31 02:27:12 aventimiglia Exp $ \ No newline at end of file