From 71e5d101a82272d2c67d35201314cf52cf292002 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 26 Feb 2017 15:33:32 +0100 Subject: [PATCH] converter compiles fine, does nothing --- src/convert.c | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/src/convert.c b/src/convert.c index 3b982e64f..a67c5a287 100644 --- a/src/convert.c +++ b/src/convert.c @@ -1,25 +1,44 @@ #include + +#ifdef USE_LIBXML2 +#include +#include +#endif #include #include -#include - #include -#include - #include +#include + +static int usage(void) { + return -1; +} + int main(int argc, char **argv) { - const char * xmlfile, *catalog; + const char *mode; register_races(); +#ifdef USE_LIBXML2 register_xmlreader(); - - if (argc < 3) return -1; - xmlfile = argv[1]; - catalog = argv[2]; - read_xml(xmlfile, catalog); - write_rules("rules.dat"); - return 0; +#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(); }