English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/common-nfo/tools/nfotiser/nfotiser.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3444 - (show annotations) (download)
Wed Aug 8 14:32:17 2007 UTC (6 years, 6 months ago) by tg
File MIME type: text/plain
File size: 1045 byte(s)
first cut at the parser data types

thanks to bsiegert@mbsd for discussing the algorithms and data types used
and providing useful information

1 /*-
2 * $FreeWRT$
3 *-
4 * This file is part of the FreeWRT project. FreeWRT is copyrighted
5 * material, please see the LICENCE file in the top-level directory
6 * or at http://www.freewrt.org/licence for details.
7 */
8
9 #ifndef NFOTISER_NFOTISER_H
10 #define NFOTISER_NFOTISER_H
11
12 #include <sys/queue.h>
13
14 struct categories {
15 const char *catname;
16 const char *catdesc;
17 };
18
19 enum parser_kwtype {
20 KWT_NORMAL,
21 KWT_MULTI,
22 KWT_ITERATED,
23 KWT_MULTITER
24 };
25
26 enum parser_argtype {
27 ARGT_STRING,
28 ARGT_INTEGER
29 };
30
31 #ifndef parser_kwords
32 #define parser_kwords int
33 #endif
34
35 struct parser_keywords {
36 const char *kwprefix;
37 parser_kwords kwnum;
38 enum parser_kwtype kwtype;
39 enum parser_argtype argtype;
40 };
41
42 struct parser_res {
43 CIRCLEQ_ENTRY(parser_res) e;
44 parser_kwords keyword;
45 char *kw_multi;
46 unsigned kw_iter;
47 char *value;
48 };
49
50 CIRCLEQ_HEAD(parser_result, parser_res);
51
52 __BEGIN_DECLS
53 /* categories.c */
54 extern const struct categories categories[];
55 const char *category(const char *);
56 /* parser.c */
57 struct parser_result *nfo_parse(int fd);
58 __END_DECLS
59
60 #endif

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20