Initial commit of libpnd 0.0.5 so we cna restart with GIT
[pandora-libraries.git] / include / pnd_pxml.h
1
2 #ifndef h_pnd_pxml_h
3 #define h_pnd_pxml_h
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 // this code is for very basic PXML.xml file parsing
10
11 #define PXML_FILENAME "PXML.xml" /* a specification defined name */
12
13 // use this handle to interact with PXML; this hides the mechanics of parsing a PXML file so that
14 // it can be upgraded with impacting applications
15 typedef void* pnd_pxml_handle;
16
17 /* pxml_fetch() will return NULL on fail, otherwise a valid handle which may be further queried
18  */
19 pnd_pxml_handle pnd_pxml_fetch ( char *fullpath );
20 void pnd_pxml_delete ( pnd_pxml_handle h );
21
22 /* overrides() allow for customization of a PXML that persists; ie: An application might be sitting
23  * on an SD card and popped out while we need to edit its personalized category; more to point, the
24  * PXML itself could be in a read-only SD or packed into an ISO, or just sitting in a directory.
25  * Rather than have a _second_ PXML in the same place or have to write back to read-only media or
26  * worry about losing customizations when an app is temporarily deleted, we can just keep the
27  * overrides themselves in NAND.
28  */
29 /* merge_override() will attempt to locate an override of the given PXML, and will modify the
30  * PXML in-place to include any overrides found.
31  * Returns >0 if a merge was done, 0 if no merge was done, and <0 on error
32  * NOTE: For searchpath, should query configs for PND_PXML_OVERRIDES_KEY (or use PND_PXML_OVERRIDES_SEARCHPATH)
33  */
34 signed char pnd_pxml_merge_override ( pnd_pxml_handle h, char *searchpath );
35
36 /* these accessor functions will return READ ONLY char*s; do not free them or modify them.
37  */
38 char *pnd_pxml_get_app_name ( pnd_pxml_handle h );
39 char *pnd_pxml_get_icon_path ( pnd_pxml_handle h );
40 char *pnd_pxml_get_unique_id ( pnd_pxml_handle h );
41 char *pnd_pxml_get_primary_category ( pnd_pxml_handle h );
42 char *pnd_pxml_get_exec_path ( pnd_pxml_handle h );
43 char *pnd_pxml_get_clockspeed ( pnd_pxml_handle h );
44
45 // for 'set' functions, pass NULL value to delete existing value without setting new one
46 void pnd_pxml_set_app_name ( pnd_pxml_handle h, char *v );
47
48 /* utilities
49  */
50 unsigned char pnd_is_pxml_valid_app ( pnd_pxml_handle h ); // returns 1 when pxml seems like a valid application
51
52 typedef struct\r
53 {
54         char *title_en;
55         char *title_de;
56         char *title_it;
57         char *title_fr;
58         char *unique_id;
59         char *standalone;
60         char *icon;
61         char *description_en;
62         char *description_de;
63         char *description_it;
64         char *description_fr;
65         char *previewpic1;
66         char *previewpic2;
67         char *author_name;
68         char *author_website;
69         char *version_major;
70         char *version_minor;
71         char *version_release;
72         char *version_build;
73         char *exec;
74         char *main_category;
75         char *subcategory1;
76         char *subcategory2;
77         char *altcategory;
78         char *altsubcategory1;
79         char *altsubcategory2;
80         char *osversion_major;
81         char *osversion_minor;
82         char *osversion_release;
83         char *osversion_build;
84         char *associationitem1_name;
85         char *associationitem1_filetype;
86         char *associationitem1_parameter;
87         char *associationitem2_name;
88         char *associationitem2_filetype;
89         char *associationitem2_parameter;
90         char *associationitem3_name;
91         char *associationitem3_filetype;
92         char *associationitem3_parameter;
93         char *clockspeed;
94         char *background;
95         char *startdir;
96 \r
97 }  pnd_pxml_t;
98
99 #ifdef __cplusplus
100 } /* "C" */
101 #endif
102
103 #endif