// another struct? Have always intended discovery_t to have minimal members.. just enough to lead to an
// application (PXML, xecutable, name); if the apps want more details, they can use the pnd_pxml code to
// fetch the full PXML and get all the details. But I think we got out of control here :)
-typedef struct
-{
+typedef struct {
+ // base
+ char *path_to_object; // full path to the PXML.xml or awesomeapp.pnd file
+ // strdup'd from PXML
char *title_en;
char *unique_id;
char *icon;
// check for validity and add to resultset if it looks executable
if ( pnd_is_pxml_valid_app ( pxmlh ) ) {
- //char b [ 1024 ]; // TBD: also lame
pnd_disco_t *p;
p = pnd_box_allocinsert ( disco_box, (char*) fpath, sizeof(pnd_disco_t) );
+
+ // base path
+ p -> path_to_object = strdup ( fpath );
+
+ // PXML fields
if ( pnd_pxml_get_app_name_en ( pxmlh ) ) {
p -> title_en = strdup ( pnd_pxml_get_app_name_en ( pxmlh ) );
}
}
if ( pnd_pxml_get_exec ( pxmlh ) ) {
p -> exec = strdup ( pnd_pxml_get_exec ( pxmlh ) );
- //snprintf ( b, 1024, "pnd_run_magic %s", pnd_pxml_get_exec ( pxmlh ) );
- //p -> exec = strdup ( b );
}
if ( pnd_pxml_get_unique_id ( pxmlh ) ) {
p -> unique_id = strdup ( pnd_pxml_get_unique_id ( pxmlh ) );
printf ( "App: %s\n", pnd_box_get_key ( d ) );
+ printf ( " Base path: %s\n", d -> path_to_object );
+
if ( d -> title_en ) {
printf ( " Name: %s\n", d -> title_en );
}