3 * UCC (University [of WA] Computer Club) Electronic Accounting System
5 * main.c - Initialisation Code
7 * This file is licenced under the 3-clause BSD Licence. See the file
8 * COPYING for full details.
17 extern void Init_Cokebank(const char *Argument); // cokebank.c
18 extern void Init_Handlers(void);
19 extern void Load_Itemlist(void);
20 extern void Server_Start(void);
21 extern int giServer_Port;
22 extern char* gsItemListFile;
23 extern char* gsCoke_SerialPort;
24 extern char* gsSnack_SerialPort;
28 char *gsCokebankPath = "cokebank.db";
36 int main(int argc, char *argv[])
41 for( i = 1; i < argc; i++ )
44 if( arg[0] == '-' && arg[1] != '-')
49 giServer_Port = atoi(argv[++i]);
52 giDebugLevel = atoi(argv[++i]);
59 else if( arg[0] == '-' && arg[1] == '-' ) {
60 if( strcmp(arg, "--itemsfile") == 0 ) {
61 gsItemListFile = argv[++i];
63 else if( strcmp(arg, "--cokeport") == 0 ) {
64 gsCoke_SerialPort = argv[++i];
66 else if( strcmp(arg, "--snackport") == 0 ) {
67 gsSnack_SerialPort = argv[++i];
78 signal(SIGINT, sigint_handler);
80 Init_Cokebank(gsCokebankPath);