source: Daodan/MSVC/inifile_test.c@ 983

Last change on this file since 983 was 567, checked in by gumby, 14 years ago

Daodan MSVC

File size: 746 bytes
Line 
1#include <stdio.h>
2#include "bool.h"
3#include <string.h>
4#include "inifile.h"
5
6bool ini_callback(char* section, bool newsection, char* name, char* value)
7{
8 if (newsection)
9 puts("New Section!");
10 printf("Section: %s Name: %s Value: %s\n", section, name, value);
11 if (!_stricmp(name, "cleantest"))
12 printf(" CleanTest: \"%s\" = \"%s\"\n", value, inifile_cleanstr(value));
13 if (!_stricmp(name, "inttest"))
14 printf(" IntTest: %s = %u\n", value, (uint32_t)inifile_parseint(value, false));
15 if (!_stricmp(name, "sinttest"))
16 printf(" IntTest: %s = %d\n", value, (int32_t)inifile_parseint(value, true));
17 return true;
18}
19
20int main()
21{
22 if (!inifile_read("testini.ini", ini_callback))
23 puts("Read error!");
24 return 0;
25}
Note: See TracBrowser for help on using the repository browser.