#include <glib.h>
typedef struct metadata_x {
- const char *key;
- const char *value;
+ char *key;
+ char *value;
} metadata_x;
typedef struct permission_x {
- const char *type;
- const char *value;
+ char *type;
+ char *value;
} permission_x;
typedef struct icon_x {
- const char *text;
- const char *lang;
- const char *section;
- const char *size;
- const char *resolution;
- const char *dpi;
+ char *text;
+ char *lang;
+ char *section;
+ char *size;
+ char *resolution;
+ char *dpi;
} icon_x;
typedef struct image_x {
- const char *text;
- const char *lang;
- const char *section;
+ char *text;
+ char *lang;
+ char *section;
} image_x;
typedef struct define_x {
- const char *path;
+ char *path;
GList *allowed;
GList *request;
} define_x;
} datashare_x;
typedef struct description_x {
- const char *name;
- const char *text;
- const char *lang;
+ char *name;
+ char *text;
+ char *lang;
} description_x;
typedef struct label_x {
- const char *name;
- const char *text;
- const char *lang;
+ char *name;
+ char *text;
+ char *lang;
} label_x;
typedef struct author_x {
- const char *email;
- const char *href;
- const char *text;
- const char *lang;
+ char *email;
+ char *href;
+ char *text;
+ char *lang;
} author_x;
typedef struct license_x {
- const char *text;
- const char *lang;
+ char *text;
+ char *lang;
} license_x;
typedef struct condition_x {
- const char *name;
- const char *text;
+ char *name;
+ char *text;
} condition_x;
typedef struct notification_x {
- const char *name;
- const char *text;
+ char *name;
+ char *text;
} notification_x;
typedef struct appcontrol_x {
- const char *operation;
- const char *uri;
- const char *mime;
+ char *operation;
+ char *uri;
+ char *mime;
} appcontrol_x;
typedef struct compatibility_x {
- const char *name;
- const char *text;
+ char *name;
+ char *text;
} compatibility_x;
typedef struct datacontrol_x {
- const char *providerid;
- const char *access;
- const char *type;
+ char *providerid;
+ char *access;
+ char *type;
} datacontrol_x;
typedef struct splashscreen_x {
- const char *src;
- const char *type;
- const char *dpi;
- const char *orientation;
- const char *indicatordisplay;
- const char *operation;
+ char *src;
+ char *type;
+ char *dpi;
+ char *orientation;
+ char *indicatordisplay;
+ char *operation;
} splashscreen_x;
typedef struct application_x {
- const char *appid; /*attr*/
- const char *exec; /*attr*/
- const char *nodisplay; /*attr, default: "false"*/
- const char *multiple; /*attr, default: "false"*/
- const char *taskmanage; /*attr, default: "true"*/
- const char *enabled; /*attr, default: "true"*/
- const char *type; /*attr*/
- const char *categories; /*attr*/
- const char *extraid; /*attr*/
- const char *hwacceleration; /*attr, default: "default"*/
- const char *screenreader; /*attr, default: "use-system-setting"*/
- const char *mainapp; /*attr, default: "false"*/
- const char *package; /*set from package_x*/
- const char *recentimage; /*attr, default: "false"*/
- const char *launchcondition; /*attr, default: "false"*/
- const char *indicatordisplay; /*attr, default: "true"*/
- const char *portraitimg; /*attr*/
- const char *landscapeimg; /*attr*/
- const char *effectimage_type; /*attr, default: "image"*/
- const char *guestmode_visibility; /*attr, default: "true"*/
- const char *component; /*no xml part*/
- const char *permission_type; /*attr, default: "normal"*/
- const char *component_type; /*attr, default: "uiapp"*/
- const char *preload; /*no xml part*/
- const char *submode; /*attr, default: "false"*/
- const char *submode_mainid; /*attr, default: "false"*/
- const char *process_pool; /*attr, default: "false"*/
- const char *installed_storage;
- const char *autorestart; /*attr, default: "false"*/
- const char *onboot; /*attr, default: "false"*/
- const char *support_disable; /*set from package_x*/
- const char *ui_gadget; /*attr, default: "false"*/
- const char *launch_mode; /*attr, default: "single"*/
- const char *ambient_support; /*attr, default: "false"*/
- const char *alias_appid; /*attr*/
- const char *effective_appid; /*attr*/
- const char *package_type; /*set from package_x*/
- const char *tep_name; /*set from package_x*/
- const char *root_path; /*set from package_x*/
- const char *api_version; /*set from package_x*/
- const char *for_all_users; /**< Flag that indicates if the package is available for everyone or for current user only, no xml part*/
+ char *appid; /*attr*/
+ char *exec; /*attr*/
+ char *nodisplay; /*attr, default: "false"*/
+ char *multiple; /*attr, default: "false"*/
+ char *taskmanage; /*attr, default: "true"*/
+ char *enabled; /*attr, default: "true"*/
+ char *type; /*attr*/
+ char *categories; /*attr*/
+ char *extraid; /*attr*/
+ char *hwacceleration; /*attr, default: "default"*/
+ char *screenreader; /*attr, default: "use-system-setting"*/
+ char *mainapp; /*attr, default: "false"*/
+ char *package; /*set from package_x*/
+ char *recentimage; /*attr, default: "false"*/
+ char *launchcondition; /*attr, default: "false"*/
+ char *indicatordisplay; /*attr, default: "true"*/
+ char *portraitimg; /*attr*/
+ char *landscapeimg; /*attr*/
+ char *effectimage_type; /*attr, default: "image"*/
+ char *guestmode_visibility; /*attr, default: "true"*/
+ char *component; /*no xml part*/
+ char *permission_type; /*attr, default: "normal"*/
+ char *component_type; /*attr, default: "uiapp"*/
+ char *preload; /*no xml part*/
+ char *submode; /*attr, default: "false"*/
+ char *submode_mainid; /*attr, default: "false"*/
+ char *process_pool; /*attr, default: "false"*/
+ char *installed_storage;
+ char *autorestart; /*attr, default: "false"*/
+ char *onboot; /*attr, default: "false"*/
+ char *support_disable; /*set from package_x*/
+ char *ui_gadget; /*attr, default: "false"*/
+ char *launch_mode; /*attr, default: "single"*/
+ char *ambient_support; /*attr, default: "false"*/
+ char *alias_appid; /*attr*/
+ char *effective_appid; /*attr*/
+ char *package_type; /*set from package_x*/
+ char *tep_name; /*set from package_x*/
+ char *root_path; /*set from package_x*/
+ char *api_version; /*set from package_x*/
+ char *for_all_users; /**< Flag that indicates if the package is available for everyone or for current user only, no xml part*/
GList *label; /*element*/
GList *icon; /*element*/
GList *image; /*element*/
} application_x;
typedef struct package_x {
- const char *for_all_users; /**< Flag that indicates if the package is available for everyone or for current user only, no xml part*/
- const char *package; /**< package name, attr*/
- const char *version; /**< package version, attr*/
- const char *installlocation; /**< package install location, attr, default: "internal-only"*/
- const char *ns; /**<name space, attr*/
- const char *removable; /**< package removable flag, no xml part*/
- const char *preload; /**< package preload flag, no xml part*/
- const char *readonly; /**< package readonly flag, no xml part*/
- const char *update; /**< package update flag, no xml part*/
- const char *appsetting; /**< package app setting flag, attr, default: "false"*/
- const char *system; /**< package system flag, no xml part*/
- const char *type; /**< package type, attr*/
- const char *package_size; /**< package size for external installation, attr*/
- const char *installed_time; /**< installed time after finishing of installation, no xml part*/
- const char *installed_storage; /**< package currently installed storage, no xml part*/
- const char *storeclient_id; /**< id of store client for installed package, attr*/
- const char *mainapp_id; /**< app id of main application, no xml part*/
- const char *package_url; /**< app id of main application, attr*/
- const char *root_path; /**< package root path, attr*/
- const char *csc_path; /**< package csc path, attr*/
- const char *nodisplay_setting; /**< package no display setting menu, attr, default: "false"*/
- const char *support_disable; /**< package support disable flag, attr, default: "false"*/
- const char *api_version; /**< minimum version of API package using, attr, default: patch_version trimmed version from tizen_full_version*/
- const char *tep_name; /*no xml part*/
- const char *backend_installer; /**< package backend installer, attr*/
+ char *for_all_users; /**< Flag that indicates if the package is available for everyone or for current user only, no xml part*/
+ char *package; /**< package name, attr*/
+ char *version; /**< package version, attr*/
+ char *installlocation; /**< package install location, attr, default: "internal-only"*/
+ char *ns; /**<name space, attr*/
+ char *removable; /**< package removable flag, no xml part*/
+ char *preload; /**< package preload flag, no xml part*/
+ char *readonly; /**< package readonly flag, no xml part*/
+ char *update; /**< package update flag, no xml part*/
+ char *appsetting; /**< package app setting flag, attr, default: "false"*/
+ char *system; /**< package system flag, no xml part*/
+ char *type; /**< package type, attr*/
+ char *package_size; /**< package size for external installation, attr*/
+ char *installed_time; /**< installed time after finishing of installation, no xml part*/
+ char *installed_storage; /**< package currently installed storage, no xml part*/
+ char *storeclient_id; /**< id of store client for installed package, attr*/
+ char *mainapp_id; /**< app id of main application, no xml part*/
+ char *package_url; /**< app id of main application, attr*/
+ char *root_path; /**< package root path, attr*/
+ char *csc_path; /**< package csc path, attr*/
+ char *nodisplay_setting; /**< package no display setting menu, attr, default: "false"*/
+ char *support_disable; /**< package support disable flag, attr, default: "false"*/
+ char *api_version; /**< minimum version of API package using, attr, default: patch_version trimmed version from tizen_full_version*/
+ char *tep_name; /*no xml part*/
+ char *backend_installer; /**< package backend installer, attr*/
GList *icon; /**< package icon, element*/
GList *label; /**< package label, element*/
GList *author; /**< package author, element*/
#endif
#define LOG_TAG "PKGMGR_PARSER"
-#define ASCII(s) (const char *)s
+#define ASCII(s) (char *)s
#define XMLCHAR(s) (const xmlChar *)s
//#define METADATA_PARSER_LIST SYSCONFDIR "/package-manager/parserlib/metadata/metadata_parser_list.txt"
const char *package;
static int __ps_process_label(xmlTextReaderPtr reader, label_x *label);
-static int __ps_process_privilege(xmlTextReaderPtr reader, const char **privilege);
+static int __ps_process_privilege(xmlTextReaderPtr reader, char **privilege);
static int __ps_process_privileges(xmlTextReaderPtr reader, GList **privileges);
-static int __ps_process_allowed(xmlTextReaderPtr reader, const char **allowed);
-static int __ps_process_condition(xmlTextReaderPtr reader, const char **condition);
+static int __ps_process_allowed(xmlTextReaderPtr reader, char **allowed);
+static int __ps_process_condition(xmlTextReaderPtr reader, char **condition);
static int __ps_process_notification(xmlTextReaderPtr reader, notification_x *notifiation);
-static int __ps_process_category(xmlTextReaderPtr reader, const char **category);
+static int __ps_process_category(xmlTextReaderPtr reader, char **category);
static int __ps_process_metadata(xmlTextReaderPtr reader, metadata_x *metadata);
static int __ps_process_permission(xmlTextReaderPtr reader, permission_x *permission);
static int __ps_process_compatibility(xmlTextReaderPtr reader, compatibility_x *compatibility);
-static int __ps_process_request(xmlTextReaderPtr reader, const char **request);
+static int __ps_process_request(xmlTextReaderPtr reader, char **request);
static int __ps_process_define(xmlTextReaderPtr reader, define_x *define);
static int __ps_process_launchconditions(xmlTextReaderPtr reader, GList **launchconditions);
static int __ps_process_datashare(xmlTextReaderPtr reader, datashare_x *datashare);
static int __ps_run_parser(xmlDocPtr docPtr, const char *tag, ACTION_TYPE action, const char *pkgid);
API int __is_admin();
-static void __save_xml_attribute(xmlTextReaderPtr reader, char *attribute, const char **xml_attribute, char *default_value)
+static void __save_xml_attribute(xmlTextReaderPtr reader, char *attribute, char **xml_attribute, char *default_value)
{
xmlChar *attrib_val = xmlTextReaderGetAttribute(reader, XMLCHAR(attribute));
if (attrib_val) {
}
}
-static void __save_xml_lang(xmlTextReaderPtr reader, const char **xml_attribute)
+static void __save_xml_lang(xmlTextReaderPtr reader, char **xml_attribute)
{
const xmlChar *attrib_val = xmlTextReaderConstXmlLang(reader);
if (attrib_val != NULL)
*xml_attribute = strdup(DEFAULT_LOCALE);
}
-static void __save_xml_value(xmlTextReaderPtr reader, const char **xml_attribute)
+static void __save_xml_value(xmlTextReaderPtr reader, char **xml_attribute)
{
xmlTextReaderRead(reader);
const xmlChar *attrib_val = xmlTextReaderConstValue(reader);
return ret;
}
-static int __ps_process_allowed(xmlTextReaderPtr reader, const char **allowed)
+static int __ps_process_allowed(xmlTextReaderPtr reader, char **allowed)
{
__save_xml_value(reader, allowed);
return 0;
}
-static int __ps_process_condition(xmlTextReaderPtr reader, const char **condition)
+static int __ps_process_condition(xmlTextReaderPtr reader, char **condition)
{
__save_xml_attribute(reader, "name", condition, NULL);
return 0;
return 0;
}
-static int __ps_process_category(xmlTextReaderPtr reader, const char **category)
+static int __ps_process_category(xmlTextReaderPtr reader, char **category)
{
__save_xml_attribute(reader, "name", category, NULL);
return 0;
}
-static int __ps_process_privilege(xmlTextReaderPtr reader, const char **privilege)
+static int __ps_process_privilege(xmlTextReaderPtr reader, char **privilege)
{
__save_xml_value(reader, privilege);
return 0;
return 0;
}
-static int __ps_process_request(xmlTextReaderPtr reader, const char **request)
+static int __ps_process_request(xmlTextReaderPtr reader, char **request)
{
__save_xml_value(reader, request);
return 0;
const xmlChar *node;
int ret = -1;
int depth = -1;
- const char *val;
+ char *val;
__save_xml_attribute(reader, "path", &define->path, NULL);
const xmlChar *node;
int ret = -1;
int depth = -1;
- const char *val;
+ char *val;
GList *operations = NULL;
GList *uris = NULL;
GList *mimes = NULL;
const xmlChar *node;
int ret = -1;
int depth = -1;
- const char *val;
+ char *val;
depth = xmlTextReaderDepth(reader);
while ((ret = __next_child_element(reader, depth))) {
const xmlChar *node;
int ret = -1;
int depth = -1;
- const char *val;
+ char *val;
depth = xmlTextReaderDepth(reader);
while ((ret = __next_child_element(reader, depth))) {
const xmlChar *node;
int ret = -1;
int depth = -1;
- const char *val;
+ char *val;
depth = xmlTextReaderDepth(reader);
while ((ret = __next_child_element(reader, depth))) {
node = xmlTextReaderConstName(reader);
__save_xml_lang(reader, &icon->lang);
xmlTextReaderRead(reader);
- const char *text = ASCII(xmlTextReaderValue(reader));
+ char *text = ASCII(xmlTextReaderValue(reader));
if (text) {
- icon->text = (const char *)__get_icon_with_path(text, uid);
- free((void *)text);
+ icon->text = __get_icon_with_path(text, uid);
+ free(text);
}
return 0;
const xmlChar *node;
int ret = -1;
int depth = -1;
- const char *val;
+ char *val;
__save_xml_attribute(reader, "appid", &application->appid, NULL);
retvm_if(application->appid == NULL, PM_PARSER_R_ERROR, "appid cant be NULL, appid field is mandatory\n");
}
while (sqlite3_step(stmt) == SQLITE_ROW) {
- _save_column_str(stmt, 0, (const char **)&appid);
+ _save_column_str(stmt, 0, &appid);
if (appid != NULL)
*list = g_list_insert_sorted(*list, appid,
__list_strcmp);
int ret;
char *query;
sqlite3_stmt *stmt;
- const char *val;
+ char *val;
query = sqlite3_mprintf(query_raw, appid);
if (query == NULL) {
while (sqlite3_step(stmt) == SQLITE_ROW) {
str = NULL;
- _save_column_str(stmt, 0, (const char **)&str);
+ _save_column_str(stmt, 0, &str);
/* TODO: revise */
__parse_appcontrol(appcontrol, str);
free(str);
return PMINFO_R_OK;
}
-static GList *__get_background_category(char *value)
+static GList *__get_background_category(const char *value)
{
GList *category_list = NULL;
int convert_value = 0;
_save_column_str(stmt, idx++, &info->api_version);
info->background_category = __get_background_category(bg_category_str);
+ free(bg_category_str);
if (_appinfo_get_label(db, info->appid, locale, &info->label)) {
pkgmgrinfo_basic_free_application(info);
_save_column_str(stmt, idx++, &appinfo->api_version);
appinfo->background_category = __get_background_category(bg_category_str);
+ free(bg_category_str);
if (_appinfo_get_splashscreens(db, appinfo->appid, &appinfo->splashscreens)) {
pkgmgrinfo_basic_free_application(appinfo);
static gpointer __copy_str(gconstpointer src, gpointer data)
{
const char *tmp = (const char *)src;
- const char *buffer;
+ char *buffer;
buffer = strdup(tmp);
if (buffer == NULL) {
}
g_hash_table_iter_init(&iter, appinfo_table);
- while (g_hash_table_iter_next(&iter, &key, &val)) {
+ while (g_hash_table_iter_next(&iter, (gpointer)&key, (gpointer)&val)) {
ret = app_func((void *)val, user_data);
if (ret != PMINFO_R_OK) {
LOGE("callback is stopped");