garten

view main.c @ 17:5e6c9260913a

lots of cleanups and small fixes
author meillo@marmaro.de
date Wed, 23 Jul 2008 17:14:38 +0200
parents
children 5937504619f2
line source
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "db.h"
4 #include "game.h"
7 void run_module(char* name, void (*module)(void)) {
8 printf(" --> %s\n", name);
9 module();
10 printf(" --< %s\n", name);
11 }
14 int main(int argc, char* argv[]) {
15 if (argc != 2) {
16 printf("usage: %s <database>\n", argv[0]);
17 exit(1);
18 }
19 database = argv[1];
20 printf("database '%s'\n", database);
22 /* echo "started backend cycle at `date +%F\ %H:%M:%S`" */
23 db_connect();
24 read_time();
27 /* modules */
28 run_module("clock", worldclock);
29 run_module("weather", weather);
30 run_module("environment", environment);
31 /* run_module("market", market); */
32 run_module("growth", growth);
33 /* run_module("orderexec", orderexec); */
36 db_close();
37 /* echo "finished backend cycle at `date +%F\ %H:%M:%S`" */
39 return 0;
40 }