Skip to content
This repository has been archived by the owner on Mar 18, 2018. It is now read-only.

Commit

Permalink
Add additional documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nevali committed Dec 5, 2012
1 parent 8180c16 commit d7aaf9f
Show file tree
Hide file tree
Showing 39 changed files with 5,126 additions and 33 deletions.
10 changes: 8 additions & 2 deletions Makefile.am
Expand Up @@ -19,11 +19,17 @@ SUBDIRS = uriparser . t util m4
doc_DATA = README.md LICENSE-2.0 TODO \
liburi.3.html \
uri_create_str.3.html uri_create_uri.3.html uri_destroy.3.html \
uri_scheme.3.html
uri_scheme.3.html uri_auth.3.html uri_host.3.html uri_port.3.html \
uri_path.3.html uri_query.3.html uri_fragment.3.html uri_portnum.3.html \
uri_absolute.3.html uri_absolute_path.3.html \
uri_str.3.html

dist_man3_MANS = liburi.3 \
uri_create_str.3 uri_create_uri.3 uri_destroy.3 \
uri_scheme.3
uri_scheme.3 uri_auth.3 uri_host.3 uri_port.3 \
uri_path.3 uri_query.3 uri_fragment.3 uri_portnum.3 \
uri_absolute.3 uri_absolute_path.3 \
uri_str.3

lib_LTLIBRARIES = liburi.la

Expand Down
14 changes: 11 additions & 3 deletions liburi.3
Expand Up @@ -2,12 +2,12 @@
.\" Title: liburi
.\" Author: Mo McRoberts
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
.\" Date: 12/04/2012
.\" Date: 12/05/2012
.\" Manual: URI Functions
.\" Source: System Programmer's Manual
.\" Language: English
.\"
.TH "LIBURI" "3" "12/04/2012" "System Programmer's Manual" "URI Functions"
.TH "LIBURI" "3" "12/05/2012" "System Programmer's Manual" "URI Functions"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -77,6 +77,13 @@ Obtain parsed components of the URI:
\fBuri_query\fR(3),
\fBuri_fragment\fR(3)\&.
.RE
.PP
Obtain information about a parsed URI:
.RS 4

\fBuri_absolute\fR(3),
\fBuri_absolute_path\fR(3)\&.
.RE
.SH "SEE ALSO"
.PP

Expand All @@ -92,7 +99,8 @@ Obtain parsed components of the URI:
\fBuri_path\fR(3),
\fBuri_query\fR(3),
\fBuri_fragment\fR(3),
\fBuri_str\fR(3)\&.
\fBuri_str\fR(3),
\fBuri_absolute\fR(3)\&.
.SH "HISTORY"
.PP
The
Expand Down
14 changes: 10 additions & 4 deletions liburi.3.html
Expand Up @@ -117,7 +117,7 @@
— parse URIs and IRIs
</p></div>

<div class="refsect1" id="idp19280"><h2>Library</h2>
<div class="refsect1" id="idp896"><h2>Library</h2>

<p>URI parsing library (liburi, -luri)</p>
</div>
Expand Down Expand Up @@ -163,10 +163,15 @@
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_query.3.html" target="_top">uri_query</a></span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_fragment.3.html" target="_top">uri_fragment</a></span>(3)</span>.
</p>
</dd><dt><span class="term">Obtain information about a parsed URI:</span></dt><dd>
<p>
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_absolute.3.html" target="_top">uri_absolute</a></span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_absolute_path.3.html" target="_top">uri_absolute_path</a></span>(3)</span>.
</p>
</dd></dl></div>
</div>

<div class="refsect1" id="idp50240"><h2>See also</h2>
<div class="refsect1" id="idp53888"><h2>See also</h2>

<p>
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uriparse.1.html" target="_top">uriparse</a></span>(1)</span>,
Expand All @@ -181,11 +186,12 @@
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_path.3.html" target="_top">uri_path</a></span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_query.3.html" target="_top">uri_query</a></span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_fragment.3.html" target="_top">uri_fragment</a></span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_str.3.html" target="_top">uri_str</a></span>(3)</span>.
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_str.3.html" target="_top">uri_str</a></span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle"><a class="ulink" href="uri_absolute.3.html" target="_top">uri_absolute</a></span>(3)</span>.
</p>
</div>

<div class="refsect1" id="idp66016"><h2>History</h2>
<div class="refsect1" id="idp70784"><h2>History</h2>

<p>
The <span class="package">liburi</span> library implements an alternative API to
Expand Down
13 changes: 12 additions & 1 deletion liburi.3.xml
Expand Up @@ -96,6 +96,16 @@
</listitem>
</varlistentry>

<varlistentry>
<term>Obtain information about a parsed URI:</term>
<listitem>
<para>
<citerefentry><refentrytitle><ulink url="uri_absolute.3.html">uri_absolute</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle><ulink url="uri_absolute_path.3.html">uri_absolute_path</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
</listitem>
</varlistentry>

</variablelist>
</refsect1>

Expand All @@ -114,7 +124,8 @@
<citerefentry><refentrytitle><ulink url="uri_path.3.html">uri_path</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle><ulink url="uri_query.3.html">uri_query</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle><ulink url="uri_fragment.3.html">uri_fragment</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle><ulink url="uri_str.3.html">uri_str</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
<citerefentry><refentrytitle><ulink url="uri_str.3.html">uri_str</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle><ulink url="uri_absolute.3.html">uri_absolute</ulink></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
</refsect1>

Expand Down
122 changes: 122 additions & 0 deletions uri_absolute.3
@@ -0,0 +1,122 @@
'\" t
.\" Title: uri_absolute_path
.\" Author: Mo McRoberts
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
.\" Date: 12/05/2012
.\" Manual: URI Functions
.\" Source: System Programmer's Manual
.\" Language: English
.\"
.TH "URI_ABSOLUTE_PATH" "3" "12/05/2012" "System Programmer's Manual" "URI Functions"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
uri_absolute \- determine whether the path in a URI is relative or absolute
.SH "LIBRARY"
.PP
URI parsing library (liburi, \-luri)
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <liburi\&.h>
.fi
.ft
.HP \w'int\ uri_absolute_path('u
.BI "int uri_absolute_path(URI\ *" "uri" ");"
.SH "DESCRIPTION"
.PP
The
\fBuri_absolute_path\fR
function determines whether the path in a parsed URI is absolute or relative\&. An absolute path is one begins with a "/" character\&.
.PP
URIs which do not include a path at all are not considered to be absolute by this function\&. Any URI which does include a path and for which
\fBuri_absolute\fR(3)
returns
1
will be determined to have an absolute path\&. More specifically, any URI which includes either a scheme or a hostname as well as a path are always considered to have an absolute path (that is,
file:foo
and
file:/foo
will give the same results after parsing)\&.
.SH "PARAMETERS"
.PP
\fIuri\fR
.RS 4
The URI to evaluate\&.
.RE
.SH "RETURN VALUE"
.PP
If successful,
\fBuri_absolute_path\fR
returns
1
if
\fIuri\fR
contains a URI with an absolute path, and
0
otherwise\&.
.PP
If an error occurs,
\fBuri_absolute\fR
returns
\-1, and sets
\fIerrno\fR
accordingly\&.
.SH "EXAMPLE"
.sp
.if n \{\
.RS 4
.\}
.nf
URI *uri;
int result;

uri = uri_create_str("http://example\&.com", NULL);
/* result will be 0 because no path is present */
result = uri_absolute_path(uri);
uri_destroy(uri);

uri = uri_create_str("/project", NULL);
/* result will be 1 because an absolute path was parsed */
result = uri_absolute_path(uri);
uri_destroy(uri);

uri = uri_create_str("results/output", NULL);
/* result will be 0 because a relative path was parsed */
result = uri_absolute_path(uri);
uri_destroy(uri);

uri = uri_create_str("file:output", NULL);
/* result will be 1 because a scheme was present, meaning the path
* is always interpreted as as being absolute (in this case, "/output")
*/
result = uri_absolute_path(uri);
uri_destroy(uri);

.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP

\fBliburi\fR(3),
\fBuri_absolute\fR(3)\&.

0 comments on commit d7aaf9f

Please sign in to comment.