#define PND_EXEC_OPTION_BLOCK 1 /* wait till children complete; note, children might fork on their own.. */
#define PND_EXEC_OPTION_NOUNION 2 /* request pnd_run not use a union, just do the mount/run */
#define PND_EXEC_OPTION_NOX11 4 /* request pnd_run to kill x11 and restart it after */
-#define PND_EXEC_OPTION_FUTURE2 8
+#define PND_EXEC_OPTION_NORUN 8 /* don't try to run; just form the pnd_run.sh line and cache it */
+#define PND_EXEC_OPTION_FUTURE2 16
unsigned char pnd_apps_exec ( char *pndrun, char *fullpath, char *unique_id,
char *rel_exec, char *rel_startdir,
char *args,
unsigned int clockspeed, unsigned int options );
+char *pnd_apps_exec_runline ( void ); // returns the cached pnd_run.sh line from last PND_EXEC_OPTION_NORUN
// should you wish to know where an app will get mounted, call this function to obtain a guess. The
// logic is wrapped up in pnd_run.sh, but in theory should be easily determined.
#include "pnd_container.h"
#include "pnd_pxml.h"
#include "pnd_apps.h"
+#include "pnd_logger.h"
+
+static char apps_exec_runline [ 1024 ];
+
+char *pnd_apps_exec_runline ( void ) {
+ return ( apps_exec_runline );
+}
unsigned char pnd_apps_exec ( char *pndrun, char *fullpath, char *unique_id,
char *rel_exec, char *rel_startdir,
// finish
argv [ f++ ] = NULL; // for execv
+ // stop here?
+ if ( options & PND_EXEC_OPTION_NORUN ) {
+ unsigned char i;
+ bzero ( apps_exec_runline, 1024 );
+ //pnd_log ( PND_LOG_DEFAULT, "Norun %u\n", f );
+ for ( i = 0; i < ( f - 1 ); i++ ) {
+ //pnd_log ( PND_LOG_DEFAULT, "Norun %u: %s\n", i, argv [ i ] );
+
+ // add spacing between args
+ if ( i > 0 ) {
+ strncat ( apps_exec_runline, " ", 1000 );
+ }
+
+ // if this is for -a, we need to wrap with quotes
+ if ( i > 0 && strcmp ( argv [ i - 1 ], "-a" ) == 0 ) {
+ strncat ( apps_exec_runline, "\"", 1000 );
+ }
+
+ strncat ( apps_exec_runline, argv [ i ], 1000 );
+
+ // if this is for -a, we need to wrap with quotes
+ if ( i > 0 && strcmp ( argv [ i - 1 ], "-a" ) == 0 ) {
+ strncat ( apps_exec_runline, "\"", 1000 );
+ }
+
+ }
+ return ( 1 );
+ }
+
// debug
#if 0
int i;