From 429e46051dba814e7d6c74368eb1bba550222cbe Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Thu, 1 Dec 2011 22:56:23 +0000 Subject: Imported Upstream version 1.4.8 --- samples/c/sample2.c | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 samples/c/sample2.c (limited to 'samples/c/sample2.c') diff --git a/samples/c/sample2.c b/samples/c/sample2.c deleted file mode 100644 index 09c45de..0000000 --- a/samples/c/sample2.c +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************* - ** Sample2 - ** Load sample.cfg and access the "values" array - *************************************************************************/ - -#include -#include - -struct config_t cfg; - -/***************************************************************************/ - -int main() -{ - /* Initialize the configuration */ - config_init(&cfg); - - /* Load the file */ - printf("loading [sample.cfg].."); - if (!config_read_file(&cfg, "sample.cfg")) - printf("failed\n"); - else - { - config_setting_t *array = NULL; - - printf("ok\n"); - - /* Display the "values" array */ - printf("display \"values\".."); - array = config_lookup(&cfg, "values"); - if (!array) - printf("failed\n"); - else - { - long value1,value2; - value1 = config_setting_get_int_elem(array, 0); - value2 = config_setting_get_int_elem(array, 1); - printf("[%lu %lu]..ok\n", value1, value2); - - printf("Done!\n"); - } - - } - - /* Free the configuration */ - config_destroy(&cfg); - - return 0; -} - - -/***************************************************************************/ -- cgit v1.2.3