#include <dirent.h>
#include <libgen.h>
-#include <sqlite3.h>
-
#include <tzplatform_config.h>
#include "pkgmgr-info.h"
#include "pkgmgr_parser_db.h"
#include "manager/pkginfo_manager.h"
-typedef int (*sqlite_query_callback)(void *data, int ncols, char **coltxt, char **colname);
+typedef int (*sqlite_query_callback)(void *data, int ncols,
+ char **coltxt, char **colname);
-static int _mkdir_for_user(const char* dir, uid_t uid, gid_t gid)
+static int _mkdir_for_user(const char *dir, uid_t uid, gid_t gid)
{
int ret;
char *fullpath;
}
ret = fchown(fd, uid, gid);
if (ret == -1) {
- _LOGE("FAIL : fchown %s %d.%d, because %s", dir, uid,
- gid, strerror_r(errno, buf, sizeof(buf)));
+ _LOGE("FAIL : fchown %s %d.%d, because %s",
+ dir, uid, gid,
+ strerror_r(errno, buf, sizeof(buf)));
close(fd);
free(fullpath);
return -1;
return strdup(path);
}
-int _check_create_cert_db(void)
-{
- return pkgmgr_parser_initialize_cert_db();
-}
-
static gid_t _get_gid(const char *name)
{
char buf[BUFSIZE];
}
/* just allow certain users to create the icon directory if needed. */
- if (uid_caller == ROOT_UID || uid_caller == APPFW_UID || uid_caller == uid)
+ if (uid_caller == ROOT_UID || uid_caller == APPFW_UID ||
+ uid_caller == uid)
_mkdir_for_user(path, uid, gid);
return path;
}
-void _save_column_int(sqlite3_stmt *stmt, int idx, int *i)
-{
- *i = sqlite3_column_int(stmt, idx);
-}
-
-inline void _save_column_str(sqlite3_stmt *stmt, int idx, char **str)
-{
- const char *val;
-
- val = (const char *)sqlite3_column_text(stmt, idx);
- if (val)
- *str = strdup(val);
-}
-
-API int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid)
+API int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid,
+ INSTALL_LOCATION location, const char *external_pkg_path,
+ uid_t uid)
{
retvm_if(pkgid == NULL, PMINFO_R_EINVAL, "pkgid is NULL\n");
- return _pkginfo_set_usr_installed_storage(pkgid, location, external_pkg_path, uid);
+ return _pkginfo_set_usr_installed_storage(pkgid,
+ location, external_pkg_path, uid);
}
-API int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path)
+API int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid,
+ INSTALL_LOCATION location, const char *external_pkg_path)
{
- return pkgmgrinfo_pkginfo_set_usr_installed_storage(pkgid, location, external_pkg_path, _getuid());
+ return pkgmgrinfo_pkginfo_set_usr_installed_storage(pkgid,
+ location, external_pkg_path, _getuid());
}