#include <dlfcn.h>
#include <vconf.h>
-#include <sqlite3.h>
#include <glib.h>
#include <unzip.h>
{E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
{E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
{E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF, PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
- {E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE}
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE},
+ {E_PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE, PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE}
};
struct _pkginfo_int_map_t {
case E_PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM:
snprintf(buf, sizeof(buf), "pi.package_system=? COLLATE NOCASE");
break;
-
+ case E_PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE:
+ if (node->value == NULL || strlen(node->value) == 0) {
+ *condition = strdup("package_res_info.res_type IS NOT NULL COLLATE NOCASE");
+ if (*condition == NULL) {
+ _LOGE("out of memeory");
+ return 0;
+ }
+ return E_PMINFO_PKGINFO_JOIN_RES_INFO;
+ } else {
+ snprintf(buf, sizeof(buf), "package_res_info.res_type=? COLLATE NOCASE");
+ flag = E_PMINFO_PKGINFO_JOIN_RES_INFO;
+ break;
+ }
case E_PMINFO_APPINFO_PROP_APP_ID:
snprintf(buf, sizeof(buf), "ai.app_id=?");
break;
return PMINFO_R_OK;
}
-API char *_get_system_locale(void)
-{
- char *lang;
- char *locale;
-
- lang = vconf_get_str(VCONFKEY_LANGSET);
- if (lang == NULL) {
- locale = strdup(DEFAULT_LOCALE);
- if (locale == NULL) {
- LOGE("out of memory");
- return NULL;
- }
- return locale;
- }
-
- locale = malloc(sizeof(char) * 6);
- if (locale == NULL) {
- LOGE("out of memory");
- free(lang);
- return NULL;
- }
-
- strncpy(locale, lang, 2);
- locale[2] = '-';
- locale[3] = tolower(lang[3]);
- locale[4] = tolower(lang[4]);
- locale[5] = '\0';
-
- free(lang);
-
- return locale;
-}
-
API int __pkginfo_check_installed_storage(package_x *pkginfo)
{
char buf[MAX_QUERY_LEN] = {'\0'};
return strdup(type);
}
-static const char *__get_library_path(const char *pkg_type)
+static void __get_library_path(const char *pkg_type, const char **path)
{
char buf[64];
- const char *path;
snprintf(buf, sizeof(buf), "package-manager/backendlib/lib%s.so",
pkg_type);
- path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
- return path;
+ *path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
}
API pkg_plugin_set *__load_library(const char *pkg_type)
bool (*on_load)(pkg_plugin_set *plugin);
const char *library_path;
- library_path = __get_library_path(pkg_type);
+ __get_library_path(pkg_type, &library_path);
if (library_path == NULL) {
_LOGE("cannot get library path for %s", pkg_type);
return NULL;