annotate 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 |
rev |
line source |
meillo@13
|
1 #include <stdio.h>
|
meillo@13
|
2 #include <stdlib.h>
|
meillo@13
|
3 #include "db.h"
|
meillo@13
|
4 #include "game.h"
|
meillo@13
|
5
|
meillo@13
|
6
|
meillo@13
|
7 void run_module(char* name, void (*module)(void)) {
|
meillo@13
|
8 printf(" --> %s\n", name);
|
meillo@13
|
9 module();
|
meillo@13
|
10 printf(" --< %s\n", name);
|
meillo@13
|
11 }
|
meillo@13
|
12
|
meillo@13
|
13
|
meillo@13
|
14 int main(int argc, char* argv[]) {
|
meillo@13
|
15 if (argc != 2) {
|
meillo@13
|
16 printf("usage: %s <database>\n", argv[0]);
|
meillo@13
|
17 exit(1);
|
meillo@13
|
18 }
|
meillo@13
|
19 database = argv[1];
|
meillo@13
|
20 printf("database '%s'\n", database);
|
meillo@13
|
21
|
meillo@13
|
22 /* echo "started backend cycle at `date +%F\ %H:%M:%S`" */
|
meillo@13
|
23 db_connect();
|
meillo@13
|
24 read_time();
|
meillo@13
|
25
|
meillo@13
|
26
|
meillo@13
|
27 /* modules */
|
meillo@13
|
28 run_module("clock", worldclock);
|
meillo@13
|
29 run_module("weather", weather);
|
meillo@13
|
30 run_module("environment", environment);
|
meillo@13
|
31 /* run_module("market", market); */
|
meillo@13
|
32 run_module("growth", growth);
|
meillo@13
|
33 /* run_module("orderexec", orderexec); */
|
meillo@13
|
34
|
meillo@13
|
35
|
meillo@13
|
36 db_close();
|
meillo@13
|
37 /* echo "finished backend cycle at `date +%F\ %H:%M:%S`" */
|
meillo@13
|
38
|
meillo@13
|
39 return 0;
|
meillo@13
|
40 }
|