Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -7,26 +7,26 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. include install.cfg +SRCFILES = stml.scm misc-stml.scm session.scm sqltbl.scm formdat.scm setup.scm stmlrun.scm keystore.scm html-filter.scm cookie.scm MODULEFILES = $(wildcard modules/*/*-mod.scm) SOFILES = $(MODULEFILES:%.scm=%.so) CFILES = $(MODULEFILES:%.scm=%.c) -OFILES = $(MODULEFILES:%.scm=%.o) +OFILES = $(SRCFILES:%.scm=%.o) TARGFILES = $(notdir $(SOFILES)) MODULES = $(addprefix $(TARGDIR)/modules/,$(TARGFILES)) install : $(TARGDIR)/stmlrun $(LOGDIR) $(MODULES) all : $(SOFILES) -stmlrun : stmlrun.scm formdat.scm misc-stml.scm session.scm stml.scm \ - setup.scm html-filter.scm requirements.scm keystore.scm \ - cookie.scm sqltbl.scm - csc stmlrun.scm - +# stmlrun : stmlrun.scm formdat.scm misc-stml.scm session.scm stml.scm \ +# setup.scm html-filter.scm requirements.scm keystore.scm \ +# cookie.scm sqltbl.scm +# csc stmlrun.scm $(TARGDIR)/stmlrun : stmlrun cp stmlrun $(TARGDIR) chmod a+rx $(TARGDIR)/stmlrun @@ -33,10 +33,13 @@ $(TARGDIR)/modules : mkdir -p $(TARGDIR)/modules $(MODULES) : $(SOFILES) $(TARGDIR)/modules cp $< $@ + +stmlrun : $(OFILES) stmlrun.scm requirements.scm + csc $(OFILES) -o stmlrun # logging currently relies on this # $(LOGDIR) : mkdir -p $(LOGDIR) @@ -47,18 +50,20 @@ # modules # %.so : %.scm csc -I modules/* -s $< + +%.o : %.scm + csc -c $< # Cookie is a special case for now. Make a loadable so for test # Complile it in by include (see dependencies above). cookie.so : cookie.scm csc -s cookie.scm - -# + # $(CFILES): build/%.c: ../scm/%.scm ../scm/macros.scm # chicken $< -output-file $@ # # # $(OFILES): src/%.o: src/%.c Index: cookie.scm ================================================================== --- cookie.scm +++ cookie.scm @@ -40,11 +40,11 @@ ;; RFC 2964 Use of HTTP state management ;; ;; The parser also supports the old Netscape spec ;; - +(declare (unit cookie)) (require-extension srfi-1 srfi-13 srfi-14 regex) (declare (export parse-cookie-string construct-cookie-string)) #> #include Index: formdat.scm ================================================================== --- formdat.scm +++ formdat.scm @@ -1,15 +1,16 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. -(include "requirements.scm") +(declare (unit formdat)) +(use regex) (define formdat:*debug* #f) ;; Old data format was something like this. BUT! ;; Forms do not have names so the hierarcy is Index: html-filter.scm ================================================================== --- html-filter.scm +++ html-filter.scm @@ -1,13 +1,15 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. + +(declare (unit html-filter)) ;; (define (s:split-string strng delim) (if (eq? (string-length strng) 0) (list strng) (let loop ((head (make-string 1 (car (string->list strng)))) Index: keystore.scm ================================================================== --- keystore.scm +++ keystore.scm @@ -1,6 +1,6 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the @@ -9,10 +9,12 @@ ;;====================================================================== ;; The meta data key store, just a general dumping ground for values ;; only used occasionally ;;====================================================================== + +(declare (unit keystore)) (define (keystore:get db key) (dbi:get-one db "SELECT value FROM metadata WHERE key=?;" key)) (define (keystore:set! db key value) Index: misc-stml.scm ================================================================== --- misc-stml.scm +++ misc-stml.scm @@ -1,6 +1,6 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the @@ -8,10 +8,13 @@ ;; PURPOSE. ;;====================================================================== ;; dumbobj helpers ;;====================================================================== + +(declare (unit misc-stml)) +(use regex) ;; given a list of symbols give the count of the matching symbol ;; l => '(a b c) (dumobj:indx a 'b) => 1 (define (s:get-fieldnum lst field-name) (let loop ((head (car lst)) Index: session.scm ================================================================== --- session.scm +++ session.scm @@ -1,15 +1,18 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. -(include "requirements.scm") +(declare (unit session)) +(require-library dbi) +(use regex) +(declare (uses cookie)) ;; sessions table ;; id session_id session_key ;; create table sessions (id serial not null,session-key text); Index: setup.scm ================================================================== --- setup.scm +++ setup.scm @@ -1,14 +1,17 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. +(declare (unit setup)) +(declare (uses session)) + ;; (define s:session (make-sdat)) (session:initialize s:session) ;; use this for getting data from page to page when scope and evals Index: sqlite3.scm ================================================================== --- sqlite3.scm +++ sqlite3.scm @@ -1,6 +1,6 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the Index: sqltbl.scm ================================================================== --- sqltbl.scm +++ sqltbl.scm @@ -1,6 +1,6 @@ -;; Copyright 2007-2008, Matthew Welland. Kiatoa.com All rights reserved. +;; Copyright 2007-2011, Matthew Welland. Kiatoa.com All rights reserved. ;; ;; DON'T USE THIS!!!! It was a bad idea :-( ;; (require-extension tinyclos) @@ -14,10 +14,12 @@ ;; conn ;; connection to db ;; num-rows ;; whatever ;; curr-row-ptr ;; number of the current row ;; curr-row ;; the current row vector (?? do we really want this ??) ;; )) + +(declare (unit sqltbl)) (define (make-sqltbl:tbl)(make-vector 9)) (define-inline (sqltbl:tbl-get-rows vec) (vector-ref vec 0)) (define-inline (sqltbl:tbl-get-fields vec) (vector-ref vec 1)) (define-inline (sqltbl:tbl-get-fields-hash vec) (vector-ref vec 2)) Index: stml.scm ================================================================== --- stml.scm +++ stml.scm @@ -1,6 +1,6 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the @@ -8,11 +8,11 @@ ;; PURPOSE. ;; stml is a list of html strings (declare (unit stml)) -(include "misc-stml") +(declare (uses misc-stml)) ;; extract various tokens from the parameter list ;; 'key val => put in the params list ;; strings => maintain order and add to the datalist <<== IMPORTANT (define (s:extract inlst) Index: stmlrun.scm ================================================================== --- stmlrun.scm +++ stmlrun.scm @@ -1,8 +1,8 @@ #!/usr/local/bin/csi -q -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the @@ -14,20 +14,18 @@ (require-library dbi) (include "requirements.scm") (include "cookie.scm") -(include "html-filter.scm") -(include "misc-stml.scm") -(include "formdat.scm") -(include "stml.scm") -;; (include "dbi.scm") -(include "session.scm") -(include "setup.scm") ;; s:session gets created here -(include "sqltbl.scm") -(include "keystore.scm") -;; (include "sugar.scm") +(declare (uses html-filter)) +(declare (uses misc-stml)) +(declare (uses formdat)) +(declare (uses stml)) +(declare (uses session)) +(declare (uses setup)) ;; s:session gets created here +(declare (uses sqltbl)) +(declare (uses keystore)) (sdat-set-log-port! s:session ;; (current-error-port)) (open-output-file (sdat-get-logfile s:session) #:append)) ;; (s:log "HTTP_COOKIE" (get-environment-variable "HTTP_COOKIE")) Index: sugar.scm ================================================================== --- sugar.scm +++ sugar.scm @@ -1,6 +1,6 @@ -;; Copyright 2007-2008, Matthew Welland. +;; Copyright 2007-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the