Next: , Previous: , Up: Textual Conversion Packages   [Contents][Index]

4.10 URI

(require 'uri)

Implements Uniform Resource Identifiers (URI) as described in RFC 2396.

Function: make-uri
Function: make-uri fragment
Function: make-uri query fragment
Function: make-uri path query fragment
Function: make-uri authority path query fragment
Function: make-uri scheme authority path query fragment

Returns a Uniform Resource Identifier string from component arguments.

Function: uri:make-path path

Returns a URI string combining the components of list path.

Function: html:anchor name

Returns a string which defines this location in the (HTML) file as name. The hypertext ‘<A HREF="#name">’ will link to this point.

(html:anchor "(section 7)")
⇒
"<A NAME=\"(section%207)\"></A>"

Returns a string which links the highlighted text to uri.

(html:link (make-uri "(section 7)") "section 7")
⇒
"<A HREF=\"#(section%207)\">section 7</A>"
Function: html:base uri

Returns a string specifying the base uri of a document, for inclusion in the HEAD of the document (see head).

Function: html:isindex prompt

Returns a string specifying the search prompt of a document, for inclusion in the HEAD of the document (see head).

Function: uri->tree uri-reference base-tree
Function: uri->tree uri-reference

Returns a list of 5 elements corresponding to the parts (scheme authority path query fragment) of string uri-reference. Elements corresponding to absent parts are #f.

The path is a list of strings. If the first string is empty, then the path is absolute; otherwise relative. The optional base-tree is a tree as returned by uri->tree; and is used as the base address for relative URIs.

If the authority component is a Server-based Naming Authority, then it is a list of the userinfo, host, and port strings (or #f). For other types of authority components the authority will be a string.

(uri->tree "http://www.ics.uci.edu/pub/ietf/uri/#Related")
⇒
(http "www.ics.uci.edu" ("" "pub" "ietf" "uri" "") #f "Related")
Function: uri:split-fields txt chr

Returns a list of txt split at each occurrence of chr. chr does not appear in the returned list of strings.

Function: uri:decode-query query-string

Converts a URI encoded query-string to a query-alist.

uric: prefixes indicate procedures dealing with URI-components.

Function: uric:encode uri-component allows

Returns a copy of the string uri-component in which all unsafe octets (as defined in RFC 2396) have been ‘%escaped. uric:decode decodes strings encoded by uric:encode.

Function: uric:decode uri-component

Returns a copy of the string uri-component in which each ‘%’ escaped characters in uri-component is replaced with the character it encodes. This routine is useful for showing URI contents on error pages.

Function: uri:path->keys path-list ptypes

path-list is a path-list as returned by uri:split-fields. uri:path->keys returns a list of items returned by uri:decode-path, coerced to types ptypes.

File-system Locators and Predicates

Function: path->uri path

Returns a URI-string for path on the local host.

Function: absolute-uri? str

Returns #t if str is an absolute-URI as indicated by a syntactically valid (per RFC 2396) scheme; otherwise returns #f.

Function: absolute-path? file-name

Returns #t if file-name is a fully specified pathname (does not depend on the current working directory); otherwise returns #f.

Function: null-directory? str

Returns #t if changing directory to str would leave the current directory unchanged; otherwise returns #f.

Function: glob-pattern? str

Returns #t if the string str contains characters used for specifying glob patterns, namely ‘*’, ‘?’, or ‘[’.

Before RFC 2396, the File Transfer Protocol (FTP) served a similar purpose.

Function: parse-ftp-address uri

Returns a list of the decoded FTP uri; or #f if indecipherable. FTP Uniform Resource Locator, ange-ftp, and getit formats are handled. The returned list has four elements which are strings or #f:

  1. username
  2. password
  3. remote-site
  4. remote-directory

Next: , Previous: , Up: Textual Conversion Packages   [Contents][Index]