diff options
author | Andy Wingo <wingo@pobox.com> | 2010-12-31 12:44:11 -0500 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-01-07 09:18:36 -0800 |
commit | 8745c33afbb7b103e9aa27adbd55884e6bbd4b51 (patch) | |
tree | a2d242f3bcb905dd28a06dab59417e420cae65fd /module | |
parent | b3f9444892224e1ee35645681cb20fe8e8ec2ff8 (diff) | |
download | guile-8745c33afbb7b103e9aa27adbd55884e6bbd4b51.tar.gz |
rename string->uri and uri->string.
* module/web/uri.scm (string->uri, uri->string): Rename from parse-uri
and unparse-uri.
* test-suite/tests/web-uri.test:
* module/web/http.scm: All callers changed.
Diffstat (limited to 'module')
-rw-r--r-- | module/web/http.scm | 6 | ||||
-rw-r--r-- | module/web/uri.scm | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/module/web/http.scm b/module/web/http.scm index f2f086632..7bad3af86 100644 --- a/module/web/http.scm +++ b/module/web/http.scm @@ -628,7 +628,7 @@ ordered alist." (display (date->string date "~a, ~d ~b ~Y ~H:~M:~S GMT") port)) (define (write-uri uri port) - (display (unparse-uri uri) port)) + (display (uri->string uri) port)) (define (parse-entity-tag val) (if (string-prefix? "W/" val) @@ -751,7 +751,7 @@ not have to have a scheme or host name. The result is a URI object." #:query (and q (substring str (1+ q) (or f end))) #:fragment (and f (substring str (1+ f) end))))) (else - (or (parse-uri (substring str start end)) + (or (string->uri (substring str start end)) (bad-request "Invalid URI: ~a" (substring str start end)))))) (define (read-request-line port) @@ -890,7 +890,7 @@ phrase\"." ((_ sym name) (declare-header sym name - (lambda (str) (or (parse-uri str) (bad-header-component 'uri str))) + (lambda (str) (or (string->uri str) (bad-header-component 'uri str))) uri? write-uri)))) diff --git a/module/web/uri.scm b/module/web/uri.scm index a7c4f2eb8..4d416a017 100644 --- a/module/web/uri.scm +++ b/module/web/uri.scm @@ -37,7 +37,7 @@ build-uri declare-default-port! - parse-uri unparse-uri + string->uri uri->string uri-decode uri-encode split-and-decode-uri-path encode-and-join-uri-path)) @@ -160,7 +160,7 @@ consistency checks to make sure that the constructed URI is valid." (define uri-regexp (make-regexp uri-pat)) -(define (parse-uri string) +(define (string->uri string) "Parse @var{string} into a URI object. Returns @code{#f} if the string could not be parsed." (% (let ((m (regexp-exec uri-regexp string))) @@ -197,7 +197,7 @@ printed." (declare-default-port! 'http 80) (declare-default-port! 'https 443) -(define (unparse-uri uri) +(define (uri->string uri) "Serialize @var{uri} to a string." (let* ((scheme-str (string-append (symbol->string (uri-scheme uri)) ":")) |