// ---> cribbed right out of discotest :/ copypaste ftw!
if ( ! pnd_run ) {
char *configpath;
- char *appspath;
char *overridespath;
// attempt to fetch a sensible default searchpath for configs
apph = pnd_conf_fetch_by_id ( pnd_conf_apps, configpath );
if ( apph ) {
- appspath = pnd_conf_get_as_char ( apph, PND_APPS_KEY );
-
- if ( ! appspath ) {
- appspath = PND_APPS_SEARCHPATH;
- }
overridespath = pnd_conf_get_as_char ( apph, PND_PXML_OVERRIDE_KEY );
} else {
// couldn't find a useful app search path so use the default
- appspath = PND_APPS_SEARCHPATH;
overridespath = PND_PXML_OVERRIDE_SEARCHPATH;
}
}
pnd_pxml_handle h = NULL;
+ pnd_pxml_handle *apps = NULL;
if ( pnd_pnd_seek_pxml ( f ) ) {
if ( pnd_pnd_accrue_pxml ( f, pxmlbuf, pxmlbuflen ) ) {
- h = pnd_pxml_fetch_buffer ( "pnd_run", pxmlbuf );
+ apps = pnd_pxml_fetch_buffer ( "pnd_run", pxmlbuf );
}
}
fclose ( f );
- if ( ! h ) {
+ if ( ! apps ) {
printf ( "ERROR: Couldn't pull PXML.xml from the pndfile.\n" );
exit ( 0 );
}
- // attempt to invoke
- unsigned int options = 0;
- if ( no_x11 ) {
- options |= PND_EXEC_OPTION_NOX11;
- }
+ // attempt to invoke.. all of the subapps? just first one?
- unsigned int clock = 200;
- if ( pnd_pxml_get_clockspeed ( h ) ) {
- clock = atoi ( pnd_pxml_get_clockspeed ( h ) );
- }
+ while ( *apps ) {
+ h = *apps;
+
+ unsigned int options = 0;
+ if ( no_x11 ) {
+ options |= PND_EXEC_OPTION_NOX11;
+ }
+
+ unsigned int clock = 200;
+ if ( pnd_pxml_get_clockspeed ( h ) ) {
+ clock = atoi ( pnd_pxml_get_clockspeed ( h ) );
+ }
+
+ if ( ! pnd_apps_exec ( pnd_run, pndfile,
+ pnd_pxml_get_unique_id ( h ),
+ pnd_pxml_get_exec ( h ),
+ pnd_pxml_get_startdir ( h ),
+ NULL /* args */,
+ clock,
+ options )
+ )
+ {
+ printf ( "ERROR: PXML.xml data is bad\n" );
+ }
- pnd_apps_exec ( pnd_run, pndfile,
- pnd_pxml_get_unique_id ( h ),
- pnd_pxml_get_exec ( h ),
- pnd_pxml_get_startdir ( h ),
- clock,
- options );
+ // next
+ apps++;
+ } // while
return ( 0 );
} // main