Changeset 3443
- Timestamp:
- 08/08/07 14:45:20 (1 year ago)
- Files:
-
- branches/common-nfo/tools/nfotiser/Makefile (modified) (1 diff)
- branches/common-nfo/tools/nfotiser/categories.c (modified) (1 diff)
- branches/common-nfo/tools/nfotiser/extern.h (modified) (1 diff)
- branches/common-nfo/tools/nfotiser/main.c (modified) (1 diff)
- branches/common-nfo/tools/nfotiser/nfotiser.h (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/common-nfo/tools/nfotiser/Makefile
r3442 r3443 62 62 nfotiser: ${OBJS} 63 63 ${HOSTCC} ${HOSTCFLAGS} ${OUR_FLAGS} -o $@ \ 64 $^ -L${TOPDIR}/tools_build/sqlite -lsqlite3 64 $^ -L${TOPDIR}/tools_build/sqlite -lsqlite3 -ldl 65 65 66 main.o: dbif.h extern.h sqlite3.h66 main.o: dbif.h extern.h nfotiser.h sqlite3.h 67 67 dbscheme.o: dbscheme.S mknfodb.sql 68 categories.o: nfotiser.h branches/common-nfo/tools/nfotiser/categories.c
r3440 r3443 10 10 #include <string.h> 11 11 12 #include "nfotiser.h" 13 12 14 static int category_cmp(const void *, const void *); 13 15 14 const struct categories { 15 const char *catname; 16 const char *catdesc; 17 } categories[] = { 16 const struct categories categories[] = { 18 17 /* this list MUST be sorted all the time */ 19 18 { "base", "Base system" }, branches/common-nfo/tools/nfotiser/extern.h
r3440 r3443 12 12 #define NFOTISER 13 13 #include "dbif.h" 14 #include "nfotiser.h" 14 15 15 16 /* categories.c */ 16 extern const char *categories[];17 extern const struct categories categories[]; 17 18 const char *category(const char *); 18 19 /* dbscheme.S */ branches/common-nfo/tools/nfotiser/main.c
r2483 r3443 109 109 D(1, "database created\n"); 110 110 111 for (const struct categories *ctp = categories; ctp->catname != NULL; 112 ++ctp) { 113 xdbexecv(NULL, NULL, NULL, 114 "INSERT INTO categories (name, desc) VALUES ('%s', '%s');", 115 ctp->catname, ctp->catdesc); 116 } 117 111 118 /* … */ 112 119


