3 #define INI_MAX_LINE 200
5 typedef char* (*ini_reader
)(char* str
, int num
, void* stream
);
7 int ini_parse(const char* filename
);
9 static int ini_parse_stream(ini_reader reader
, void* stream
)
11 char line
[INI_MAX_LINE
];
12 int max_line
= INI_MAX_LINE
;
13 while (reader(line
, max_line
, stream
) != NULL
)
18 static int ini_parse_file(FILE* file
)
20 return ini_parse_stream((ini_reader
)fgets
, file
);
23 int ini_parse(const char* filename
)
28 file
= fopen(filename
, "r");
31 error
= ini_parse_file(file
);