+ Splitting file surflets.scm into several packages
- Removing surflets.scm
+ The surflets package remains and collects the most usual used packages
It does not export any more the outdaters, the access to IDs
(like session-id), callbacks, form-query-list.
(and maybe some other stuff I've forgot to mention here, see list
below).
The new packages are (not included in surflets are marked (*)):
+ surflets/addresses: MAKE-ADDRESS, MAKE-ANNOTATED-ADDRESS
+ surflets/bindings: GET-BINDINGS, EXTRACT-BINDINGS and stuff
+ surflets/ids (*): MY-SESSION-ID, .., INSTANCE-SESSION-ID
+ surflets/input-fields: MAKE-INPUT-FIELD, MAKE-NUMBER-INPUT-FIELD...
+ surflets/outdaters(*): MAKE-OUTDATER, OUTDATER?...
+ surflets/returned-via: RETURNED-VIA, CASE-RETURNED-VIA
+ surflets/send-html: SEND-HTML/SUSPEND...
+ surflets/surflet-sxml: URL-RULE,..., SURLFET-SXML-RULES, ...
+ surflets/sxml: SXML->STRING, DEFAULT-RULE,...
+ surflets/typed-optionals(*): TYPED-OPTIONALS, OPTIONALS
+ surflets/utilities(*): MAKE-CALLBACK, FORM-QUERY-LIST,
GENERATE-UNIQUE-NAME...
2003-03-10 11:29:32 -05:00
|
|
|
;; utilities for surflets
|
|
|
|
;; Copyright 2002, 2003 Andreas Bernauer
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;; from parse-html-forms (cgi-script)
|
|
|
|
;;; Return the form data as an alist of decoded strings.
|
|
|
|
;;; So a query string like "button=on&reply=Oh,%20yes" becomes alist
|
|
|
|
;;; (("button" . "on") ("reply" . "Oh, yes"))
|
|
|
|
;;; This works only for GET and POST methods.
|
|
|
|
|
|
|
|
(define (form-query-list q)
|
|
|
|
(if q
|
|
|
|
(parse-html-form-query q)
|
|
|
|
'()))
|
|
|
|
|
|
|
|
;; from uri.scm
|
|
|
|
(define (rev-append a b) ; (append (reverse a) b)
|
|
|
|
(let rev-app ((a a) (b b)) ; Should be defined in a list-proc
|
|
|
|
(if (pair? a) ; package, not here.
|
|
|
|
(rev-app (cdr a) (cons (car a) b))
|
|
|
|
b)))
|
|
|
|
|
2003-04-15 09:55:00 -04:00
|
|
|
;; Every call will surely return another number.
|
|
|
|
(define generate-unique-number
|
+ Splitting file surflets.scm into several packages
- Removing surflets.scm
+ The surflets package remains and collects the most usual used packages
It does not export any more the outdaters, the access to IDs
(like session-id), callbacks, form-query-list.
(and maybe some other stuff I've forgot to mention here, see list
below).
The new packages are (not included in surflets are marked (*)):
+ surflets/addresses: MAKE-ADDRESS, MAKE-ANNOTATED-ADDRESS
+ surflets/bindings: GET-BINDINGS, EXTRACT-BINDINGS and stuff
+ surflets/ids (*): MY-SESSION-ID, .., INSTANCE-SESSION-ID
+ surflets/input-fields: MAKE-INPUT-FIELD, MAKE-NUMBER-INPUT-FIELD...
+ surflets/outdaters(*): MAKE-OUTDATER, OUTDATER?...
+ surflets/returned-via: RETURNED-VIA, CASE-RETURNED-VIA
+ surflets/send-html: SEND-HTML/SUSPEND...
+ surflets/surflet-sxml: URL-RULE,..., SURLFET-SXML-RULES, ...
+ surflets/sxml: SXML->STRING, DEFAULT-RULE,...
+ surflets/typed-optionals(*): TYPED-OPTIONALS, OPTIONALS
+ surflets/utilities(*): MAKE-CALLBACK, FORM-QUERY-LIST,
GENERATE-UNIQUE-NAME...
2003-03-10 11:29:32 -05:00
|
|
|
(let ((id 0))
|
2003-04-15 09:55:00 -04:00
|
|
|
(lambda ()
|
+ Splitting file surflets.scm into several packages
- Removing surflets.scm
+ The surflets package remains and collects the most usual used packages
It does not export any more the outdaters, the access to IDs
(like session-id), callbacks, form-query-list.
(and maybe some other stuff I've forgot to mention here, see list
below).
The new packages are (not included in surflets are marked (*)):
+ surflets/addresses: MAKE-ADDRESS, MAKE-ANNOTATED-ADDRESS
+ surflets/bindings: GET-BINDINGS, EXTRACT-BINDINGS and stuff
+ surflets/ids (*): MY-SESSION-ID, .., INSTANCE-SESSION-ID
+ surflets/input-fields: MAKE-INPUT-FIELD, MAKE-NUMBER-INPUT-FIELD...
+ surflets/outdaters(*): MAKE-OUTDATER, OUTDATER?...
+ surflets/returned-via: RETURNED-VIA, CASE-RETURNED-VIA
+ surflets/send-html: SEND-HTML/SUSPEND...
+ surflets/surflet-sxml: URL-RULE,..., SURLFET-SXML-RULES, ...
+ surflets/sxml: SXML->STRING, DEFAULT-RULE,...
+ surflets/typed-optionals(*): TYPED-OPTIONALS, OPTIONALS
+ surflets/utilities(*): MAKE-CALLBACK, FORM-QUERY-LIST,
GENERATE-UNIQUE-NAME...
2003-03-10 11:29:32 -05:00
|
|
|
(set! id (+ 1 id))
|
2003-04-15 09:55:00 -04:00
|
|
|
id)))
|
|
|
|
|
|
|
|
;; FIXME: consider creating small names
|
|
|
|
(define (generate-unique-name type-string)
|
|
|
|
(string-append type-string
|
2003-04-16 08:20:12 -04:00
|
|
|
(number->string (generate-unique-number))))
|
|
|
|
|
|
|
|
(define identity (lambda (a) a))
|