# HG changeset patch # User meillo@marmaro.de # Date 1216819235 -7200 # Node ID f1d43b52ed36c364de647d4ac9615abd426eb4c6 # Parent 8db6497d606572f00611d55d8868e154320ee0e8 and here now is the main program diff -r 8db6497d6065 -r f1d43b52ed36 .hgignore --- a/.hgignore Wed Jul 23 15:19:45 2008 +0200 +++ b/.hgignore Wed Jul 23 15:20:35 2008 +0200 @@ -8,3 +8,6 @@ *.tar.gz ChangeLog +bu +sql +garten diff -r 8db6497d6065 -r f1d43b52ed36 main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.c Wed Jul 23 15:20:35 2008 +0200 @@ -0,0 +1,40 @@ +#include +#include +#include "db.h" +#include "game.h" + + +void run_module(char* name, void (*module)(void)) { + printf(" --> %s\n", name); + module(); + printf(" --< %s\n", name); +} + + +int main(int argc, char* argv[]) { + if (argc != 2) { + printf("usage: %s \n", argv[0]); + exit(1); + } + database = argv[1]; + printf("database '%s'\n", database); + + /* echo "started backend cycle at `date +%F\ %H:%M:%S`" */ + db_connect(); + read_time(); + + + /* modules */ + run_module("clock", worldclock); + run_module("weather", weather); + run_module("environment", environment); + /* run_module("market", market); */ + run_module("growth", growth); + /* run_module("orderexec", orderexec); */ + + + db_close(); + /* echo "finished backend cycle at `date +%F\ %H:%M:%S`" */ + + return 0; +}