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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3443 - (show annotations) (download)
Wed Aug 8 12:45:20 2007 UTC (6 years, 6 months ago) by tg
File MIME type: text/plain
File size: 1219 byte(s)
• use libdl (required on GNU/Lunox)
• fix categories decl (oops…)
• insert categories into DB

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 #include <stdlib.h>
10 #include <string.h>
11
12 #include "nfotiser.h"
13
14 static int category_cmp(const void *, const void *);
15
16 const struct categories categories[] = {
17 /* this list MUST be sorted all the time */
18 { "base", "Base system" },
19 { "comms", "Serial communications & terminal emulation" },
20 { "crypto", "Crypto" },
21 { "fsutils", "FileSystem related" },
22 { "ipv6", "IPv6" },
23 { "libs", "Libraries" },
24 { "misc", "Applications" },
25 { "multimedia", "Multimedia" },
26 { "net", "Networking" },
27 { "netbt", "Bluetooth" },
28 { "shells", "Shells" },
29 { "sysutils", "Utilities" },
30 { "voip", "Telephony" },
31 { NULL, NULL }
32 };
33
34 const char *
35 category(const char *name)
36 {
37 return (name == NULL ? NULL : ((struct categories *)bsearch(name,
38 categories, (sizeof (categories) / sizeof (categories[0])),
39 sizeof (struct categories), category_cmp))->catdesc);
40 }
41
42 static int
43 category_cmp(const void *key, const void *item)
44 {
45 return (strcmp((const char *)key,
46 ((const struct categories *)item)->catname));
47 }

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