33 #include "../public/nsapi.h" |
33 #include "../public/nsapi.h" |
34 #include "../util/systhr.h" |
34 #include "../util/systhr.h" |
35 |
35 |
36 #include "func.h" |
36 #include "func.h" |
37 #include "config.h" |
37 #include "config.h" |
|
38 #include "configmanager.h" |
38 #include "httplistener.h" |
39 #include "httplistener.h" |
39 #include "webserver.h" |
40 #include "webserver.h" |
40 |
41 |
41 |
42 |
42 extern struct FuncStruct webserver_funcs[]; |
43 extern struct FuncStruct webserver_funcs[]; |
49 // init NSAPI functions |
50 // init NSAPI functions |
50 func_init(); |
51 func_init(); |
51 add_functions(webserver_funcs); |
52 add_functions(webserver_funcs); |
52 |
53 |
53 // load init.conf |
54 // load init.conf |
54 load_init_conf(NULL); |
55 load_init_conf("conf/init.conf"); |
55 |
56 |
56 // load server.conf |
57 // load server.conf |
57 load_server_conf(NULL); |
58 init_configuration_manager(); |
|
59 if(cfgmgr_load_config() != 0) { |
|
60 fprintf(stderr, "Cannot load configuration\n"); |
|
61 return -1; |
|
62 } |
58 |
63 |
59 // init NSAPI functions |
64 // init NSAPI functions |
60 |
65 |
61 |
66 |
62 return 0; |
67 return 0; |