guowenxue
2020-08-21 02f4d9518378031c63df7a36c49d8b2eabdaab90
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
45
46
/*********************************************************************************
 *      Copyright:  (C) 2012 Guo Wenxue<guowenxue@gmail.com>  
 *                  All rights reserved.
 *
 *       Filename:  test_ini.c
 *    Description:  This file 
 *                 
 *        Version:  1.0.0(12/18/2012~)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "12/18/2012 10:54:09 AM"
 *                 
 ********************************************************************************/
 
#include "cp_iniparser.h"
 
 
#define INI_CONF   "sample.ini"
 
/********************************************************************************
 *  Description:
 *   Input Args:
 *  Output Args:
 * Return Value:
 ********************************************************************************/
int main (int argc, char **argv)
{
    dictionary   *ini;
    FILE         *fp;
 
    ini=iniparser_load(INI_CONF);
 
    fp=fopen(INI_CONF, "w+");
 
    iniparser_set(ini, "section1:key1", "30");
 
 
    iniparser_dump(ini, stderr);
 
    iniparser_dump_ini(ini, fp);
 
 
    iniparser_freedict(ini);
 
 
    return 0;
} /* ----- End of main() ----- */