The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>URI</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.0">
<link rel="start" href="index.html" title="Raptor RDF Syntax Parsing and Serializing Library Manual">
<link rel="up" href="reference-manual.html" title="Part&#160;II.&#160;Raptor Reference Manual">
<link rel="prev" href="raptor-section-uri-factory.html" title="URI Factory">
<link rel="next" href="raptor-section-www.html" title="WWW">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="introduction.html" title="Raptor Overview">
<link rel="part" href="tutorial.html" title="Part&#160;I.&#160;Raptor Tutorial">
<link rel="chapter" href="tutorial-initialising-finishing.html" title="Initialising and Finishing using the Library">
<link rel="chapter" href="tutorial-querying-functionality.html" title="Listing built-in functionality">
<link rel="chapter" href="tutorial-parsing.html" title="Parsing syntaxes to RDF Triples">
<link rel="chapter" href="tutorial-serializing.html" title="Serializing RDF triples to a syntax">
<link rel="part" href="reference-manual.html" title="Part&#160;II.&#160;Raptor Reference Manual">
<link rel="chapter" href="raptor-parsers.html" title="Parsers in Raptor (syntax to triples)">
<link rel="chapter" href="raptor-serializers.html" title="Serializers in Raptor (triples to syntax)">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="raptor-section-uri-factory.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Raptor RDF Syntax Parsing and Serializing Library Manual</th>
<td><a accesskey="n" href="raptor-section-www.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2565194" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2623579" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="raptor-section-uri"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2565194"></a><span class="refentrytitle">URI</span>
</h2>
<p>URI &#8212; URI class and relative URI computation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">



typedef     <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>;
            <a href="raptor-section-uri.html#raptor-uri-handler">raptor_uri_handler</a>;
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri">raptor_new_uri</a>                  (unsigned char *uri_string);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri-from-uri-local-name">raptor_new_uri_from_uri_local_name</a>
                                            (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             unsigned char *local_name);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri-relative-to-base">raptor_new_uri_relative_to_base</a> (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             unsigned char *uri_string);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri-from-id">raptor_new_uri_from_id</a>          (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             unsigned char *id);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri-for-rdf-concept">raptor_new_uri_for_rdf_concept</a>  (const char *name);
void        <a href="raptor-section-uri.html#raptor-free-uri">raptor_free_uri</a>                 (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);
int         <a href="raptor-section-uri.html#raptor-uri-equals">raptor_uri_equals</a>               (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri1,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri2);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-uri-copy">raptor_uri_copy</a>                 (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-as-string">raptor_uri_as_string</a>         (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-as-counted-string">raptor_uri_as_counted_string</a> (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             size_t *len_p);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri-for-xmlbase">raptor_new_uri_for_xmlbase</a>      (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *old_uri);
<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* <a href="raptor-section-uri.html#raptor-new-uri-for-retrieval">raptor_new_uri_for_retrieval</a>    (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *old_uri);
void        <a href="raptor-section-uri.html#raptor-uri-resolve-uri-reference">raptor_uri_resolve_uri_reference</a>
                                            (unsigned char *base_uri,
                                             unsigned char *reference_uri,
                                             unsigned char *buffer,
                                             size_t length);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-filename-to-uri-string">raptor_uri_filename_to_uri_string</a>
                                            (const char *filename);
char*       <a href="raptor-section-uri.html#raptor-uri-uri-string-to-filename">raptor_uri_uri_string_to_filename</a>
                                            (unsigned char *uri_string);
char*       <a href="raptor-section-uri.html#raptor-uri-uri-string-to-filename-fragment">raptor_uri_uri_string_to_filename_fragment</a>
                                            (unsigned char *uri_string,
                                             unsigned char **fragment_p);
int         <a href="raptor-section-uri.html#raptor-uri-uri-string-is-file-uri">raptor_uri_uri_string_is_file_uri</a>
                                            (unsigned char *uri_string);
int         <a href="raptor-section-uri.html#raptor-uri-is-file-uri">raptor_uri_is_file_uri</a>          (unsigned char *uri_string);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-to-relative-counted-uri-string">raptor_uri_to_relative_counted_uri_string</a>
                                            (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *reference_uri,
                                             size_t *length_p);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-to-relative-uri-string">raptor_uri_to_relative_uri_string</a>
                                            (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *reference_uri);
void        <a href="raptor-section-uri.html#raptor-uri-print">raptor_uri_print</a>                (const <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             FILE *stream);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-to-counted-string">raptor_uri_to_counted_string</a> (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             size_t *len_p);
unsigned char* <a href="raptor-section-uri.html#raptor-uri-to-string">raptor_uri_to_string</a>         (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);
void        <a href="raptor-section-uri.html#raptor-uri-set-handler">raptor_uri_set_handler</a>          (const <a href="raptor-section-uri.html#raptor-uri-handler">raptor_uri_handler</a> *handler,
                                             void *context);
void        <a href="raptor-section-uri.html#raptor-uri-get-handler">raptor_uri_get_handler</a>          (<a href="raptor-section-uri.html#raptor-uri-handler">raptor_uri_handler</a> **handler,
                                             void **context);
int         <a href="raptor-section-uri.html#raptor-iostream-write-uri">raptor_iostream_write_uri</a>       (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2623579"></a><h2>Description</h2>
<p>
A class for absolute URIs used inside raptor and relative URI
computation utility functions used inside the main Redland
<a
href="/usr/share/gtk-doc/html/redland/redland-uri.html#librdf-uri"
><span class="type">librdf_uri</span></a> class.  Only absolute URIs are provided, with no
current access to internals of URIs such as URI scheme, path, authority.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2623605"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2623616"></a><h3>
<a name="raptor-uri"></a>raptor_uri</h3>
<a class="indexterm" name="id2623628"></a><pre class="programlisting">raptor_uri* raptor_uri;
</pre>
<p>
Raptor URI Class.</p>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623647"></a><h3>
<a name="raptor-uri-handler"></a>raptor_uri_handler</h3>
<a class="indexterm" name="id2623659"></a><pre class="programlisting">typedef struct {
  /* constructors */
  raptor_new_uri_func                     new_uri;
  raptor_new_uri_from_uri_local_name_func new_uri_from_uri_local_name;
  raptor_new_uri_relative_to_base_func    new_uri_relative_to_base;
  raptor_new_uri_for_rdf_concept_func     new_uri_for_rdf_concept;
  /* destructor */
  raptor_free_uri_func                    free_uri;
  /* methods */
  raptor_uri_equals_func                  uri_equals;
  raptor_uri_copy_func                    uri_copy; /* well, copy constructor */
  raptor_uri_as_string_func               uri_as_string;
  raptor_uri_as_counted_string_func       uri_as_counted_string;
  int initialised;
} raptor_uri_handler;
</pre>
<p>
URI implementation handler structure.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-new-uri-func">raptor_new_uri_func</a>&#160;<em class="structfield"><code>new_uri</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-new-uri"><code class="function">raptor_new_uri()</code></a>
</td>
</tr>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-new-uri-from-uri-local-name-func">raptor_new_uri_from_uri_local_name_func</a>&#160;<em class="structfield"><code>new_uri_from_uri_local_name</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-new-uri-from-uri-local-name"><code class="function">raptor_new_uri_from_uri_local_name()</code></a>
</td>
</tr>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-new-uri-relative-to-base-func">raptor_new_uri_relative_to_base_func</a>&#160;<em class="structfield"><code>new_uri_relative_to_base</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-new-uri-relative-to-base"><code class="function">raptor_new_uri_relative_to_base()</code></a>
</td>
</tr>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-new-uri-for-rdf-concept-func">raptor_new_uri_for_rdf_concept_func</a>&#160;<em class="structfield"><code>new_uri_for_rdf_concept</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-new-uri-for-rdf-concept"><code class="function">raptor_new_uri_for_rdf_concept()</code></a>
</td>
</tr>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-free-uri-func">raptor_free_uri_func</a>&#160;<em class="structfield"><code>free_uri</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-free-uri"><code class="function">raptor_free_uri()</code></a>
</td>
</tr>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-uri-equals-func">raptor_uri_equals_func</a>&#160;<em class="structfield"><code>uri_equals</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-uri-equals"><code class="function">raptor_uri_equals()</code></a>
</td>
</tr>
<tr>
<td><span class="term"><a href="raptor-section-uri-factory.html#raptor-uri-copy-func">raptor_uri_copy_func</a>&#160;<em class="structfield"><code>uri_copy</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-uri-copy"><code class="function">raptor_uri_copy()</code></a>
</td>
</tr>
<tr>
<td><span class="term">raptor_uri_as_string_func&#160;<em class="structfield"><code>uri_as_string</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-uri-as-string"><code class="function">raptor_uri_as_string()</code></a>
</td>
</tr>
<tr>
<td><span class="term">raptor_uri_as_counted_string_func&#160;<em class="structfield"><code>uri_as_counted_string</code></em>;</span></td>
<td> function for <a href="raptor-section-uri.html#raptor-uri-as-counted-string"><code class="function">raptor_uri_as_counted_string()</code></a>
</td>
</tr>
<tr>
<td><span class="term">int&#160;<em class="structfield"><code>initialised</code></em>;</span></td>
<td> Internal
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623947"></a><h3>
<a name="raptor-new-uri"></a>raptor_new_uri ()</h3>
<a class="indexterm" name="id2623959"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri                  (unsigned char *uri_string);</pre>
<p>
Constructor - create a raptor URI from a UTF-8 encoded Unicode string.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri_string</code></em>&#160;:</span></td>
<td> URI string.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624028"></a><h3>
<a name="raptor-new-uri-from-uri-local-name"></a>raptor_new_uri_from_uri_local_name ()</h3>
<a class="indexterm" name="id2624042"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri_from_uri_local_name
                                            (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             unsigned char *local_name);</pre>
<p>
Constructor - create a raptor URI from an existing URI and a local name.
</p>
<p>
Creates a new URI from the concatenation of the <em class="parameter"><code>local_name</code></em> to the
<em class="parameter"><code>uri</code></em>.  This is NOT relative URI resolution, which is done by the
<a href="raptor-section-uri.html#raptor-new-uri-relative-to-base"><code class="function">raptor_new_uri_relative_to_base()</code></a> constructor.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> existing <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>local_name</code></em>&#160;:</span></td>
<td> local name
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624168"></a><h3>
<a name="raptor-new-uri-relative-to-base"></a>raptor_new_uri_relative_to_base ()</h3>
<a class="indexterm" name="id2635228"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri_relative_to_base (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             unsigned char *uri_string);</pre>
<p>
Constructor - create a raptor URI from a base URI and a relative URI string.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em>&#160;:</span></td>
<td> existing base URI
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>uri_string</code></em>&#160;:</span></td>
<td> relative URI string
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635310"></a><h3>
<a name="raptor-new-uri-from-id"></a>raptor_new_uri_from_id ()</h3>
<a class="indexterm" name="id2635320"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri_from_id          (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             unsigned char *id);</pre>
<p>
Constructor - create a new URI from a base URI and RDF ID.
</p>
<p>
This creates a URI equivalent to concatenating <em class="parameter"><code>base_uri</code></em> with
## and <em class="parameter"><code>id</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em>&#160;:</span></td>
<td> existing base URI
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>id</code></em>&#160;:</span></td>
<td> RDF ID
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635415"></a><h3>
<a name="raptor-new-uri-for-rdf-concept"></a>raptor_new_uri_for_rdf_concept ()</h3>
<a class="indexterm" name="id2635427"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri_for_rdf_concept  (const char *name);</pre>
<p>
Constructor - create a raptor URI for the RDF namespace concept name.
</p>
<p>
Example: u=raptor_new_uri_for_rdf_concept("value") creates a new
URI for the rdf:value term.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></td>
<td> RDF namespace concept
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635494"></a><h3>
<a name="raptor-free-uri"></a>raptor_free_uri ()</h3>
<a class="indexterm" name="id2635504"></a><pre class="programlisting">void        raptor_free_uri                 (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);</pre>
<p>
Destructor - destroy a <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> URI to destroy
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635554"></a><h3>
<a name="raptor-uri-equals"></a>raptor_uri_equals ()</h3>
<a class="indexterm" name="id2635565"></a><pre class="programlisting">int         raptor_uri_equals               (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri1,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri2);</pre>
<p>
Check if two URIs are equal.
</p>
<p>
A NULL URI is not equal to a non-NULL URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri1</code></em>&#160;:</span></td>
<td> URI 1 (may be NULL)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>uri2</code></em>&#160;:</span></td>
<td> URI 2 (may be NULL)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 if the URIs are equal
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635642"></a><h3>
<a name="raptor-uri-copy"></a>raptor_uri_copy ()</h3>
<a class="indexterm" name="id2635653"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_uri_copy                 (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);</pre>
<p>
Constructor - get a copy of a URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> URI object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635713"></a><h3>
<a name="raptor-uri-as-string"></a>raptor_uri_as_string ()</h3>
<a class="indexterm" name="id2635723"></a><pre class="programlisting">unsigned char* raptor_uri_as_string         (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);</pre>
<p>
Get a string representation of a URI.
</p>
<p>
Returns a shared pointer to a string representation of <em class="parameter"><code>uri</code></em>.  This
string is shared and must not be freed, otherwise see use the
<a href="raptor-section-uri.html#raptor-uri-to-string"><code class="function">raptor_uri_to_string()</code></a> or <a href="raptor-section-uri.html#raptor-uri-to-counted-string"><code class="function">raptor_uri_to_counted_string()</code></a> methods.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> shared string representation of URI
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635814"></a><h3>
<a name="raptor-uri-as-counted-string"></a>raptor_uri_as_counted_string ()</h3>
<a class="indexterm" name="id2635826"></a><pre class="programlisting">unsigned char* raptor_uri_as_counted_string (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             size_t *len_p);</pre>
<p>
Get a string representation of a URI with count.
</p>
<p>
Returns a shared pointer to a string representation of <em class="parameter"><code>uri</code></em> along
with the length of the string in <em class="parameter"><code>len_p</code></em>, if not NULL.  This
string is shared and must not be freed, otherwise see use the
<a href="raptor-section-uri.html#raptor-uri-to-string"><code class="function">raptor_uri_to_string()</code></a> or <a href="raptor-section-uri.html#raptor-uri-to-counted-string"><code class="function">raptor_uri_to_counted_string()</code></a> methods.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> URI object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>len_p</code></em>&#160;:</span></td>
<td> address of length variable or NULL
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> shared string representation of URI
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2635938"></a><h3>
<a name="raptor-new-uri-for-xmlbase"></a>raptor_new_uri_for_xmlbase ()</h3>
<a class="indexterm" name="id2635949"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri_for_xmlbase      (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *old_uri);</pre>
<p>
Constructor - create a URI suitable for use as an XML Base.
</p>
<p>
Takes an existing URI and ensures it has a path (default /) and has
no fragment or query arguments - XML base does not use these.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>old_uri</code></em>&#160;:</span></td>
<td> URI to transform
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636015"></a><h3>
<a name="raptor-new-uri-for-retrieval"></a>raptor_new_uri_for_retrieval ()</h3>
<a class="indexterm" name="id2636028"></a><pre class="programlisting"><a href="raptor-section-uri.html#raptor-uri">raptor_uri</a>* raptor_new_uri_for_retrieval    (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *old_uri);</pre>
<p>
Constructor - create a URI suitable for retrieval.
</p>
<p>
Takes an existing URI and ensures it has a path (default /) and has
no fragment - URI retrieval does not use the fragment part.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>old_uri</code></em>&#160;:</span></td>
<td> URI to transform
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636095"></a><h3>
<a name="raptor-uri-resolve-uri-reference"></a>raptor_uri_resolve_uri_reference ()</h3>
<a class="indexterm" name="id2636108"></a><pre class="programlisting">void        raptor_uri_resolve_uri_reference
                                            (unsigned char *base_uri,
                                             unsigned char *reference_uri,
                                             unsigned char *buffer,
                                             size_t length);</pre>
<p>
Resolve a URI to a base URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em>&#160;:</span></td>
<td> Base URI string
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>reference_uri</code></em>&#160;:</span></td>
<td> Reference URI string
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>buffer</code></em>&#160;:</span></td>
<td> Destination buffer URI
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>length</code></em>&#160;:</span></td>
<td> Length of destination buffer
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636211"></a><h3>
<a name="raptor-uri-filename-to-uri-string"></a>raptor_uri_filename_to_uri_string ()</h3>
<a class="indexterm" name="id2636225"></a><pre class="programlisting">unsigned char* raptor_uri_filename_to_uri_string
                                            (const char *filename);</pre>
<p>
Converts a filename to a file: URI.
</p>
<p>
Handles the OS-specific escaping on turning filenames into URIs
and returns a new buffer that the caller must <code class="function">free()</code>.  Turns
a space in the filname into <code class="literal">20</code> and '%' into <code class="literal">25</code>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td> The filename to convert
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A newly allocated string with the URI or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636312"></a><h3>
<a name="raptor-uri-uri-string-to-filename"></a>raptor_uri_uri_string_to_filename ()</h3>
<a class="indexterm" name="id2636326"></a><pre class="programlisting">char*       raptor_uri_uri_string_to_filename
                                            (unsigned char *uri_string);</pre>
<p>
Convert a file: URI to a filename.
</p>
<p>
Handles the OS-specific file: URIs to filename mappings.  Returns
a new buffer containing the filename that the caller must free.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri_string</code></em>&#160;:</span></td>
<td> The file: URI to convert
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A newly allocated string with the filename or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636387"></a><h3>
<a name="raptor-uri-uri-string-to-filename-fragment"></a>raptor_uri_uri_string_to_filename_fragment ()</h3>
<a class="indexterm" name="id2636401"></a><pre class="programlisting">char*       raptor_uri_uri_string_to_filename_fragment
                                            (unsigned char *uri_string,
                                             unsigned char **fragment_p);</pre>
<p>
Convert a file: URI to a filename and fragment.
</p>
<p>
Handles the OS-specific file: URIs to filename mappings.  Returns
a new buffer containing the filename that the caller must free.
</p>
<p>
If <em class="parameter"><code>fragment_p</code></em> is given, a new string containing the URI fragment
is returned, or NULL if none is present</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri_string</code></em>&#160;:</span></td>
<td> The file: URI to convert
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>fragment_p</code></em>&#160;:</span></td>
<td> Address of pointer to store any URI fragment or NULL
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A newly allocated string with the filename or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636493"></a><h3>
<a name="raptor-uri-uri-string-is-file-uri"></a>raptor_uri_uri_string_is_file_uri ()</h3>
<a class="indexterm" name="id2636507"></a><pre class="programlisting">int         raptor_uri_uri_string_is_file_uri
                                            (unsigned char *uri_string);</pre>
<p>
Check if a URI string is a file: URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri_string</code></em>&#160;:</span></td>
<td> The URI string to check
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> Non zero if URI string is a file: URI
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636562"></a><h3>
<a name="raptor-uri-is-file-uri"></a>raptor_uri_is_file_uri ()</h3>
<a class="indexterm" name="id2636573"></a><pre class="programlisting">int         raptor_uri_is_file_uri          (unsigned char *uri_string);</pre>
<p>
<em class="parameter"><code>Deprecated</code></em>: use raptor_uri_uri_string_is_file_uri
</p>
<p>
Check if a URI string is a file: URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri_string</code></em>&#160;:</span></td>
<td> The URI string to check
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> Non zero if URI string is a file: URI
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636637"></a><h3>
<a name="raptor-uri-to-relative-counted-uri-string"></a>raptor_uri_to_relative_counted_uri_string ()</h3>
<a class="indexterm" name="id2636651"></a><pre class="programlisting">unsigned char* raptor_uri_to_relative_counted_uri_string
                                            (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *reference_uri,
                                             size_t *length_p);</pre>
<p>
Get the counted relative URI string of a URI against a base URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em>&#160;:</span></td>
<td> The base absolute URI to resolve against (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>reference_uri</code></em>&#160;:</span></td>
<td> The reference absolute URI to use
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>length_p</code></em>&#160;:</span></td>
<td> Location to store the length of the relative URI string or NULL
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A newly allocated relative URI string or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636749"></a><h3>
<a name="raptor-uri-to-relative-uri-string"></a>raptor_uri_to_relative_uri_string ()</h3>
<a class="indexterm" name="id2636762"></a><pre class="programlisting">unsigned char* raptor_uri_to_relative_uri_string
                                            (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *base_uri,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *reference_uri);</pre>
<p>
Get the relative URI string of a URI against a base URI.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em>&#160;:</span></td>
<td> The base absolute URI to resolve against
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>reference_uri</code></em>&#160;:</span></td>
<td> The reference absolute URI to use
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> A newly allocated relative URI string or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636840"></a><h3>
<a name="raptor-uri-print"></a>raptor_uri_print ()</h3>
<a class="indexterm" name="id2636850"></a><pre class="programlisting">void        raptor_uri_print                (const <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             FILE *stream);</pre>
<p>
Print a URI to a file handle.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> URI to print
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>stream</code></em>&#160;:</span></td>
<td> The file handle to print to
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2636915"></a><h3>
<a name="raptor-uri-to-counted-string"></a>raptor_uri_to_counted_string ()</h3>
<a class="indexterm" name="id2636927"></a><pre class="programlisting">unsigned char* raptor_uri_to_counted_string (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri,
                                             size_t *len_p);</pre>
<p>
Get a new counted string for a URI.
</p>
<p>
If <em class="parameter"><code>len_p</code></em> is not NULL, the length of the string is stored in it.
</p>
<p>
The memory allocated must be freed by the caller and
<a href="raptor-section-memory.html#raptor-free-memory"><code class="function">raptor_free_memory()</code></a> should be used for best portability.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>len_p</code></em>&#160;:</span></td>
<td> Pointer to length (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new string or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2637032"></a><h3>
<a name="raptor-uri-to-string"></a>raptor_uri_to_string ()</h3>
<a class="indexterm" name="id2637042"></a><pre class="programlisting">unsigned char* raptor_uri_to_string         (<a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);</pre>
<p>
Get a new string for a URI.
</p>
<p>
The memory allocated must be freed by the caller and
<a href="raptor-section-memory.html#raptor-free-memory"><code class="function">raptor_free_memory()</code></a> should be used for best portability.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> <a href="raptor-section-uri.html#raptor-uri"><span class="type">raptor_uri</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> new string or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2637118"></a><h3>
<a name="raptor-uri-set-handler"></a>raptor_uri_set_handler ()</h3>
<a class="indexterm" name="id2637128"></a><pre class="programlisting">void        raptor_uri_set_handler          (const <a href="raptor-section-uri.html#raptor-uri-handler">raptor_uri_handler</a> *handler,
                                             void *context);</pre>
<p>
Change the URI class implementation to the functions provided by the
<em class="parameter"><code>handler</code></em> URI implementation.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>handler</code></em>&#160;:</span></td>
<td> URI handler structure
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> URI handler context
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2637197"></a><h3>
<a name="raptor-uri-get-handler"></a>raptor_uri_get_handler ()</h3>
<a class="indexterm" name="id2637208"></a><pre class="programlisting">void        raptor_uri_get_handler          (<a href="raptor-section-uri.html#raptor-uri-handler">raptor_uri_handler</a> **handler,
                                             void **context);</pre>
<p>
Return the current raptor URI class implementation <em class="parameter"><code>handler</code></em> and <em class="parameter"><code>context</code></em></p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>handler</code></em>&#160;:</span></td>
<td> URI handler to return
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></td>
<td> URI context to return
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2637281"></a><h3>
<a name="raptor-iostream-write-uri"></a>raptor_iostream_write_uri ()</h3>
<a class="indexterm" name="id2637292"></a><pre class="programlisting">int         raptor_iostream_write_uri       (<a href="raptor-section-iostream.html#raptor-iostream">raptor_iostream</a> *iostr,
                                             <a href="raptor-section-uri.html#raptor-uri">raptor_uri</a> *uri);</pre>
<p>
Write a raptor URI to the iostream.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>iostr</code></em>&#160;:</span></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em>&#160;:</span></td>
<td> URI
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>