Add new API for getting the root path of given pkg
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 10 Oct 2012 04:48:59 +0000 (13:48 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 10 Oct 2012 05:20:57 +0000 (14:20 +0900)
Change-Id: Iccaf67cbfe7686b1ba0a97ee9e1db29ed54099aa

CMakeLists.txt
debian/changelog
include/livebox.h
packaging/liblivebox.spec
src/livebox.c

index 6655e3d..483e158 100644 (file)
@@ -16,6 +16,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
        dlog
+       livebox-service
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index 921ebdf..d2333a9 100644 (file)
@@ -1,3 +1,10 @@
+livebox (0.0.9) unstable; urgency=low
+
+  * Git: slp/pkgs/l/livebox
+  * Tag: livebox_0.0.9
+
+ -- Sung-jae Park <nicesj.park@samsung.com>  Wed, 10 Oct 2012 14:20:42 +0900
+
 livebox (0.0.8) unstable; urgency=low
 
   * Git: slp/pkgs/l/livebox
index 29c8e97..372b9ed 100644 (file)
@@ -97,6 +97,12 @@ extern int livebox_desc_del_block(struct livebox_desc *handle, int idx);
  */
 extern char *livebox_util_nl2br(const char *str);
 
+/*!
+ * \brief Get the root path of given application package.
+ * \param[in] pkgname application package name
+ * \param[out] char* Allocated string, root path of given package.
+ */
+extern char *livebox_root_path(const char *pkgname);
 #ifdef __cplusplus
 }
 #endif
index 90d0f52..9a29db5 100644 (file)
@@ -1,12 +1,13 @@
 Name: liblivebox
 Summary: Library for the development of a livebox 
-Version: 0.0.8
+Version: 0.0.9
 Release: 1
 Group: main/app
 License: Samsung Proprietary License
 Source0: %{name}-%{version}.tar.gz
 BuildRequires: cmake, gettext-tools
 BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(livebox-service)
 
 %description
 Livebox development library
index 190b4fb..57c3346 100644 (file)
@@ -5,6 +5,7 @@
 #include <libgen.h>
 
 #include <dlog.h>
+#include <livebox-service.h>
 
 #include "debug.h"
 #include "livebox.h"
@@ -372,4 +373,25 @@ EAPI int livebox_desc_del_block(struct livebox_desc *handle, int idx)
        return -ENOENT;
 }
 
+EAPI char *livebox_root_path(const char *pkgname)
+{
+       char *ret;
+       char *appid;
+       int len;
+
+       appid = livebox_service_appid(pkgname);
+       if (!appid)
+               return NULL;
+
+       len = strlen("/opt/apps//") + strlen(appid) + 1;
+       ret = malloc(len);
+       if (!ret) {
+               DbgPrint("Heap: %s\n", strerror(errno));
+               return NULL;
+       }
+
+       snprintf(ret, len, "/opt/apps/%s/", appid);
+       return ret;
+}
+
 /* End of a file */