converter compiles fine, does nothing

This commit is contained in:
Enno Rehling 2017-02-26 15:33:32 +01:00
parent f406c47657
commit 71e5d101a8
1 changed files with 31 additions and 12 deletions

View File

@ -1,25 +1,44 @@
#include <platform.h> #include <platform.h>
#ifdef USE_LIBXML2
#include <kernel/xmlreader.h>
#include <util/xml.h>
#endif
#include <kernel/race.h> #include <kernel/race.h>
#include <kernel/rules.h> #include <kernel/rules.h>
#include <kernel/xmlreader.h>
#include <races/races.h> #include <races/races.h>
#include <util/xml.h>
#include <storage.h> #include <storage.h>
#include <string.h>
static int usage(void) {
return -1;
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
const char * xmlfile, *catalog; const char *mode;
register_races(); register_races();
#ifdef USE_LIBXML2
register_xmlreader(); register_xmlreader();
#endif
if (argc < 3) return -1; if (argc < 2) return usage();
xmlfile = argv[1]; mode = argv[1];
catalog = argv[2]; #ifdef USE_LIBXML2
if (strcmp(mode, "rules")==0) {
const char *xmlfile, *catalog;
if (argc < 4) return usage();
xmlfile = argv[2];
catalog = argv[3];
read_xml(xmlfile, catalog); read_xml(xmlfile, catalog);
write_rules("rules.dat"); write_rules("rules.dat");
return 0; return 0;
} }
#endif
if (strcmp(mode, "po")==0) {
return 0;
}
return usage();
}