Added support for a hup script; if the pnd.hupscript key is within the 'apps' config...
[pandora-libraries.git] / include / pnd_apps.h
1
2 #ifndef h_pnd_apps_h
3 #define h_pnd_apps_h
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 #define PND_APPS_SEARCHPATH "/mnt/sd1/pandora/apps:/mnt/sd2/pandora/apps:./testdata/apps"
10 #define PND_APPS_KEY "autodiscovery.searchpath"
11
12 #define PND_PNDRUN_SEARCHPATH_KEY "pnd.searchpath"
13 #define PND_PNDRUN_KEY "pnd.runscript"
14 #define PND_PNDRUN_FILENAME "pnd_run.sh"
15 #define PND_PNDRUN_DEFAULT "./testdata/scripts/pnd_run.sh"
16
17 #define PND_PNDHUP_KEY "pnd.hupscript"
18 #define PND_PNDHUP_FILENAME "pnd_hup.sh"
19
20 #define PND_PXML_OVERRIDE_SEARCHPATH "~/pxml-overrides"
21 #define PND_PXML_OVERRIDE_KEY "overrides.searchpath"
22
23 #define PND_MOUNT_PATH "/mnt/apps/" /* all mounted PND images should be here.. /mnt/apps/myapp/... */
24
25 // .desktop support
26 #define PND_DOTDESKTOP_KEY "dotfiles.dotdesktoppath"
27 #define PND_DOTDESKTOP_DEFAULT "/usr/share/applications"
28
29 // apps
30 #define PND_DEFAULT_WORKDIR "./"
31
32 /* pnd_apps_exec() is used to blindly launch an app, be it a .pnd file bundle or a plain executable
33  * (shell, bin, whatever.) pndrun specifies the full path to the pnd_run sh script, which should be
34  * found using searchpaths and locates.. see locatetest.c for a sample
35  * pnd_run, fullpath, unique_id, rel_exec required
36  * rel_startdir, clockspeed, options are optional
37  * NOTE: Use pnd_locate function to locate the pnd_run, for example
38  * NOTE: if specified, clock speed will be set prior to invoking the script, and set back on exit
39  * NOTE: No values can be except clockspeed; a 0 clockspeed means 'leave alone'. Set startdoir to "." instead of NULL.
40  * fork() is implied; calling this function does not kill this process :)
41  * NOTE: PAss in the full path to the awesomeapp.pnd or to the directory containing PXML.xml (not the PXML.xml itself.)
42  * Options is a set of boolean flags, derived from the #define's below; OR them together.
43  *   option-block, when set, suggests the launch should wait until the invoked application exits (disregarding why app exits)
44  *   example: options = PND_EXEC_OPTION_BLOCK | PND_EXEC_OPTION_2;
45  */
46 #define PND_EXEC_OPTION_NIL        0
47 #define PND_EXEC_OPTION_BLOCK      1 /* wait till children complete; note, children might fork on their own.. */
48 #define PND_EXEC_OPTION_NOUNION    2 /* request pnd_run not use a union, just do the mount/run */
49 #define PND_EXEC_OPTION_FUTURE2    4
50
51 unsigned char pnd_apps_exec ( char *pndrun, char *fullpath, char *unique_id,
52                               char *rel_exec, char *rel_startdir,
53                               unsigned int clockspeed, unsigned int options );
54
55 #ifdef __cplusplus
56 } /* "C" */
57 #endif
58
59 #endif