aboutsummaryrefslogtreecommitdiff
path: root/iniparser-4.1/example/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'iniparser-4.1/example/parse.c')
-rw-r--r--iniparser-4.1/example/parse.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/iniparser-4.1/example/parse.c b/iniparser-4.1/example/parse.c
new file mode 100644
index 0000000..37d07aa
--- /dev/null
+++ b/iniparser-4.1/example/parse.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "iniparser.h"
+
+int main(int argc, char * argv[])
+{
+ dictionary * ini ;
+ char * ini_name ;
+
+ if (argc<2) {
+ ini_name = "twisted.ini";
+ } else {
+ ini_name = argv[1] ;
+ }
+
+ ini = iniparser_load(ini_name);
+ iniparser_dump(ini, stdout);
+ iniparser_freedict(ini);
+
+ return 0 ;
+}