Server now listens and accepts connections (and returns a value to USER)
[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                         default:
40                                 // Usage Error?
41                                 break;
42                         }
43                 }
44                 else {
45                         // Usage Error?
46                 }
47         }
48         
49         //Init_Cokebank();
50         
51         //Load_Itemlist();
52         
53         Server_Start();
54         
55         return 0;
56 }
57

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