9 // this code is for very basic PXML.xml file parsing
11 #define PXML_FILENAME "PXML.xml" /* a specification defined name */
12 #define PXML_TAGHEAD "<PXML>" /* case insensitive */
13 #define PXML_TAGFOOT "</PXML>" /* case insensitive */
15 // use this handle to interact with PXML; this hides the mechanics of parsing a PXML file so that
16 // it can be upgraded with impacting applications
17 typedef void* pnd_pxml_handle;
19 /* pxml_fetch() will return NULL on fail, otherwise a valid handle which may be further queried
21 pnd_pxml_handle pnd_pxml_fetch ( char *fullpath );
22 pnd_pxml_handle pnd_pxml_fetch_buffer ( char *filename, char *buffer );
23 void pnd_pxml_delete ( pnd_pxml_handle h );
25 /* overrides() allow for customization of a PXML that persists; ie: An application might be sitting
26 * on an SD card and popped out while we need to edit its personalized category; more to point, the
27 * PXML itself could be in a read-only SD or packed into an ISO, or just sitting in a directory.
28 * Rather than have a _second_ PXML in the same place or have to write back to read-only media or
29 * worry about losing customizations when an app is temporarily deleted, we can just keep the
30 * overrides themselves in NAND.
32 /* merge_override() will attempt to locate an override of the given PXML, and will modify the
33 * PXML in-place to include any overrides found.
34 * Returns >0 if a merge was done, 0 if no merge was done, and <0 on error
35 * NOTE: For searchpath, should query configs for PND_PXML_OVERRIDES_KEY (or use PND_PXML_OVERRIDES_SEARCHPATH)
37 signed char pnd_pxml_merge_override ( pnd_pxml_handle h, char *searchpath );
39 /* these accessor functions will return READ ONLY char*s; do not free them or modify them.
41 char *pnd_pxml_get_app_name ( pnd_pxml_handle h );
42 char *pnd_pxml_get_icon_path ( pnd_pxml_handle h );
43 char *pnd_pxml_get_unique_id ( pnd_pxml_handle h );
44 char *pnd_pxml_get_primary_category ( pnd_pxml_handle h );
45 char *pnd_pxml_get_exec_path ( pnd_pxml_handle h );
46 char *pnd_pxml_get_clockspeed ( pnd_pxml_handle h );
48 // for 'set' functions, pass NULL value to delete existing value without setting new one
49 void pnd_pxml_set_app_name ( pnd_pxml_handle h, char *v );
53 unsigned char pnd_is_pxml_valid_app ( pnd_pxml_handle h ); // returns 1 when pxml seems like a valid application
74 char *version_release;
81 char *altsubcategory1;
82 char *altsubcategory2;
83 char *osversion_major;
84 char *osversion_minor;
85 char *osversion_release;
86 char *osversion_build;
87 char *associationitem1_name;
88 char *associationitem1_filetype;
89 char *associationitem1_parameter;
90 char *associationitem2_name;
91 char *associationitem2_filetype;
92 char *associationitem2_parameter;
93 char *associationitem3_name;
94 char *associationitem3_filetype;
95 char *associationitem3_parameter;