Update License
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 25 Mar 2013 04:23:04 +0000 (04:23 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 25 Mar 2013 04:23:04 +0000 (04:23 +0000)
2012 -> 2013

Change-Id: Ia2097ee995f95dda395aecd861e7b58832e55ed1

43 files changed:
CMakeLists.txt
LICENSE
include/debug.h
include/dlist.h
include/fb.h
include/provider.h
include/provider_buffer.h
include/provider_buffer_internal.h
include/util.h
packaging/libprovider.spec
sample/org.tizen.live-app/CMakeLists.txt
sample/org.tizen.live-app/include/CController.h
sample/org.tizen.live-app/include/CMain.h
sample/org.tizen.live-app/include/CModel.h
sample/org.tizen.live-app/include/CView.h
sample/org.tizen.live-app/include/CWindow.h
sample/org.tizen.live-app/include/debug.h
sample/org.tizen.live-app/packaging/org.tizen.live-app.spec
sample/org.tizen.live-app/res/image/org.tizen.live-app.png [moved from sample/org.tizen.live-app/res/image/org.zien.live-app.png with 100% similarity]
sample/org.tizen.live-app/src/CController.cpp
sample/org.tizen.live-app/src/CMain.cpp
sample/org.tizen.live-app/src/CModel.cpp
sample/org.tizen.live-app/src/CView.cpp
sample/org.tizen.live-app/src/CWindow.cpp
sample/org.tizen.live-video/include/CController.h
sample/org.tizen.live-video/include/CMain.h
sample/org.tizen.live-video/include/CModel.h
sample/org.tizen.live-video/include/CVideo.h
sample/org.tizen.live-video/include/CView.h
sample/org.tizen.live-video/include/CWindow.h
sample/org.tizen.live-video/include/debug.h
sample/org.tizen.live-video/packaging/org.tizen.live-video.spec
sample/org.tizen.live-video/src/CController.cpp
sample/org.tizen.live-video/src/CMain.cpp
sample/org.tizen.live-video/src/CModel.cpp
sample/org.tizen.live-video/src/CVideo.cpp
sample/org.tizen.live-video/src/CView.cpp
sample/org.tizen.live-video/src/CWindow.cpp
src/dlist.c
src/fb.c
src/provider.c
src/provider_buffer.c
src/util.c

index fb7c1cd..18b0a61 100644 (file)
@@ -27,6 +27,7 @@ pkg_check_modules(pkgs REQUIRED
        xfixes
        dri2proto
        xdamage
+       livebox-service # To import the error code
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
diff --git a/LICENSE b/LICENSE
index 27daa90..009765e 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 Flora License 
 
-Version 1.0, May, 2012 
+Version 1.0, May, 2013 
 
 http://www.tizenopensource.org/license 
 
index f6fd2ab..eb1ef37 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index b4a5719..7085384 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 8003c62..5b2622c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 5046cec..15a06a6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index f4d80a8..a8b5b5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 75256d3..82ad111 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index c33c285..e0c9fff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 2c743ad..da03a04 100644 (file)
@@ -1,8 +1,8 @@
 Name: libprovider
 Summary: Library for developing the livebox service provider.
-Version: 0.6.0
+Version: 0.6.2
 Release: 1
-Group: framework/livebox
+Group: HomeTF/Livebox
 License: Flora License
 Source0: %{name}-%{version}.tar.gz
 BuildRequires: cmake, gettext-tools, coreutils
@@ -18,6 +18,7 @@ BuildRequires: pkgconfig(libtbm)
 BuildRequires: pkgconfig(xfixes)
 BuildRequires: pkgconfig(dri2proto)
 BuildRequires: pkgconfig(xdamage)
+BuildRequires: pkgconfig(livebox-service)
 
 %description
 Supporting the commnuncation channel with master service for livebox remote view.
index 1715456..14bbd3b 100644 (file)
@@ -32,10 +32,8 @@ ADD_EXECUTABLE(${PROJECT_NAME}
 
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkg_LDFLAGS} "-ldl")
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.${PROJECT_NAME}.xml DESTINATION /opt/share/packages)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.${PROJECT_NAME}.conf DESTINATION
-       /opt/usr/live/org.tizen.${PROJECT_NAME}/etc)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/image/unknown.png DESTINATION
-       /opt/usr/live/org.tizen.${PROJECT_NAME}/res/image)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.${PROJECT_NAME}.conf DESTINATION /opt/usr/live/org.tizen.${PROJECT_NAME}/etc)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/image/unknown.png DESTINATION /opt/usr/live/org.tizen.${PROJECT_NAME}/res/image)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION
        /opt/usr/apps/org.tizen.${PROJECT_NAME}/bin
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
index 7647676..ab3f260 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 62077ae..d262be8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index daf8f44..651e302 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index df8852c..af4d042 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 73a6084..6b54ad8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 6e436ce..df1e9eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 996cef9..a58f0a5 100644 (file)
@@ -5,7 +5,7 @@ Release: 1
 Group: main/app
 License: Flora License
 Source0: %{name}-%{version}.tar.gz
-BuildRequires: cmake, gettext-tools, coreutils
+BuildRequires: cmake, gettext-tools
 BuildRequires: pkgconfig(appcore-efl)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(glib-2.0)
@@ -37,7 +37,7 @@ mkdir -p /opt/usr/live/org.tizen.live-app/libexec
 touch /opt/usr/live/org.tizen.live-app/libexec/liblive-org.tizen.live-app.so
 
 %files -n org.tizen.live-app
-#%manifest org.tizen.data-provider-slave.manifest
+#%manifest org.tizen.live-app.manifest
 %defattr(-,root,root,-)
 /opt/usr/apps/org.tizen.live-app/bin/live-app
 /opt/share/packages/*.xml
index 6e4508d..65e0d37 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 815b085..ac309ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 6869d1e..6566acc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 7065bf0..8f86324 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index f1ae120..903eadc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 7647676..ab3f260 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 62077ae..d262be8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 1c879cf..5173a42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index fdccd8e..93e88fe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 8a63836..5e651b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 917d562..101986c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 6e436ce..df1e9eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index fe72fd8..2544799 100644 (file)
@@ -5,7 +5,7 @@ Release: 1
 Group: main/app
 License: Flora License
 Source0: %{name}-%{version}.tar.gz
-BuildRequires: cmake, gettext-tools, coreutils
+BuildRequires: cmake, gettext-tools
 BuildRequires: pkgconfig(appcore-efl)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(glib-2.0)
@@ -43,7 +43,7 @@ mkdir -p /opt/usr/live/org.tizen.live-video/libexec
 touch /opt/usr/live/org.tizen.live-video/libexec/liblive-org.tizen.live-video.so
 
 %files -n org.tizen.live-video
-#%manifest org.tizen.data-provider-slave.manifest
+#%manifest org.tizen.live-video.manifest
 %defattr(-,root,root,-)
 /opt/usr/apps/org.tizen.live-video/bin/live-video
 /opt/share/packages/*.xml
index 87f8503..421bdc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index a5fd624..8cb99eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index cbcd064..06c96a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index eec8341..4714798 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index ab4cd22..1712d88 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 8ca600f..2e4c4cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 56ff060..78c76ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
index 7c13d61..ff850d2 100644 (file)
--- a/src/fb.c
+++ b/src/fb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,6 +41,7 @@
 #include <tbm_bufmgr.h>
 
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "debug.h"
 #include "util.h"
@@ -142,7 +143,7 @@ int fb_init(void *disp)
                s_info.disp = XOpenDisplay(NULL);
                if (!s_info.disp) {
                        ErrPrint("Failed to open a display\n");
-                       return -EFAULT;
+                       return LB_STATUS_ERROR_FAULT;
                }
 
                s_info.disp_is_opened = 1;
@@ -155,21 +156,21 @@ int fb_init(void *disp)
 
        if (!DRI2QueryExtension(s_info.disp, &s_info.evt_base, &s_info.err_base)) {
                DbgPrint("DRI2 is not supported\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (!DRI2QueryVersion(s_info.disp, &dri2Major, &dri2Minor)) {
                DbgPrint("DRI2 is not supported\n");
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (!DRI2Connect(s_info.disp, DefaultRootWindow(s_info.disp), &driverName, &deviceName)) {
                DbgPrint("DRI2 is not supported\n");
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        s_info.fd = open(deviceName, O_RDWR);
@@ -179,7 +180,7 @@ int fb_init(void *disp)
                DbgPrint("Failed to open a drm device: (%s)\n", strerror(errno));
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        drmGetMagic(s_info.fd, &magic);
@@ -190,7 +191,7 @@ int fb_init(void *disp)
                s_info.fd = -1;
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        s_info.bufmgr = tbm_bufmgr_init(s_info.fd);
@@ -200,10 +201,10 @@ int fb_init(void *disp)
                s_info.fd = -1;
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 int fb_fini(void)
@@ -226,7 +227,7 @@ int fb_fini(void)
        s_info.screen = 0;
        s_info.visual = NULL;
        s_info.depth = 0;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int sync_for_file(struct fb_info *info)
@@ -237,33 +238,33 @@ static inline int sync_for_file(struct fb_info *info)
        buffer = info->buffer;
        if (!buffer) {
                DbgPrint("Buffer is NIL, skip sync\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid state of a FB\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (buffer->type != BUFFER_TYPE_FILE) {
                DbgPrint("Ingore sync\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        fd = open(util_uri_to_path(info->id), O_WRONLY | O_CREAT, 0644);
        if (fd < 0) {
                ErrPrint("open %s: %s\n", util_uri_to_path(info->id), strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (write(fd, buffer->data, info->bufsz) != info->bufsz) {
                ErrPrint("write: %s\n", strerror(errno));
                close(fd);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        close(fd);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int sync_for_pixmap(struct fb_info *info)
@@ -274,27 +275,27 @@ static inline int sync_for_pixmap(struct fb_info *info)
        buffer = info->buffer;
        if (!buffer) {
                DbgPrint("Buffer is NIL, skip sync\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid state of a FB\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (buffer->type != BUFFER_TYPE_PIXMAP) {
                DbgPrint("Invalid buffer\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (info->handle == 0) {
                DbgPrint("Pixmap ID is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->bufsz == 0) {
                DbgPrint("Nothing can be sync\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        pixmap_info = (struct pixmap_info *)buffer->data;
@@ -304,19 +305,19 @@ static inline int sync_for_pixmap(struct fb_info *info)
         */
        XShmPutImage(s_info.disp, (Pixmap)info->handle, pixmap_info->gc, pixmap_info->xim, 0, 0, 0, 0, info->w, info->h, False);
        XSync(s_info.disp, False);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 int fb_sync(struct fb_info *info)
 {
        if (!info) {
                ErrPrint("FB Handle is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!info->id || info->id[0] == '\0') {
                DbgPrint("Ingore sync\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (!strncasecmp(info->id, SCHEMA_FILE, strlen(SCHEMA_FILE))) {
@@ -324,11 +325,11 @@ int fb_sync(struct fb_info *info)
        } else if (!strncasecmp(info->id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
                return sync_for_pixmap(info);
        } else if (!strncasecmp(info->id, SCHEMA_SHM, strlen(SCHEMA_SHM))) {
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        DbgPrint("Invalid URI: [%s]\n", info->id);
-       return -EINVAL;
+       return LB_STATUS_ERROR_INVALID;
 }
 
 static inline struct fb_info *find_shm_by_pixmap(Pixmap id)
@@ -415,7 +416,7 @@ static inline int create_pixmap_info(struct fb_info *info)
        pixmap_info->si.shmid = shmget(IPC_PRIVATE, info->bufsz, IPC_CREAT | 0666);
        if (pixmap_info->si.shmid < 0) {
                ErrPrint("shmget: %s\n", strerror(errno));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        DbgPrint("SHMID: %d (Size: %d)\n", pixmap_info->si.shmid, info->bufsz);
@@ -426,7 +427,7 @@ static inline int create_pixmap_info(struct fb_info *info)
                if (shmctl(pixmap_info->si.shmid, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
 
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
        DbgPrint("SHMADDR: 0x%p\n", pixmap_info->si.shmaddr);
 
@@ -442,7 +443,7 @@ static inline int create_pixmap_info(struct fb_info *info)
                if (shmctl(pixmap_info->si.shmid, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
 
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        pixmap_info->xim->data = pixmap_info->si.shmaddr;
@@ -460,12 +461,12 @@ static inline int create_pixmap_info(struct fb_info *info)
                if (shmctl(pixmap_info->si.shmid, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
 
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        s_info.shm_list = dlist_append(s_info.shm_list, info);
        DbgPrint("Pixmap info is successfully created\n");
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int destroy_pixmap_info(struct fb_info *info)
@@ -489,7 +490,7 @@ static inline int destroy_pixmap_info(struct fb_info *info)
 
        dlist_remove_data(s_info.shm_list, info);
        DbgPrint("Successfully destroyed\n");
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline struct gem_data *create_gem(Pixmap pixmap, int w, int h, int depth)
@@ -571,7 +572,7 @@ static inline int destroy_gem(struct gem_data *gem)
        }
 
        free(gem);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline void *acquire_gem(struct gem_data *gem)
@@ -667,23 +668,23 @@ int fb_create_gem(struct fb_info *info)
 {
        if (info->gem) {
                DbgPrint("Already created\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        info->gem = create_gem(info->handle, info->w, info->h, sizeof(int));
-       return info->gem ? 0 : -EFAULT;
+       return info->gem ? LB_STATUS_SUCCESS : LB_STATUS_ERROR_FAULT;
 }
 
 int fb_destroy_gem(struct fb_info *info)
 {
        if (!info->gem) {
                ErrPrint("GEM is not created\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        destroy_gem(info->gem);
        info->gem = NULL;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 void *fb_acquire_gem(struct fb_info *info)
@@ -700,18 +701,18 @@ int fb_release_gem(struct fb_info *info)
 {
        if (!info->gem) {
                ErrPrint("Invalid FB info\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        release_gem(info->gem);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 int fb_destroy(struct fb_info *info)
 {
        if (!info) {
                ErrPrint("Handle is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->buffer) {
@@ -722,7 +723,7 @@ int fb_destroy(struct fb_info *info)
 
        free(info->id);
        free(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 int fb_is_created(struct fb_info *info)
@@ -839,7 +840,7 @@ int fb_release_buffer(void *data)
        struct fb_info *info;
 
        if (!data)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        info = find_shm_by_canvas(data);
        if (info)
@@ -849,7 +850,7 @@ int fb_release_buffer(void *data)
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (buffer->type) {
@@ -889,10 +890,10 @@ int fb_release_buffer(void *data)
                break;
        default:
                ErrPrint("Unknown type\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 int fb_refcnt(void *data)
@@ -902,20 +903,20 @@ int fb_refcnt(void *data)
        int ret;
 
        if (!data)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        buffer = container_of(data, struct buffer, data);
 
        if (buffer->state != CREATED) {
                ErrPrint("Invalid handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (buffer->type) {
        case BUFFER_TYPE_SHM:
                if (shmctl(buffer->refcnt, IPC_STAT, &buf) < 0) {
                        ErrPrint("shmctl: %s\n", strerror(errno));
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        break;
                }
 
@@ -928,7 +929,7 @@ int fb_refcnt(void *data)
                ret = buffer->refcnt;
                break;
        default:
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                break;
        }
 
@@ -944,12 +945,12 @@ int fb_get_size(struct fb_info *info, int *w, int *h)
 {
        if (!info) {
                ErrPrint("Handle is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        *w = info->w;
        *h = info->h;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 int fb_size(struct fb_info *info)
index 4636c4d..475071c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
 #include <com-core_packet.h>
 
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "dlist.h"
 #include "util.h"
@@ -67,16 +68,13 @@ static struct packet *master_script(pid_t pid, int handle, const struct packet *
                &(arg.info.content_event.info.pointer.down));
        if (ret != 11) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
                goto errout;
        }
 
        arg.type = EVENT_CONTENT_EVENT;
 
        if (s_info.table.content_event)
-               ret = s_info.table.content_event(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.content_event(&arg, s_info.data);
 
 errout:
        return NULL;
@@ -95,16 +93,13 @@ static struct packet *master_clicked(pid_t pid, int handle, const struct packet
                        &arg.info.clicked.x, &arg.info.clicked.y);
        if (ret != 6) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
                goto errout;
        }
 
        arg.type = EVENT_CLICKED;
 
        if (s_info.table.clicked)
-               ret = s_info.table.clicked(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.clicked(&arg, s_info.data);
 
 errout:
        return NULL;
@@ -124,7 +119,6 @@ static struct packet *master_text_signal(pid_t pid, int handle, const struct pac
 
        if (ret != 8) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
                goto errout;
        }
 
@@ -134,9 +128,7 @@ static struct packet *master_text_signal(pid_t pid, int handle, const struct pac
        arg.type = EVENT_TEXT_SIGNAL;
 
        if (s_info.table.text_signal)
-               ret = s_info.table.text_signal(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.text_signal(&arg, s_info.data);
 
 errout:
        return NULL;
@@ -152,7 +144,7 @@ static struct packet *master_delete(pid_t pid, int handle, const struct packet *
        ret = packet_get(packet, "ss", &arg.pkgname, &arg.id);
        if (ret != 2) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -161,7 +153,7 @@ static struct packet *master_delete(pid_t pid, int handle, const struct packet *
        if (s_info.table.lb_destroy)
                ret = s_info.table.lb_destroy(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        result = packet_create_reply(packet, "i", ret);
@@ -178,7 +170,7 @@ static struct packet *master_resize(pid_t pid, int handle, const struct packet *
        ret = packet_get(packet, "ssii", &arg.pkgname, &arg.id, &arg.info.resize.w, &arg.info.resize.h);
        if (ret != 4) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -187,7 +179,7 @@ static struct packet *master_resize(pid_t pid, int handle, const struct packet *
        if (s_info.table.resize)
                ret = s_info.table.resize(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        result = packet_create_reply(packet, "i", ret);
@@ -217,7 +209,7 @@ static struct packet *master_renew(pid_t pid, int handle, const struct packet *p
                                &arg.info.lb_recreate.abi);
        if (ret != 11) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -226,7 +218,7 @@ static struct packet *master_renew(pid_t pid, int handle, const struct packet *p
        if (s_info.table.lb_recreate)
                ret = s_info.table.lb_recreate(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        if (arg.info.lb_recreate.out_content)
@@ -277,7 +269,7 @@ static struct packet *master_new(pid_t pid, int handle, const struct packet *pac
                                &arg.info.lb_create.height);
        if (ret != 12) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -286,7 +278,7 @@ static struct packet *master_new(pid_t pid, int handle, const struct packet *pac
        if (s_info.table.lb_create)
                ret = s_info.table.lb_create(&arg, &width, &height, &priority, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        if (arg.info.lb_create.out_content)
@@ -320,7 +312,7 @@ static struct packet *master_set_period(pid_t pid, int handle, const struct pack
        ret = packet_get(packet, "ssd", &arg.pkgname, &arg.id, &arg.info.set_period.period);
        if (ret != 3) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -329,7 +321,7 @@ static struct packet *master_set_period(pid_t pid, int handle, const struct pack
        if (s_info.table.set_period)
                ret = s_info.table.set_period(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        result = packet_create_reply(packet, "i", ret);
@@ -347,7 +339,7 @@ static struct packet *master_change_group(pid_t pid, int handle, const struct pa
                                &arg.info.change_group.cluster, &arg.info.change_group.category);
        if (ret != 4) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -356,7 +348,7 @@ static struct packet *master_change_group(pid_t pid, int handle, const struct pa
        if (s_info.table.change_group)
                ret = s_info.table.change_group(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        result = packet_create_reply(packet, "i", ret);
@@ -374,7 +366,7 @@ static struct packet *master_pinup(pid_t pid, int handle, const struct packet *p
        ret = packet_get(packet, "ssi", &arg.pkgname, &arg.id, &arg.info.pinup.state);
        if (ret != 3) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -383,7 +375,7 @@ static struct packet *master_pinup(pid_t pid, int handle, const struct packet *p
        if (s_info.table.pinup)
                ret = s_info.table.pinup(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        content = "default";
@@ -405,16 +397,13 @@ static struct packet *master_update_content(pid_t pid, int handle, const struct
        ret = packet_get(packet, "ssss", &arg.pkgname, &arg.id, &arg.info.update_content.cluster, &arg.info.update_content.category);
        if (ret != 4) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
                goto errout;
        }
 
        arg.type = EVENT_UPDATE_CONTENT;
 
        if (s_info.table.update_content)
-               ret = s_info.table.update_content(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.update_content(&arg, s_info.data);
 
 errout:
        return NULL;
@@ -468,7 +457,7 @@ static struct packet *master_pause(pid_t pid, int handle, const struct packet *p
        ret = packet_get(packet, "d", &arg.info.pause.timestamp);
        if (ret != 1) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
        arg.pkgname = NULL;
@@ -478,7 +467,7 @@ static struct packet *master_pause(pid_t pid, int handle, const struct packet *p
        if (s_info.table.pause)
                ret = s_info.table.pause(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        result = packet_create_reply(packet, "i", ret);
@@ -495,7 +484,7 @@ static struct packet *master_resume(pid_t pid, int handle, const struct packet *
        ret = packet_get(packet, "d", &arg.info.resume.timestamp);
        if (ret != 1) {
                ErrPrint("Parameter is not valid\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto errout;
        }
 
@@ -506,7 +495,7 @@ static struct packet *master_resume(pid_t pid, int handle, const struct packet *
        if (s_info.table.resume)
                ret = s_info.table.resume(&arg, s_info.data);
        else
-               ret = -ENOSYS;
+               ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 errout:
        result = packet_create_reply(packet, "i", ret);
@@ -523,16 +512,13 @@ struct packet *master_pd_create(pid_t pid, int handle, const struct packet *pack
        ret = packet_get(packet, "ssiidd", &arg.pkgname, &arg.id, &arg.info.pd_create.w, &arg.info.pd_create.h, &arg.info.pd_create.x, &arg.info.pd_create.y);
        if (ret != 6) {
                ErrPrint("Invalid packet\n");
-               ret = -EINVAL;
                goto out;
        }
 
        arg.type = EVENT_PD_CREATE;
 
        if (s_info.table.pd_create)
-               ret = s_info.table.pd_create(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_create(&arg, s_info.data);
 
 out:
        return NULL;
@@ -546,16 +532,13 @@ struct packet *master_pd_move(pid_t pid, int handle, const struct packet *packet
        ret = packet_get(packet, "ssiidd", &arg.pkgname, &arg.id, &arg.info.pd_move.w, &arg.info.pd_move.h, &arg.info.pd_move.x, &arg.info.pd_move.y);
        if (ret != 6) {
                ErrPrint("Invalid packet\n");
-               ret = -EINVAL;
                goto out;
        }
 
        arg.type = EVENT_PD_MOVE;
 
        if (s_info.table.pd_move)
-               ret = s_info.table.pd_move(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_move(&arg, s_info.data);
 
 out:
        return NULL;
@@ -569,15 +552,12 @@ struct packet *master_pd_destroy(pid_t pid, int handle, const struct packet *pac
        ret = packet_get(packet, "ss", &arg.pkgname, &arg.id);
        if (ret != 2) {
                ErrPrint("Invalid packet\n");
-               ret = -EINVAL;
                goto out;
        }
 
        arg.type = EVENT_PD_DESTROY;
        if (s_info.table.pd_destroy)
-               ret = s_info.table.pd_destroy(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_destroy(&arg, s_info.data);
 
 out:
        return NULL;
@@ -589,11 +569,11 @@ struct packet *master_pd_access_read(pid_t pid, int handle, const struct packet
        double timestamp;
        int ret;
 
-       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+       ret = packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
                                         &arg.info.pd_access.w, &arg.info.pd_access.h,
                                         &timestamp,
-                                        &arg.info.pd_access.x, &arg.info.pd_access.y) != 7)
-       {
+                                        &arg.info.pd_access.x, &arg.info.pd_access.y);
+       if (ret != 7) {
                ErrPrint("Invalid packet\n");
                goto out;
        }
@@ -601,9 +581,7 @@ struct packet *master_pd_access_read(pid_t pid, int handle, const struct packet
        arg.type = EVENT_PD_ACCESS;
        arg.info.pd_access.event = ACCESS_READ;
        if (s_info.table.pd_access)
-               ret = s_info.table.pd_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -627,9 +605,7 @@ struct packet *master_pd_access_read_prev(pid_t pid, int handle, const struct pa
        arg.type = EVENT_PD_ACCESS;
        arg.info.pd_access.event = ACCESS_READ_PREV;
        if (s_info.table.pd_access)
-               ret = s_info.table.pd_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -653,9 +629,7 @@ struct packet *master_pd_access_read_next(pid_t pid, int handle, const struct pa
        arg.type = EVENT_PD_ACCESS;
        arg.info.pd_access.event = ACCESS_READ_NEXT;
        if (s_info.table.pd_access)
-               ret = s_info.table.pd_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -679,9 +653,7 @@ struct packet *master_pd_access_activate(pid_t pid, int handle, const struct pac
        arg.type = EVENT_PD_ACCESS;
        arg.info.pd_access.event = ACCESS_ACTIVATE;
        if (s_info.table.pd_access)
-               ret = s_info.table.pd_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.pd_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -705,9 +677,7 @@ struct packet *master_lb_access_read(pid_t pid, int handle, const struct packet
        arg.type = EVENT_LB_ACCESS;
        arg.info.lb_access.event = ACCESS_READ;
        if (s_info.table.lb_access)
-               ret = s_info.table.lb_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.lb_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -719,11 +689,11 @@ struct packet *master_lb_access_read_prev(pid_t pid, int handle, const struct pa
        double timestamp;
        int ret;
 
-       if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+       ret = packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
                                         &arg.info.lb_access.w, &arg.info.lb_access.h,
                                         &timestamp,
-                                        &arg.info.lb_access.x, &arg.info.lb_access.y) != 7)
-       {
+                                        &arg.info.lb_access.x, &arg.info.lb_access.y);
+       if (ret != 7) {
                ErrPrint("Invalid packet\n");
                goto out;
        }
@@ -731,9 +701,7 @@ struct packet *master_lb_access_read_prev(pid_t pid, int handle, const struct pa
        arg.type = EVENT_LB_ACCESS;
        arg.info.lb_access.event = ACCESS_READ_PREV;
        if (s_info.table.lb_access)
-               ret = s_info.table.lb_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.lb_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -749,8 +717,7 @@ struct packet *master_lb_access_read_next(pid_t pid, int handle, const struct pa
                                         &arg.info.lb_access.w, &arg.info.lb_access.h,
                                         &timestamp,
                                         &arg.info.lb_access.x, &arg.info.lb_access.y);
-       if (ret != 7)
-       {
+       if (ret != 7) {
                ErrPrint("Invalid packet\n");
                goto out;
        }
@@ -758,9 +725,7 @@ struct packet *master_lb_access_read_next(pid_t pid, int handle, const struct pa
        arg.type = EVENT_LB_ACCESS;
        arg.info.lb_access.event = ACCESS_READ_NEXT;
        if (s_info.table.lb_access)
-               ret = s_info.table.lb_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.lb_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -784,9 +749,7 @@ struct packet *master_lb_access_activate(pid_t pid, int handle, const struct pac
        arg.type = EVENT_LB_ACCESS;
        arg.info.lb_access.event = ACCESS_ACTIVATE;
        if (s_info.table.lb_access)
-               ret = s_info.table.lb_access(&arg, s_info.data);
-       else
-               ret = -ENOSYS;
+               (void)s_info.table.lb_access(&arg, s_info.data);
 
 out:
        return NULL;
@@ -1008,18 +971,18 @@ EAPI int provider_init(void *disp, const char *name, struct event_handler *table
 
        if (!name || !table) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (s_info.name) {
                ErrPrint("Provider is already initialized\n");
-               return -EALREADY;
+               return LB_STATUS_ERROR_ALREADY;
        }
 
        s_info.name = strdup(name);
        if (!s_info.name) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        memcpy(&s_info.table, table, sizeof(*table));
@@ -1031,13 +994,13 @@ EAPI int provider_init(void *disp, const char *name, struct event_handler *table
        ret = com_core_packet_client_init(SLAVE_SOCKET, 0, s_table);
        if (ret < 0) {
                ErrPrint("Failed to establish the connection with the master\n");
-               return s_info.fd;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        provider_buffer_init(disp);
 
        DbgPrint("Slave is initialized\n");
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 EAPI void *provider_fini(void)
@@ -1074,18 +1037,18 @@ EAPI int provider_send_call(const char *pkgname, const char *id, const char *fun
 
        if (!pkgname || !id || !funcname) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("call", "ssss", s_info.name, pkgname, id, funcname);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_send_ret(const char *pkgname, const char *id, const char *funcname)
@@ -1095,18 +1058,18 @@ EAPI int provider_send_ret(const char *pkgname, const char *id, const char *func
 
        if (!pkgname || !id || !funcname) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("ret", "ssss", s_info.name, pkgname, id, funcname);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_send_faulted(const char *pkgname, const char *id, const char *funcname)
@@ -1116,18 +1079,18 @@ EAPI int provider_send_faulted(const char *pkgname, const char *id, const char *
 
        if (!pkgname || !id || !funcname) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("faulted", "ssss", s_info.name, pkgname, id, funcname);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_send_hello(void)
@@ -1138,23 +1101,23 @@ EAPI int provider_send_hello(void)
 
        if (!s_info.name) {
                ErrPrint("Provider is not initialized\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (s_info.fd < 0) {
                ErrPrint("Connection is not established\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("hello", "s", s_info.name);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_send_ping(void)
@@ -1165,23 +1128,23 @@ EAPI int provider_send_ping(void)
        DbgPrint("name[%s]\n", s_info.name);
        if (!s_info.name) {
                ErrPrint("Provider is not initialized\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (s_info.fd < 0) {
                ErrPrint("Connection is not established\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("ping", "s", s_info.name);
        if (!packet) {
                ErrPrint("Failed to create a a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 static inline void keep_file_in_safe(const char *id)
@@ -1203,8 +1166,10 @@ static inline void keep_file_in_safe(const char *id)
        if (s_info.prevent_overwrite)
                return;
 
-       if (access(path, R_OK | F_OK) != 0)
+       if (access(path, R_OK | F_OK) != 0) {
+               ErrPrint("[%s] %s\n", path, strerror(errno));
                return;
+       }
 
        len = strlen(path);
        base_idx = len - 1;
@@ -1237,7 +1202,7 @@ EAPI int provider_send_updated(const char *pkgname, const char *id, int w, int h
 
        if (!pkgname || !id) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!content_info)
@@ -1248,7 +1213,7 @@ EAPI int provider_send_updated(const char *pkgname, const char *id, int w, int h
 
        if (s_info.fd < 0) {
                ErrPrint("Connection is not established\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        keep_file_in_safe(id);
@@ -1257,12 +1222,12 @@ EAPI int provider_send_updated(const char *pkgname, const char *id, int w, int h
                                        s_info.name, pkgname, id, w, h, priority, content_info, title);
        if (!packet) {
                ErrPrint("failed to build a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_send_desc_updated(const char *pkgname, const char *id, const char *descfile)
@@ -1272,12 +1237,12 @@ EAPI int provider_send_desc_updated(const char *pkgname, const char *id, const c
 
        if (!pkgname || !id) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (s_info.fd < 0) {
                ErrPrint("Connection is not established\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!descfile)
@@ -1286,12 +1251,12 @@ EAPI int provider_send_desc_updated(const char *pkgname, const char *id, const c
        packet = packet_create_noack("desc_updated", "ssss", s_info.name, pkgname, id, descfile);
        if (!packet) {
                ErrPrint("Failed to build a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_send_deleted(const char *pkgname, const char *id)
@@ -1301,23 +1266,23 @@ EAPI int provider_send_deleted(const char *pkgname, const char *id)
 
        if (!pkgname || !id) {
                ErrPrint("Invalid arguement\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (s_info.fd < 0) {
                ErrPrint("Connection is not established\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("deleted", "sss", s_info.name, pkgname, id);
        if (!packet) {
                ErrPrint("Failed to build a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = com_core_packet_send_only(s_info.fd, packet);
        packet_destroy(packet);
-       return ret;
+       return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
 }
 
 const char *provider_name(void)
index dd5a8dc..d157023 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
 #include <com-core_packet.h>
 
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "dlist.h"
 #include "util.h"
@@ -99,19 +100,19 @@ static inline int send_release_request(enum target_type type, const char *pkgnam
        packet = packet_create("release_buffer", "isss", type, provider_name(), pkgname, id);
        if (!packet) {
                ErrPrint("Failed to build a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        result = com_core_packet_oneshot_send(SLAVE_SOCKET, packet, 0.0f);
        packet_destroy(packet);
        if (!result) {
                ErrPrint("Failed to send a request\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (packet_get(result, "i", &ret) != 1) {
                ErrPrint("Invalid result packet\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
        packet_unref(result);
@@ -171,11 +172,11 @@ EAPI int provider_buffer_set_user_data(struct livebox_buffer *handle, void *data
 {
        if (!handle || handle->state != BUFFER_CREATED) {
                ErrPrint("info is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        handle->user_data = data;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 EAPI void *provider_buffer_user_data(struct livebox_buffer *handle)
@@ -257,12 +258,12 @@ EAPI int provider_buffer_resize(struct livebox_buffer *info, int w, int h)
 
        if (!info || info->state != BUFFER_CREATED) {
                ErrPrint("info is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        fb = send_resize_request(info->type, info->pkgname, info->id, w, h);
        if (!fb)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        /*!
         * \note
@@ -271,7 +272,7 @@ EAPI int provider_buffer_resize(struct livebox_buffer *info, int w, int h)
         * it only can be destroyed when there is no reference exists.
         */
        info->fb = fb;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 EAPI void *provider_buffer_ref(struct livebox_buffer *info)
@@ -288,7 +289,7 @@ EAPI int provider_buffer_unref(void *ptr)
 {
        if (!ptr) {
                ErrPrint("PTR is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        return fb_release_buffer(ptr);
@@ -300,7 +301,7 @@ EAPI int provider_buffer_release(struct livebox_buffer *info)
 
        if (!info || info->state != BUFFER_CREATED) {
                ErrPrint("Buffer handler is NULL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        dlist_remove_data(s_info.buffer_list, info);
@@ -318,14 +319,14 @@ EAPI int provider_buffer_release(struct livebox_buffer *info)
        free(info->pkgname);
        free(info->id);
        free(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 EAPI int provider_buffer_sync(struct livebox_buffer *info)
 {
        if (!info || info->state != BUFFER_CREATED) {
                ErrPrint("Buffer handler is NULL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        return fb_sync(info->fb);
@@ -369,7 +370,7 @@ EAPI int provider_buffer_get_size(struct livebox_buffer *info, int *w, int *h, i
 {
        if (!info || info->state != BUFFER_CREATED) {
                ErrPrint("Buffer handler is NULL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (w)
@@ -381,7 +382,7 @@ EAPI int provider_buffer_get_size(struct livebox_buffer *info, int *w, int *h, i
        if (pixel_size)
                *pixel_size = info->pixel_size;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 EAPI const char *provider_buffer_uri(struct livebox_buffer *info)
@@ -429,7 +430,7 @@ EAPI int provider_buffer_pixmap_is_support_hw(struct livebox_buffer *info)
 EAPI int provider_buffer_pixmap_create_hw(struct livebox_buffer *info)
 {
        if (!fb_has_gem(info->fb))
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        return fb_create_gem(info->fb);
 }
@@ -437,7 +438,7 @@ EAPI int provider_buffer_pixmap_create_hw(struct livebox_buffer *info)
 EAPI int provider_buffer_pixmap_destroy_hw(struct livebox_buffer *info)
 {
        if (!fb_has_gem(info->fb))
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        return fb_destroy_gem(info->fb);
 }
@@ -458,7 +459,7 @@ EAPI void *provider_buffer_pixmap_hw_addr(struct livebox_buffer *info)
 
 EAPI int provider_buffer_pre_render(struct livebox_buffer *info)
 {
-       int ret = 0;
+       int ret = LB_STATUS_SUCCESS;
 
        if (fb_has_gem(info->fb))
                ret = fb_acquire_gem(info->fb) ? 0 : -EFAULT;
@@ -468,7 +469,7 @@ EAPI int provider_buffer_pre_render(struct livebox_buffer *info)
 
 EAPI int provider_buffer_post_render(struct livebox_buffer *info)
 {
-       int ret = 0;
+       int ret = LB_STATUS_SUCCESS;
 
        if (fb_has_gem(info->fb))
                ret = fb_release_gem(info->fb);
index 786d04b..6754dad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012  Samsung Electronics Co., Ltd
+ * Copyright 2013  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the "License");
  * you may not use this file except in compliance with the License.