e99a7fc3e3a69c065786cba62b1abc87ed22573b
[tpg/opendispense2.git] / server / src / main.c
1 /*
2  * OpenDispense 2 
3  * UCC (University [of WA] Computer Club) Electronic Accounting System
4  *
5  * main.c - Initialisation Code
6  *
7  * This file is licenced under the 3-clause BSD Licence. See the file
8  * COPYING for full details.
9  */
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include "common.h"
13
14 // === IMPORTS ===
15 extern void     Init_Cokebank(void);
16 extern void     Load_Itemlist(void);
17 extern void     Server_Start(void);
18 extern int      giServer_Port;
19
20 // === GLOBALS ===
21  int    giDebugLevel = 0;
22
23 // === CODE ===
24 int main(int argc, char *argv[])
25 {
26          int    i;
27         
28         // Parse Arguments
29         for( i = 1; i < argc; i++ )
30         {
31                 char    *arg = argv[i];
32                 if( arg[0] == '-' )
33                 {
34                         switch(arg[1])
35                         {
36                         case 'p':
37                                 giServer_Port = atoi(argv[++i]);
38                                 break;
39                         case 'd':
40                                 giDebugLevel = atoi(argv[++i]);
41                                 break;
42                         default:
43                                 // Usage Error?
44                                 break;
45                         }
46                 }
47                 else {
48                         // Usage Error?
49                 }
50         }
51         
52         Init_Cokebank();
53         
54         //Load_Itemlist();
55         
56         Server_Start();
57         
58         return 0;
59 }
60

UCC git Repository :: git.ucc.asn.au