server/src/convert.c

45 lines
816 B
C
Raw Normal View History

2017-02-26 15:30:58 +01:00
#include <platform.h>
2017-02-26 15:33:32 +01:00
#ifdef USE_LIBXML2
#include <kernel/xmlreader.h>
#include <util/xml.h>
#endif
2017-02-26 15:30:58 +01:00
#include <kernel/race.h>
#include <kernel/rules.h>
#include <races/races.h>
#include <storage.h>
2017-02-26 15:33:32 +01:00
#include <string.h>
static int usage(void) {
return -1;
}
2017-02-26 15:30:58 +01:00
int main(int argc, char **argv) {
2017-02-26 15:33:32 +01:00
const char *mode;
2017-02-26 15:30:58 +01:00
register_races();
2017-02-26 15:33:32 +01:00
#ifdef USE_LIBXML2
2017-02-26 15:30:58 +01:00
register_xmlreader();
2017-02-26 15:33:32 +01:00
#endif
if (argc < 2) return usage();
mode = argv[1];
#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);
write_rules("rules.dat");
return 0;
}
#endif
if (strcmp(mode, "po")==0) {
return 0;
}
return usage();
2017-02-26 15:03:47 +01:00
}