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 3470 - (show annotations) (download)
Thu Aug 9 16:04:11 2007 UTC (6 years, 6 months ago) by tg
File MIME type: text/plain
File size: 1544 byte(s)
track the _real_ entry type, for varname expansion:
• KWT_MULTI etc. with a short match become KWT_NORMAL
• KWT_MULTITOP becomes KWT_MULTI xor KWT_MULTITER

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 #include "nfohelpr.h"
14
15 struct categories {
16 const char *catname;
17 const char *catdesc;
18 };
19
20 enum parser_kwtype {
21 KWT_NORMAL,
22 KWT_MULTI,
23 KWT_ITERATED,
24 KWT_MULTITER,
25 KWT_MULTITOP
26 };
27
28 enum parser_argtype {
29 ARGT_STRING,
30 ARGT_INTEGER
31 };
32
33 #ifndef parser_kwords
34 #define parser_kwords int
35 #endif
36
37 struct parser_keywords {
38 const char *kwprefix;
39 parser_kwords kwnum;
40 enum parser_kwtype kwtype;
41 enum parser_argtype argtype;
42 };
43
44 struct parser_res {
45 CIRCLEQ_ENTRY(parser_res) e;
46 parser_kwords keyword;
47 enum parser_kwtype itype;
48 char *kw_multi;
49 unsigned kw_iter;
50 char *value;
51 };
52
53 CIRCLEQ_HEAD(parser_result, parser_res);
54
55 __BEGIN_DECLS
56 /* categories.c */
57 extern const struct categories categories[];
58 const char *category(const char *);
59 /* parser.c */
60 struct parser_result *nfo_parse(int, const struct parser_keywords *);
61 const struct parser_keywords *parser_getkwbynum(parser_kwords,
62 const struct parser_keywords *);
63 void parser_dump(struct parser_res *, const struct parser_keywords *);
64 void parser_free(struct parser_result *);
65 EXTERN char *parser_errpfx I__(NULL);
66 struct parser_res *parse_lookupbyname(struct parser_result *, const char *);
67 struct parser_res *parse_lookup(struct parser_result *, struct parser_res *);
68 __END_DECLS
69
70 #endif

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