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/pfile.c

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: 3991 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 /* $FreeWRT: src/share/misc/licence.template,v 1.20 2006/12/11 21:04:56 tg Rel $ */
2
3 /*-
4 * Copyright (c) 2007
5 * Thorsten Glaser <tg@mirbsd.de>
6 *
7 * Provided that these terms and disclaimer and all copyright notices
8 * are retained or reproduced in an accompanying document, permission
9 * is granted to deal in this work without restriction, including un-
10 * limited rights to use, publicly perform, distribute, sell, modify,
11 * merge, give away, or sublicence.
12 *
13 * Advertising materials mentioning features or use of this work must
14 * display the following acknowledgement:
15 * This product includes material provided by Thorsten Glaser.
16 * This acknowledgement does not need to be reprinted if this work is
17 * linked into a bigger work whose licence does not allow such clause
18 * and the author of this work is given due credit in the bigger work
19 * or its accompanying documents, where such information is generally
20 * kept, provided that said credits are retained.
21 *
22 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
23 * the utmost extent permitted by applicable law, neither express nor
24 * implied; without malicious intent or gross negligence. In no event
25 * may a licensor, author or contributor be held liable for indirect,
26 * direct, other damage, loss, or other issues arising in any way out
27 * of dealing in the work, even if advised of the possibility of such
28 * damage or existence of a defect, except proven that it results out
29 * of said person's immediate fault when using the work as intended.
30 */
31
32 #include <sys/param.h>
33
34 #include <err.h>
35 #include <errno.h>
36 #include <stdint.h>
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include <string.h>
40 #include <unistd.h>
41
42 enum kwords {
43 KA_DISTFILE,
44 KA_HASH,
45 KA_RCCONF_SYM,
46 KN_DISTFILES,
47 K_BDEPS,
48 K_BROKEN,
49 K_CATEGORY,
50 K_CITEM,
51 K_CONFFILES,
52 K_CONFSYMS,
53 K_CSYM,
54 K_DASHVER,
55 K_DEFLT,
56 K_DESC,
57 K_FLAVOURS,
58 K_GROUPS,
59 K_HASHES,
60 K_HELP,
61 K_MDEPS,
62 K_MENUITEM,
63 K_MULTIPKGS,
64 K_NAME,
65 K_PERMIT_BIN,
66 K_PERMIT_SRC,
67 K_PKGDEPS,
68 K_PKGNAME,
69 K_RCCONF_SYMS,
70 K_SDEPS,
71 K_SITES,
72 K_URLS,
73 K_USERS,
74 K_VDEPS,
75 K_VERSION
76 };
77 #define parser_kwords enum kwords
78
79 #include "extern.h"
80
81 static const struct parser_keywords kwords[] = {
82 /* sorted but shortest-match aware */
83 { "BROKEN", K_BROKEN, KWT_NORMAL, ARGT_STRING },
84 { "BUILDDEPS", K_BDEPS, KWT_MULTI, ARGT_STRING },
85 { "CATEGORY", K_CATEGORY, KWT_MULTI, ARGT_STRING },
86 { "CITEM", K_CITEM, KWT_MULTI, ARGT_STRING },
87 { "CONFFILES", K_CONFFILES, KWT_MULTI, ARGT_STRING },
88 { "CONFSYMS", K_CONFSYMS, KWT_NORMAL, ARGT_STRING },
89 { "CSYMDEPS", K_SDEPS, KWT_MULTI, ARGT_STRING },
90 { "CSYM", K_CSYM, KWT_MULTI, ARGT_STRING },
91 { "CVALDEPS", K_VDEPS, KWT_MULTI, ARGT_STRING },
92 { "DASHVER", K_DASHVER, KWT_NORMAL, ARGT_INTEGER },
93 { "DEFAULT", K_DEFLT, KWT_MULTI, ARGT_STRING },
94 { "DESCRIPTION", K_DESC, KWT_MULTI, ARGT_STRING },
95 { "DISTFILES", KN_DISTFILES, KWT_NORMAL, ARGT_INTEGER },
96 { "DISTFILE", KA_DISTFILE, KWT_ITERATED, ARGT_STRING },
97 { "FLAVOURS", K_FLAVOURS, KWT_MULTI, ARGT_STRING },
98 { "GROUPS", K_GROUPS, KWT_NORMAL, ARGT_STRING },
99 { "HASHES", K_HASHES, KWT_NORMAL, ARGT_STRING },
100 { "HASH", KA_HASH, KWT_MULTITER, ARGT_STRING },
101 { "HELPTEXT", K_HELP, KWT_MULTI, ARGT_STRING },
102 { "MASTER_SITES", K_SITES, KWT_ITERATED, ARGT_STRING },
103 { "MENUDEPS", K_MDEPS, KWT_MULTI, ARGT_STRING },
104 { "MENUITEM", K_MENUITEM, KWT_MULTI, ARGT_STRING },
105 { "MULTIPKGS", K_MULTIPKGS, KWT_NORMAL, ARGT_STRING },
106 { "NAME", K_NAME, KWT_NORMAL, ARGT_STRING },
107 { "PERMIT_BIN", K_PERMIT_BIN, KWT_MULTI, ARGT_STRING },
108 { "PERMIT_SRC", K_PERMIT_SRC, KWT_NORMAL, ARGT_STRING },
109 { "PKGDEPS", K_PKGDEPS, KWT_MULTI, ARGT_STRING },
110 { "PKGNAME", K_PKGNAME, KWT_NORMAL, ARGT_STRING },
111 { "RCCONF_SYMS", K_RCCONF_SYMS, KWT_NORMAL, ARGT_INTEGER },
112 { "RCCONF_SYM", KA_RCCONF_SYM, KWT_MULTITER, ARGT_STRING },
113 { "URLS", K_URLS, KWT_NORMAL, ARGT_STRING },
114 { "USERS", K_USERS, KWT_NORMAL, ARGT_STRING },
115 { "VERSION", K_VERSION, KWT_NORMAL, ARGT_STRING },
116 { NULL, 0, 0, 0 }
117 };

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