2 #include <stdio.h> /* for printf, NULL */
3 #include <stdlib.h> /* for free */
4 #include <string.h> /* for strlen */
7 #include "pnd_container.h"
10 int main ( int argc, char *argv[] ) {
12 // if an argument specified, try to load that one instead
15 h = pnd_conf_fetch_by_path ( argv [ 1 ] );
16 char *i = pnd_box_get_head ( h );
17 printf ( "%s -> %s [%p:%d]\n", pnd_box_get_key ( i ), i, i, strlen ( i ) );
18 while ( ( i = pnd_box_get_next ( i ) ) ) {
19 printf ( "%s -> %s [%p:%d]\n", pnd_box_get_key ( i ), i, i, strlen ( i ) );
22 char *poop = pnd_conf_get_as_char ( h, "info.viewer_args" );
23 printf ( "info.viewer_args test: %s [%p:%d]\n", poop, poop, strlen ( poop ) );
28 // attempt to fetch a sensible default searchpath for configs
29 char *configpath = pnd_conf_query_searchpath();
30 printf ( "Config searchpath is: '%s'\n", configpath );
32 // attempt to fetch the 'apps' config
35 apph = pnd_conf_fetch_by_id ( pnd_conf_apps, configpath );
38 printf ( "Couldn't locate apps config!\n" );
42 // dump the config file
43 printf ( "Config file name is: '%s'\n", pnd_box_get_name ( apph ) );
44 char *value = pnd_box_get_head ( apph );
45 printf ( "Config has key '%s'\n", pnd_box_get_key ( value ) );
46 printf ( "Config has value '%s'\n", value );
47 while ( ( value = pnd_box_get_next ( value ) ) ) {
48 printf ( "Config has key '%s'\n", pnd_box_get_key ( value ) );
49 printf ( "Config has value '%s'\n", value );
52 // lets query the apps config
55 binpath = pnd_conf_get_as_char ( apph, PND_APPS_KEY );
58 printf ( "Couldn't locate the app auto-discovery searchpath!\n" );
62 printf ( "Located auto-discovery searchpath '%s'\n", binpath );
64 // exeunt with alarums
66 pnd_box_delete ( apph );