Changeset 3440
- Timestamp:
- 08/08/07 14:23:25 (1 year ago)
- Files:
-
- branches/common-nfo/tools/nfotiser/categories.c (modified) (1 diff)
- branches/common-nfo/tools/nfotiser/extern.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/common-nfo/tools/nfotiser/categories.c
r2475 r3440 8 8 9 9 #include <stdlib.h> 10 #include <string.h> 10 11 11 struct categories { 12 static int category_cmp(const void *, const void *); 13 14 const struct categories { 12 15 const char *catname; 13 16 const char *catdesc; 14 17 } categories[] = { 18 /* this list MUST be sorted all the time */ 15 19 { "base", "Base system" }, 16 { "shells", "Shells" }, 17 { "misc", "Applications" }, 18 { "net", "Networking" }, 20 { "comms", "Serial communications & terminal emulation" }, 19 21 { "crypto", "Crypto" }, 22 { "fsutils", "FileSystem related" }, 20 23 { "ipv6", "IPv6" }, 21 24 { "libs", "Libraries" }, 25 { "misc", "Applications" }, 22 26 { "multimedia", "Multimedia" }, 23 { "comms", "Serial communications & terminal emulation" }, 27 { "net", "Networking" }, 28 { "netbt", "Bluetooth" }, 29 { "shells", "Shells" }, 30 { "sysutils", "Utilities" }, 24 31 { "voip", "Telephony" }, 25 { "sysutils", "Utilities" },26 { "fsutils", "FileSystem related" },27 { "netbt", "Bluetooth" },28 32 { NULL, NULL } 29 33 }; 34 35 const char * 36 category(const char *name) 37 { 38 return (name == NULL ? NULL : ((struct categories *)bsearch(name, 39 categories, (sizeof (categories) / sizeof (categories[0])), 40 sizeof (struct categories), category_cmp))->catdesc); 41 } 42 43 static int 44 category_cmp(const void *key, const void *item) 45 { 46 return (strcmp((const char *)key, 47 ((const struct categories *)item)->catname)); 48 } branches/common-nfo/tools/nfotiser/extern.h
r2483 r3440 15 15 /* categories.c */ 16 16 extern const char *categories[]; 17 const char *category(const char *); 17 18 /* dbscheme.S */ 18 19 extern const char dbscheme[];


