File: parser_8h-source.html

package info (click to toggle)
klone 1.1.1.dfsg1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,480 kB
  • ctags: 4,238
  • sloc: ansic: 16,288; makefile: 384; sh: 351
file content (74 lines) | stat: -rw-r--r-- 6,297 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>KLone: parser.h Source File</title>
<link href="kl.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<div class="nav">
<a class="el" href="dir_000002.html">klone</a></div>
<h1>parser.h</h1><a href="parser_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
00002 <span class="comment"> * Copyright (c) 2005, 2006 by KoanLogic s.r.l. &lt;http://www.koanlogic.com&gt;</span>
00003 <span class="comment"> * All rights reserved.</span>
00004 <span class="comment"> *</span>
00005 <span class="comment"> * This file is part of KLone, and as such it is subject to the license stated</span>
00006 <span class="comment"> * in the LICENSE file which you have received as part of this distribution.</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> * $Id: parser.h,v 1.7 2006/01/09 12:38:37 tat Exp $</span>
00009 <span class="comment"> */</span>
00010 
00011 <span class="preprocessor">#ifndef _KLONE_PARSER_H_</span>
00012 <span class="preprocessor"></span><span class="preprocessor">#define _KLONE_PARSER_H_</span>
00013 <span class="preprocessor"></span>
00014 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
00015 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
00016 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
00017 <span class="preprocessor">#include &lt;<a class="code" href="io_8h.html">klone/io.h</a>&gt;</span>
00018 
00019 <span class="preprocessor">#ifdef __cplusplus</span>
00020 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00021 <span class="preprocessor">#endif</span>
00022 <span class="preprocessor"></span>
00023 <span class="keyword">struct </span><a class="code" href="structparser__s.html">parser_s</a>;
<a name="l00024"></a><a class="code" href="parser_8h.html#a0">00024</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structparser__s.html">parser_s</a> <a class="code" href="parser_8h.html#a0">parser_t</a>;
00025 
<a name="l00026"></a><a class="code" href="structparser__s.html">00026</a> <span class="keyword">struct </span><a class="code" href="structparser__s.html">parser_s</a>
00027 {
<a name="l00028"></a><a class="code" href="structparser__s.html#o1">00028</a>     <a class="code" href="structio__s.html">io_t</a> *in, *out;
<a name="l00029"></a><a class="code" href="structparser__s.html#o2">00029</a>     <span class="keywordtype">int</span> state, prev_state, cmd_code, line, code_line;
<a name="l00030"></a><a class="code" href="structparser__s.html#o7">00030</a>     <span class="keywordtype">void</span> *cb_arg; <span class="comment">/* opaque callback funcs argument */</span>
00031     <span class="comment">/* &lt;%[.]   %&gt;  where . is a non-blank char */</span>
00032     int (*cb_code) (<a class="code" href="parser_8h.html#a0">parser_t</a> *, int, <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, size_t); 
00033     int (*cb_html) (<a class="code" href="parser_8h.html#a0">parser_t</a> *, <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, size_t); <span class="comment">/* HTML */</span>
00034 }; 
00035 
<a name="l00036"></a><a class="code" href="parser_8h.html#a1">00036</a> <span class="keyword">typedef</span> int (*parser_cb_html_t)(<a class="code" href="parser_8h.html#a0">parser_t</a> *, <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, size_t);
<a name="l00037"></a><a class="code" href="parser_8h.html#a2">00037</a> <span class="keyword">typedef</span> int (*parser_cb_code_t)(<a class="code" href="parser_8h.html#a0">parser_t</a> *, int, <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, size_t);
00038 
00039 <span class="keywordtype">int</span> <a class="code" href="parser_8h.html#a3">parser_create</a>(parser_t **);
00040 <span class="keywordtype">int</span> <a class="code" href="parser_8h.html#a4">parser_free</a>(parser_t *);
00041 <span class="keywordtype">int</span> <a class="code" href="parser_8h.html#a5">parser_run</a>(parser_t *);
00042 <span class="keywordtype">int</span> <a class="code" href="parser_8h.html#a6">parser_reset</a>(parser_t *);
00043 
00044 <span class="keywordtype">void</span> <a class="code" href="parser_8h.html#a7">parser_set_io</a>(parser_t *, <a class="code" href="structio__s.html">io_t</a> *, <a class="code" href="structio__s.html">io_t</a> *);
00045 <span class="keywordtype">void</span> <a class="code" href="parser_8h.html#a8">parser_set_cb_code</a>(parser_t *, parser_cb_code_t);
00046 <span class="keywordtype">void</span> <a class="code" href="parser_8h.html#a9">parser_set_cb_html</a>(parser_t *, parser_cb_html_t);
00047 <span class="keywordtype">void</span> <a class="code" href="parser_8h.html#a10">parser_set_cb_arg</a>(parser_t *, <span class="keywordtype">void</span> *);
00048 
00049 <span class="preprocessor">#ifdef __cplusplus</span>
00050 <span class="preprocessor"></span>}
00051 <span class="preprocessor">#endif </span>
00052 <span class="preprocessor"></span>
00053 <span class="preprocessor">#endif</span>
</pre></div><hr>
<div> 
  <div style="text-align:left">
    <a href="http://www.koanlogic.com/kl/cont/gb/html/products.html">&larr;Products</a>
  </div>
  <div style="text-align:center;">
    &copy; 2005-2006 - <a href="http://www.koanlogic.com">KoanLogic S.r.l.</a> - All rights reserved
  </div>
</div>

</body>
</html>