base
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>PREAMBLE</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="next" href="apas02.html" title="APPLICABILITY AND DEFINITIONS"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">PREAMBLE</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gfdl.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas02.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2945982"></a>PREAMBLE</h2></div></div></div><p>The purpose of this License is to make a manual, textbook,
|
||||
or other written document "free" in the sense of freedom: to
|
||||
assure everyone the effective freedom to copy and redistribute it,
|
||||
with or without modifying it, either commercially or
|
||||
noncommercially. Secondarily, this License preserves for the
|
||||
author and publisher a way to get credit for their work, while not
|
||||
being considered responsible for modifications made by
|
||||
others.</p><p>This License is a kind of "copyleft", which means that
|
||||
derivative works of the document must themselves be free in the
|
||||
same sense. It complements the GNU General Public License, which
|
||||
is a copyleft license designed for free software.</p><p>We have designed this License in order to use it for manuals
|
||||
for free software, because free software needs free documentation:
|
||||
a free program should come with manuals providing the same
|
||||
freedoms that the software does. But this License is not limited
|
||||
to software manuals; it can be used for any textual work,
|
||||
regardless of subject matter or whether it is published as a
|
||||
printed book. We recommend this License principally for works
|
||||
whose purpose is instruction or reference.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gfdl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. GNU Free Documentation License </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> APPLICABILITY AND DEFINITIONS</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>APPLICABILITY AND DEFINITIONS</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas01.html" title="PREAMBLE"><link rel="next" href="apas03.html" title="VERBATIM COPYING"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">APPLICABILITY AND DEFINITIONS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas01.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas03.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2945992"></a>APPLICABILITY AND DEFINITIONS</h2></div></div></div><p>This License applies to any manual or other work that
|
||||
contains a notice placed by the copyright holder saying it can be
|
||||
distributed under the terms of this License. The "Document",
|
||||
below, refers to any such manual or work. Any member of the
|
||||
public is a licensee, and is addressed as "you".</p><p>A "Modified Version" of the Document means any work
|
||||
containing the Document or a portion of it, either copied
|
||||
verbatim, or with modifications and/or translated into another
|
||||
language.</p><p>A "Secondary Section" is a named appendix or a front-matter
|
||||
section of the Document that deals exclusively with the
|
||||
relationship of the publishers or authors of the Document to the
|
||||
Document's overall subject (or to related matters) and contains
|
||||
nothing that could fall directly within that overall subject.
|
||||
(For example, if the Document is in part a textbook of
|
||||
mathematics, a Secondary Section may not explain any mathematics.)
|
||||
The relationship could be a matter of historical connection with
|
||||
the subject or with related matters, or of legal, commercial,
|
||||
philosophical, ethical or political position regarding
|
||||
them.</p><p>The "Invariant Sections" are certain Secondary Sections
|
||||
whose titles are designated, as being those of Invariant Sections,
|
||||
in the notice that says that the Document is released under this
|
||||
License.</p><p>The "Cover Texts" are certain short passages of text that
|
||||
are listed, as Front-Cover Texts or Back-Cover Texts, in the
|
||||
notice that says that the Document is released under this
|
||||
License.</p><p>A "Transparent" copy of the Document means a
|
||||
machine-readable copy, represented in a format whose specification
|
||||
is available to the general public, whose contents can be viewed
|
||||
and edited directly and straightforwardly with generic text
|
||||
editors or (for images composed of pixels) generic paint programs
|
||||
or (for drawings) some widely available drawing editor, and that
|
||||
is suitable for input to text formatters or for automatic
|
||||
translation to a variety of formats suitable for input to text
|
||||
formatters. A copy made in an otherwise Transparent file format
|
||||
whose markup has been designed to thwart or discourage subsequent
|
||||
modification by readers is not Transparent. A copy that is not
|
||||
"Transparent" is called "Opaque".</p><p>Examples of suitable formats for Transparent copies include
|
||||
plain ASCII without markup, Texinfo input format, LaTeX input
|
||||
format, SGML or XML using a publicly available DTD, and
|
||||
standard-conforming simple HTML designed for human modification.
|
||||
Opaque formats include PostScript, PDF, proprietary formats that
|
||||
can be read and edited only by proprietary word processors, SGML
|
||||
or XML for which the DTD and/or processing tools are not generally
|
||||
available, and the machine-generated HTML produced by some word
|
||||
processors for output purposes only.</p><p>The "Title Page" means, for a printed book, the title page
|
||||
itself, plus such following pages as are needed to hold, legibly,
|
||||
the material this License requires to appear in the title page.
|
||||
For works in formats which do not have any title page as such,
|
||||
"Title Page" means the text near the most prominent appearance of
|
||||
the work's title, preceding the beginning of the body of the
|
||||
text.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas01.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">PREAMBLE </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> VERBATIM COPYING</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>VERBATIM COPYING</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas02.html" title="APPLICABILITY AND DEFINITIONS"><link rel="next" href="apas04.html" title="COPYING IN QUANTITY"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">VERBATIM COPYING</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas02.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas04.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946878"></a>VERBATIM COPYING</h2></div></div></div><p>You may copy and distribute the Document in any medium,
|
||||
either commercially or noncommercially, provided that this
|
||||
License, the copyright notices, and the license notice saying this
|
||||
License applies to the Document are reproduced in all copies, and
|
||||
that you add no other conditions whatsoever to those of this
|
||||
License. You may not use technical measures to obstruct or
|
||||
control the reading or further copying of the copies you make or
|
||||
distribute. However, you may accept compensation in exchange for
|
||||
copies. If you distribute a large enough number of copies you
|
||||
must also follow the conditions in section 3.</p><p>You may also lend copies, under the same conditions stated
|
||||
above, and you may publicly display copies.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">APPLICABILITY AND DEFINITIONS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> COPYING IN QUANTITY</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>COPYING IN QUANTITY</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas03.html" title="VERBATIM COPYING"><link rel="next" href="apas05.html" title="MODIFICATIONS"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">COPYING IN QUANTITY</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas03.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas05.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946905"></a>COPYING IN QUANTITY</h2></div></div></div><p>If you publish printed copies of the Document numbering more
|
||||
than 100, and the Document's license notice requires Cover Texts,
|
||||
you must enclose the copies in covers that carry, clearly and
|
||||
legibly, all these Cover Texts: Front-Cover Texts on the front
|
||||
cover, and Back-Cover Texts on the back cover. Both covers must
|
||||
also clearly and legibly identify you as the publisher of these
|
||||
copies. The front cover must present the full title with all
|
||||
words of the title equally prominent and visible. You may add
|
||||
other material on the covers in addition. Copying with changes
|
||||
limited to the covers, as long as they preserve the title of the
|
||||
Document and satisfy these conditions, can be treated as verbatim
|
||||
copying in other respects.</p><p>If the required texts for either cover are too voluminous to
|
||||
fit legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto
|
||||
adjacent pages.</p><p>If you publish or distribute Opaque copies of the Document
|
||||
numbering more than 100, you must either include a
|
||||
machine-readable Transparent copy along with each Opaque copy, or
|
||||
state in or with each Opaque copy a publicly-accessible
|
||||
computer-network location containing a complete Transparent copy
|
||||
of the Document, free of added material, which the general
|
||||
network-using public has access to download anonymously at no
|
||||
charge using public-standard network protocols. If you use the
|
||||
latter option, you must take reasonably prudent steps, when you
|
||||
begin distribution of Opaque copies in quantity, to ensure that
|
||||
this Transparent copy will remain thus accessible at the stated
|
||||
location until at least one year after the last time you
|
||||
distribute an Opaque copy (directly or through your agents or
|
||||
retailers) of that edition to the public.</p><p>It is requested, but not required, that you contact the
|
||||
authors of the Document well before redistributing any large
|
||||
number of copies, to give them a chance to provide you with an
|
||||
updated version of the Document.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">VERBATIM COPYING </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> MODIFICATIONS</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>MODIFICATIONS</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas04.html" title="COPYING IN QUANTITY"><link rel="next" href="apas06.html" title="COMBINING DOCUMENTS"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">MODIFICATIONS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas04.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas06.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946976"></a>MODIFICATIONS</h2></div></div></div><p>You may copy and distribute a Modified Version of the
|
||||
Document under the conditions of sections 2 and 3 above, provided
|
||||
that you release the Modified Version under precisely this
|
||||
License, with the Modified Version filling the role of the
|
||||
Document, thus licensing distribution and modification of the
|
||||
Modified Version to whoever possesses a copy of it. In addition,
|
||||
you must do these things in the Modified Version:</p><div class="orderedlist"><ol type="A"><li><p>Use in the Title Page
|
||||
(and on the covers, if any) a title distinct from that of the
|
||||
Document, and from those of previous versions (which should, if
|
||||
there were any, be listed in the History section of the
|
||||
Document). You may use the same title as a previous version if
|
||||
the original publisher of that version gives permission.</p></li><li><p>List on the Title Page,
|
||||
as authors, one or more persons or entities responsible for
|
||||
authorship of the modifications in the Modified Version,
|
||||
together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has less than
|
||||
five).</p></li><li><p>State on the Title page
|
||||
the name of the publisher of the Modified Version, as the
|
||||
publisher.</p></li><li><p>Preserve all the
|
||||
copyright notices of the Document.</p></li><li><p>Add an appropriate
|
||||
copyright notice for your modifications adjacent to the other
|
||||
copyright notices.</p></li><li><p>Include, immediately
|
||||
after the copyright notices, a license notice giving the public
|
||||
permission to use the Modified Version under the terms of this
|
||||
License, in the form shown in the Addendum below.</p></li><li><p>Preserve in that license
|
||||
notice the full lists of Invariant Sections and required Cover
|
||||
Texts given in the Document's license notice.</p></li><li><p>Include an unaltered
|
||||
copy of this License.</p></li><li><p>Preserve the section
|
||||
entitled "History", and its title, and add to it an item stating
|
||||
at least the title, year, new authors, and publisher of the
|
||||
Modified Version as given on the Title Page. If there is no
|
||||
section entitled "History" in the Document, create one stating
|
||||
the title, year, authors, and publisher of the Document as given
|
||||
on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.</p></li><li><p>Preserve the network
|
||||
location, if any, given in the Document for public access to a
|
||||
Transparent copy of the Document, and likewise the network
|
||||
locations given in the Document for previous versions it was
|
||||
based on. These may be placed in the "History" section. You
|
||||
may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.</p></li><li><p>In any section entitled
|
||||
"Acknowledgements" or "Dedications", preserve the section's
|
||||
title, and preserve in the section all the substance and tone of
|
||||
each of the contributor acknowledgements and/or dedications
|
||||
given therein.</p></li><li><p>Preserve all the
|
||||
Invariant Sections of the Document, unaltered in their text and
|
||||
in their titles. Section numbers or the equivalent are not
|
||||
considered part of the section titles.</p></li><li><p>Delete any section
|
||||
entitled "Endorsements". Such a section may not be included in
|
||||
the Modified Version.</p></li><li><p>Do not retitle any
|
||||
existing section as "Endorsements" or to conflict in title with
|
||||
any Invariant Section.</p></li></ol></div><p>If the Modified Version includes new front-matter sections
|
||||
or appendices that qualify as Secondary Sections and contain no
|
||||
material copied from the Document, you may at your option
|
||||
designate some or all of these sections as invariant. To do this,
|
||||
add their titles to the list of Invariant Sections in the Modified
|
||||
Version's license notice. These titles must be distinct from any
|
||||
other section titles.</p><p>You may add a section entitled "Endorsements", provided it
|
||||
contains nothing but endorsements of your Modified Version by
|
||||
various parties--for example, statements of peer review or that
|
||||
the text has been approved by an organization as the authoritative
|
||||
definition of a standard.</p><p>You may add a passage of up to five words as a Front-Cover
|
||||
Text, and a passage of up to 25 words as a Back-Cover Text, to the
|
||||
end of the list of Cover Texts in the Modified Version. Only one
|
||||
passage of Front-Cover Text and one of Back-Cover Text may be
|
||||
added by (or through arrangements made by) any one entity. If the
|
||||
Document already includes a cover text for the same cover,
|
||||
previously added by you or by arrangement made by the same entity
|
||||
you are acting on behalf of, you may not add another; but you may
|
||||
replace the old one, on explicit permission from the previous
|
||||
publisher that added the old one.</p><p>The author(s) and publisher(s) of the Document do not by
|
||||
this License give permission to use their names for publicity for
|
||||
or to assert or imply endorsement of any Modified Version.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">COPYING IN QUANTITY </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> COMBINING DOCUMENTS</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>COMBINING DOCUMENTS</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas05.html" title="MODIFICATIONS"><link rel="next" href="apas07.html" title="COLLECTIONS OF DOCUMENTS"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">COMBINING DOCUMENTS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas05.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas07.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2947171"></a>COMBINING DOCUMENTS</h2></div></div></div><p>You may combine the Document with other documents released
|
||||
under this License, under the terms defined in section 4 above for
|
||||
modified versions, provided that you include in the combination
|
||||
all of the Invariant Sections of all of the original documents,
|
||||
unmodified, and list them all as Invariant Sections of your
|
||||
combined work in its license notice.</p><p>The combined work need only contain one copy of this
|
||||
License, and multiple identical Invariant Sections may be replaced
|
||||
with a single copy. If there are multiple Invariant Sections with
|
||||
the same name but different contents, make the title of each such
|
||||
section unique by adding at the end of it, in parentheses, the
|
||||
name of the original author or publisher of that section if known,
|
||||
or else a unique number. Make the same adjustment to the section
|
||||
titles in the list of Invariant Sections in the license notice of
|
||||
the combined work.</p><p>In the combination, you must combine any sections entitled
|
||||
"History" in the various original documents, forming one section
|
||||
entitled "History"; likewise combine any sections entitled
|
||||
"Acknowledgements", and any sections entitled "Dedications". You
|
||||
must delete all sections entitled "Endorsements."</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">MODIFICATIONS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> COLLECTIONS OF DOCUMENTS</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>COLLECTIONS OF DOCUMENTS</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas06.html" title="COMBINING DOCUMENTS"><link rel="next" href="apas08.html" title="AGGREGATION WITH INDEPENDENT WORKS"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">COLLECTIONS OF DOCUMENTS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas06.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas08.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946693"></a>COLLECTIONS OF DOCUMENTS</h2></div></div></div><p>You may make a collection consisting of the Document and
|
||||
other documents released under this License, and replace the
|
||||
individual copies of this License in the various documents with a
|
||||
single copy that is included in the collection, provided that you
|
||||
follow the rules of this License for verbatim copying of each of
|
||||
the documents in all other respects.</p><p>You may extract a single document from such a collection,
|
||||
and distribute it individually under this License, provided you
|
||||
insert a copy of this License into the extracted document, and
|
||||
follow this License in all other respects regarding verbatim
|
||||
copying of that document.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">COMBINING DOCUMENTS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> AGGREGATION WITH INDEPENDENT WORKS</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,14 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>AGGREGATION WITH INDEPENDENT WORKS</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas07.html" title="COLLECTIONS OF DOCUMENTS"><link rel="next" href="apas09.html" title="TRANSLATION"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">AGGREGATION WITH INDEPENDENT WORKS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas07.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas09.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946720"></a>AGGREGATION WITH INDEPENDENT WORKS</h2></div></div></div><p>A compilation of the Document or its derivatives with other
|
||||
separate and independent documents or works, in or on a volume of
|
||||
a storage or distribution medium, does not as a whole count as a
|
||||
Modified Version of the Document, provided no compilation
|
||||
copyright is claimed for the compilation. Such a compilation is
|
||||
called an "aggregate", and this License does not apply to the
|
||||
other self-contained works thus compiled with the Document, on
|
||||
account of their being thus compiled, if they are not themselves
|
||||
derivative works of the Document.</p><p>If the Cover Text requirement of section 3 is applicable to
|
||||
these copies of the Document, then if the Document is less than
|
||||
one quarter of the entire aggregate, the Document's Cover Texts
|
||||
may be placed on covers that surround only the Document within the
|
||||
aggregate. Otherwise they must appear on covers around the whole
|
||||
aggregate.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas07.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas09.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">COLLECTIONS OF DOCUMENTS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> TRANSLATION</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>TRANSLATION</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas08.html" title="AGGREGATION WITH INDEPENDENT WORKS"><link rel="next" href="apas10.html" title="TERMINATION"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">TRANSLATION</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas08.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas10.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946751"></a>TRANSLATION</h2></div></div></div><p>Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section
|
||||
4. Replacing Invariant Sections with translations requires
|
||||
special permission from their copyright holders, but you may
|
||||
include translations of some or all Invariant Sections in addition
|
||||
to the original versions of these Invariant Sections. You may
|
||||
include a translation of this License provided that you also
|
||||
include the original English version of this License. In case of
|
||||
a disagreement between the translation and the original English
|
||||
version of this License, the original English version will
|
||||
prevail.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas08.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas10.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">AGGREGATION WITH INDEPENDENT WORKS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> TERMINATION</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>TERMINATION</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas09.html" title="TRANSLATION"><link rel="next" href="apas11.html" title="FUTURE REVISIONS OF THIS LICENSE"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">TERMINATION</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas09.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas11.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946774"></a>TERMINATION</h2></div></div></div><p>You may not copy, modify, sublicense, or distribute the
|
||||
Document except as expressly provided for under this License. Any
|
||||
other attempt to copy, modify, sublicense or distribute the
|
||||
Document is void, and will automatically terminate your rights
|
||||
under this License. However, parties who have received copies, or
|
||||
rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full
|
||||
compliance.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas11.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">TRANSLATION </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> FUTURE REVISIONS OF THIS LICENSE</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,13 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>FUTURE REVISIONS OF THIS LICENSE</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas10.html" title="TERMINATION"><link rel="next" href="apas12.html" title="How to use this License for your documents"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">FUTURE REVISIONS OF THIS LICENSE</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas10.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> <a accesskey="n" href="apas12.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946794"></a>FUTURE REVISIONS OF THIS LICENSE</h2></div></div></div><p>The Free Software Foundation may publish new, revised
|
||||
versions of the GNU Free Documentation License from time to time.
|
||||
Such new versions will be similar in spirit to the present
|
||||
version, but may differ in detail to address new problems or
|
||||
concerns. See <a href="http://www.gnu.org/copyleft/" target="_top">http://www.gnu.org/copyleft/</a>.</p><p>Each version of the License is given a distinguishing
|
||||
version number. If the Document specifies that a particular
|
||||
numbered version of this License "or any later version" applies to
|
||||
it, you have the option of following the terms and conditions
|
||||
either of that specified version or of any later version that has
|
||||
been published (not as a draft) by the Free Software Foundation.
|
||||
If the Document does not specify a version number of this License,
|
||||
you may choose any version ever published (not as a draft) by the
|
||||
Free Software Foundation.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas10.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apas12.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">TERMINATION </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> How to use this License for your documents</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,19 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>How to use this License for your documents</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="gfdl.html" title="Appendix A. GNU Free Documentation License"><link rel="prev" href="apas11.html" title="FUTURE REVISIONS OF THIS LICENSE"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">How to use this License for your documents</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apas11.html">Prev</a> </td><th width="60%" align="center">Appendix A. GNU Free Documentation License</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946820"></a>How to use this License for your documents</h2></div></div></div><p>To use this License in a document you have written, include
|
||||
a copy of the License in the document and put the following
|
||||
copyright and license notices just after the title page:</p><div class="blockquote"><blockquote class="blockquote"><p>
|
||||
Copyright (c) YEAR YOUR NAME.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1
|
||||
or any later version published by the Free Software Foundation;
|
||||
with the Invariant Sections being LIST THEIR TITLES, with the
|
||||
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
</p></blockquote></div><p>If you have no Invariant Sections, write "with no Invariant
|
||||
Sections" instead of saying which ones are invariant. If you have
|
||||
no Front-Cover Texts, write "no Front-Cover Texts" instead of
|
||||
"Front-Cover Texts being LIST"; likewise for Back-Cover
|
||||
Texts.</p><p>If your document contains nontrivial examples of program
|
||||
code, we recommend releasing these examples in parallel under your
|
||||
choice of free software license, such as the GNU General Public
|
||||
License, to permit their use in free software.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apas11.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gfdl.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">FUTURE REVISIONS OF THIS LICENSE </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 2. The neon C language interface</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="index.html" title="neon HTTP/WebDAV client library"><link rel="prev" href="compliance.html" title="Standards compliance"><link rel="next" href="xml.html" title="Parsing XML"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. The neon C language interface</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compliance.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="xml.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="api"></a>Chapter 2. The neon C language interface</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="xml.html">Parsing XML</a></span></dt><dd><dl><dt><span class="sect2"><a href="xml.html#xml-sax">Introduction to SAX</a></span></dt><dt><span class="sect2"><a href="xml.html#xml-stacked">Stacked SAX handlers</a></span></dt><dt><span class="sect2"><a href="xml.html#xml-state">Maintaining state</a></span></dt><dt><span class="sect2"><a href="xml.html#xml-ns">XML namespaces</a></span></dt></dl></dd></dl></div><p>The documentation for the neon interface is split between
|
||||
this chapter, which gives a broad introduction to the abstractions
|
||||
exposed by the library, and <a href="ref.html" title="neon API reference">neon API reference</a>, which gives a
|
||||
function-by-function breakdown of the interface.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="compliance.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="xml.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Standards compliance </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Parsing XML</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Bibliography</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="index.html" title="neon HTTP/WebDAV client library"><link rel="prev" href="refxml.html" title="ne_xml_create"><link rel="next" href="gfdl.html" title="Appendix A. GNU Free Documentation License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bibliography</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refxml.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="gfdl.html">Next</a></td></tr></table><hr></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a name="biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a name="bib.ssltls"></a><p>[<span class="abbrev">SSL-and-TLS</span>] <span class="title"><i><a href="http://www.rtfm.com/sslbook/" target="_top">SSL and
|
||||
TLS: Designing and Building Secure Systems</a></i>. </span><span class="author"><span class="firstname">Eric</span> <span class="surname">Rescorla</span>. </span><span class="isbn">0-201-62598-3. </span><span class="publisher"><span class="publishername">Addison-Wesley. </span></span><span class="pubdate">March 2001. </span></p></div><div class="biblioentry"><a name="bib.xmlnames"></a><p>[<span class="abbrev">REC-XML-names</span>] <span class="corpauthor">World Wide Web Consortium. </span><span class="title"><i><a href="http://www.w3.org/TR/REC-xml-names" target="_top">Namespaces in XML</a></i>. </span><span class="pubdate">January 1999. </span></p></div><div class="biblioentry"><a name="bib.rfc2616"></a><p>[<span class="abbrev">RFC2616</span>] <span class="title"><i><a href="http://www.ietf.org/rfc/rfc2616.txt" target="_top">Hypertext Transfer
|
||||
Protocol—HTTP/1.1</a></i>. </span><span class="authorgroup"><span class="firstname">Roy</span> <span class="surname">Fielding</span>, <span class="firstname">Jim</span> <span class="surname">Gettys</span>, <span class="firstname">Jeff</span> <span class="surname">Mogul</span>, <span class="firstname">Henrik</span> <span class="surname">Frystyk</span>, <span class="firstname">Larry</span> <span class="surname">Masinter</span>, <span class="firstname">Paul</span> <span class="surname">Leach</span>, and <span class="firstname">Tim</span> <span class="surname">Berners-Lee</span>. </span><span class="publishername">IETF. </span><span class="pubdate">June 1999. </span></p></div><div class="biblioentry"><a name="bib.rfc2518"></a><p>[<span class="abbrev">RFC2518</span>] <span class="title"><i><a href="http://www.ietf.org/rfc/rfc2518.txt" target="_top">HTTP Extensions for Distributed Authoring—WEBDAV</a></i>. </span><span class="authorgroup"><span class="firstname">Yaron</span> <span class="surname">Goland</span>, <span class="firstname">Jim</span> <span class="surname">Whitehead</span>, <span class="firstname">Asad</span> <span class="surname">Faizi</span>, <span class="firstname">Steve</span> <span class="surname">Carter</span>, and <span class="firstname">Del</span> <span class="surname">Jensen</span>. </span><span class="publishername">IETF. </span><span class="pubdate">February 1999. </span></p></div><div class="biblioentry"><a name="bib.rfc3280"></a><p>[<span class="abbrev">RFC3280</span>] <span class="title"><i><a href="http://www.ietf.org/rfc/rfc3280.txt" target="_top">Internet X.509 Public Key Infrastructure
|
||||
Certificate and Certificate Revocation List (CRL) Profile</a></i>. </span><span class="authorgroup"><span class="firstname">Russel</span> <span class="surname">Housley</span>, <span class="firstname">Warwick</span> <span class="surname">Ford</span>, <span class="firstname">Tim</span> <span class="surname">Polk</span>, and <span class="firstname">David</span> <span class="surname">Solo</span>. </span><span class="publishername">IETF. </span><span class="pubdate">April 2002. </span></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refxml.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="gfdl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_xml_create </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. GNU Free Documentation License</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,33 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Standards compliance</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="intro.html" title="Chapter 1. Introduction"><link rel="prev" href="using.html" title="How to use neon from your application"><link rel="next" href="api.html" title="Chapter 2. The neon C language interface"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Standards compliance</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="compliance"></a>Standards compliance</h2></div></div></div><p>neon is intended to be compliant with the IETF and W3C
|
||||
standards which it implements, with a few exceptions due to
|
||||
practical necessity or interoperability issues. These
|
||||
exceptions are documented in this section.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2926908"></a>RFC 2518, HTTP Extensions for Distributed Authoring—WebDAV</h3></div></div></div><p>neon is deliberately not compliant with section
|
||||
23.4.2, and treats property names as a (namespace-URI, name)
|
||||
pair. This is <a href="http://lists.w3.org/Archives/Public/w3c-dist-auth/1999OctDec/0343.html" target="_top">generally
|
||||
considered</a> to be correct behaviour by the WebDAV
|
||||
working group, and is likely to formally adopted in a future
|
||||
revision of the specification.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2926928"></a>RFC 2616, Hypertext Transfer Protocol—HTTP/1.1</h3></div></div></div><p>There is some confusion in this specification about the
|
||||
use of the “<span class="quote">identity</span>”
|
||||
<em class="firstterm">transfer-coding</em>. neon treats the
|
||||
presence of <span class="emphasis"><em>any</em></span>
|
||||
<code class="literal">Transfer-Encoding</code> response header as an
|
||||
indication that the response message uses the
|
||||
“<span class="quote">chunked</span>” transfer-coding. This was the
|
||||
suggested resolution <a href="http://lists.w3.org/Archives/Public/ietf-http-wg-old/2001SepDec/0018.html" target="_top">proposed
|
||||
by Larry Masinter</a>.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2926969"></a>RFC 2617, HTTP Authentication: Basic and Digest Access Authentication</h3></div></div></div><p>neon is not strictly compliant with the quoting rules
|
||||
given in the grammar for the <code class="literal">Authorization</code>
|
||||
header. The grammar requires that the <code class="literal">qop</code>
|
||||
and <code class="literal">algorithm</code> parameters are not quoted,
|
||||
however one widely deployed server implementation
|
||||
(Microsoft® IIS 5) rejects the request if these parameters
|
||||
are not quoted. neon sends these parameters with
|
||||
quotes—this is not known to cause any problems with
|
||||
other server implementations.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2926956"></a>Namespaces in XML</h3></div></div></div><p>The neon XML parser interface will accept and parse
|
||||
without error some XML documents which are well-formed
|
||||
according to the XML specification but do not conform to the
|
||||
"Namespaces in XML" specification [<a href="biblio.html#bib.xmlnames" title="[REC-XML-names]"><span class="abbrev">REC-XML-names</span></a>]. Specifically: the restrictions on
|
||||
the first character of the <code class="literal">NCName</code> rule are
|
||||
not all implemented; neon will allow any
|
||||
<code class="literal">CombiningChar</code>, <code class="literal">Extender</code>
|
||||
and some characters from the <code class="literal">Digit</code> class in
|
||||
this position.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">How to use neon from your application </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. The neon C language interface</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,33 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Feature list</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="intro.html" title="Chapter 1. Introduction"><link rel="prev" href="intro.html" title="Chapter 1. Introduction"><link rel="next" href="using.html" title="How to use neon from your application"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Feature list</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="features"></a>Feature list</h2></div></div></div><p>The major features of the neon library are as follows:</p><div class="itemizedlist"><ul type="disc"><li><p>A high-level interface to common HTTP and WebDAV
|
||||
methods. This allows you to easily dispatch a GET or a MKCOL request
|
||||
against a resource with a single function call.</p></li><li><p>A low-level interface for HTTP request
|
||||
handling; allowing you to implement requests using arbitrary methods
|
||||
and request headers, capture arbitrary response headers, and so
|
||||
on.</p></li><li><p>Persistent connection support; neon groups a
|
||||
set of requests to a server into a "session"; requests within that
|
||||
session can use a persistent (also known as "keep-alive")
|
||||
connection.</p></li><li><p>Modern HTTP authentication support: a complete
|
||||
implementation of the new authentication standard, RFC2617,
|
||||
supporting the Digest (MD5) and Basic schemes, including integrity
|
||||
checking. Credentials are supplied by an application-defined
|
||||
callback.</p></li><li><p>Proxy server support; a session can be set to
|
||||
use a proxy server. Authentication is supported for the Proxy as well
|
||||
as the origin server.</p></li><li><p>Complete SSL support; a simple interface for
|
||||
enabling SSL, hiding the complexity of using an SSL library directly.
|
||||
Client certificate support, callback-based server certificate
|
||||
verification, along with functions to load trusted CA
|
||||
certificates.</p></li><li><p>Generic XML parsing interface for handling XML
|
||||
response bodies using SAX-like callbacks. Both the expat and libxml
|
||||
XML parser libraries are supported.</p></li><li><p>WebDAV metadata support; set and remove
|
||||
properties, query properties (PROPFIND); simple interface for
|
||||
retrieving "flat" byte-string properties, more advanced support for
|
||||
parsing "complex" XML structured properties.</p></li><li><p>Build environment support: the neon source
|
||||
tree is designed so that it can be embedded in your application's
|
||||
build tree; autoconf macros are supplied for integration. To get
|
||||
started quickly a <a href="refconfig.html" title="neon-config"><span class="refentrytitle">neon-config</span></a> script is included,
|
||||
to easily determine how to compile and link against an installed copy
|
||||
of neon</p></li><li><p>Complete test suite: the neon test suite
|
||||
comprises half as many lines of source code as the library itself,
|
||||
including many tests for protocol compliance in network behaviour, and
|
||||
that the library implementation meets the guarantees made by the
|
||||
API.</p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> How to use neon from your application</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Appendix A. GNU Free Documentation License</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="index.html" title="neon HTTP/WebDAV client library"><link rel="prev" href="biblio.html" title="Bibliography"><link rel="next" href="apas01.html" title="PREAMBLE"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. GNU Free Documentation License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="biblio.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apas01.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="gfdl"></a>Appendix A. GNU Free Documentation License</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="apas01.html">0. PREAMBLE</a></span></dt><dt><span class="sect1"><a href="apas02.html">1. APPLICABILITY AND DEFINITIONS</a></span></dt><dt><span class="sect1"><a href="apas03.html">2. VERBATIM COPYING</a></span></dt><dt><span class="sect1"><a href="apas04.html">3. COPYING IN QUANTITY</a></span></dt><dt><span class="sect1"><a href="apas05.html">4. MODIFICATIONS</a></span></dt><dt><span class="sect1"><a href="apas06.html">5. COMBINING DOCUMENTS</a></span></dt><dt><span class="sect1"><a href="apas07.html">6. COLLECTIONS OF DOCUMENTS</a></span></dt><dt><span class="sect1"><a href="apas08.html">7. AGGREGATION WITH INDEPENDENT WORKS</a></span></dt><dt><span class="sect1"><a href="apas09.html">8. TRANSLATION</a></span></dt><dt><span class="sect1"><a href="apas10.html">9. TERMINATION</a></span></dt><dt><span class="sect1"><a href="apas11.html">10. FUTURE REVISIONS OF THIS LICENSE</a></span></dt><dt><span class="sect1"><a href="apas12.html">How to use this License for your documents</a></span></dt></dl></div><p>Version 1.1, March 2000</p><div class="blockquote"><blockquote class="blockquote"><p>Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.</p></blockquote></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="biblio.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="apas01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Bibliography </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> PREAMBLE</td></tr></table></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 1. Introduction</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="index.html" title="neon HTTP/WebDAV client library"><link rel="prev" href="index.html" title="neon HTTP/WebDAV client library"><link rel="next" href="features.html" title="Feature list"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="features.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="features.html">Feature list</a></span></dt><dt><span class="sect1"><a href="using.html">How to use neon from your application</a></span></dt><dt><span class="sect1"><a href="compliance.html">Standards compliance</a></span></dt><dd><dl><dt><span class="sect2"><a href="compliance.html#id2926908">RFC 2518, HTTP Extensions for Distributed Authoring—WebDAV</a></span></dt><dt><span class="sect2"><a href="compliance.html#id2926928">RFC 2616, Hypertext Transfer Protocol—HTTP/1.1</a></span></dt><dt><span class="sect2"><a href="compliance.html#id2926969">RFC 2617, HTTP Authentication: Basic and Digest Access Authentication</a></span></dt><dt><span class="sect2"><a href="compliance.html#id2926956">Namespaces in XML</a></span></dt></dl></dd></dl></div><p>This chapter provides an introduction to neon, giving an
|
||||
overview of the range of features offered, and some general guidelines
|
||||
for using the neon API.</p><p>neon aims to provide a modern, flexible, and simple API
|
||||
in the C programming language for implementing HTTP and WebDAV
|
||||
support. The WebDAV functionality is entirely separate from the basic
|
||||
HTTP functionality; neon can be used simply as an HTTP client library,
|
||||
ignoring the WebDAV support if desired.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="features.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">neon HTTP/WebDAV client library </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Feature list</td></tr></table></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_malloc</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refiaddr.html" title="ne_iaddr_make"><link rel="next" href="refsess.html" title="ne_session_create"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_malloc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refiaddr.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsess.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refalloc"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_malloc, ne_calloc, ne_realloc, ne_strdup, ne_strndup, ne_oom_callback — memory allocation wrappers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_alloc.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void *<b class="fsfunc">ne_malloc</b>(</code>size_t <var xmlns="" class="pdparam">size</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void *<b class="fsfunc">ne_calloc</b>(</code>size_t <var xmlns="" class="pdparam">size</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void *<b class="fsfunc">ne_realloc</b>(</code>void *<var xmlns="" class="pdparam">size</var>, size_t <var xmlns="" class="pdparam">len</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_strdup</b>(</code>const char *<var xmlns="" class="pdparam">s</var>, size_t <var xmlns="" class="pdparam">size</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_strndup</b>(</code>const char *<var xmlns="" class="pdparam">s</var>, size_t <var xmlns="" class="pdparam">size</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_oom_callback</b>(</code>void (*<var xmlns="" class="pdparam">callback</var>)(void)<code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2934859"></a><h2>Description</h2><p>The functions <code class="function">ne_malloc</code>,
|
||||
<code class="function">ne_calloc</code>, <code class="function">ne_realloc</code>,
|
||||
<code class="function">ne_strdup</code> and <code class="function">ne_strdnup</code>
|
||||
provide wrappers for the equivalent functions in the standard C
|
||||
library. The wrappers provide the extra guarantee that if the C
|
||||
library equivalent returns <code class="literal">NULL</code> when no memory is available, an
|
||||
optional callback will be called, and the library will then call
|
||||
<code class="function">abort</code>().</p><p><code class="function">ne_oom_callback</code> registers a callback
|
||||
which will be invoked if an out of memory error is detected.</p></div><div class="refsect1" lang="en"><a name="id2934923"></a><h2>Notes</h2><p>If the operating system uses optimistic memory
|
||||
allocation, the C library memory allocation routines will not return
|
||||
<code class="literal">NULL</code>, so it is not possible to gracefully handle memory allocation
|
||||
failures.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refiaddr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsess.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_iaddr_make </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_session_create</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_set_server_auth</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refreqbody.html" title="ne_set_request_body_buffer"><link rel="next" href="refshave.html" title="ne_shave"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_set_server_auth</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refreqbody.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refshave.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refauth"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_set_server_auth, ne_set_proxy_auth, ne_forget_auth — register authentication callbacks</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_auth.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">typedef int (*<b class="fsfunc">ne_request_auth</b>)(</code>void *<var xmlns="" class="pdparam">userdata</var>, const char *<var xmlns="" class="pdparam">realm</var>, int <var xmlns="" class="pdparam">attempt</var>, char *<var xmlns="" class="pdparam">username</var>, char *<var xmlns="" class="pdparam">password</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_server_auth</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, ne_request_auth <var xmlns="" class="pdparam">callback</var>, void *<var xmlns="" class="pdparam">userdata</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_proxy_auth</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, ne_request_auth <var xmlns="" class="pdparam">callback</var>, void *<var xmlns="" class="pdparam">userdata</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_forget_auth</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2939752"></a><h2>Description</h2><p>The <em class="type">ne_request_auth</em> function type defines a
|
||||
callback which is invoked when a server or proxy server requires user
|
||||
authentication for a particular request. The
|
||||
<code class="parameter">realm</code> string is supplied by the server. The <code class="parameter">attempt</code> is a counter giving the
|
||||
number of times the request has been retried with different
|
||||
authentication credentials. The first time the callback is invoked
|
||||
for a particular request, <code class="parameter">attempt</code> will be zero.</p><p>To retry the request using new authentication
|
||||
credentials, the callback should return zero, and the
|
||||
<code class="parameter">username</code> and <code class="parameter">password</code>
|
||||
buffers must contain <code class="literal">NUL</code>-terminated strings. The
|
||||
<code class="literal">NE_ABUFSIZ</code> constant gives the size of these
|
||||
buffers.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>If you only wish to allow the user one attempt to enter
|
||||
credentials, use the value of the <code class="parameter">attempt</code>
|
||||
parameter as the return value of the callback.</p></div><p>To abort the request, the callback should return a
|
||||
non-zero value; in which case the contents of the
|
||||
<code class="parameter">username</code> and <code class="parameter">password</code>
|
||||
buffers are ignored.</p><p>The <code class="function">ne_forget_auth</code> function can be
|
||||
used to discard the cached authentication credentials.</p></div><div class="refsect1" lang="en"><a name="id2939865"></a><h2>Examples</h2><pre class="programlisting">
|
||||
/* Function which prompts for a line of user input: */
|
||||
extern char *prompt_for(const char *prompt);
|
||||
|
||||
static int
|
||||
my_auth(void *userdata, const char *realm, int attempts,
|
||||
char *username, char *password)
|
||||
{
|
||||
strncpy(username, prompt_for("Username: "), NE_ABUFSIZ);
|
||||
strncpy(password, prompt_for("Password: "), NE_ABUFSIZ);
|
||||
return attempts;
|
||||
}
|
||||
|
||||
int main(...)
|
||||
{
|
||||
ne_session *sess = ne_session_create(...);
|
||||
|
||||
ne_set_server_auth(sess, my_auth, NULL);
|
||||
|
||||
/* ... */
|
||||
}</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refreqbody.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refshave.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_set_request_body_buffer </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_shave</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_buffer</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refresolve.html" title="ne_addr_resolve"><link rel="next" href="refbufapp.html" title="ne_buffer_append"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_buffer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refresolve.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refbufapp.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refbuf"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_buffer — string buffer handling</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_string.h>
|
||||
|
||||
typedef struct {
|
||||
char *data;
|
||||
size_t used;
|
||||
size_t length;
|
||||
} <em class="type">ne_buffer</em>;</pre></div></div><div class="refsect1" lang="en"><a name="id2930091"></a><h2>Description</h2><p>The <em class="type">ne_buffer</em> type represents an expandable
|
||||
memory buffer for holding <code class="literal">NUL</code>-terminated strings. The
|
||||
<em class="structfield"><code>data</code></em> field points to the beginnning of the
|
||||
string, the length of which is given by the
|
||||
<em class="structfield"><code>used</code></em> field. The current size of memory
|
||||
allocated is given by the <em class="structfield"><code>length</code></em> field. It
|
||||
is not recommended that the fields of a buffer are manipulated
|
||||
directly. The <em class="structfield"><code>data</code></em> pointer may change when
|
||||
the buffer is modified.</p><p>A buffer is created using <a href="refbufcr.html#ne_buffer_create">ne_buffer_create</a> or <a href="refbufcr.html#ne_buffer_create_sized">ne_buffer_ncreate</a>, and destroyed using <a href="refbufdest.html#ne_buffer_destroy">ne_buffer_destroy</a> or <a href="refbufdest.html#ne_buffer_finish">ne_buffer_finish</a>.
|
||||
The functions <a href="refbufapp.html#ne_buffer_append">ne_buffer_append</a>, <a href="refbufapp.html#ne_buffer_zappend">ne_buffer_zappend</a> and <a href="refbufapp.html#ne_buffer_concat">ne_buffer_concat</a> are
|
||||
used to append data to a buffer.</p><p>If the string referenced by the
|
||||
<em class="structfield"><code>data</code></em> pointer is modified directly (rather
|
||||
than using one of the functions listed above),
|
||||
<code class="function">ne_buffer_altered</code> must be called.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refresolve.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refbufapp.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_addr_resolve </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_buffer_append</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,22 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_buffer_append</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbuf.html" title="ne_buffer"><link rel="next" href="refbufutil.html" title="ne_buffer_clear"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_buffer_append</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbuf.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refbufutil.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refbufapp"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_buffer_append, ne_buffer_zappend, ne_buffer_concat — append data to a string buffer</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_string.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_append</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var>, const char *<var xmlns="" class="pdparam">string</var>, size_t <var xmlns="" class="pdparam">len</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_zappend</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var>, const char *<var xmlns="" class="pdparam">string</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_concat</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var>, const char *<var xmlns="" class="pdparam">str</var>, ...<code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2931548"></a><h2>Description</h2><p>The <code class="function">ne_buffer_append</code> and
|
||||
<code class="function">ne_buffer_zappend</code> functions append a string to
|
||||
the end of a buffer; extending the buffer as necessary. The
|
||||
<code class="parameter">len</code> passed to
|
||||
<code class="function">ne_buffer_append</code> specifies the length of the
|
||||
string to append; there must be no <code class="literal">NUL</code> terminator in the first
|
||||
<code class="parameter">len</code> bytes of the string.
|
||||
<code class="function">ne_buffer_zappend</code> must be passed a
|
||||
<code class="literal">NUL</code>-terminated string.</p><p>The <code class="function">ne_buffer_concat</code> function takes
|
||||
a variable-length argument list following <code class="parameter">str</code>;
|
||||
each argument must be a <em class="type">char *</em> pointer to a
|
||||
<code class="literal">NUL</code>-terminated string. A <code class="literal">NULL</code> pointer must be given as the last
|
||||
argument to mark the end of the list. The strings (including
|
||||
<code class="parameter">str</code>) are appended to the buffer in the order
|
||||
given. None of the strings passed to
|
||||
<code class="function">ne_buffer_concat</code> are modified.</p></div><div class="refsect1" lang="en"><a name="id2931656"></a><h2>Examples</h2><p>The following code will output "<code class="literal">Hello, world.
|
||||
And goodbye.</code>".</p><pre class="programlisting">ne_buffer *buf = ne_buffer_create();
|
||||
ne_buffer_zappend(buf, "Hello");
|
||||
ne_buffer_concat(buf, ", world. ", "And ", "goodbye.", NULL);
|
||||
puts(buf->data);
|
||||
ne_buffer_destroy(buf);</pre></div><div class="refsect1" lang="en"><a name="id2931681"></a><h2>See also</h2><p><a href="refbuf.html#ne_buffer">ne_buffer</a>, <a href="refbufcr.html#ne_buffer_create">ne_buffer_create</a>,
|
||||
<a href="refbufdest.html#ne_buffer_destroy">ne_buffer_destroy</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbuf.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refbufutil.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_buffer_clear</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_buffer_create</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbufutil.html" title="ne_buffer_clear"><link rel="next" href="refbufdest.html" title="ne_buffer_destroy"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_buffer_create</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbufutil.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refbufdest.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refbufcr"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_buffer_create, ne_buffer_ncreate — general purpose of group of functions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_alloc.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_buffer *<b class="fsfunc">ne_buffer_create</b>(</code><code xmlns="">void)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_buffer *<b class="fsfunc">ne_buffer_ncreate</b>(</code>size_t <var xmlns="" class="pdparam">size</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2932533"></a><h2>Description</h2><p><code class="function">ne_buffer_create</code> creates a new
|
||||
buffer object, with an implementation-defined initial size.
|
||||
<code class="function">ne_buffer_ncreate</code> creates an
|
||||
<em class="type">ne_buffer</em> where the minimum initial size is given in the
|
||||
<code class="parameter">size</code> parameter. The buffer created will
|
||||
contain the empty string (<code class="literal">""</code>).</p></div><div class="refsect1" lang="en"><a name="id2932570"></a><h2>Return value</h2><p>Both functions return a pointer to a new buffer object,
|
||||
and never <code class="literal">NULL</code>.</p></div><div class="refsect1" lang="en"><a name="id2932587"></a><h2>See also</h2><p><a href="refbuf.html#ne_buffer">ne_buffer</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbufutil.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refbufdest.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer_clear </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_buffer_destroy</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_buffer_destroy</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbufcr.html" title="ne_buffer_create"><link rel="next" href="referr.html" title="ne_get_error"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_buffer_destroy</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbufcr.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="referr.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refbufdest"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_buffer_destroy, ne_buffer_finish — destroy a buffer object</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_string.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_destroy</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_buffer_finish</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2932017"></a><h2>Description</h2><p><code class="function">ne_buffer_destroy</code> frees all memory
|
||||
associated with the buffer. <code class="function">ne_buffer_finish</code>
|
||||
frees the buffer structure, but not the actual string stored in the
|
||||
buffer, which is returned and must be <code class="function">free</code>()d by
|
||||
the caller.</p><p>Any use of the buffer object after calling either of these
|
||||
functions gives undefined behaviour.</p></div><div class="refsect1" lang="en"><a name="id2932051"></a><h2>Return value</h2><p><code class="function">ne_buffer_finish</code> returns the
|
||||
<code class="function">malloc</code>-allocated string stored in the buffer.</p></div><div class="refsect1" lang="en"><a name="id2932909"></a><h2>Examples</h2><p>An example use of <code class="function">ne_buffer_finish</code>;
|
||||
the <code class="function">duplicate</code> function returns a string made up of
|
||||
<code class="parameter">n</code> copies of <code class="parameter">str</code>:</p><pre class="programlisting">static char *duplicate(int n, const char *str)
|
||||
{
|
||||
ne_buffer *buf = ne_buffer_create();
|
||||
while (n--) {
|
||||
ne_buffer_zappend(buf, str);
|
||||
}
|
||||
return ne_buffer_finish(buf);
|
||||
}</pre></div><div class="refsect1" lang="en"><a name="id2932952"></a><h2>See also</h2><p><a href="refbuf.html#ne_buffer">ne_buffer</a>, <a href="refbufcr.html#ne_buffer_create">ne_buffer_create</a>,
|
||||
<a href="refbufapp.html#ne_buffer_zappend">ne_buffer_zappend</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbufcr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="referr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer_create </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_get_error</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_buffer_clear</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbufapp.html" title="ne_buffer_append"><link rel="next" href="refbufcr.html" title="ne_buffer_create"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_buffer_clear</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbufapp.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refbufcr.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refbufutil"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_buffer_clear, ne_buffer_grow, ne_buffer_altered — general purpose of group of functions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_string.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_clear</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_altered</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_buffer_grow</b>(</code>ne_buffer *<var xmlns="" class="pdparam">buf</var>, size_t <var xmlns="" class="pdparam">size</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2932153"></a><h2>Description</h2><p>The <code class="function">ne_buffer_clear</code> function sets
|
||||
the string stored in <code class="parameter">buf</code> to be the empty string
|
||||
(<code class="literal">""</code>).</p><p>The <code class="function">ne_buffer_altered</code> function must
|
||||
be used after the string stored in the buffer
|
||||
<code class="parameter">buf</code> is modified by directly rather than using
|
||||
<a href="refbufapp.html#ne_buffer_append">ne_buffer_append</a>, <a href="refbufapp.html#ne_buffer_zappend">ne_buffer_zappend</a>
|
||||
or <a href="refbufapp.html#ne_buffer_concat">ne_buffer_concat</a>.</p><p>The <code class="function">ne_buffer_grow</code> function
|
||||
ensures that at least <code class="parameter">size</code> bytes are allocated
|
||||
for the string; this can be used if a large amount of data is going to
|
||||
be appended to the buffer and may result in more efficient memory
|
||||
allocation.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbufapp.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refbufcr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer_append </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_buffer_create</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,33 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_cert_identity</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsockinit.html" title="ne_sock_init"><link rel="next" href="refsslcert2.html" title="ne_ssl_cert_cmp"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_cert_identity</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsockinit.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsslcert2.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refcert"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_cert_identity, ne_ssl_cert_signedby, ne_ssl_cert_issuer, ne_ssl_cert_subject — functions to access certificate properties</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_ssl.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_ssl_cert_identity</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_ssl_certificate *<b class="fsfunc">ne_ssl_cert_signedby</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_ssl_dname *<b class="fsfunc">ne_ssl_cert_subject</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_ssl_dname *<b class="fsfunc">ne_ssl_cert_issuer</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2940883"></a><h2>Description</h2><p>The function <code class="function">ne_ssl_cert_identity</code>
|
||||
retrieves the “<span class="quote">identity</span>” of a certificate; for an
|
||||
SSL server certificate, this will be the hostname for which the
|
||||
certificate was issued. In PKI parlance, the identity is the
|
||||
<span class="emphasis"><em>common name</em></span> attribute of the distinguished name of
|
||||
the certificate subject.</p><p>The functions <code class="function">ne_ssl_cert_subject</code> and
|
||||
<code class="function">ne_ssl_cert_issuer</code> can be used to access the
|
||||
objects representing the distinguished name of the subject and of
|
||||
the issuer of a certificate, respectively.</p><p>If a certificate object is part of a certificate chain, then
|
||||
<code class="function">ne_ssl_cert_signedby</code> can be used to find the
|
||||
certificate which signed a particular certificate. For a
|
||||
self-signed certificate or a certificate for which the full chain
|
||||
is not available, this function will return <code class="literal">NULL</code>.</p></div><div class="refsect1" lang="en"><a name="id2940948"></a><h2>Return value</h2><p><code class="function">ne_ssl_cert_issuer</code> and
|
||||
<code class="function">ne_ssl_cert_subject</code> are guaranteed to never
|
||||
return <code class="literal">NULL</code>. <code class="function">ne_ssl_cert_identity</code> may
|
||||
return <code class="literal">NULL</code> if the certificate has no specific
|
||||
“<span class="quote">identity</span>”. <code class="function">ne_ssl_cert_signedby</code>
|
||||
may return <code class="literal">NULL</code> as covered above.</p></div><div class="refsect1" lang="en"><a name="id2941005"></a><h2>Examples</h2><p>The following function could be used to display information
|
||||
about a given certificate:</p><pre class="programlisting">void dump_cert(const ne_ssl_certificate *cert) {
|
||||
const char *id = ne_ssl_cert_identity(cert);
|
||||
char *dn;
|
||||
|
||||
if (id)
|
||||
printf("Certificate was issued for '%s'.\n", id);
|
||||
|
||||
dn = ne_ssl_readable_dname(ne_ssl_cert_subject(cert));
|
||||
printf("Subject: %s\n", dn);
|
||||
free(dn);
|
||||
|
||||
dn = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert));
|
||||
printf("Issuer: %s\n", dn);
|
||||
free(dn);
|
||||
}</pre></div><div class="refsect1" lang="en"><a name="id2941029"></a><h2>See also</h2><p><a href="refsslcert2.html#ne_ssl_cert_cmp">ne_ssl_cert_cmp</a>, <a href="refssldname.html#ne_ssl_readable_dname">ne_ssl_readable_dname</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsockinit.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsslcert2.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_sock_init </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_cert_cmp</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,55 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_client_cert</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsslvfy.html" title="ne_ssl_set_verify"><link rel="next" href="refstatus.html" title="ne_status"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_client_cert</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsslvfy.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refstatus.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refclicert"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_clicert_read, ne_ssl_clicert_name, ne_ssl_clicert_encrypted, ne_ssl_clicert_decrypt, ne_ssl_clicert_owner, ne_ssl_clicert_free — SSL client certificate handling</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_ssl.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_ssl_client_cert *<b class="fsfunc">ne_ssl_clicert_read</b>(</code>const char *<var xmlns="" class="pdparam">filename</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_ssl_clicert_name</b>(</code>const ne_ssl_client_cert *<var xmlns="" class="pdparam">ccert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_ssl_clicert_encrypted</b>(</code>const ne_ssl_client_cert *<var xmlns="" class="pdparam">ccert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_ssl_clicert_decrypt</b>(</code>ne_ssl_client_cert *<var xmlns="" class="pdparam">ccert</var>, const char *<var xmlns="" class="pdparam">password</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_ssl_certificate *<b class="fsfunc">ne_ssl_clicert_owner</b>(</code>const ne_ssl_client_cert *<var xmlns="" class="pdparam">ccert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_clicert_free</b>(</code>ne_ssl_client_cert *<var xmlns="" class="pdparam">ccert</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2944032"></a><h2>Description</h2><p>The <code class="function">ne_ssl_clicert_read</code> function reads
|
||||
a <em class="firstterm">client certificate</em> from a
|
||||
PKCS#12-formatted file, and returns an
|
||||
<em class="type">ne_ssl_client_cert</em> object. If the client
|
||||
certificate is encrypted, it must be decrypted before it is used.
|
||||
An <em class="type">ne_ssl_client_cert</em> object holds a client
|
||||
certificate and the associated private key, not just a
|
||||
certificate; the term "<em class="glossterm">client certificate</em>"
|
||||
will used to refer to this pair.</p><p>A client certificate can be in one of two states:
|
||||
<span class="emphasis"><em>encrypted</em></span> or <span class="emphasis"><em>decrypted</em></span>.
|
||||
The <code class="function">ne_ssl_clicert_encrypted</code> function will
|
||||
return non-zero if the client certificate is in the
|
||||
<span class="emphasis"><em>encrypted</em></span> state. A client certificate object
|
||||
returned by <code class="function">ne_ssl_clicert_read</code> may be
|
||||
initially in either state, depending on whether the file was
|
||||
encrypted or not.</p><p><code class="function">ne_ssl_clicert_decrypt</code> can be used to
|
||||
decrypt a client certificate using the appropriate password. This
|
||||
function must only be called if the object is in the
|
||||
<span class="emphasis"><em>encrypted</em></span> state; if decryption fails, the
|
||||
certificate state does not change, so decryption can be attempted
|
||||
more than once using different passwords.</p><p>A client certificate can be given a "friendly name" when it
|
||||
is created; <code class="function">ne_ssl_clicert_name</code> will return
|
||||
this name (or <code class="literal">NULL</code> if no friendly name was specified).
|
||||
<code class="function">ne_ssl_clicert_name</code> can be used when the
|
||||
client certificate is in either the encrypted or decrypted state,
|
||||
and will return the same string for the lifetime of the
|
||||
object.</p><p>The function <code class="function">ne_ssl_clicert_owner</code>
|
||||
returns the certificate part of the client certificate; it must
|
||||
only be called if the client certificate is in the
|
||||
<span class="emphasis"><em>decrypted</em></span> state.</p><p>When the client certificate is no longer needed, the
|
||||
<code class="function">ne_ssl_clicert_free</code> function should be used
|
||||
to destroy the object.</p></div><div class="refsect1" lang="en"><a name="id2944170"></a><h2>Return value</h2><p><code class="function">ne_ssl_clicert_read</code> returns a client
|
||||
certificate object, or <code class="literal">NULL</code> if the file could not be read.
|
||||
<code class="function">ne_ssl_clicert_encrypted</code> returns zero if the
|
||||
object is in the decrypted state, or non-zero if it is in the
|
||||
encrypted state. <code class="function">ne_ssl_clicert_name</code> returns
|
||||
a <code class="literal">NUL</code>-terminated friendly name string, or <code class="literal">NULL</code>.
|
||||
<code class="function">ne_ssl_clicert_owner</code> returns a certificate
|
||||
object.</p></div><div class="refsect1" lang="en"><a name="id2944226"></a><h2>Examples</h2><p>The following code reads a client certificate and decrypts
|
||||
it if necessary, then loads it into an HTTP session.</p><pre class="programlisting">ne_ssl_client_cert *ccert;
|
||||
|
||||
ccert = ne_ssl_clicert_read("/path/to/client.p12");
|
||||
|
||||
if (ccert == NULL) {
|
||||
/* handle error... */
|
||||
} else if (ne_ssl_clicert_encrypted(ccert)) {
|
||||
char *password = prompt_for_password();
|
||||
|
||||
if (ne_ssl_clicert_decrypt(ccert, password)) {
|
||||
/* could not decrypt! handle error... */
|
||||
}
|
||||
}
|
||||
|
||||
ne_ssl_set_clicert(sess, ccert);
|
||||
</pre></div><div class="refsect1" lang="en"><a name="id2944249"></a><h2>See also</h2><p><a href="refsslcertio.html#ne_ssl_cert_read">ne_ssl_cert_read</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsslvfy.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refstatus.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_set_verify </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_status</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,32 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>neon-config</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refneon.html" title="neon"><link rel="next" href="refresolve.html" title="ne_addr_resolve"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">neon-config</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refneon.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refresolve.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refconfig"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>neon-config — script providing information about installed copy
|
||||
of neon library</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">neon-config</code> [<code class="option">--prefix</code>] [[<code class="option">--cflags</code>] | [<code class="option">--libs</code>] | [<code class="option">--la-file</code>] | [<code class="option">--support</code> <em class="replaceable"><code>feature</code></em>] | [<code class="option">--help</code>] | [<code class="option">--version</code>]]</p></div></div><div class="refsect1" lang="en"><a name="id2929576"></a><h2>Description</h2><p>The <span><strong class="command">neon-config</strong></span> script provides
|
||||
information about an installed copy of the neon library. The
|
||||
<code class="option">--cflags</code> and <code class="option">--libs</code> options instruct
|
||||
how to compile and link an application against the library; the
|
||||
<code class="option">--version</code> and <code class="option">--support</code> options can
|
||||
help determine whether the library meets the applications
|
||||
requirements.</p></div><div class="refsect1" lang="en"><a name="id2929611"></a><h2>Options</h2><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><code class="option">--cflags</code></span></td><td>Print the flags which should be passed to
|
||||
the C compiler when compiling object files, when the object files use
|
||||
neon header files.</td></tr><tr><td><span class="term"><code class="option">--libs</code></span></td><td>Print the flags which should be passed to
|
||||
the linker when linking an application which uses the neon
|
||||
library</td></tr><tr><td><span class="term"><code class="option">--la-file</code></span></td><td>Print the location of the libtool library
|
||||
script, <code class="filename">libneon.la</code>, which can be used to link against
|
||||
neon by applications using libtool.</td></tr><tr><td><span class="term"><code class="option">--version</code></span></td><td>Print the version of the library</td></tr><tr><td><span class="term"><code class="option">--prefix</code> <em class="replaceable"><code>dir</code></em></span></td><td>If <em class="replaceable"><code>dir</code></em> is given; relocate output of
|
||||
<code class="option">--cflags</code> and <code class="option">--libs</code> as if neon was
|
||||
installed in given prefix directory. Otherwise, print the
|
||||
installation prefix of the library.</td></tr><tr><td><span class="term"><code class="option">--support</code> <em class="replaceable"><code>feature</code></em></span></td><td>The script exits with success if
|
||||
<em class="replaceable"><code>feature</code></em> is supported by the
|
||||
library.</td></tr><tr><td><span class="term"><code class="option">--help</code></span></td><td>Print help message; includes list of known
|
||||
features and whether they are supported or not.</td></tr></tbody></table></div></div><div class="refsect1" lang="en"><a name="example"></a><h2>Example</h2><p>Below is a Makefile fragment which could be used to
|
||||
build an application against an installed neon library, when the
|
||||
<span><strong class="command">neon-config</strong></span> script can be found in
|
||||
<code class="envar">$PATH</code>.</p><pre class="programlisting">CFLAGS = `neon-config --cflags`
|
||||
LIBS = `neon-config --libs`
|
||||
OBJECTS = myapp.o
|
||||
TARGET = myapp
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
||||
|
||||
myapp.o: myapp.c
|
||||
$(CC) $(CFLAGS) -c myapp.c -o myapp.o</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refneon.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refresolve.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">neon </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_addr_resolve</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_get_error</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbufdest.html" title="ne_buffer_destroy"><link rel="next" href="refgetst.html" title="ne_get_status"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_get_error</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbufdest.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refgetst.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="referr"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_get_error, ne_set_error — error handling for HTTP sessions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_session.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_get_error</b>(</code>ne_sesssion *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_error</b>(</code>ne_sesssion *<var xmlns="" class="pdparam">session</var>, const char *<var xmlns="" class="pdparam">format</var>, ...<code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2933302"></a><h2>Description</h2><p>The session error string is used to store any
|
||||
human-readable error information associated with any errors which
|
||||
occur whilst using the HTTP session.</p><p>The <code class="function">ne_get_error</code> function returns the current
|
||||
session error string. This string persists only until it is changed by a
|
||||
subsequent operation on the session.</p><p>The <code class="function">ne_set_error</code> function can be
|
||||
used to set a new session error string, using a
|
||||
<code class="function">printf</code>-style format string interface.</p></div><div class="refsect1" lang="en"><a name="id2933343"></a><h2>Examples</h2><p>Retrieve the current error string:</p><pre class="programlisting">ne_session *sess = ne_session_create(...);
|
||||
...
|
||||
printf("Error was: %s\n", ne_get_error(sess));</pre><p>Set a new error string:</p><pre class="programlisting">ne_session *sess = ne_session_create(...);
|
||||
...
|
||||
ne_set_error(sess, "Response missing header %s", "somestring");</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbufdest.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refgetst.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer_destroy </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_get_status</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,13 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_get_status</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="referr.html" title="ne_get_error"><link rel="next" href="refiaddr.html" title="ne_iaddr_make"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_get_status</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="referr.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refiaddr.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refgetst"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_get_status — retrieve HTTP response status for request</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_request.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_status *<b class="fsfunc">ne_get_status</b>(</code>const ne_request *<var xmlns="" class="pdparam">request</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2932825"></a><h2>Description</h2><p>The <code class="function">ne_get_status</code> function returns
|
||||
a pointer to the HTTP status object giving the result of a request.
|
||||
The object returned only becomes valid once the request has been
|
||||
<span class="emphasis"><em>successfully</em></span> dispatched (the return value of
|
||||
<code class="function">ne_request_dispatch</code> or
|
||||
<code class="function">ne_begin_request</code> was zero). The object remains
|
||||
valid until the associated request object is destroyed.</p></div><div class="refsect1" lang="en"><a name="id2932861"></a><h2>See also</h2><p><a href="refstatus.html#ne_status">ne_status</a>, <a href="refreq.html#ne_request_create">ne_request_create</a></p></div><div class="refsect1" lang="en"><a name="id2933681"></a><h2>Example</h2><p>Display the response status code of applying the
|
||||
<code class="literal">HEAD</code> method to some resource.</p><pre class="programlisting">ne_request *req = ne_request_create(sess, "HEAD", "/foo/bar");
|
||||
if (ne_request_dispatch(req))
|
||||
/* handle errors... */
|
||||
else
|
||||
printf("Response status code was %d\n", ne_get_status(req)->code);
|
||||
ne_request_destroy(req);</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="referr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refiaddr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_get_error </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_iaddr_make</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,37 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_iaddr_make</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refgetst.html" title="ne_get_status"><link rel="next" href="refalloc.html" title="ne_malloc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_iaddr_make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refgetst.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refalloc.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refiaddr"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_iaddr_make, ne_iaddr_cmp, ne_iaddr_print, ne_iaddr_typeof, ne_iaddr_free — functions to manipulate and compare network addresses</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_socket.h>
|
||||
|
||||
typedef enum {
|
||||
ne_iaddr_ipv4 = 0,
|
||||
ne_iaddr_ipv6
|
||||
} <em class="type">ne_iaddr_type</em>;</pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_inet_addr *<b class="fsfunc">ne_iaddr_make</b>(</code>ne_iaddr_type <var xmlns="" class="pdparam">type</var>, const unsigned char *<var xmlns="" class="pdparam">raw</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_iaddr_cmp</b>(</code>const ne_inet_addr *<var xmlns="" class="pdparam">ia1</var>, const ne_inet_addr *<var xmlns="" class="pdparam">ia2</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_iaddr_print</b>(</code>const ne_inet_addr *<var xmlns="" class="pdparam">ia</var>, char *<var xmlns="" class="pdparam">buffer</var>, size_t <var xmlns="" class="pdparam">bufsiz</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_iaddr_type <b class="fsfunc">ne_iaddr_typeof</b>(</code>const ne_inet_addr *<var xmlns="" class="pdparam">ia</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_iaddr_free</b>(</code>const ne_inet_addr *<var xmlns="" class="pdparam">ia</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2934071"></a><h2>Description</h2><p><code class="function">ne_iaddr_make</code> creates an
|
||||
<em class="type">ne_inet_addr</em> object from a raw binary network
|
||||
address; for instance the four bytes <code class="literal">0x7f 0x00 0x00
|
||||
0x01</code> represent the IPv4 address
|
||||
<code class="literal">127.0.0.1</code>. The object returned is suitable for
|
||||
passing to <code class="function">ne_sock_connect</code>. A binary IPv4
|
||||
address contains four bytes; a binary IPv6 address contains
|
||||
sixteen bytes; addresses passed must be in network byte
|
||||
order.</p><p><code class="function">ne_iaddr_cmp</code> can be used to compare two
|
||||
network addresses; returning zero only if they are identical. The
|
||||
addresses need not be of the same address type; if the addresses
|
||||
are not of the same type, the return value is guaranteed to be
|
||||
non-zero.</p><p><code class="function">ne_iaddr_print</code> can be used to print the
|
||||
human-readable string representation of a network address into a
|
||||
buffer, for instance the string
|
||||
<code class="literal">"127.0.0.1"</code>.</p><p><code class="function">ne_iaddr_typeof</code> returns the type of the
|
||||
given network address.</p><p><code class="function">ne_iaddr_free</code> releases the memory
|
||||
associated with a network address object.</p></div><div class="refsect1" lang="en"><a name="id2934159"></a><h2>Return value</h2><p><code class="function">ne_iaddr_make</code> returns <code class="literal">NULL</code> if the
|
||||
address type passed is not supported (for instance on a platform
|
||||
which does not support IPv6).</p><p><code class="function">ne_iaddr_print</code> returns the
|
||||
<code class="parameter">buffer</code> pointer, and never <code class="literal">NULL</code>.</p></div><div class="refsect1" lang="en"><a name="id2934202"></a><h2>Examples</h2><p>The following example connects a socket to port 80 at the
|
||||
address <code class="literal">127.0.0.1</code>.</p><pre class="programlisting">unsigned char addr[] = "\0x7f\0x00\0x00\0x01";
|
||||
ne_inet_addr *ia;
|
||||
|
||||
ia = ne_iaddr_make(ne_iaddr_ipv4, addr);
|
||||
if (ia != NULL) {
|
||||
ne_socket *sock = ne_sock_connect(ia, 80);
|
||||
ne_iaddr_free(ia);
|
||||
/* ... */
|
||||
} else {
|
||||
/* ... */
|
||||
}</pre></div><div class="refsect1" lang="en"><a name="id2934229"></a><h2>See also</h2><p><a href="refresolve.html#ne_addr_resolve">ne_addr_resolve</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refgetst.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refalloc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_get_status </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_malloc</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,68 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>neon</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="ref.html" title="neon API reference"><link rel="next" href="refconfig.html" title="neon-config"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">neon</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refconfig.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refneon"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>neon — HTTP and WebDAV client library</p></div><div class="refsect1" lang="en"><a name="id2928090"></a><h2>Description</h2><p>neon is an HTTP and WebDAV client library. The major
|
||||
abstractions exposed are the HTTP <span class="emphasis"><em>session</em></span>,
|
||||
created by <a href="refsess.html#ne_session_create">ne_session_create</a>; and the HTTP
|
||||
<span class="emphasis"><em>request</em></span>, created by <a href="refreq.html#ne_request_create">ne_request_create</a>. HTTP authentication is handled
|
||||
transparently for server and proxy servers, see <a href="refauth.html#ne_set_server_auth">ne_set_server_auth</a>; complete SSL/TLS support is also
|
||||
included, see <a href="refsslvfy.html#ne_ssl_set_verify">ne_ssl_set_verify</a>.</p></div><div class="refsect1" lang="en"><a name="id2928747"></a><h2>Conventions</h2><p>Some conventions are used throughout the neon API, to
|
||||
provide a consistent and simple interface; these are documented
|
||||
below.</p><div class="refsect2" lang="en"><a name="id2928758"></a><h3>Thread-safeness and global initialization</h3><p>neon itself is implemented to be thread-safe (avoiding any
|
||||
use of global state), but relies on the operating system providing
|
||||
a thread-safe resolver interface. Modern operating systems offer
|
||||
the thread-safe <code class="function">getaddrinfo</code> interface, which
|
||||
neon supports; some others implement
|
||||
<code class="function">gethostbyname</code> using thread-local
|
||||
storage.</p><p>To allow thread-safe use of the OpenSSL library, the
|
||||
application must register some locking callbacks in accordance
|
||||
with the <a href="http://www.openssl.org/docs/crypto/threads.html" target="_top">OpenSSL
|
||||
documentation</a>.</p><p>Some platforms and libraries used by neon require global
|
||||
initialization before use; notably:
|
||||
|
||||
</p><div class="itemizedlist"><ul type="disc"><li>OpenSSL requires global initialization to
|
||||
load shared lookup tables.</li><li>The SOCKS library requires initialization
|
||||
before use.</li><li>The Win32 socket library requires
|
||||
initialization before use.</li></ul></div><p>
|
||||
|
||||
The <a href="refsockinit.html#ne_sock_init">ne_sock_init</a> function should be called
|
||||
before any other use of neon to perform any necessary
|
||||
initialization needed for the particular platform.</p></div><div class="refsect2" lang="en"><a name="id2928833"></a><h3>Namespaces</h3><p>To avoid possible collisions between names used for symbols
|
||||
and preprocessor macros by an application and the libraries it
|
||||
uses, it is good practice for each library to reserve a particular
|
||||
<span class="emphasis"><em>namespace prefix</em></span>. An application which
|
||||
ensures it uses no names with these prefixes is then guaranteed to
|
||||
avoid such collisions.</p><p>The neon library reserves the use of the namespace
|
||||
prefixes <code class="literal">ne_</code> and <code class="literal">NE_</code>. The
|
||||
libraries used by neon may also reserve certain namespaces;
|
||||
collisions between these libraries and a neon-based application
|
||||
will not be detected at compile time, since the underlying library
|
||||
interfaces are not exposed through the neon header files. Such
|
||||
collisions can only be detected at link time, when the linker
|
||||
attempts to resolve symbols. The following list documents some of
|
||||
the namespaces claimed by libraries used by neon; this list may
|
||||
be incomplete.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term">SSL, ssl, TLS, tls, ERR_, BIO_, d2i_, i2d_, ASN1_</span></td><td>Some of the many prefixes used by the OpenSSL
|
||||
library; little attempt has been made to keep exported symbols
|
||||
within any particular prefixes for this
|
||||
library.</td></tr><tr><td><span class="term">XML_, Xml[A-Z]</span></td><td>Namespaces
|
||||
used by the expat library.</td></tr><tr><td><span class="term">xml[A-Z], html[A-Z], docb[A-Z]</span></td><td>Namespaces used by the libxml2 library; a
|
||||
relatively small number of symbols are used without these
|
||||
prefixes.</td></tr></tbody></table></div></div><div class="refsect2" lang="en"><a name="id2928918"></a><h3>Argument validation</h3><p>neon does not attempt to validate that the parameters
|
||||
passed to functions conform to the API (for instance, checking
|
||||
that pointer arguments are not <code class="literal">NULL</code>). Any use of the neon API
|
||||
which is not documented to produce a certain behaviour results is
|
||||
said to produce <span class="emphasis"><em>undefined behaviour</em></span>; it is
|
||||
likely that neon will segfault under these conditions.</p></div><div class="refsect2" lang="en"><a name="id2928933"></a><h3>URI paths, WebDAV metadata</h3><p>The path strings passed to any function must be
|
||||
<span class="emphasis"><em>URI-encoded</em></span> by the application; neon never
|
||||
performs any URI encoding or decoding internally. WebDAV property
|
||||
names and values must be valid UTF-8 encoded Unicode
|
||||
strings.</p></div><div class="refsect2" lang="en"><a name="id2928962"></a><h3>User interaction</h3><p>As a pure library interface, neon will never produce
|
||||
output on <code class="constant">stdout</code> or
|
||||
<code class="constant">stderr</code>; all user interaction is the
|
||||
responsibilty of the application.</p></div><div class="refsect2" lang="en"><a name="id2928986"></a><h3>Memory handling</h3><p>neon does not attempt to cope gracefully with an
|
||||
out-of-memory situation; instead, by default, the
|
||||
<code class="function">abort</code> function is called to immediately
|
||||
terminate the process. An application may register a custom
|
||||
function which will be called before <code class="function">abort</code> in
|
||||
such a situation; see <a href="refalloc.html#ne_oom_callback">ne_oom_callback</a>.</p></div><div class="refsect2" lang="en"><a name="id2929018"></a><h3>Callbacks and userdata</h3><p>Whenever a callback is registered, a
|
||||
<code class="literal">userdata</code> pointer is also used to allow the
|
||||
application to associate a context with the callback. The
|
||||
userdata is of type <em class="type">void *</em>, allowing any pointer to
|
||||
be used.</p></div></div><div class="refsect1" lang="en"><a name="id2929040"></a><h2>See also</h2><p><a href="refsess.html" title="ne_session_create"><span class="refentrytitle">ne_session_create</span></a>, <a href="refalloc.html#ne_oom_callback">ne_oom_callback</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refconfig.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">neon API reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> neon-config</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,28 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_set_useragent</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refresphdr.html" title="ne_get_response_header"><link rel="next" href="refreqopts.html" title="ne_set_request_expect100"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_set_useragent</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refresphdr.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refreqopts.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refopts"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_set_useragent, ne_set_persist, ne_set_read_timeout, ne_get_scheme, ne_get_server_hostport — common properties for HTTP sessions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_session.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_useragent</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, const char *<var xmlns="" class="pdparam">product</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_persist</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, int <var xmlns="" class="pdparam">flag</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_read_timeout</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, int <var xmlns="" class="pdparam">timeout</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_get_scheme</b>(</code>ne_sesssion *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_get_server_hostport</b>(</code>ne_sesssion *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2938401"></a><h2>Description</h2><p>The <code class="literal">User-Agent</code> request header is used
|
||||
to identify the software which generated the request for statistical
|
||||
or debugging purposes. neon does not send a
|
||||
<code class="literal">User-Agent</code> header unless a call is made to the
|
||||
<code class="function">ne_set_useragent</code>.
|
||||
<code class="function">ne_set_useragent</code> must be passed a product string
|
||||
conforming to RFC2616's product token grammar; of the form
|
||||
<code class="literal">"Product/Version"</code>.</p><p>By default neon will use a persistent connection
|
||||
whenever possible. For specific applications, or for debugging
|
||||
purposes, it is sometimes useful to disable persistent connections.
|
||||
The <code class="function">ne_set_persist</code> function will disable
|
||||
persistent connections if passed a <code class="parameter">flag</code>
|
||||
parameter of <code class="literal">0</code>, and will enable them
|
||||
otherwise.</p><p>When neon reads from a socket, by default the read
|
||||
operation will time out after 60 seconds, and the request will fail
|
||||
giving an <span class="errorcode">NE_TIMEOUT</span> error. To configure this
|
||||
timeout interval, call <code class="function">ne_set_read_timeout</code> giving
|
||||
the desired number of seconds as the <code class="parameter">timeout</code>
|
||||
parameter.</p><p>The scheme used to initially create the session will be
|
||||
returned by <code class="function">ne_get_scheme</code>.</p><p>The hostport pair with which the session is associated
|
||||
will be returned by the
|
||||
<code class="function">ne_get_server_hostport</code>; for example
|
||||
<code class="literal">www.example.com:8080</code>. Note that the
|
||||
<code class="literal">:port</code> will be omitted if the default port
|
||||
for the scheme is used.</p></div><div class="refsect1" lang="en"><a name="id2938531"></a><h2>Examples</h2><p>Set a user-agent string:</p><pre class="programlisting">ne_session *sess = ne_session_create(...);
|
||||
ne_set_useragent(sess, "MyApplication/2.1");</pre><p>Disable use of persistent connections:</p><pre class="programlisting">ne_session *sess = ne_session_create(...);
|
||||
ne_set_persist(sess, 0);</pre><p>Set a 30 second read timeout:</p><pre class="programlisting">ne_session *sess = ne_session_create(...);
|
||||
ne_set_read_timeout(sess, 30);</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refresphdr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refreqopts.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_get_response_header </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_set_request_expect100</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_request_create</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsess.html" title="ne_session_create"><link rel="next" href="refreqhdr.html" title="ne_add_request_header"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_request_create</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsess.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refreqhdr.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refreq"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_request_create, ne_request_dispatch, ne_request_destroy — low-level HTTP request handling</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_request.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_request *<b class="fsfunc">ne_request_create</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, const char *<var xmlns="" class="pdparam">method</var>, const char *<var xmlns="" class="pdparam">path</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_request_dispatch</b>(</code>ne_request *<var xmlns="" class="pdparam">req</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_request_destroy</b>(</code>ne_request *<var xmlns="" class="pdparam">req</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2935337"></a><h2>Description</h2><p>An HTTP request, represented by the
|
||||
<em class="type">ne_request</em> type, specifies that some operation is to be
|
||||
performed on some resource. The
|
||||
<code class="function">ne_request_create</code> function creates a request
|
||||
object, specifying the operation in the <code class="parameter">method</code>
|
||||
parameter. The location of the resource is determined by the server in
|
||||
use for the session given by the <code class="parameter">sess</code>
|
||||
parameter, combined with the <code class="parameter">path</code> parameter.</p><p>The <code class="parameter">path</code> string used must conform to the
|
||||
<code class="literal">abs_path</code> definition given in RFC2396, with an
|
||||
optional "?query" part, and must be URI-escaped by the caller (for
|
||||
instance, using <code class="function">ne_path_escape</code>). If the string
|
||||
comes from an untrusted source, failure to perform URI-escaping
|
||||
results in a security vulnerability.</p><p>To dispatch a request, and process the response, the
|
||||
<code class="function">ne_request_dispatch</code> function can be used. An
|
||||
alternative is to use the (more complex, but more flexible)
|
||||
combination of the <code class="function">ne_begin_request</code>,
|
||||
<code class="function">ne_end_request</code>, and
|
||||
<code class="function">ne_read_response_block</code> functions; see
|
||||
<code class="function">ne_begin_request</code>.</p><p>To add extra headers in the request, the functions <a href="refreqhdr.html#ne_add_request_header">ne_add_request_header</a> and <a href="refreqhdr.html#ne_print_request_header">ne_print_request_header</a> can be used. To include a message
|
||||
body with the request, one of the functions
|
||||
<code class="function">ne_set_request_body_buffer</code>, <a href="refreqbody.html#ne_set_request_body_fd">ne_set_request_body_fd</a>, or
|
||||
<code class="function">ne_set_request_body_provider</code> can be used.</p><p>The return value of
|
||||
<code class="function">ne_request_dispatch</code> indicates merely whether the
|
||||
request was sent and the response read successfully. To discover the
|
||||
result of the operation, <a href="refgetst.html#ne_get_status">ne_get_status</a>, along with
|
||||
any processing of the response headers and message body.</p><p>A request can only be dispatched once: calling
|
||||
<code class="function">ne_request_dispatch</code> more than once on a single
|
||||
<em class="type">ne_request</em> object produces undefined behaviour. Once all
|
||||
processing associated with the request object is complete, use the
|
||||
<code class="function">ne_request_destroy</code> function to destroy the
|
||||
resources associated with it. Any subsequent use of the request
|
||||
object produces undefined behaviour.</p></div><div class="refsect1" lang="en"><a name="id2936417"></a><h2>Return value</h2><p>The <code class="function">ne_request_create</code> function
|
||||
returns a pointer to a request object (and never <code class="literal">NULL</code>).</p><p>The <code class="function">ne_request_dispatch</code> function
|
||||
returns zero if the request was dispatched successfully, and a
|
||||
non-zero error code otherwise.</p></div><div class="refsect1" lang="en"><a name="id2936456"></a><h2>Errors</h2><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="errorcode">NE_ERROR</span></span></td><td>Request failed (see session error string)</td></tr><tr><td><span class="term"><span class="errorcode">NE_LOOKUP</span></span></td><td>The DNS lookup for the server (or proxy server) failed.</td></tr><tr><td><span class="term"><span class="errorcode">NE_AUTH</span></span></td><td>Authentication failed on the server.</td></tr><tr><td><span class="term"><span class="errorcode">NE_PROXYAUTH</span></span></td><td>Authentication failed on the proxy server.</td></tr><tr><td><span class="term"><span class="errorcode">NE_CONNECT</span></span></td><td>A connection to the server could not be established.</td></tr><tr><td><span class="term"><span class="errorcode">NE_TIMEOUT</span></span></td><td>A timeout occurred while waiting for the server to respond.</td></tr></tbody></table></div></div><div class="refsect1" lang="en"><a name="id2936562"></a><h2>Example</h2><p>An example of applying a <code class="literal">MKCOL</code>
|
||||
operation to the resource at the location
|
||||
<code class="literal">http://www.example.com/foo/bar/</code>:</p><pre class="programlisting">ne_session *sess = ne_session_create("http", "www.example.com", 80);
|
||||
ne_request *req = ne_request_create(sess, "MKCOL", "/foo/bar/");
|
||||
if (ne_request_dispatch(req)) {
|
||||
printf("Request failed: %s\n", ne_get_error(sess));
|
||||
}
|
||||
ne_request_destroy(req);</pre></div><div class="refsect1" lang="en"><a name="id2936595"></a><h2>See also</h2><p><a href="referr.html#ne_get_error">ne_get_error</a>, <a href="referr.html#ne_set_error">ne_set_error</a>, <a href="refgetst.html#ne_get_status">ne_get_status</a>, <a href="refreqhdr.html#ne_add_request_header">ne_add_request_header</a>, <a href="refreqbody.html#ne_set_request_body_buffer">ne_set_request_body_buffer</a>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsess.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refreqhdr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_session_create </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_add_request_header</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_set_request_body_buffer</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refreqopts.html" title="ne_set_request_expect100"><link rel="next" href="refauth.html" title="ne_set_server_auth"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_set_request_body_buffer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refreqopts.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refauth.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refreqbody"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_set_request_body_buffer, ne_set_request_body_fd — include a message body with a request</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_request.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_request_body_buffer</b>(</code>ne_request *<var xmlns="" class="pdparam">req</var>, const char *<var xmlns="" class="pdparam">buf</var>, size_t <var xmlns="" class="pdparam">count</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2938928"></a><h2>Description</h2><p>The <code class="function">ne_set_request_body_buffer</code>
|
||||
function specifies that a message body should be included with the
|
||||
body, which is stored in the <code class="parameter">count</code> bytes buffer
|
||||
<code class="parameter">buf</code>.</p></div><div class="refsect1" lang="en"><a name="id2938985"></a><h2>See also</h2><p><a href="refreq.html#ne_request_create">ne_request_create</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refreqopts.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refauth.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_set_request_expect100 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_set_server_auth</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_add_request_header</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refreq.html" title="ne_request_create"><link rel="next" href="refresphdr.html" title="ne_get_response_header"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_add_request_header</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refreq.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refresphdr.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refreqhdr"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_add_request_header, ne_print_request_header — add headers to a request</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_request.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_add_request_header</b>(</code>ne_request *<var xmlns="" class="pdparam">request</var>, const char *<var xmlns="" class="pdparam">name</var>, const char *<var xmlns="" class="pdparam">value</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_print_request_header</b>(</code>ne_request *<var xmlns="" class="pdparam">request</var>, const char *<var xmlns="" class="pdparam">name</var>, const char *<var xmlns="" class="pdparam">format</var>, ...<code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2937312"></a><h2>Description</h2><p>The functions <code class="function">ne_add_request_header</code>
|
||||
and <code class="function">ne_print_request_header</code> can be used to add
|
||||
headers to a request, before it is sent.</p><p><code class="function">ne_add_request_header</code> simply adds a
|
||||
header of given <code class="parameter">name</code>, with given
|
||||
<code class="parameter">value</code>.</p><p><code class="function">ne_print_request_header</code> adds a
|
||||
header of given <code class="parameter">name</code>, taking the value from the
|
||||
<code class="function">printf</code>-like <code class="parameter">format</code> string
|
||||
parameter and subsequent variable-length argument list.</p></div><div class="refsect1" lang="en"><a name="id2937384"></a><h2>See also</h2><p><a href="refreq.html#ne_request_create">ne_request_create</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refreq.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refresphdr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_request_create </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_get_response_header</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,16 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_set_request_expect100</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refopts.html" title="ne_set_useragent"><link rel="next" href="refreqbody.html" title="ne_set_request_body_buffer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_set_request_expect100</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refopts.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refreqbody.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refreqopts"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_set_request_expect100 — function to enable Expect: 100-continue support</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_request.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_set_request_expect100</b>(</code>ne_request *<var xmlns="" class="pdparam">request</var>, int <var xmlns="" class="pdparam">flag</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2939023"></a><h2>Description</h2><p>An extension introduced in the HTTP/1.1 specification was
|
||||
the use of the <code class="literal">Expect: 100-continue</code> header.
|
||||
This header allows an HTTP client to be informed of the expected
|
||||
response status before the request message body is sent: a useful
|
||||
optimisation for situations where a large message body is to be
|
||||
sent. The <code class="function">ne_set_request_expect100</code> function
|
||||
can be used to enable this feature by passing the
|
||||
<code class="parameter">flag</code> parameter as any non-zero
|
||||
integer.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Unfortunately, if this header is sent to a server
|
||||
which is not fully compliant with the HTTP/1.1 specification, a
|
||||
deadlock occurs resulting in a temporarily "hung" connection.
|
||||
neon will recover gracefully from this situation, but only after a
|
||||
15 second timeout. It is highly recommended that this option is
|
||||
not enabled unless it is known that the server in use correctly
|
||||
implements <code class="literal">Expect: 100-continue</code>
|
||||
support.</p></div></div><div class="refsect1" lang="en"><a name="id2939075"></a><h2>See also</h2><p><a href="refreq.html#ne_request_create">ne_request_create</a>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refopts.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refreqbody.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_set_useragent </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_set_request_body_buffer</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,48 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_addr_resolve</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refconfig.html" title="neon-config"><link rel="next" href="refbuf.html" title="ne_buffer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_addr_resolve</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refconfig.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refbuf.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refresolve"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_addr_resolve, ne_addr_result, ne_addr_first, ne_addr_next, ne_addr_error, ne_addr_destroy — functions to resolve hostnames to addresses</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_socket.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_sock_addr *<b class="fsfunc">ne_addr_resolve</b>(</code>const char *<var xmlns="" class="pdparam">hostname</var>, int <var xmlns="" class="pdparam">flags</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_addr_result</b>(</code>const ne_sock_addr *<var xmlns="" class="pdparam">addr</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_inet_addr *<b class="fsfunc">ne_addr_first</b>(</code>ne_sock_addr *<var xmlns="" class="pdparam">addr</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const ne_inet_addr *<b class="fsfunc">ne_addr_next</b>(</code>ne_sock_addr *<var xmlns="" class="pdparam">addr</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_addr_error</b>(</code>const ne_sock_addr *<var xmlns="" class="pdparam">addr</var>, char *<var xmlns="" class="pdparam">buffer</var>, size_t <var xmlns="" class="pdparam">bufsiz</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_addr_destroy</b>(</code>ne_sock_addr *<var xmlns="" class="pdparam">addr</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2930350"></a><h2>Description</h2><p>The <code class="function">ne_addr_resolve</code> function resolves
|
||||
the given <code class="parameter">hostname</code>, returning an
|
||||
<em class="type">ne_sock_addr</em> object representing the address (or
|
||||
addresses) associated with the hostname. The
|
||||
<code class="parameter">flags</code> parameter is currently unused, and
|
||||
must be passed as 0.</p><p>The <code class="parameter">hostname</code> passed to
|
||||
<code class="function">ne_addr_resolve</code> can be a DNS hostname
|
||||
(e.g. <code class="literal">"www.example.com"</code>) or an IPv4 dotted quad
|
||||
(e.g. <code class="literal">"192.0.34.72"</code>); or, on systems which
|
||||
support IPv6, an IPv6 hex address, which may be enclosed in
|
||||
brackets, e.g. <code class="literal">"[::1]"</code>.</p><p>To determine whether the hostname was successfully resolved,
|
||||
the <code class="function">ne_addr_result</code> function is used, which
|
||||
returns non-zero if an error occurred. If an error did occur, the
|
||||
<code class="function">ne_addr_error</code> function can be used, which
|
||||
will copy the error string into a given
|
||||
<code class="parameter">buffer</code> (of size
|
||||
<code class="parameter">bufsiz</code>).</p><p>The functions <code class="function">ne_addr_first</code> and
|
||||
<code class="function">ne_addr_next</code> are used to retrieve the
|
||||
Internet addresses associated with an address object which has
|
||||
been successfully resolved. <code class="function">ne_addr_first</code>
|
||||
returns the first address; <code class="function">ne_addr_next</code>
|
||||
returns the next address after the most recent call to
|
||||
<code class="function">ne_addr_next</code> or
|
||||
<code class="function">ne_addr_first</code>, or <code class="literal">NULL</code> if there are no more
|
||||
addresses. The <em class="type">ne_inet_addr</em> pointer returned by
|
||||
these functions can be passed to
|
||||
<code class="function">ne_sock_connect</code> to connect a socket.</p><p>After the address object has been used, it should be
|
||||
destroyed using <code class="function">ne_addr_destroy</code>.</p></div><div class="refsect1" lang="en"><a name="id2930524"></a><h2>Return value</h2><p><code class="function">ne_addr_resolve</code> returns a pointer to an
|
||||
address object, and never <code class="literal">NULL</code>.
|
||||
<code class="function">ne_addr_error</code> returns the
|
||||
<code class="parameter">buffer</code> parameter .</p></div><div class="refsect1" lang="en"><a name="id2930558"></a><h2>Examples</h2><p>The code below prints out the set of addresses associated
|
||||
with the hostname <code class="literal">www.google.com</code>.</p><pre class="programlisting">ne_sock_addr *addr;
|
||||
char buf[256];
|
||||
|
||||
addr = ne_addr_resolve("www.google.com", 0);
|
||||
if (ne_addr_result(addr)) {
|
||||
printf("Could not resolve www.google.com: %s\n",
|
||||
ne_addr_error(addr, buf, sizeof buf));
|
||||
} else {
|
||||
const ne_inet_addr *ia;
|
||||
printf("www.google.com:");
|
||||
for (ia = ne_addr_first(addr); ia != NULL; ia = ne_addr_next(addr)) {
|
||||
printf(" %s", ne_iaddr_print(ia, buf, sizeof buf));
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
ne_addr_destroy(addr);
|
||||
</pre></div><div class="refsect1" lang="en"><a name="id2930589"></a><h2>See also</h2><p><a href="refiaddr.html#ne_iaddr_print">ne_iaddr_print</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refconfig.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refbuf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">neon-config </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_buffer</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_get_response_header</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refreqhdr.html" title="ne_add_request_header"><link rel="next" href="refopts.html" title="ne_set_useragent"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_get_response_header</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refreqhdr.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refopts.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refresphdr"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_get_response_header, ne_response_header_iterate — functions to access response headers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_request.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_get_response_header</b>(</code>ne_request *<var xmlns="" class="pdparam">request</var>, const char *<var xmlns="" class="pdparam">name</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void *<b class="fsfunc">ne_response_header_iterate</b>(</code>ne_request *<var xmlns="" class="pdparam">request</var>, void *<var xmlns="" class="pdparam">cursor</var>, const char **<var xmlns="" class="pdparam">name</var>, const char **<var xmlns="" class="pdparam">value</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2937746"></a><h2>Description</h2><p>To retrieve the value of a response header field, the
|
||||
<code class="function">ne_get_response_header</code> function can be used,
|
||||
and is given the name of the header to return.</p><p>To iterate over all the response headers returned, the
|
||||
<code class="function">ne_response_header_iterate</code> function can be
|
||||
used. This function takes a <code class="parameter">cursor</code>
|
||||
parameter which should be <code class="literal">NULL</code> to retrieve the first header. The
|
||||
function stores the name and value of the next header header in
|
||||
the <code class="parameter">name</code> and <code class="parameter">value</code>
|
||||
parameters, and returns a new cursor pointer which can be passed
|
||||
to <code class="function">ne_response_header_iterate</code> to retrieve the
|
||||
next header.</p></div><div class="refsect1" lang="en"><a name="id2937809"></a><h2>Return value</h2><p><code class="function">ne_get_response_header</code> returns a
|
||||
string, or <code class="literal">NULL</code> if no header with that name was given. If used
|
||||
during request processing, the return value pointer is valid only
|
||||
until the next call to <code class="function">ne_begin_request</code>, or
|
||||
else, until the request object is destroyed.</p><p>Likewise, the cursor, names, and values returned by
|
||||
<code class="function">ne_response_header_iterate</code> are only valid
|
||||
until the next call to <code class="function">ne_begin_request</code> or
|
||||
until the request object is destroyed.</p></div><div class="refsect1" lang="en"><a name="id2937858"></a><h2>Examples</h2><p>The following code will output the value of the
|
||||
<code class="literal">Last-Modified</code> header for a resource:</p><pre class="programlisting">ne_request *req = ne_request_create(sess, "GET", "/foo.txt");
|
||||
if (ne_request_dispatch(req) == NE_OK) {
|
||||
const char *mtime = ne_get_response_header(req, "Last-Modified");
|
||||
if (mtime) {
|
||||
printf("/foo.txt has last-modified value %s\n", mtime);
|
||||
}
|
||||
}
|
||||
ne_request_destroy(req);</pre></div><div class="refsect1" lang="en"><a name="id2937886"></a><h2>See also</h2><p><a href="refreq.html#ne_request_create">ne_request_create</a>, <a href="refreq.html#ne_request_destroy">ne_request_destroy</a>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refreqhdr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refopts.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_add_request_header </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_set_useragent</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_session_create</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refalloc.html" title="ne_malloc"><link rel="next" href="refreq.html" title="ne_request_create"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_session_create</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refalloc.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refreq.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsess"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_session_create, ne_close_connection, ne_session_proxy, ne_session_destroy — set up HTTP sessions</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_session.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_session *<b class="fsfunc">ne_session_create</b>(</code>const char *<var xmlns="" class="pdparam">scheme</var>, const char *<var xmlns="" class="pdparam">hostname</var>, unsigned int <var xmlns="" class="pdparam">port</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_session_proxy</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, const char *<var xmlns="" class="pdparam">hostname</var>, unsigned int <var xmlns="" class="pdparam">port</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_close_connection</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_session_destroy</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2935438"></a><h2>Description</h2><p>An <em class="type">ne_session</em> object represents an HTTP
|
||||
session - a logical grouping of a sequence of HTTP requests made to a
|
||||
certain server. Any requests made using the session can use a
|
||||
persistent connection, share cached authentication credentials and any
|
||||
other common attributes.</p><p>A new HTTP session is created using
|
||||
<code class="function">ne_session_create</code>, giving the
|
||||
<code class="parameter">hostname</code> and <code class="parameter">port</code> of the
|
||||
server to use, along with the <code class="parameter">scheme</code> used to
|
||||
contact the server (usually <code class="literal">"http"</code>). Before the
|
||||
first use of <code class="function">ne_session_create</code> in a process,
|
||||
<a href="refsockinit.html#ne_sock_init">ne_sock_init</a> must have been called to perform any
|
||||
global initialization needed by any libraries used by neon.</p><p>To enable SSL/TLS for the session, pass the string
|
||||
<code class="literal">"https"</code> as the <code class="parameter">scheme</code>
|
||||
parameter, and either register a certificate verification function
|
||||
(see <a href="refsslvfy.html#ne_ssl_set_verify">ne_ssl_set_verify</a>) or trust the appropriate
|
||||
certificate (see <a href="refsslca.html#ne_ssl_trust_cert">ne_ssl_trust_cert</a>, <a href="refsslca.html#ne_ssl_trust_default_ca">ne_ssl_trust_default_ca</a>).</p><p>If an HTTP proxy server should be used for the session,
|
||||
<code class="function">ne_session_proxy</code> must be called giving the
|
||||
hostname and port on which to contact the proxy.</p><p>If it is known that the session will not be used for a
|
||||
significant period of time, <code class="function">ne_close_connection</code>
|
||||
can be called to close the connection, if one remains open. Use of
|
||||
this function is entirely optional, but it must not be called if there
|
||||
is a request active using the session.</p><p>Once a session has been completed,
|
||||
<code class="function">ne_session_destroy</code> must be called to destroy the
|
||||
resources associated with the session. Any subsequent use of the
|
||||
session pointer produces undefined behaviour.</p></div><div class="refsect1" lang="en"><a name="id2935580"></a><h2>Notes</h2><p>The hostname passed to
|
||||
<code class="function">ne_session_create</code> is resolved when the first
|
||||
request using the session is dispatched; a DNS resolution failure can
|
||||
only be detected at that time (using the <code class="literal">NE_LOOKUP</code>
|
||||
error code); see <a href="refreq.html#ne_request_dispatch">ne_request_dispatch</a> for
|
||||
details.</p></div><div class="refsect1" lang="en"><a name="id2935611"></a><h2>Return Values</h2><p><code class="function">ne_session_create</code> will return
|
||||
a pointer to a new session object (and never <code class="literal">NULL</code>).</p></div><div class="refsect1" lang="en"><a name="id2935633"></a><h2>Examples</h2><p>Create and destroy a session:</p><pre class="programlisting">ne_session *sess;
|
||||
sess = ne_session_create("http", "host.example.com", 80);
|
||||
/* ... use sess ... */
|
||||
ne_session_destroy(sess);
|
||||
</pre></div><div class="refsect1" lang="en"><a name="id2935651"></a><h2>See Also</h2><p><a href="refsslvfy.html#ne_ssl_set_verify">ne_ssl_set_verify</a>, <a href="refsslca.html#ne_ssl_trust_cert">ne_ssl_trust_cert</a>, <a href="refsockinit.html#ne_sock_init">ne_sock_init</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refalloc.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refreq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_malloc </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_request_create</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_shave</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refauth.html" title="ne_set_server_auth"><link rel="next" href="refsockinit.html" title="ne_sock_init"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_shave</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refauth.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsockinit.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refshave"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_shave — trim whitespace from a string</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_string.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_shave</b>(</code>char *<var xmlns="" class="pdparam">str</var>, const char *<var xmlns="" class="pdparam">whitespace</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2940306"></a><h2>Description</h2><p><code class="function">ne_shave</code> returns a portion of
|
||||
<code class="parameter">str</code> with any leading or trailing characters in
|
||||
the <code class="parameter">whitespace</code> array removed.
|
||||
<code class="parameter">str</code> may be modified. Note that the return
|
||||
value may not be equal to <code class="parameter">str</code>.</p></div><div class="refsect1" lang="en"><a name="id2940345"></a><h2>Examples</h2><p>The following code segment will output
|
||||
<code class="literal">"fish"</code>:</p><pre class="programlisting">char s[] = ".!.fish!.!";
|
||||
puts(ne_shave(s, ".!"));</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refauth.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsockinit.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_set_server_auth </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_sock_init</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_sock_init</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refshave.html" title="ne_shave"><link rel="next" href="refcert.html" title="ne_ssl_cert_identity"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_sock_init</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refshave.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refcert.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsockinit"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_sock_init — perform library initialization</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_socket.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_sock_init</b>(</code><code xmlns="">void)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2940204"></a><h2>Description</h2><p>In some platforms and configurations, neon may be using
|
||||
some socket or SSL libraries which require global initialization
|
||||
before use. To perform this initialization, the
|
||||
<code class="function">ne_sock_init</code> function must be called once
|
||||
before any other library functions are used.</p></div><div class="refsect1" lang="en"><a name="id2940225"></a><h2>Return value</h2><p><code class="function">ne_sock_init</code> returns zero on success,
|
||||
or non-zero on error. If an error occurs, no further use of the
|
||||
neon library should be attempted.</p></div><div class="refsect1" lang="en"><a name="id2940244"></a><h2>See also</h2><p><a href="refneon.html" title="neon"><span class="refentrytitle">neon</span></a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refshave.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refcert.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_shave </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_cert_identity</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,15 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_trust_cert</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refssldname.html" title="ne_ssl_dname"><link rel="next" href="refsslvfy.html" title="ne_ssl_set_verify"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_trust_cert</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refssldname.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsslvfy.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsslca"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_trust_cert, ne_ssl_trust_default_ca — functions to indicate that certificates are trusted</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_session.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_trust_cert</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_trust_default_ca</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2942809"></a><h2>Description</h2><p>To indicate that a given certificate is trusted by the
|
||||
user, the certificate object can be passed to
|
||||
<code class="function">ne_ssl_trust_cert</code>. The certificate object is
|
||||
duplicated internally and can subequently be destroyed.</p><p>The SSL library in use by neon may include a default
|
||||
set of CA certificates; calling the
|
||||
<code class="function">ne_ssl_trust_default_ca</code> function will indicate
|
||||
that these CAs are trusted by the user.</p></div><div class="refsect1" lang="en"><a name="id2942840"></a><h2>Examples</h2><p>Load the CA certificate stored in <code class="filename">/path/to/cacert.pem</code>:</p><pre class="programlisting">ne_session *sess = ne_session_create(...);
|
||||
ne_ssl_certificate *cert = ne_ssl_cert_read("/path/to/cacert.pem");
|
||||
|
||||
if (cert) {
|
||||
ne_ssl_trust_cert(sess, cert);
|
||||
ne_ssl_cert_free(cert);
|
||||
} else {
|
||||
printf("Could not load CA cert: %s\n", ne_get_error(sess));
|
||||
}</pre></div><div class="refsect1" lang="en"><a name="id2942868"></a><h2>See also</h2><p><a href="refsslcertio.html#ne_ssl_cert_read">ne_ssl_cert_read</a>, <a href="refsslcertio.html#ne_ssl_cert_import">ne_ssl_cert_import</a>, <a href="refsslcert2.html#ne_ssl_cert_free">ne_ssl_cert_free</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refssldname.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsslvfy.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_dname </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_set_verify</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_cert_cmp</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refcert.html" title="ne_ssl_cert_identity"><link rel="next" href="refsslcertio.html" title="ne_ssl_cert_read"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_cert_cmp</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refcert.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsslcertio.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsslcert2"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_cert_cmp, ne_ssl_cert_free — functions to operate on certificate objects</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_header.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_ssl_cert_cmp</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">c1</var>, const ne_ssl_certificate *<var xmlns="" class="pdparam">c2</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_cert_free</b>(</code>ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2941470"></a><h2>Description</h2><p>The <code class="function">ne_ssl_cert_cmp</code> function can be
|
||||
used to compare two certificate objects; it returns zero if they
|
||||
refer to the same certificate, and non-zero otherwise.</p><p>The <code class="function">ne_ssl_cert_free</code> function can be
|
||||
used to destroy a certificate object when it is no longer
|
||||
needed.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refcert.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsslcertio.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_cert_identity </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_cert_read</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_cert_read</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsslcert2.html" title="ne_ssl_cert_cmp"><link rel="next" href="refssldname.html" title="ne_ssl_dname"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_cert_read</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsslcert2.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refssldname.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsslcertio"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_cert_read, ne_ssl_cert_write, ne_ssl_cert_import, ne_ssl_cert_export — functions to read or write certificates to and from files or strings</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_ssl.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_ssl_certificate *<b class="fsfunc">ne_ssl_cert_read</b>(</code>const char *<var xmlns="" class="pdparam">filename</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_ssl_cert_write</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var>, const char *<var xmlns="" class="pdparam">filename</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_ssl_certificate *<b class="fsfunc">ne_ssl_cert_import</b>(</code>const char *<var xmlns="" class="pdparam">data</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_ssl_cert_export</b>(</code>const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2941457"></a><h2>Description</h2><p>The <code class="function">ne_ssl_cert_write</code> function writes a
|
||||
certificate to a file using the PEM encoding. The
|
||||
<code class="function">ne_ssl_cert_export</code> function returns a
|
||||
base64-encoded <code class="literal">NUL</code>-terminated string representing the
|
||||
certificate. This string is malloc-allocated and should be
|
||||
destroyed using <code class="function">free</code> by the caller.</p><p>The <code class="function">ne_ssl_cert_read</code> function reads a
|
||||
certificate from a PEM-encoded file, and returns a certificate
|
||||
object. The <code class="function">ne_ssl_cert_import</code> function
|
||||
returns a certificate object from a base64-encoded string,
|
||||
<code class="parameter">data</code>, as returned by
|
||||
<code class="function">ne_ssl_cert_export</code>. The certificate object
|
||||
returned by these functions should be destroyed using <a href="refsslcert2.html#ne_ssl_cert_free">ne_ssl_cert_free</a> after use.</p></div><div class="refsect1" lang="en"><a name="id2941869"></a><h2>Return value</h2><p><code class="function">ne_ssl_cert_read</code> returns <code class="literal">NULL</code> if a
|
||||
certificate could not be read from the file.
|
||||
<code class="function">ne_ssl_cert_write</code> returns non-zero if the
|
||||
certificate could not be written to the file.
|
||||
<code class="function">ne_ssl_cert_export</code> always returns a
|
||||
<code class="literal">NUL</code>-terminated string, and never <code class="literal">NULL</code>.
|
||||
<code class="function">ne_ssl_cert_import</code> returns <code class="literal">NULL</code> if the
|
||||
string was not a valid base64-encoded certificate.</p></div><div class="refsect1" lang="en"><a name="id2941929"></a><h2>Encoding Formats</h2><p>The string produced by
|
||||
<code class="function">ne_ssl_cert_export</code> is the base64 encoding of
|
||||
the DER representation of the certificate. The file written by
|
||||
<code class="function">ne_ssl_cert_write</code> uses the PEM format: this
|
||||
is the base64 encoding of the DER representation with newlines
|
||||
every 64 characters, and start and end marker lines.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsslcert2.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refssldname.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_cert_cmp </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_dname</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,9 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_dname</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsslcertio.html" title="ne_ssl_cert_read"><link rel="next" href="refsslca.html" title="ne_ssl_trust_cert"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_dname</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsslcertio.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsslca.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refssldname"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_readable_dname, ne_ssl_dname_cmp — SSL distinguished name handling</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_ssl.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_ssl_readable_dname</b>(</code>const ne_ssl_dname *<var xmlns="" class="pdparam">dname</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_ssl_dname_cmp</b>(</code>const ne_ssl_dname *<var xmlns="" class="pdparam">dn1</var>, const ne_ssl_dname *<var xmlns="" class="pdparam">dn2</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2942382"></a><h2>Description</h2><p>The <code class="function">ne_ssl_readable_dname</code> function
|
||||
creates a single-line, human-readable string out of an
|
||||
<em class="type">ne_ssl_dname</em> object. The returned string is
|
||||
<code class="function">malloc</code>()-allocated, and must be
|
||||
<code class="function">free</code>()d by the caller.</p><p>The <code class="function">ne_ssl_dname_cmp</code> function
|
||||
compares two distinguished names, and returns zero if they are
|
||||
equal, or non-zero otherwise.</p></div><div class="refsect1" lang="en"><a name="id2942427"></a><h2>Return value</h2><p><code class="function">ne_ssl_readable_dname</code> returns a <code class="function">malloc</code>-allocated
|
||||
string, and never <code class="literal">NULL</code>.</p></div><div class="refsect1" lang="en"><a name="id2942455"></a><h2>Examples</h2><p>See <a href="refcert.html#ne_ssl_cert_subject">ne_ssl_cert_subject</a> for an example
|
||||
use of <code class="function">ne_ssl_readable_dname</code>.</p></div><div class="refsect1" lang="en"><a name="id2942478"></a><h2>See also</h2><p><a href="refcert.html#ne_ssl_cert_subject">ne_ssl_cert_subject</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsslcertio.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsslca.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_cert_read </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_trust_cert</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_ssl_set_verify</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refsslca.html" title="ne_ssl_trust_cert"><link rel="next" href="refclicert.html" title="ne_ssl_client_cert"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_ssl_set_verify</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refsslca.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refclicert.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refsslvfy"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_ssl_set_verify — register an SSL certificate verification callback</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_session.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">typedef int <b class="fsfunc">ne_ssl_verify_fn</b>(</code>void *<var xmlns="" class="pdparam">userdata</var>, int <var xmlns="" class="pdparam">failures</var>, const ne_ssl_certificate *<var xmlns="" class="pdparam">cert</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_ssl_set_verify</b>(</code>ne_session *<var xmlns="" class="pdparam">session</var>, ne_ssl_verify_fn <var xmlns="" class="pdparam">verify_fn</var>, void *<var xmlns="" class="pdparam">userdata</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2943206"></a><h2>Description</h2><p>To enable manual SSL certificate verification, a
|
||||
callback can be registered using
|
||||
<code class="function">ne_ssl_set_verify</code>. If such a callback is not
|
||||
registered, when a connection is established to an SSL server which
|
||||
does not present a certificate signed by a trusted CA (see <a href="refsslca.html#ne_ssl_trust_cert">ne_ssl_trust_cert</a>), or if the certificate presented is invalid in
|
||||
some way, the connection will fail.</p><p>When the callback is invoked, the
|
||||
<code class="parameter">failures</code> parameter gives a bitmask indicating
|
||||
in what way the automatic certificate verification failed. The value
|
||||
is equal to the bit-wise OR of one or more of the following
|
||||
constants (and is guaranteed to be non-zero):</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><code class="constant">NE_SSL_NOTYETVALID</code></span></td><td>The certificate is not yet valid.</td></tr><tr><td><span class="term"><code class="constant">NE_SSL_EXPIRED</code></span></td><td>The certificate has expired.</td></tr><tr><td><span class="term"><code class="constant">NE_SSL_IDMISMATCH</code></span></td><td>The hostname used for the session does not match
|
||||
the hostname to which the certificate was issued.</td></tr><tr><td><span class="term"><code class="constant">NE_SSL_UNTRUSTED</code></span></td><td>The Certificate Authority which signed the certificate
|
||||
is not trusted.</td></tr></tbody></table></div><p>Note that if either of the
|
||||
<code class="constant">NE_SSL_IDMISMATCH</code> or
|
||||
<code class="constant">NE_SSL_UNTRUSTED</code> failures is given, the
|
||||
connection may have been intercepted by a third party, and
|
||||
must not be presumed to be “<span class="quote">secure</span>”.</p><p>The <code class="parameter">cert</code> parameter passed to the
|
||||
callback represents the certificate which was presented by the server.
|
||||
If the server presented a chain of certificates, the chain can be
|
||||
accessed using <a href="refcert.html#ne_ssl_cert_signedby">ne_ssl_cert_signedby</a>. The
|
||||
<code class="parameter">cert</code> object given is not valid after the
|
||||
callback returns.</p></div><div class="refsect1" lang="en"><a name="id2943350"></a><h2>Return value</h2><p>The verification callback must return zero to indicate
|
||||
that the certificate should be trusted; and non-zero otherwise (in
|
||||
which case, the connection will fail).</p></div><div class="refsect1" lang="en"><a name="id2943363"></a><h2>Examples</h2><p>The following code implements an example verification
|
||||
callback, using the <code class="function">dump_cert</code> function
|
||||
from <a href="refcert.html#ne_ssl_cert_subject">ne_ssl_cert_subject</a> to display
|
||||
certification information. Notice that the hostname of the
|
||||
server used for the session is passed as the
|
||||
<code class="parameter">userdata</code> parameter to the
|
||||
callback.</p><pre class="programlisting">
|
||||
static int
|
||||
my_verify(void *userdata, int failures, const ne_ssl_certificate *cert)
|
||||
{
|
||||
const char *hostname = userdata;
|
||||
|
||||
dump_cert(cert);
|
||||
|
||||
puts("Certificate verification failed - the connection may have been "
|
||||
"intercepted by a third party!");
|
||||
|
||||
if (failures & NE_SSL_IDMISMATCH) {
|
||||
const char *id = ne_ssl_cert_identity(cert);
|
||||
if (id)
|
||||
printf("Server certificate was issued to '%s' not '%s'.\n",
|
||||
id, hostname);
|
||||
else
|
||||
printf("The certificate was not issued for '%s'\n", hostname);
|
||||
}
|
||||
|
||||
if (failures & NE_SSL_UNTRUSTED)
|
||||
puts("The certificate is not signed by a trusted Certificate Authority.");
|
||||
|
||||
/* ... check for validity failures ... */
|
||||
|
||||
if (prompt_user())
|
||||
return 1; /* fail verification */
|
||||
else
|
||||
return 0; /* trust the certificate anyway */
|
||||
}
|
||||
|
||||
int
|
||||
main(...)
|
||||
{
|
||||
ne_session *sess = ne_session_create("https", "some.host.name", 443);
|
||||
ne_ssl_set_verify(sess, my_verify, "some.host.name");
|
||||
...
|
||||
}</pre></div><div class="refsect1" lang="en"><a name="id2943428"></a><h2>See also</h2><p><a href="refsslca.html#ne_ssl_trust_cert">ne_ssl_trust_cert</a>, <a href="refssldname.html#ne_ssl_readable_dname">ne_ssl_readable_dname</a>, <a href="refcert.html#ne_ssl_cert_subject">ne_ssl_cert_subject</a></p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refsslca.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refclicert.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_trust_cert </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_ssl_client_cert</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,22 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_status</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refclicert.html" title="ne_ssl_client_cert"><link rel="next" href="reftok.html" title="ne_token"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_status</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refclicert.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="reftok.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refstatus"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_status — HTTP status structure</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_utils.h>
|
||||
|
||||
typedef struct {
|
||||
int major_version, minor_version;
|
||||
int code, klass;
|
||||
const char *reason_phrase;
|
||||
} <em class="type">ne_status</em>;</pre></div></div><div class="refsect1" lang="en"><a name="id2943754"></a><h2>Description</h2><p>An <em class="type">ne_status</em> type represents an HTTP
|
||||
response status; used in response messages giving a result of request.
|
||||
The <em class="structfield"><code>major_version</code></em> and
|
||||
<em class="structfield"><code>minor_version</code></em> fields give the HTTP version
|
||||
supported by the server issuing the response. The
|
||||
<em class="structfield"><code>code</code></em> field gives the status code of the
|
||||
result (lying between 100 and 999 inclusive), and the
|
||||
<em class="structfield"><code>klass</code></em> field gives the
|
||||
class<sup>[<a name="id2943826" href="#ftn.id2943826">2</a>]</sup>, which is equal to the most significant digit
|
||||
of the status.</p><p>There are five classes of HTTP status code defined by
|
||||
RFC2616:</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><code class="literal">1xx</code></span></td><td>Informational response.</td></tr><tr><td><span class="term"><code class="literal">2xx</code></span></td><td>Success: the operation was successful</td></tr><tr><td><span class="term"><code class="literal">3xx</code></span></td><td>Redirection</td></tr><tr><td><span class="term"><code class="literal">4xx</code></span></td><td>Client
|
||||
error: the request made was incorrect in some
|
||||
manner.</td></tr><tr><td><span class="term"><code class="literal">5xx</code></span></td><td>Server error</td></tr></tbody></table></div></div><div class="refsect1" lang="en"><a name="id2944895"></a><h2>See also</h2><p><a href="refgetst.html#ne_get_status">ne_get_status</a>.</p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2943826" href="#id2943826">2</a>] </sup>the field is named “<span class="quote">klass</span>” not
|
||||
“<span class="quote">class</span>” so that the header can be used from a C++
|
||||
program, in which “<span class="quote">class</span>” is a reserved
|
||||
word)</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refclicert.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="reftok.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_ssl_client_cert </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_token</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_token</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refstatus.html" title="ne_status"><link rel="next" href="refvers.html" title="ne_version_match"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_token</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refstatus.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refvers.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="reftok"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_token, ne_qtoken — string tokenizers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_string.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_token</b>(</code>char **<var xmlns="" class="pdparam">str</var>, char <var xmlns="" class="pdparam">sep</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">char *<b class="fsfunc">ne_qtoken</b>(</code>char **<var xmlns="" class="pdparam">str</var>, char <var xmlns="" class="pdparam">sep</var>, const char *<var xmlns="" class="pdparam">quotes</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2945224"></a><h2>Description</h2><p><code class="function">ne_token</code> and
|
||||
<code class="function">ne_qtoken</code> tokenize the string at the location
|
||||
stored in the pointer <code class="parameter">str</code>. Each time the
|
||||
function is called, it returns the next token, and modifies the
|
||||
<code class="parameter">str</code> pointer to point to the remainer of the
|
||||
string, or <code class="literal">NULL</code> if there are no more tokens in the string. A token
|
||||
is delimited by the separator character <code class="parameter">sep</code>; if
|
||||
<code class="function">ne_qtoken</code> is used any quoted segments of the
|
||||
string are skipped when searching for a separator. A quoted segment
|
||||
is enclosed in a pair of one of the characters given in the
|
||||
<code class="parameter">quotes</code> string.</p><p>The string being tokenized is modified each time
|
||||
the tokenizing function is called; replacing the next separator
|
||||
character with a <code class="literal">NUL</code> terminator.</p></div><div class="refsect1" lang="en"><a name="id2945302"></a><h2>Examples</h2><p>The following function prints out each token in a
|
||||
comma-separated string <code class="parameter">list</code>, which is
|
||||
modified in-place:</p><pre class="programlisting">static void splitter(char *list)
|
||||
{
|
||||
do {
|
||||
printf("Token: %s\n", ne_token(&list, ','));
|
||||
while (list);
|
||||
}</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refstatus.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refvers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_status </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_version_match</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_version_match</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="reftok.html" title="ne_token"><link rel="next" href="refxml.html" title="ne_xml_create"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_version_match</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="reftok.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refxml.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refvers"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_version_match, ne_version_string — library versioning</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_utils.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">int <b class="fsfunc">ne_version_match</b>(</code>int <var xmlns="" class="pdparam">major</var>, int <var xmlns="" class="pdparam">minor</var><code xmlns="">)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">const char *<b class="fsfunc">ne_version_string</b>(</code><code xmlns="">void)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2945635"></a><h2>Description</h2><p>The <code class="function">ne_version_match</code> function returns
|
||||
non-zero if the library version is not of major version
|
||||
<code class="parameter">major</code>, or the minor version is less than
|
||||
<code class="parameter">minor</code>. For neon versions 0.x, every
|
||||
minor version is assumed to be incompatible with every other minor
|
||||
version.</p><p>The <code class="function">ne_version_string</code> function returns
|
||||
a string giving the library version.</p></div><div class="refsect1" lang="en"><a name="id2945680"></a><h2>Examples</h2><p>To require neon 1.x, version 1.2 or later:</p><pre class="programlisting">if (ne_version_match(1, 2)) {
|
||||
printf("Library version out of date: 1.2 required, found %s.",
|
||||
ne_version_string());
|
||||
exit(1);
|
||||
}</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="reftok.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refxml.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_token </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_xml_create</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_xml_create</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refvers.html" title="ne_version_match"><link rel="next" href="biblio.html" title="Bibliography"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_xml_create</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refvers.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="biblio.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refxml"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_xml_create, ne_xml_destroy — create and destroy an XML parser</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_xml.h></pre><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">ne_xml_parser *<b class="fsfunc">ne_xml_create</b>(</code><code xmlns="">void)</code>;</code></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="funcprototype"><code><code xmlns="" class="funcdef">void <b class="fsfunc">ne_xml_destroy</b>(</code>ne_xml_parser *<var xmlns="" class="pdparam">parser</var><code xmlns="">)</code>;</code></div></div></div><div class="refsect1" lang="en"><a name="id2945138"></a><h2>Description</h2><p>The <code class="function">ne_xml_create</code> function creates an
|
||||
XML parser object, which can be used for parsing XML documents
|
||||
using stacked SAX handlers.</p></div><div class="refsect1" lang="en"><a name="id2945156"></a><h2>Return value</h2><p><code class="function">ne_xml_create</code> returns a pointer to an
|
||||
XML parser object, and never <code class="literal">NULL</code></p></div><div class="refsect1" lang="en"><a name="id2945177"></a><h2>See also</h2><p>XXX</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refvers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="biblio.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_version_match </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Bibliography</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>How to use neon from your application</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="intro.html" title="Chapter 1. Introduction"><link rel="prev" href="features.html" title="Feature list"><link rel="next" href="compliance.html" title="Standards compliance"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">How to use neon from your application</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="features.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="compliance.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="using"></a>How to use neon from your application</h2></div></div></div><p>This section describes how to add neon support to an
|
||||
application. If you just want to quickly try out neon, use
|
||||
the <a href="refconfig.html" title="neon-config"><span class="refentrytitle">neon-config</span></a> script.</p><p>The neon source code is designed to be easily embedded
|
||||
into an application source tree. neon has no dependencies on
|
||||
libraries other than an SSL toolkit and XML parser, though the
|
||||
source tree can be configured to have no support for SSL or XML
|
||||
if desired. To configure the neon source code some <a href="http://www.gnu.org/software/autoconf/" target="_top">GNU autoconf</a>
|
||||
macros are supplied, which can be used in a number of ways, as
|
||||
follows:</p><div class="itemizedlist"><ul type="disc"><li><p>autoconf macros are distributed in the 'macros'
|
||||
subdirectory of the neon distribution. Use the NEON_LIBRARY
|
||||
macro from your configure.in to check for the presence of
|
||||
the neon library installed on the system. The macro adds an
|
||||
'--with-neon=...' argument to configure, which allows the
|
||||
user to specify a location for the library (the standard
|
||||
/usr and /usr/local directories are checked automatically
|
||||
without having to be specified).</p></li><li><p>The 'src' directory of the neon package can be
|
||||
imported directly into your application, if you do not wish
|
||||
to add an external dependency. If you wish to bundle, use
|
||||
the NEON_BUNDLED macro to configure neon in your application:
|
||||
here, the neon sources are bundled in a directory called
|
||||
'libneon':</p><pre class="programlisting">NEON_BUNDLED(libneon, ...)</pre><p>If your application supports builds where srcdir != builddir,
|
||||
you should use the NEON_VPATH_BUNDLED macro like this:</p><pre class="programlisting">NEON_VPATH_BUNDLED(${srcdir}/libneon, libneon, ...)</pre><p>If you use this macro, a '--with-included-neon' option
|
||||
will be added to the generated configure script. This
|
||||
allows the user to force the bundled neon to be used in the
|
||||
application, rather than any neon library found on the
|
||||
system. If you allow neon to be configured this way, you
|
||||
must also configure an XML parser. Use the NEON_XML_PARSER
|
||||
macro to do this.</p></li><li><p>The final argument to the _BUNDLED macros is a
|
||||
set of actions which are executed if the bundled build *is*
|
||||
chosen (rather than an external neon which might have been
|
||||
found on the user's system). In here, use either the
|
||||
NEON_LIBTOOL_BUILD or NEON_NORMAL_BUILD macro to set up the
|
||||
neon Makefile appropriately: including adding the neon source
|
||||
directory to the recursive make.</p></li></ul></div><p>A full fragment might be:</p><pre class="programlisting">NEON_BUNDLED(libneon, [
|
||||
NEON_NORMAL_BUILD
|
||||
NEON_XML_PARSER
|
||||
SUBDIRS="libneon $SUBDIRS"
|
||||
])</pre><p>This means the bundled neon source directory (called 'libneon')
|
||||
is used if no neon is found on the system, and the standard XML
|
||||
parser search is used.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="features.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="compliance.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Feature list </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Standards compliance</td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,90 @@
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Parsing XML</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="api.html" title="Chapter 2. The neon C language interface"><link rel="prev" href="api.html" title="Chapter 2. The neon C language interface"><link rel="next" href="ref.html" title="neon API reference"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Parsing XML</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Chapter 2. The neon C language interface</th><td width="20%" align="right"> <a accesskey="n" href="ref.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xml"></a>Parsing XML</h2></div></div></div><p>The neon XML interface is exposed by the
|
||||
<code class="filename">ne_xml.h</code> header file. This interface gives a
|
||||
wrapper around the standard <a href="http://www.saxproject.org/" target="_top">SAX</a> API used by XML
|
||||
parsers, with an additional abstraction, <em class="firstterm">stacked SAX
|
||||
handlers</em>, and also giving consistent <a href="http://www.w3.org/TR/REC-xml-names" target="_top">XML Namespace</a> support.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xml-sax"></a>Introduction to SAX</h3></div></div></div><p>A SAX-based parser works by emitting a sequence of
|
||||
<em class="firstterm">events</em> to reflect the tokens being parsed
|
||||
from the XML document. For example, parsing the following document
|
||||
fragment:
|
||||
|
||||
</p><pre class="programlisting">
|
||||
<hello>world</hello>
|
||||
</pre><p>
|
||||
|
||||
results in the following events:
|
||||
|
||||
</p><div class="orderedlist"><ol type="1"><li><span class="emphasis"><em>start-element</em></span> "hello"</li><li><span class="emphasis"><em>character-data</em></span> "world"</li><li><span class="emphasis"><em>end-element</em></span> "hello"</li></ol></div><p>
|
||||
|
||||
This example demonstrates the three event types used used in the
|
||||
subset of SAX exposed by the neon XML interface: <span class="emphasis"><em>start-element</em></span>,
|
||||
<span class="emphasis"><em>character-data</em></span> and <span class="emphasis"><em>end-element</em></span>. In a C API, an “<span class="quote">event</span>” is
|
||||
implemented as a function callback; three callback types are used in
|
||||
neon, one for each type of event.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xml-stacked"></a>Stacked SAX handlers</h3></div></div></div><p>WebDAV property values are represented as fragments of XML,
|
||||
transmitted as parts of larger XML documents over HTTP (notably in
|
||||
the body of the response to a <code class="literal">PROPFIND</code> request).
|
||||
When neon parses such documents, the SAX events generated for
|
||||
these property value fragments may need to be handled by the
|
||||
application, since neon has no knowledge of the structure of
|
||||
properties used by the application.</p><p>To solve this problem<sup>[<a name="id2927533" href="#ftn.id2927533">1</a>]</sup> the neon XML interface introduces
|
||||
the concept of a <em class="firstterm">SAX handler</em>. A SAX handler
|
||||
comprises a <span class="emphasis"><em>start-element</em></span>, <span class="emphasis"><em>character-data</em></span> and <span class="emphasis"><em>end-element</em></span> callback; the
|
||||
<span class="emphasis"><em>start-element</em></span> callback being defined such that each handler may
|
||||
<span class="emphasis"><em>accept</em></span> or <span class="emphasis"><em>decline</em></span> the
|
||||
<span class="emphasis"><em>start-element</em></span> event. Handlers are composed into a <em class="firstterm">handler
|
||||
stack</em> before parsing a document. When a new <span class="emphasis"><em>start-element</em></span>
|
||||
event is generated by the XML parser, neon invokes each <span class="emphasis"><em>start-element</em></span>
|
||||
callback in the handler stack in turn until one accepts the event.
|
||||
The handler which accepts the event will then be subsequently be
|
||||
passed <span class="emphasis"><em>character-data</em></span> events if the element contains character data,
|
||||
followed by an <span class="emphasis"><em>end-element</em></span> event when the element is closed. If no
|
||||
handler in the stack accepts a <span class="emphasis"><em>start-element</em></span> event, the branch of the
|
||||
tree is ignored.</p><p>To illustrate, given a handler A, which accepts the
|
||||
<code class="literal">cat</code> and <code class="literal">age</code> elements, and a
|
||||
handler B, which accepts the <code class="literal">name</code> element, the
|
||||
following document:
|
||||
|
||||
</p><div class="example"><a name="xml-example"></a><p class="title"><b>Example 2.1. An example XML document</b></p><pre class="programlisting">
|
||||
<cat>
|
||||
<age>3</age>
|
||||
<name>Bob</name>
|
||||
</cat>
|
||||
</pre></div><p>
|
||||
|
||||
would be parsed as follows:
|
||||
|
||||
</p><div class="orderedlist"><ol type="1"><li>A <span class="emphasis"><em>start-element</em></span> "cat" → <span class="emphasis"><em>accept</em></span></li><li>A <span class="emphasis"><em>start-element</em></span> "age" → <span class="emphasis"><em>accept</em></span></li><li>A <span class="emphasis"><em>character-data</em></span> "3"</li><li>A <span class="emphasis"><em>end-element</em></span> "age"</li><li>A <span class="emphasis"><em>start-element</em></span> "name" → <span class="emphasis"><em>decline</em></span></li><li>B <span class="emphasis"><em>start-element</em></span> "name" → <span class="emphasis"><em>accept</em></span></li><li>B <span class="emphasis"><em>character-data</em></span> "Bob"</li><li>B <span class="emphasis"><em>end-element</em></span> "name"</li><li>A <span class="emphasis"><em>end-element</em></span> "cat"</li></ol></div><p>The search for a handler which will accept a <span class="emphasis"><em>start-element</em></span> event
|
||||
begins at the handler of the parent element and continues toward the
|
||||
top of the stack. For the root element, it begins at the base of
|
||||
the stack. In the above example, handler A is at the base, and
|
||||
handler B at the top; if the <code class="literal">name</code> element had any
|
||||
children, only B's <span class="emphasis"><em>start-element</em></span> would be invoked to accept
|
||||
them.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xml-state"></a>Maintaining state</h3></div></div></div><p>To facilitate communication between independent handlers, a
|
||||
<em class="firstterm">state integer</em> is associated with each element
|
||||
being parsed. This integer is returned by <span class="emphasis"><em>start-element</em></span> callback and
|
||||
is passed to the subsequent <span class="emphasis"><em>character-data</em></span> and <span class="emphasis"><em>end-element</em></span> callbacks
|
||||
associated with the element. The state integer of the parent
|
||||
element is also passed to each <span class="emphasis"><em>start-element</em></span> callback, the value zero
|
||||
used for the root element (which by definition has no
|
||||
parent).</p><p>To further extend <a href="xml.html#xml-example" title="Example 2.1. An example XML document">Example 2.1, “An example XML document”</a>: if handler A
|
||||
defines that the state of the root element <code class="sgmltag-element">cat</code>
|
||||
will be <code class="literal">42</code>, the event trace would be as
|
||||
follows:
|
||||
|
||||
</p><div class="orderedlist"><ol type="1"><li>A <span class="emphasis"><em>start-element</em></span> (parent = 0, "cat") →
|
||||
<span class="emphasis"><em>accept</em></span>, state = 42
|
||||
</li><li>A <span class="emphasis"><em>start-element</em></span> (parent = 42, "age") →
|
||||
<span class="emphasis"><em>accept</em></span>, state = 50
|
||||
</li><li>A <span class="emphasis"><em>character-data</em></span> (state = 50, "3")</li><li>A <span class="emphasis"><em>end-element</em></span> (state = 50, "age")</li><li>A <span class="emphasis"><em>start-element</em></span> (parent = 42, "name") →
|
||||
<span class="emphasis"><em>decline</em></span></li><li>B <span class="emphasis"><em>start-element</em></span> (parent = 42, "name") →
|
||||
<span class="emphasis"><em>accept</em></span>, state = 99</li><li>B <span class="emphasis"><em>character-data</em></span> (state = 99, "Bob")</li><li>B <span class="emphasis"><em>end-element</em></span> (state = 99, "name")</li><li>A <span class="emphasis"><em>end-element</em></span> (state = 42, "cat")</li></ol></div><p>To avoid collisions between state integers used by different
|
||||
handlers, the interface definition of any handler includes the range
|
||||
of integers it will use.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xml-ns"></a>XML namespaces</h3></div></div></div><p>To support XML namespaces, every element name is represented
|
||||
as a <span class="emphasis"><em>(namespace, name)</em></span> pair. The <span class="emphasis"><em>start-element</em></span>
|
||||
and <span class="emphasis"><em>end-element</em></span> callbacks are passed namespace and name strings
|
||||
accordingly. If an element in the XML document has no declared
|
||||
namespace, the namespace given will be the empty string,
|
||||
<code class="literal">""</code>.</p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2927533" href="#id2927533">1</a>] </sup>This
|
||||
“<span class="quote">problem</span>” only needs solving because the SAX interface
|
||||
is so inflexible when implemented as C function callbacks; a better
|
||||
approach would be to use an XML parser interface which is not based
|
||||
on callbacks.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="api.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. The neon C language interface </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> neon API reference</td></tr></table></div></body></html>
|
||||
Reference in New Issue
Block a user