10 // Gets the byte size of a file
11 int file_byte_size(char* path
)
13 int f
= open(path
, O_RDONLY
);
24 int main(int argc
, char** argv
)
27 printf("Usage: ./c_parser file\n");
31 int fl_sz
= file_byte_size(argv
[1]);
32 char* input
= malloc(fl_sz
);
34 FILE* ifl
= fopen(argv
[1], "r");
36 printf("Error: cannot read file %s, are you sure permissions are set correctly ?\n", argv
[1]);
39 int rd
= fread(input
, 1, fl_sz
, ifl
);
44 UJObject obj
= UJDecode(input
, fl_sz
, NULL
, &state
);