UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

50 lines 11 kB
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#273f79"/><link rel="stylesheet" href="lpdoc.css" type="text/css"/><script type="text/javascript" src="lpdoc.js"></script><title>URL encoding/decoding &mdash; The Ciao System v1.22</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">&#9776;</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="http_doc.html">&#x2191;</a><a class="lpdoc-navbutton" href="http_server.html">&#x2190;</a><a class="lpdoc-navbutton" href="http_forms.html">&#x2192;</a><a class="lpdoc-navbutton" href="ciaosearch.html">&#x1F50D;</a></span><span><a href="ciaofulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciao.html">The Ciao System</a> &raquo;<br/> </li><li><a href="ExtraLibs.html">PART VIII - Additional libraries</a> &raquo;<br/> </li><li><a href="http_doc.html">HTTP client/server libraries</a> &raquo;<br/> </li><li><a href=""><strong>URL encoding/decoding</strong></a></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li><li><a href="#Documentation on exports">Documentation on exports</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>URL encoding/decoding</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#url"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="The Ciao Development Team" href="ciaosearch.html#The Ciao Development Team">The Ciao Development Team</a>.<p> <p>This module implements URL encoding/decoding predicates.<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/><tt>:- use_module(library(http/url)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#url_info/2"><tt>url_info/2</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#url_info_relative/3"><tt>url_info_relative/3</tt></a>. <li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="2" href="#url_term/1"><tt>url_term/1</tt></a>. </ul></ul></div></div><div id="Documentation on exports"><h2>Documentation on exports</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="url_term/1" href="ciaosearch.html#url_term/1">url_term/1</a></div><div class="lpdoc-deftext">A term specifying an Internet Uniform Resource Locator. Currently only HTTP URLs are supported. Example: <tt>http(&apos;ciao-lang.org&apos;,80,&quot;/ciao/&quot;)</tt>. Defined as <pre class="lpdoc-codeblock">url_term(http(Hostname,Port,URIStr)) :- atm(Hostname), int(Port), string(URIStr). </pre><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>url_term(URL)</tt> </span><p><span class="lpdoc-var">URL</span> specifies a URL.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="url_info/2" href="ciaosearch.html#url_info/2">url_info/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>url_info(URL,URLTerm)</tt> </span><p>Translates a URL <span class="lpdoc-var">URL</span> to a Prolog structure <span class="lpdoc-var">URLTerm</span> which details its various components, and vice-versa. For now non-HTTP URLs make the predicate fail.<p><span class="lpdoc-usage-header">Usage 1:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="3" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="4" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">URL</span> is an atom. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="5" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> </ul><p><span class="lpdoc-usage-header">Usage 2:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="6" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="7" href="basic_props.html#string/1"><tt>basic_props:string/1</tt></a>)</span><span><span class="lpdoc-var">URL</span> is a string (a list of character codes). </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="8" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> </ul><p><span class="lpdoc-usage-header">Usage 3:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="9" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">URL</span> is a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="10" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="11" href="basic_props.html#string/1"><tt>basic_props:string/1</tt></a>)</span><span><span class="lpdoc-var">URL</span> is a string (a list of character codes). </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="url_info_relative/3" href="ciaosearch.html#url_info_relative/3">url_info_relative/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>url_info_relative(URL,BaseURLTerm,URLTerm)</tt> </span><p>Translates a relative URL <span class="lpdoc-var">URL</span> which appears in the HTML page refered to by <span class="lpdoc-var">BaseURLTerm</span> into <span class="lpdoc-var">URLTerm</span>, a Prolog structure containing its absolute parameters. Absolute URLs are translated as with <a class="lpdoc-idx-anchor" id="12" href="#url_info/2"><tt>url_info/2</tt></a>. E.g. <pre class="lpdoc-codeblock"> url_info_relative(&quot;dadu.html&quot;, http(&apos;www.foo.com&apos;,80,&quot;/bar/scoob.html&quot;), Info)</pre> gives <tt>Info = http(&apos;www.foo.com&apos;,80,&quot;/bar/dadu.html&quot;)</tt>.<p><span class="lpdoc-usage-header">Usage 1:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="13" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="14" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">URL</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="15" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">BaseURLTerm</span> specifies a URL. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="16" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> </ul><p><span class="lpdoc-usage-header">Usage 2:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="17" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="18" href="basic_props.html#string/1"><tt>basic_props:string/1</tt></a>)</span><span><span class="lpdoc-var">URL</span> is a string (a list of character codes). </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="19" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">BaseURLTerm</span> specifies a URL. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="20" href="#url_term/1"><tt>url:url_term/1</tt></a>)</span><span><span class="lpdoc-var">URLTerm</span> specifies a URL. </span> </ul></div></div><p> </div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="21" href="lists.html"><tt>lists</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="http_grammar.html"><tt>http_grammar</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="23" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="27" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="28" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="29" href="regtypes_doc.html"><tt>regtypes</tt></a>, <a class="lpdoc-idx-anchor" id="30" href="dcg_doc.html"><tt>dcg</tt></a>, <a class="lpdoc-idx-anchor" id="31" href="doccomments_doc.html"><tt>doccomments</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>