summaryrefslogtreecommitdiff
path: root/docs/html/tutorial-parser-features.html
blob: e1d683efc9b22ad710b1def06ffb180873aa7b6c (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Parser options</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Raptor RDF Syntax Library Manual">
<link rel="up" href="tutorial-parsing.html" title="Parsing syntaxes to RDF Triples">
<link rel="prev" href="tutorial-parser-create.html" title="Create the Parser object">
<link rel="next" href="tutorial-parser-set-triple-handler.html" title="Set RDF statement callback handler">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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-parser-create.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="tutorial-parsing.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 Library Manual</th>
<td><a accesskey="n" href="tutorial-parser-set-triple-handler.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="tutorial-parser-features"></a>Parser options</h2></div></div></div>
<p>There are several
<span class="emphasis"><em> options</em></span> that can be set on parsers.
The exact list of options can be found at run time via the
<a class="link" href="tutorial-querying-functionality.html" title="Listing built-in functionality">Querying Functionality</a>
or in the API reference for 
<a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><code class="literal">raptor_option</code></a>.
</p>
<p>Options are integer enumerations of the
 <a class="link" href="raptor2-section-option.html#raptor-option" title="enum raptor_option"><span class="type">raptor_option</span></a> enum and have
typed values that are either booleans, integers or strings.
The function that sets options for parsers is
<a class="link" href="raptor2-section-parser.html#raptor-parser-set-option" title="raptor_parser_set_option ()">raptor_parser_set_option()</a>
used as follows:
</p>
<pre class="programlisting">
  /* Set a boolean or integer valued option to value 1 */
  raptor_parser_set_option(rdf_parser, option, NULL, 1);

  /* Set a string valued option to value "abc" */
  raptor_parser_set_option(rdf_parser, option, "abc", -1);
</pre>
<p>
</p>
<p>
There is a corresponding function for reading the values of parser
option
<a class="link" href="raptor2-section-parser.html#raptor-parser-get-option" title="raptor_parser_get_option ()"><code class="function">raptor_parser_get_option()</code></a>
which takes the option enumeration parameter and returns the boolean /
integer or string value correspondingly into the appropriate pointer
argument.
</p>
<pre class="programlisting">
  /* Get a boolean or integer option value */
  int int_var;
  raptor_parser_get_option(rdf_parser, option, NULL, &amp;int_var);

  /* Get a string option value */
  char* string_var;
  raptor_parser_get_option(rdf_parser, option, &amp;string_var, NULL);
</pre>
<p>
</p>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>