Changeset 3443

Show
Ignore:
Timestamp:
08/08/07 14:45:20 (1 year ago)
Author:
tg
Message:

• use libdl (required on GNU/Lunox)
• fix categories decl (oops…)
• insert categories into DB

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/common-nfo/tools/nfotiser/Makefile

    r3442 r3443  
    6262nfotiser: ${OBJS} 
    6363        ${HOSTCC} ${HOSTCFLAGS} ${OUR_FLAGS} -o $@ \ 
    64             $^ -L${TOPDIR}/tools_build/sqlite -lsqlite3 
     64            $^ -L${TOPDIR}/tools_build/sqlite -lsqlite3 -ldl 
    6565 
    66 main.o: dbif.h extern.h sqlite3.h 
     66main.o: dbif.h extern.h nfotiser.h sqlite3.h 
    6767dbscheme.o: dbscheme.S mknfodb.sql 
     68categories.o: nfotiser.h 
  • branches/common-nfo/tools/nfotiser/categories.c

    r3440 r3443  
    1010#include <string.h> 
    1111 
     12#include "nfotiser.h" 
     13 
    1214static int category_cmp(const void *, const void *); 
    1315 
    14 const struct categories { 
    15         const char *catname; 
    16         const char *catdesc; 
    17 } categories[] = { 
     16const struct categories categories[] = { 
    1817        /* this list MUST be sorted all the time */ 
    1918        { "base",       "Base system" }, 
  • branches/common-nfo/tools/nfotiser/extern.h

    r3440 r3443  
    1212#define NFOTISER 
    1313#include "dbif.h" 
     14#include "nfotiser.h" 
    1415 
    1516/* categories.c */ 
    16 extern const char *categories[]; 
     17extern const struct categories categories[]; 
    1718const char *category(const char *); 
    1819/* dbscheme.S */ 
  • branches/common-nfo/tools/nfotiser/main.c

    r2483 r3443  
    109109        D(1, "database created\n"); 
    110110 
     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 
    111118        /* … */ 
    112119