Differences From Artifact [0494197193]:

To Artifact [c4bf2d3a15]:


1
2
3

4
5
6
7
8
9
10
11
12
13

14
15

16
17
18
19
20
21





22
23
24
25
26




27
28
29
30


31
32

33
34
35
36
37
38
39
40
41



42
43

44
45
46
47
48
49
50
1
2

3
4
5
6
7
8
9
10
11
12

13
14

15
16
17




18
19
20
21
22





23
24
25
26

27


28
29
30

31
32
33
34
35
36
37



38
39
40
41

42
43
44
45
46
47
48
49


-
+









-
+

-
+


-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-

-
-
+
+

-
+






-
-
-
+
+
+

-
+







#!/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
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.

;; (require-extension syntax-case)
(declare (run-time-macros))
;; (declare (run-time-macros))

(use dbi)
(require-library dbi)

(include "requirements.scm")
(include "html-filter.scm")
(include "misc-stml.scm")
(include "formdat.scm")
(include "stml.scm")
(include "cookie.scm")
(declare (uses html-filter))
(declare (uses misc-stml))
(declare (uses formdat))
(declare (uses stml))
;; (include "dbi.scm")
(include "session.scm")
(include "setup.scm") ;; s:session gets created here
(include "sqltbl.scm")
(include "keystore.scm")
(declare (uses session))
(declare (uses setup)) ;; s:session gets created here
(declare (uses sqltbl))
(declare (uses keystore))
(include "sugar.scm")

(slot-set! s:session 'log-port ;; (current-error-port))
	   (open-output-file (slot-ref s:session 'logfile) #:append))
(sdat-set-log-port! s:session ;; (current-error-port))
	   (open-output-file (sdat-get-logfile s:session) #:append))

;; (s:log "HTTP_COOKIE" (getenv "HTTP_COOKIE"))
;; (s:log "HTTP_COOKIE" (get-environment-variable "HTTP_COOKIE"))
;; (s:log "stdin-dat=" (slot-ref s:session 'stdin-dat))

(s:validate-inputs)

(session:run-actions s:session)

(slot-set! s:session 'pagedat 
           (append (slot-ref s:session 'pagedat)
                   (s:call (slot-ref s:session 'toppage))))
(sdat-set-pagedat! s:session
           (append (sdat-get-pagedat s:session)
                   (s:call (sdat-get-toppage s:session))))

(if (eq? (slot-ref s:session 'page-type) 'html) ;; default is html. 
(if (eq? (sdat-get-page-type s:session) 'html) ;; default is html. 
    (session:cgi-out s:session)
    (session:alt-out s:session))

(session:save-vars s:session)

(session:close s:session)