/usr/share/gtk-doc/html/raptor/tutorial-querying-functionality.html is in libraptor1-doc 1.4.21-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Listing built-in functionality</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Raptor RDF Syntax Parsing and Serializing Library Manual">
<link rel="up" href="tutorial.html" title="Part I. Raptor Tutorial">
<link rel="prev" href="tutorial-initialising-finishing.html" title="Initialising and Finishing using the Library">
<link rel="next" href="tutorial-parsing.html" title="Parsing syntaxes to RDF Triples">
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="introduction.html" title="Raptor Overview">
<link rel="part" href="tutorial.html" title="Part I. Raptor Tutorial">
<link rel="chapter" href="tutorial-initialising-finishing.html" title="Initialising and Finishing using the Library">
<link rel="chapter" href="tutorial-querying-functionality.html" title="Listing built-in functionality">
<link rel="chapter" href="tutorial-parsing.html" title="Parsing syntaxes to RDF Triples">
<link rel="chapter" href="tutorial-serializing.html" title="Serializing RDF triples to a syntax">
<link rel="part" href="reference-manual.html" title="Part II. Raptor Reference Manual">
<link rel="chapter" href="raptor-parsers.html" title="Parsers in Raptor (syntax to triples)">
<link rel="chapter" href="raptor-serializers.html" title="Serializers in Raptor (triples to syntax)">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="tutorial-initialising-finishing.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="tutorial.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Raptor RDF Syntax Parsing and Serializing Library Manual</th>
<td><a accesskey="n" href="tutorial-parsing.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter" title="Listing built-in functionality">
<div class="titlepage"><div><div><h2 class="title">
<a name="tutorial-querying-functionality"></a>Listing built-in functionality</h2></div></div></div>
<p>
Raptor can be configured and compiled with support for different
parsers and serializers. Lists of the functionality built into the
library can be interrogated by means of
<span class="emphasis"><em>enumerate</em></span> functions. These take as input an
<code class="literal">int</code> counter and return descriptions of the feature
at that offset in the list. The descriptions are returned stored in
the variables pointed to by the reference arguments of the
<code class="literal">**</code><span class="emphasis"><em>var</em></span> form.
The return value of the function is non-zero when the counter has
gone too far.
</p>
<div class="variablelist" title="Listing Functionality with Enumeration">
<p class="title"><b>Listing Functionality with Enumeration</b></p>
<table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">List the parse syntaxes (parser names)</span></p></td>
<td><pre class="programlisting">
int
raptor_parsers_enumerate(const unsigned int counter,
const char **name, const char **label);
</pre></td>
</tr>
<tr>
<td><p><span class="term">List the parse syntaxes
(same as above but with more information)</span></p></td>
<td><pre class="programlisting">
int
raptor_syntaxes_enumerate(const unsigned int counter,
const char **name,
const char **label,
const char **mime_type,
const unsigned char **uri_string);
</pre></td>
</tr>
<tr>
<td><p><span class="term">List the serializer syntaxes (serializer names)</span></p></td>
<td><pre class="programlisting">
int
raptor_serializers_enumerate(const unsigned int counter,
const char **name,
const char **label,
const char **mime_type,
const unsigned char **uri_string);
</pre></td>
</tr>
<tr>
<td><p><span class="term">List the Parser features</span></p></td>
<td><pre class="programlisting">
int
raptor_features_enumerate(const raptor_feature feature,
const char **name, raptor_uri **uri,
const char **label);
</pre></td>
</tr>
<tr>
<td><p><span class="term">List the Serializer features</span></p></td>
<td><pre class="programlisting">
int
raptor_serializer_features_enumerate(const raptor_feature feature,
const char **name,
raptor_uri **uri,
const char **label);
</pre></td>
</tr>
<tr>
<td><p><span class="term">List the XML Writer features</span></p></td>
<td><pre class="programlisting">
int
raptor_xml_writer_features_enumerate(const raptor_feature feature,
const char **name,
raptor_uri **uri,
const char **label);
</pre></td>
</tr>
</tbody>
</table>
</div>
<p>These functions can be called directly after
<a class="link" href="raptor-section-world.html#raptor-init" title="raptor_init ()"><code class="function">raptor_init()</code></a>
has been called so can be used to find name parameters for creating
parser and serializer instances. This is one way to find a parser
(name) by it's MIME Type, the other is to use the mime_type parameter
of the
<a class="link" href="raptor-section-parser.html#raptor-new-parser-for-content" title="raptor_new_parser_for_content ()"><code class="function">raptor_new_parser_for_content()</code></a>.</p>
<div class="example">
<a name="raptor-example-list-all-parser-features"></a><p class="title"><b>Example 1. List all features of parsers with an enumerate function</b></p>
<div class="example-contents">
<pre class="programlisting">
int i;
for(i=0; i < RAPTOR_FEATURE_LAST; i++) {
const char *name;
raptor_uri *uri;
const char *label;
if(raptor_features_enumerate((raptor_feature)i, &name, &uri, &label))
continue;
/* do something with name, uri and label */
}
</pre>
<p>There are more examples of this usage in the source for the
<code class="literal">rapper</code> utility in <code class="filename">util/rapper.c</code>.
</p>
</div>
</div>
<br class="example-break">
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.13</div>
</body>
</html>
|