2 #include <stdio.h> /* for printf, NULL */
3 #include <stdlib.h> /* for free */
6 #include "pnd_container.h"
11 // attempt to fetch a sensible default searchpath for configs
12 char *configpath = pnd_conf_query_searchpath();
13 printf ( "Config searchpath is: '%s'\n", configpath );
15 // attempt to fetch the 'apps' config
18 apph = pnd_conf_fetch_by_id ( pnd_conf_apps, configpath );
21 printf ( "Couldn't locate apps config!\n" );
25 // dump the config file
26 printf ( "Config file name is: '%s'\n", pnd_box_get_name ( apph ) );
27 char *value = pnd_box_get_head ( apph );
28 printf ( "Config has key '%s'\n", pnd_box_get_key ( value ) );
29 printf ( "Config has value '%s'\n", value );
30 while ( ( value = pnd_box_get_next ( value ) ) ) {
31 printf ( "Config has key '%s'\n", pnd_box_get_key ( value ) );
32 printf ( "Config has value '%s'\n", value );
35 // lets query the apps config
38 binpath = pnd_conf_get_as_char ( apph, PND_APPS_KEY );
41 printf ( "Couldn't locate the app auto-discovery searchpath!\n" );
45 printf ( "Located auto-discovery searchpath '%s'\n", binpath );
47 // exeunt with alarums
49 pnd_box_delete ( apph );