Check-in [bd1b679435]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:small fixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bd1b6794356880e8e9a3888eaee0932acc3092c1
User & Date: aldo 2018-04-16 15:02:56
Context
2018-12-09
15:17
added sqlite3-config-log and sqlite3-busy-timeout check-in: 73c6d80c36 user: aldo tags: trunk
2018-04-16
15:07
use @ in json check-in: 7164164ed6 user: root tags: trunk
15:02
small fixes check-in: bd1b679435 user: aldo tags: trunk
2018-01-08
17:10
Initial SDL_Mixer support check-in: 242c211156 user: ovenpasta@users.noreply.github.com tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to json.sls.

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
				       (if v (cdr v) v))))#'(tag ...))
	    body ...)])))


 (define (json->string json)
   (define special '((#\backspace . #\b) (#\newline . #\n) (#\alarm . #\a) 
		     (#\return . #\r) (#\tab #\t) (#\\ . #\\) (#\" . #\")))
   (cond [(and (pair? json) (eq? (car json) 'dict))
	  (string-append 
	   "{\n"
	   (string-intersperse
	    (map (lambda (pair)
		   (let ([k (car pair)]
			 [v (cdr pair)])
		     (string-append "  " (json->string k)







|







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
				       (if v (cdr v) v))))#'(tag ...))
	    body ...)])))


 (define (json->string json)
   (define special '((#\backspace . #\b) (#\newline . #\n) (#\alarm . #\a) 
		     (#\return . #\r) (#\tab #\t) (#\\ . #\\) (#\" . #\")))
   (cond [(and (pair? json)  (eq? (car json) '@))
	  (string-append 
	   "{\n"
	   (string-intersperse
	    (map (lambda (pair)
		   (let ([k (car pair)]
			 [v (cdr pair)])
		     (string-append "  " (json->string k)

Changes to scgi.sls.

73
74
75
76
77
78
79

80
81
82
83
84
85
86
    (call-with-port
     (socket 'inet 'stream '() 0)
     (lambda (sock)
       (bind/inet sock addr port)
       (listen sock 1000)
       (do ()
	   (#f)

	 (printf "scgi: waiting for connection...~n")
	 (call-with-port
	  (accept sock)
	  (lambda (clifd)
	    (printf "scgi: accepted connection~n")
	    (if (> nchildren max-children)
		(sleep (make-time 'time-duration 0 1)))







>







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    (call-with-port
     (socket 'inet 'stream '() 0)
     (lambda (sock)
       (bind/inet sock addr port)
       (listen sock 1000)
       (do ()
	   (#f)
	 (printf "scgi: active children: ~d~n" nchildren)
	 (printf "scgi: waiting for connection...~n")
	 (call-with-port
	  (accept sock)
	  (lambda (clifd)
	    (printf "scgi: accepted connection~n")
	    (if (> nchildren max-children)
		(sleep (make-time 'time-duration 0 1)))

Changes to sxml/SXML-to-HTML-ext.scm.

160
161
162
163
164
165
166
167


168
169
170
171
172
173
174
(define universal-conversion-rules
  `((@
      ((*default*       ; local override for attributes
        . ,(lambda (attr-key . value) (enattr attr-key value))))
      . ,(lambda (trigger . value) (cons '@ value)))
    (*default* . ,(lambda (tag . elems) (entag* tag elems)))
    (*text* . ,(lambda (trigger str) 
		 (if (string? str) (string->goodHTML str) str)))


    (n_		; a non-breaking space
     . ,(lambda (tag . elems)
	  (cons " " elems)))))

; A variation of universal-conversion-rules which keeps '<', '>', '&'
; and similar characters intact. The universal-protected-rules are
; useful when the tree of fragments has to be traversed one more time.







|
>
>







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
(define universal-conversion-rules
  `((@
      ((*default*       ; local override for attributes
        . ,(lambda (attr-key . value) (enattr attr-key value))))
      . ,(lambda (trigger . value) (cons '@ value)))
    (*default* . ,(lambda (tag . elems) (entag* tag elems)))
    (*text* . ,(lambda (trigger str) 
		 (cond [(string? str) (string->goodHTML str)]
			[(bytevector? str) (utf8->string str)]
			[else str])))
    (n_		; a non-breaking space
     . ,(lambda (tag . elems)
	  (cons "&nbsp;" elems)))))

; A variation of universal-conversion-rules which keeps '<', '>', '&'
; and similar characters intact. The universal-protected-rules are
; useful when the tree of fragments has to be traversed one more time.

Changes to sxml/SXML-to-HTML.scm.

61
62
63
64
65
66
67
68
69


70
71
72
73
74
75
76
                ; Universal transformation rules. Work for every HTML,
                ; present and future
    `((@
      ((*default*       ; local override for attributes
        . ,(lambda (attr-key . value) (enattr attr-key value))))
      . ,(lambda (trigger . value) (cons '@ value)))
     (*default* . ,(lambda (tag . elems) (entag tag elems)))
     (*text* . ,(lambda (trigger str) 
		  (if (string? str) (string->goodHTML str) str)))


 
                ; Handle a nontraditional but convenient top-level element:
                ; (html:begin title <html-body>) element
     (html:begin . ,(lambda (tag title . elems)
        (list "Content-type: text/html"         ; HTTP headers
              nl nl                            ; two nl end the headers
              "<HTML><HEAD><TITLE>" title "</TITLE></HEAD>"







|
|
>
>







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
                ; Universal transformation rules. Work for every HTML,
                ; present and future
    `((@
      ((*default*       ; local override for attributes
        . ,(lambda (attr-key . value) (enattr attr-key value))))
      . ,(lambda (trigger . value) (cons '@ value)))
     (*default* . ,(lambda (tag . elems) (entag tag elems)))
     (*text* . ,(lambda (trigger str)
		  (cond [(string? str) (string->goodHTML str)]
			[(bytevector? str) (utf8->string str)]
			[else str])))
 
                ; Handle a nontraditional but convenient top-level element:
                ; (html:begin title <html-body>) element
     (html:begin . ,(lambda (tag title . elems)
        (list "Content-type: text/html"         ; HTTP headers
              nl nl                            ; two nl end the headers
              "<HTML><HEAD><TITLE>" title "</TITLE></HEAD>"

Changes to thunder-utils.sls.

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
    (call-with-port (open-file-input-port path)
		    (lambda (p) (get-bytevector-all p))))
  
  (define (save-bytevector path data)
    (call-with-port (open-file-output-port path)
		    (lambda (p) (put-bytevector p data))))

  
  (define-syntax (nest stx)
    (syntax-case stx ()
      ((nest outer ... inner)
       (fold-right (lambda (o i)
		     (with-syntax (((outer ...) o)
				   (inner i))
		       #'(outer ... inner)))
		   #'inner (syntax->list #'(outer ...))))))


  );library








|












116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
    (call-with-port (open-file-input-port path)
		    (lambda (p) (get-bytevector-all p))))
  
  (define (save-bytevector path data)
    (call-with-port (open-file-output-port path)
		    (lambda (p) (put-bytevector p data))))

  ;; from https://fare.livejournal.com/189741.html
  (define-syntax (nest stx)
    (syntax-case stx ()
      ((nest outer ... inner)
       (fold-right (lambda (o i)
		     (with-syntax (((outer ...) o)
				   (inner i))
		       #'(outer ... inner)))
		   #'inner (syntax->list #'(outer ...))))))


  );library