-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
44 lines (36 loc) · 926 Bytes
/
main.c
File metadata and controls
44 lines (36 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "main.h"
int
mainLoadRes(obj_resources* ptr){
FILE* res_conf_json=fopen(F_MAIN_CONF,"r");
bool error=false;
if(!res_conf_json){
fprintf(stderr,"test %s failed to open %s",__func__,F_MAIN_CONF);
return(1);}
else{
size_t strLength=0;
json_stream JS={0};
json_open_stream(&JS, res_conf_json);
json_set_streaming(&JS,true);
skipToNextObj(&JS,&strLength);
resourcesFinalize(ptr);
resourcesParse(ptr,&JS);
if(error){
fprintf(stderr,"PARISING ERROR %s\n",__func__);}
//resources_Dump(ptr); //debugDUMP
json_close(&JS);
fclose(res_conf_json);
return(0);}}
#ifndef _TESTS
int
main(int argc, char **argv){
fprintf(stderr,"argc=%d arg1=%s\n",argc,*argv);
time_t tt; //FIXIT
srand(time(&tt)); //FIXIT
setlocale(LC_ALL, "en_US.utf8");
obj_resources resources={0};
resourcesFinalize(&resources);
mainLoadRes(&resources);
tuiInit();
resourcesClean(&resources);
}
#endif