2 #include <stdio.h> // for stdio
3 #include <unistd.h> // for exit()
4 #include <stdlib.h> // for exit()
7 #include "pnd_container.h"
9 #include "pnd_locate.h"
11 int main ( int argc, char *argv[] ) {
15 /* attempt to sort out the config file madness
18 // attempt to fetch a sensible default searchpath for configs
19 configpath = pnd_conf_query_searchpath();
21 // attempt to fetch app config, or default the pnd_run.sh location
24 apph = pnd_conf_fetch_by_id ( pnd_conf_apps, configpath );
27 pndpath = pnd_conf_get_as_char ( apph, PND_PNDRUN_SEARCHPATH_KEY );
29 printf ( "Found a path in apps config: '%s'\n", pndpath );
32 pndpath = PND_PNDRUN_SEARCHPATH_KEY;
36 // couldn't find a useful app search path so use the default
37 pndpath = PND_PNDRUN_SEARCHPATH_KEY;
40 // given a searchpath (Default or configured), try to find pnd_run.sh; if not
41 // found, then just use the default
44 printf ( "Searching in path '%s'\n", pndpath );
46 pndrun = pnd_locate_filename ( pndpath, PND_PNDRUN_FILENAME );
49 printf ( "Result is default, not a locate-find\n" );
50 pndrun = PND_PNDRUN_DEFAULT;
53 printf ( "Locate found pnd_run.sh in '%s'\n", pndrun );