26 if (fopen_s(&h_file, f_path,
"r") || !h_file)
return 0;
29 char* c_str_ptr = 0, * c_str_ptr_end = 0;
33 unsigned int line_number = 1;
34 while (fgets(c_line,
sizeof(c_line), h_file))
43 if (*c_line ==
'[' && (c_str_ptr = strchr(c_line,
']')))
47 handler(data, line_number, c_line + 1, 0, 0);
49 else if ((c_str_ptr = strchr(c_line,
'=')))
52 if ((c_str_ptr_end = strchr(c_str_ptr,
'\n'))) {
53 *c_str_ptr_end =
'\0';
58 handler(data, line_number, 0, c_line, c_str_ptr + 1);