Replace system errno with livebox errno.
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 22 Mar 2013 15:36:17 +0000 (15:36 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Sun, 24 Mar 2013 03:30:10 +0000 (03:30 +0000)
Make error status code more portable.
If the livebox_create function has updaetd content, try send it to the provider.

Change-Id: I2851d03c1f0a2bbc6c28abfdfd4c46161a0953f1

29 files changed:
include/abi.h
include/client_life.h
include/critical_log.h
include/event.h
include/instance.h
include/liveinfo.h
src/abi.c
src/buffer_handler.c
src/client_life.c
src/client_rpc.c
src/conf.c
src/critical_log.c
src/event.c
src/fault_manager.c
src/fb.c
src/group.c
src/instance.c
src/io.c
src/liveinfo.c
src/main.c
src/package.c
src/parser.c
src/pkgmgr.c
src/script_handler.c
src/server.c
src/slave_life.c
src/slave_rpc.c
src/util.c
src/xmonitor.c

index ea70f7f..f99f4cf 100644 (file)
@@ -18,7 +18,7 @@ extern int abi_add_entry(const char *abi, const char *pkgname);
 extern int abi_update_entry(const char *abi, const char *pkgname);
 extern int abi_del_entry(const char *abi);
 extern const char *abi_find_slave(const char *abi);
-extern int abi_del_all(void);
+extern void abi_del_all(void);
 extern const char *abi_find_by_pkgname(const char *pkgname);
 
 /* End of a file */
index 8a7ceb7..3cf5b42 100644 (file)
@@ -98,7 +98,7 @@ extern int client_unsubscribe(struct client_node *client, const char *cluster, c
 extern int client_is_subscribed(struct client_node *client, const char *cluster, const char *category);
 
 extern int client_init(void);
-extern int client_fini(void);
+extern void client_fini(void);
 
 extern int client_browse_list(const char *cluster, const char *category, int (*cb)(struct client_node *client, void *data), void *data);
 extern int client_nr_of_subscriber(const char *cluster, const char *category);
index 070ac47..1aa847e 100644 (file)
@@ -16,7 +16,7 @@
 
 extern int critical_log(const char *func, int line, const char *fmt, ...);
 extern int critical_log_init(const char *tag);
-extern int critical_log_fini(void);
+extern void critical_log_fini(void);
 
 #define CRITICAL_LOG(args...) critical_log(__func__, __LINE__, args)
 
index 525bfc6..c7b2b40 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2012  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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 struct event_data {
        int x;
        int y;
index 4556ea9..53fbd42 100644 (file)
@@ -193,7 +193,6 @@ extern const enum instance_state const instance_state(const struct inst_info *in
  */
 extern int instance_unicast_created_event(struct inst_info *inst, struct client_node *client);
 extern int instance_unicast_deleted_event(struct inst_info *inst, struct client_node *client);
-extern void instance_send_resized_event(struct inst_info *inst, int is_pd, int w, int h, int status);
 
 extern int instance_create_lb_buffer(struct inst_info *inst);
 extern int instance_create_pd_buffer(struct inst_info *inst);
index 592a8ee..e55a31c 100644 (file)
@@ -17,9 +17,9 @@
 struct liveinfo;
 
 extern int liveinfo_init(void);
-extern int liveinfo_fini(void);
+extern void liveinfo_fini(void);
 extern struct liveinfo *liveinfo_create(pid_t pid, int handle);
-extern int liveinfo_destroy(struct liveinfo *info);
+extern void liveinfo_destroy(struct liveinfo *info);
 
 extern struct liveinfo *liveinfo_find_by_pid(pid_t pid);
 extern struct liveinfo *liveinfo_find_by_handle(int handle);
@@ -28,6 +28,6 @@ extern const char *liveinfo_filename(struct liveinfo *info);
 extern pid_t liveinfo_pid(struct liveinfo *info);
 extern FILE *liveinfo_fifo(struct liveinfo *info);
 extern int liveinfo_open_fifo(struct liveinfo *info);
-extern int liveinfo_close_fifo(struct liveinfo *info);
+extern void liveinfo_close_fifo(struct liveinfo *info);
 
 /* End of a file */
index 62db6c9..b77e81a 100644 (file)
--- a/src/abi.c
+++ b/src/abi.c
@@ -20,6 +20,7 @@
 
 #include <Eina.h>
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -45,14 +46,14 @@ HAPI int abi_add_entry(const char *abi, const char *pkgname)
        item = malloc(sizeof(*item));
        if (!item) {
                ErrPrint("Failed to add a new entry for abi[%s - %s]\n", abi, pkgname);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->abi = strdup(abi);
        if (!item->abi) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(item);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->pkgname = strdup(pkgname);
@@ -60,11 +61,11 @@ HAPI int abi_add_entry(const char *abi, const char *pkgname)
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(item->abi);
                DbgFree(item);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        s_abi.list = eina_list_append(s_abi.list, item);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int abi_update_entry(const char *abi, const char *pkgname)
@@ -77,7 +78,7 @@ HAPI int abi_update_entry(const char *abi, const char *pkgname)
        _pkgname = strdup(pkgname);
        if (!_pkgname) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        EINA_LIST_FOREACH_SAFE(s_abi.list, l, n, item) {
@@ -89,7 +90,7 @@ HAPI int abi_update_entry(const char *abi, const char *pkgname)
        }
 
        DbgFree(_pkgname);
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 HAPI int abi_del_entry(const char *abi)
@@ -104,14 +105,14 @@ HAPI int abi_del_entry(const char *abi)
                        DbgFree(item->abi);
                        DbgFree(item->pkgname);
                        DbgFree(item);
-                       return 0;
+                       return LB_STATUS_SUCCESS;
                }
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
-HAPI int abi_del_all(void)
+HAPI void abi_del_all(void)
 {
        struct item *item;
 
@@ -120,8 +121,6 @@ HAPI int abi_del_all(void)
                DbgFree(item->pkgname);
                DbgFree(item);
        }
-
-       return 0;
 }
 
 HAPI const char *abi_find_slave(const char *abi)
index 59346cb..ddf66cd 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <dlog.h>
 #include <packet.h>
+#include <livebox-errno.h>
 
 #include "debug.h"
 #include "conf.h"
@@ -222,7 +223,7 @@ static inline int create_gem(struct buffer *buffer)
        disp = ecore_x_display_get();
        if (!disp) {
                ErrPrint("Failed to get display\n");
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        gem = (struct gem_data *)buffer->data;
@@ -231,11 +232,11 @@ static inline int create_gem(struct buffer *buffer)
                gem->data = calloc(1, gem->w * gem->h * gem->depth);
                if (!gem->data) {
                        ErrPrint("Heap: %s\n", strerror(errno));
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
 
                DbgPrint("DRI2(gem) is not supported - Fallback to the S/W Backend\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        DRI2CreateDrawable(disp, gem->pixmap);
@@ -246,7 +247,7 @@ static inline int create_gem(struct buffer *buffer)
        if (!gem->dri2_buffer || !gem->dri2_buffer->name) {
                ErrPrint("Failed to get a gem buffer\n");
                DRI2DestroyDrawable(disp, gem->pixmap);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
        DbgPrint("dri2_buffer: %p, name: %p, %dx%d\n",
                                gem->dri2_buffer, gem->dri2_buffer->name, gem->w, gem->h);
@@ -260,7 +261,7 @@ static inline int create_gem(struct buffer *buffer)
        if (!gem->pixmap_bo) {
                ErrPrint("Failed to import BO\n");
                DRI2DestroyDrawable(disp, gem->pixmap);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (gem->dri2_buffer->pitch != gem->w * gem->depth) {
@@ -274,7 +275,7 @@ static inline int create_gem(struct buffer *buffer)
                }
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline void *acquire_gem(struct buffer *buffer)
@@ -384,7 +385,7 @@ static inline int destroy_pixmap(struct buffer *buffer)
 
                disp = ecore_x_display_get();
                if (!disp)
-                       return -EIO;
+                       return LB_STATUS_ERROR_IO;
 
                DbgPrint("Free pixmap 0x%X\n", gem->pixmap);
                XFreePixmap(disp, gem->pixmap);
@@ -392,7 +393,7 @@ static inline int destroy_pixmap(struct buffer *buffer)
 
        buffer->state = DESTROYED;
        DbgFree(buffer);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int destroy_gem(struct buffer *buffer)
@@ -400,14 +401,14 @@ static inline int destroy_gem(struct buffer *buffer)
        struct gem_data *gem;
 
        if (!buffer)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        /*!
         * Forcely release the acquire_buffer.
         */
        gem = (struct gem_data *)buffer->data;
        if (!gem)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        if (s_info.fd >= 0) {
                if (gem->compensate_data) {
@@ -430,7 +431,7 @@ static inline int destroy_gem(struct buffer *buffer)
                gem->data = NULL;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int load_file_buffer(struct buffer_info *info)
@@ -445,7 +446,7 @@ static inline int load_file_buffer(struct buffer_info *info)
        new_id = malloc(len);
        if (!new_id) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        timestamp = util_timestamp();
@@ -455,14 +456,14 @@ static inline int load_file_buffer(struct buffer_info *info)
        if (!size) {
                ErrPrint("Canvas buffer size is ZERO\n");
                DbgFree(new_id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        buffer = calloc(1, size);
        if (!buffer) {
                ErrPrint("Failed to allocate buffer\n");
                DbgFree(new_id);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        buffer->type = BUFFER_TYPE_FILE;
@@ -476,7 +477,7 @@ static inline int load_file_buffer(struct buffer_info *info)
        info->is_loaded = 1;
 
        DbgPrint("FILE type %d created\n", size);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int load_shm_buffer(struct buffer_info *info)
@@ -490,13 +491,13 @@ static inline int load_shm_buffer(struct buffer_info *info)
        size = info->w * info->h * info->pixel_size;
        if (!size) {
                ErrPrint("Invalid buffer size\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        id = shmget(IPC_PRIVATE, size + sizeof(*buffer), IPC_CREAT | 0666);
        if (id < 0) {
                ErrPrint("shmget: %s\n", strerror(errno));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        buffer = shmat(id, NULL, 0);
@@ -506,7 +507,7 @@ static inline int load_shm_buffer(struct buffer_info *info)
                if (shmctl(id, IPC_RMID, 0) < 0)
                        ErrPrint("%s shmctl: %s\n", info->id, strerror(errno));
 
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        buffer->type = BUFFER_TYPE_SHM;
@@ -525,7 +526,7 @@ static inline int load_shm_buffer(struct buffer_info *info)
                if (shmctl(id, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
 
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        snprintf(new_id, len, SCHEMA_SHM "%d", id);
@@ -534,7 +535,7 @@ static inline int load_shm_buffer(struct buffer_info *info)
        info->id = new_id;
        info->buffer = buffer;
        info->is_loaded = 1;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int load_pixmap_buffer(struct buffer_info *info)
@@ -559,7 +560,7 @@ static inline int load_pixmap_buffer(struct buffer_info *info)
        if (!buffer) {
                DbgPrint("Failed to make a reference of a pixmap\n");
                info->is_loaded = 0;
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        len = strlen(SCHEMA_PIXMAP) + 30; /* strlen("pixmap://") + 30 */
@@ -568,7 +569,7 @@ static inline int load_pixmap_buffer(struct buffer_info *info)
                info->is_loaded = 0;
                ErrPrint("Heap: %s\n", strerror(errno));
                buffer_handler_pixmap_unref(buffer);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgPrint("Releaseo old id (%s)\n", info->id);
@@ -581,7 +582,7 @@ static inline int load_pixmap_buffer(struct buffer_info *info)
        snprintf(info->id, len, SCHEMA_PIXMAP "%d", (int)gem->pixmap);
        DbgPrint("info->id: %s\n", info->id);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int buffer_handler_load(struct buffer_info *info)
@@ -590,12 +591,12 @@ HAPI int buffer_handler_load(struct buffer_info *info)
 
        if (!info) {
                DbgPrint("buffer handler is nil\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->is_loaded) {
                DbgPrint("Buffer is already loaded\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        switch (info->type) {
@@ -610,7 +611,7 @@ HAPI int buffer_handler_load(struct buffer_info *info)
                break;
        default:
                ErrPrint("Invalid buffer\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                break;
        }
 
@@ -625,7 +626,7 @@ static inline int unload_file_buffer(struct buffer_info *info)
        new_id = strdup(SCHEMA_FILE "/tmp/.live.undefined");
        if (!new_id) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->buffer);
@@ -637,7 +638,7 @@ static inline int unload_file_buffer(struct buffer_info *info)
 
        DbgFree(info->id);
        info->id = new_id;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int unload_shm_buffer(struct buffer_info *info)
@@ -648,19 +649,19 @@ static inline int unload_shm_buffer(struct buffer_info *info)
        new_id = strdup(SCHEMA_SHM "-1");
        if (!new_id) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        if (sscanf(info->id, SCHEMA_SHM "%d", &id) != 1) {
                ErrPrint("%s Invalid ID\n", info->id);
                DbgFree(new_id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (id < 0) {
                ErrPrint("(%s) Invalid id: %d\n", info->id, id);
                DbgFree(new_id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (shmdt(info->buffer) < 0)
@@ -673,7 +674,7 @@ static inline int unload_shm_buffer(struct buffer_info *info)
 
        DbgFree(info->id);
        info->id = new_id;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int unload_pixmap_buffer(struct buffer_info *info)
@@ -684,19 +685,19 @@ static inline int unload_pixmap_buffer(struct buffer_info *info)
        new_id = strdup(SCHEMA_PIXMAP "0");
        if (!new_id) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        if (sscanf(info->id, SCHEMA_PIXMAP "%d", &id) != 1) {
                ErrPrint("Invalid ID (%s)\n", info->id);
                DbgFree(new_id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (id == 0) {
                ErrPrint("(%s) Invalid id: %d\n", info->id, id);
                DbgFree(new_id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        /*!
@@ -713,7 +714,7 @@ static inline int unload_pixmap_buffer(struct buffer_info *info)
 
        DbgFree(info->id);
        info->id = new_id;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int buffer_handler_unload(struct buffer_info *info)
@@ -722,12 +723,12 @@ HAPI int buffer_handler_unload(struct buffer_info *info)
 
        if (!info) {
                DbgPrint("buffer handler is nil\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!info->is_loaded) {
                ErrPrint("Buffer is not loaded\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (info->type) {
@@ -742,7 +743,7 @@ HAPI int buffer_handler_unload(struct buffer_info *info)
                break;
        default:
                ErrPrint("Invalid buffer\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                break;
        }
 
@@ -759,7 +760,7 @@ HAPI int buffer_handler_destroy(struct buffer_info *info)
 
        if (!info) {
                DbgPrint("Buffer is not created yet. info is nil\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        EINA_LIST_FOREACH(s_info.pixmap_list, l, buffer) {
@@ -770,7 +771,7 @@ HAPI int buffer_handler_destroy(struct buffer_info *info)
        buffer_handler_unload(info);
        DbgFree(info->id);
        DbgFree(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const char *buffer_handler_id(const struct buffer_info *info)
@@ -968,7 +969,7 @@ HAPI int buffer_handler_pixmap_release_buffer(void *canvas)
        void *_ptr;
 
        if (!canvas)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        EINA_LIST_FOREACH_SAFE(s_info.pixmap_list, l, n, buffer) {
                if (!buffer || buffer->state != CREATED || buffer->type != BUFFER_TYPE_PIXMAP) {
@@ -985,11 +986,11 @@ HAPI int buffer_handler_pixmap_release_buffer(void *canvas)
                if (_ptr == canvas) {
                        release_gem(buffer);
                        buffer_handler_pixmap_unref(buffer);
-                       return 0;
+                       return LB_STATUS_SUCCESS;
                }
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 /*!
@@ -1005,7 +1006,7 @@ HAPI int buffer_handler_pixmap_unref(void *buffer_ptr)
 
        buffer->refcnt--;
        if (buffer->refcnt > 0)
-               return 0; /* Return NULL means, gem buffer still in use */
+               return LB_STATUS_SUCCESS; /* Return NULL means, gem buffer still in use */
 
        s_info.pixmap_list = eina_list_remove(s_info.pixmap_list, buffer);
 
@@ -1019,7 +1020,7 @@ HAPI int buffer_handler_pixmap_unref(void *buffer_ptr)
        if (info && info->buffer == buffer)
                info->buffer = NULL;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int buffer_handler_is_loaded(const struct buffer_info *info)
@@ -1042,19 +1043,19 @@ HAPI int buffer_handler_resize(struct buffer_info *info, int w, int h)
 
        if (!info) {
                ErrPrint("Invalid handler\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->w == w && info->h == h) {
                DbgPrint("No changes\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        buffer_handler_update_size(info, w, h);
 
        if (!info->is_loaded) {
                DbgPrint("Not yet loaded, just update the size [%dx%d]\n", w, h);
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        ret = buffer_handler_unload(info);
@@ -1065,20 +1066,20 @@ HAPI int buffer_handler_resize(struct buffer_info *info, int w, int h)
        if (ret < 0)
                ErrPrint("Load: %d\n", ret);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int buffer_handler_get_size(struct buffer_info *info, int *w, int *h)
 {
        if (!info)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        if (w)
                *w = info->w;
        if (h)
                *h = info->h;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI struct inst_info *buffer_handler_instance(struct buffer_info *info)
@@ -1102,30 +1103,30 @@ static inline int sync_for_pixmap(struct buffer *buffer)
 
        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;
        }
 
        disp = ecore_x_display_get();
        if (!disp) {
                ErrPrint("Failed to get a display\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        gem = (struct gem_data *)buffer->data;
        if (gem->w == 0 || gem->h == 0) {
                DbgPrint("Nothing can be sync\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        si.shmid = shmget(IPC_PRIVATE, gem->w * gem->h * gem->depth, IPC_CREAT | 0666);
        if (si.shmid < 0) {
                ErrPrint("shmget: %s\n", strerror(errno));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        si.readOnly = False;
@@ -1133,7 +1134,7 @@ static inline int sync_for_pixmap(struct buffer *buffer)
        if (si.shmaddr == (void *)-1) {
                if (shmctl(si.shmid, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        screen = DefaultScreenOfDisplay(disp);
@@ -1149,7 +1150,7 @@ static inline int sync_for_pixmap(struct buffer *buffer)
 
                if (shmctl(si.shmid, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        xim->data = si.shmaddr;
@@ -1167,7 +1168,7 @@ static inline int sync_for_pixmap(struct buffer *buffer)
                if (shmctl(si.shmid, IPC_RMID, 0) < 0)
                        ErrPrint("shmctl: %s\n", strerror(errno));
 
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        memcpy(xim->data, gem->data, gem->w * gem->h * gem->depth);
@@ -1189,7 +1190,7 @@ static inline int sync_for_pixmap(struct buffer *buffer)
        if (shmctl(si.shmid, IPC_RMID, 0) < 0)
                ErrPrint("shmctl: %s\n", strerror(errno));
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void buffer_handler_flush(struct buffer_info *info)
@@ -1246,21 +1247,21 @@ HAPI int buffer_handler_init(void)
 
        if (!DRI2QueryExtension(ecore_x_display_get(), &s_info.evt_base, &s_info.err_base)) {
                DbgPrint("DRI2 is not supported\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (!DRI2QueryVersion(ecore_x_display_get(), &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(ecore_x_display_get(), DefaultRootWindow(ecore_x_display_get()), &driverName, &deviceName)) {
                DbgPrint("DRI2 is not supported\n");
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        DbgPrint("Open: %s (driver: %s)", deviceName, driverName);
@@ -1271,7 +1272,7 @@ HAPI int buffer_handler_init(void)
                s_info.err_base = 0;
                DbgFree(deviceName);
                DbgFree(driverName);
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        s_info.fd = open(deviceName, O_RDWR);
@@ -1281,7 +1282,7 @@ HAPI int buffer_handler_init(void)
                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);
@@ -1292,7 +1293,7 @@ HAPI int buffer_handler_init(void)
                s_info.fd = -1;
                s_info.evt_base = 0;
                s_info.err_base = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        s_info.slp_bufmgr = tbm_bufmgr_init(s_info.fd);
@@ -1302,10 +1303,10 @@ HAPI int buffer_handler_init(void)
                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;
 }
 
 HAPI int buffer_handler_fini(void)
@@ -1320,7 +1321,7 @@ HAPI int buffer_handler_fini(void)
                s_info.slp_bufmgr = NULL;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index f795feb..f2ed705 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <dlog.h>
 #include <packet.h>
+#include <livebox-errno.h>
 
 #include "client_life.h"
 #include "instance.h"
@@ -410,13 +411,13 @@ HAPI int client_event_callback_add(struct client_node *client, enum client_event
 
        if (!cb) {
                ErrPrint("Invalid callback (cb == NULL)\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        item = calloc(1, sizeof(*item));
        if (!item) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->cb = cb;
@@ -449,10 +450,10 @@ HAPI int client_event_callback_add(struct client_node *client, enum client_event
                break;
        default:
                DbgFree(item);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int client_event_callback_del(struct client_node *client, enum client_event event, int (*cb)(struct client_node *, void *), void *data)
@@ -463,7 +464,7 @@ HAPI int client_event_callback_del(struct client_node *client, enum client_event
 
        if (!cb) {
                ErrPrint("Invalid callback (cb == NULL)\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (event) {
@@ -472,7 +473,7 @@ HAPI int client_event_callback_del(struct client_node *client, enum client_event
                        if (item->cb == cb && item->data == data) {
                                client->event_deactivate_list = eina_list_remove(client->event_deactivate_list, item);
                                DbgFree(item);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -482,7 +483,7 @@ HAPI int client_event_callback_del(struct client_node *client, enum client_event
                        if (item->cb == cb && item->data == data) {
                                client->event_activate_list = eina_list_remove(client->event_activate_list, item);
                                DbgFree(item);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -492,7 +493,7 @@ HAPI int client_event_callback_del(struct client_node *client, enum client_event
                break;
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 HAPI int client_set_data(struct client_node *client, const char *tag, void *data)
@@ -502,20 +503,20 @@ HAPI int client_set_data(struct client_node *client, const char *tag, void *data
        item = calloc(1, sizeof(*item));
        if (!item) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->tag = strdup(tag);
        if (!item->tag) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(item);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->data = data;
 
        client->data_list = eina_list_append(client->data_list, item);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void *client_data(struct client_node *client, const char *tag)
@@ -571,10 +572,10 @@ HAPI void client_resumed(struct client_node *client)
 
 HAPI int client_init(void)
 {
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
-HAPI int client_fini(void)
+HAPI void client_fini(void)
 {
        struct global_event_handler *handler;
        struct client_node *client;
@@ -592,8 +593,6 @@ HAPI int client_fini(void)
        EINA_LIST_FREE(s_info.destroy_event_list, handler) {
                DbgFree(handler);
        }
-
-       return 0;
 }
 
 HAPI const int const client_is_activated(const struct client_node *client)
@@ -608,7 +607,7 @@ HAPI int client_global_event_handler_add(enum client_global_event event_type, in
        handler = malloc(sizeof(*handler));
        if (!handler) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        handler->cbdata = data;
@@ -623,10 +622,10 @@ HAPI int client_global_event_handler_add(enum client_global_event event_type, in
                break;
        default:
                DbgFree(handler);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int client_global_event_handler_del(enum client_global_event event_type, int (*cb)(struct client_node *, void *), void *data)
@@ -641,7 +640,7 @@ HAPI int client_global_event_handler_del(enum client_global_event event_type, in
                        if (handler->cb == cb && handler->cbdata == data) {
                                s_info.create_event_list = eina_list_remove(s_info.create_event_list, handler);
                                DbgFree(handler);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -650,7 +649,7 @@ HAPI int client_global_event_handler_del(enum client_global_event event_type, in
                        if (handler->cb == cb && handler->cbdata == data) {
                                s_info.destroy_event_list = eina_list_remove(s_info.destroy_event_list, handler);
                                DbgFree(handler);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -658,7 +657,7 @@ HAPI int client_global_event_handler_del(enum client_global_event event_type, in
                break;
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 HAPI int client_subscribe(struct client_node *client, const char *cluster, const char *category)
@@ -668,14 +667,14 @@ HAPI int client_subscribe(struct client_node *client, const char *cluster, const
        item = malloc(sizeof(*item));
        if (!item) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->cluster = strdup(cluster);
        if (!item->cluster) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(item);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->category = strdup(category);
@@ -683,11 +682,11 @@ HAPI int client_subscribe(struct client_node *client, const char *cluster, const
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(item->cluster);
                DbgFree(item);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        client->subscribe_list = eina_list_append(client->subscribe_list, item);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int client_unsubscribe(struct client_node *client, const char *cluster, const char *category)
@@ -702,11 +701,11 @@ HAPI int client_unsubscribe(struct client_node *client, const char *cluster, con
                        DbgFree(item->cluster);
                        DbgFree(item->category);
                        DbgFree(item);
-                       return 0;
+                       return LB_STATUS_SUCCESS;
                }
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 HAPI int client_is_subscribed(struct client_node *client, const char *cluster, const char *category)
@@ -738,7 +737,7 @@ HAPI int client_browse_list(const char *cluster, const char *category, int (*cb)
        int cnt;
 
        if (!cb || !cluster || !category)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        cnt = 0;
        EINA_LIST_FOREACH(s_info.client_list, l, client) {
@@ -746,7 +745,7 @@ HAPI int client_browse_list(const char *cluster, const char *category, int (*cb)
                        continue;
 
                if (cb(client, data) < 0)
-                       return -ECANCELED;
+                       return LB_STATUS_ERROR_CANCEL;
 
                cnt++;
        }
@@ -785,7 +784,7 @@ HAPI int client_broadcast(struct inst_info *inst, struct packet *packet)
        }
 
        packet_unref(packet);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index 8266ffe..87c0440 100644 (file)
@@ -23,6 +23,7 @@
 #include <dlog.h>
 #include <com-core_packet.h>
 #include <packet.h>
+#include <livebox-errno.h>
 
 #include "client_life.h"
 #include "instance.h"
@@ -166,12 +167,12 @@ HAPI int client_rpc_async_request(struct client_node *client, struct packet *pac
        struct client_rpc *rpc;
 
        if (!client || !packet)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        if (client_is_faulted(client)) {
                ErrPrint("Client[%p] is faulted\n", client);
                packet_unref(packet);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        rpc = client_data(client, RPC_TAG);
@@ -181,12 +182,12 @@ HAPI int client_rpc_async_request(struct client_node *client, struct packet *pac
        command = create_command(client, packet);
        if (!command) {
                packet_unref(packet);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        push_command(command);
        packet_unref(packet);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int deactivated_cb(struct client_node *client, void *data)
@@ -199,7 +200,7 @@ static int deactivated_cb(struct client_node *client, void *data)
        rpc = client_data(client, RPC_TAG);
        if (!rpc) {
                ErrPrint("client is not valid\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        DbgPrint("Reset handle for %d\n", client_pid(client));
@@ -214,7 +215,7 @@ static int deactivated_cb(struct client_node *client, void *data)
        }
        DbgPrint("End: Destroying command\n");
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int client_rpc_init(struct client_node *client, int handle)
@@ -225,7 +226,7 @@ HAPI int client_rpc_init(struct client_node *client, int handle)
        rpc = calloc(1, sizeof(*rpc));
        if (!rpc) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        ret = client_set_data(client, RPC_TAG, rpc);
@@ -239,7 +240,7 @@ HAPI int client_rpc_init(struct client_node *client, int handle)
        rpc->handle = handle;
 
        client_event_callback_add(client, CLIENT_EVENT_DEACTIVATE, deactivated_cb, NULL);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int client_rpc_fini(struct client_node *client)
@@ -248,11 +249,11 @@ HAPI int client_rpc_fini(struct client_node *client)
 
        rpc = client_del_data(client, RPC_TAG);
        if (!rpc)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        client_event_callback_del(client, CLIENT_EVENT_DEACTIVATE, deactivated_cb, NULL);
        DbgFree(rpc);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int client_rpc_handle(struct client_node *client)
@@ -262,7 +263,7 @@ HAPI int client_rpc_handle(struct client_node *client)
        rpc = client_data(client, RPC_TAG);
        if (!rpc) {
                DbgPrint("Client has no RPC\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        return rpc->handle;
index f0ab7ea..84ec63b 100644 (file)
@@ -18,6 +18,7 @@
 #include <ctype.h>
 
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "conf.h"
 #include "util.h"
@@ -492,7 +493,7 @@ HAPI int conf_loader(void)
        fp = fopen("/usr/share/data-provider-master/conf.ini", "rt");
        if (!fp) {
                ErrPrint("Error: %s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        state = START;
@@ -650,7 +651,7 @@ HAPI int conf_loader(void)
         } while (c != EOF);
 
        fclose(fp);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index 36e7ccf..8094b9d 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <dlog.h>
 #include <Eina.h>
+#include <livebox-errno.h>
 
 #include "conf.h"
 #include "debug.h"
@@ -83,7 +84,7 @@ HAPI int critical_log(const char *func, int line, const char *fmt, ...)
        struct timeval tv;
 
        if (!s_info.fp)
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
 
        if (gettimeofday(&tv, NULL) < 0) {
                tv.tv_sec = 0;
@@ -109,12 +110,12 @@ HAPI int critical_log_init(const char *name)
        char *filename;
 
        if (s_info.fp)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        s_info.filename = strdup(name);
        if (!s_info.filename) {
                ErrPrint("Failed to create a log file\n");
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        namelen = strlen(name) + strlen(SLAVE_LOG_PATH) + 20;
@@ -124,7 +125,7 @@ HAPI int critical_log_init(const char *name)
                ErrPrint("Failed to create a log file\n");
                DbgFree(s_info.filename);
                s_info.filename = NULL;
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        snprintf(filename, namelen, "%s/%d_%s", SLAVE_LOG_PATH, s_info.file_id, name);
@@ -135,16 +136,16 @@ HAPI int critical_log_init(const char *name)
                DbgFree(s_info.filename);
                s_info.filename = NULL;
                DbgFree(filename);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        DbgFree(filename);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 
 
-HAPI int critical_log_fini(void)
+HAPI void critical_log_fini(void)
 {
        if (s_info.filename) {
                DbgFree(s_info.filename);
@@ -155,8 +156,6 @@ HAPI int critical_log_fini(void)
                fclose(s_info.fp);
                s_info.fp = NULL;
        }
-
-       return 0;
 }
 
 
index 0062abb..78fbe71 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2012  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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
@@ -13,6 +29,7 @@
 #include <Eina.h>
 #include <Ecore.h>
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -94,9 +111,9 @@ HAPI int event_init(void)
        ret = pthread_mutex_init(&s_info.event_list_lock, NULL);
        if (ret != 0) {
                ErrPrint("Mutex: %s\n", strerror(ret));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int event_fini(void)
@@ -105,7 +122,7 @@ HAPI int event_fini(void)
        ret = pthread_mutex_destroy(&s_info.event_list_lock);
        if (ret != 0)
                ErrPrint("Mutex destroy failed: %s\n", strerror(ret));
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int processing_input_event(struct input_event *event)
@@ -134,7 +151,7 @@ static inline int processing_input_event(struct input_event *event)
                                event_ch = EVENT_CH;
                                if (write(s_info.evt_pipe[PIPE_WRITE], &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
                                        ErrPrint("Unable to send an event: %s\n", strerror(errno));
-                                       return -EIO;
+                                       return LB_STATUS_ERROR_IO;
                                }
                        }
                        break;
@@ -205,7 +222,7 @@ static inline int processing_input_event(struct input_event *event)
                break;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static void *event_main(void *data)
@@ -237,20 +254,20 @@ static void *event_main(void *data)
                } else if (ret == 0) {
                        ErrPrint("Timeout expired\n");
                        CANCEL_SECTION_END();
-                       return (void *)-ETIMEDOUT;
+                       return (void *)LB_STATUS_ERROR_TIMEOUT;
                }
                CANCEL_SECTION_END();
 
                if (!FD_ISSET(s_info.handle, &set)) {
                        ErrPrint("Unexpected handle is toggled\n");
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        break;
                }
 
                readsize = read(s_info.handle, ptr + offset, sizeof(input_event) - offset);
                if (readsize < 0) {
                        ErrPrint("Unable to read device: %s / fd: %d / offset: %d / size: %d - %d\n", strerror(errno), s_info.handle, offset, sizeof(input_event), readsize);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        break;
                }
 
@@ -258,7 +275,7 @@ static void *event_main(void *data)
                if (offset == sizeof(input_event)) {
                        offset = 0;
                        if (processing_input_event(&input_event) < 0) {
-                               ret = -EFAULT;
+                               ret = LB_STATUS_ERROR_FAULT;
                                break;
                        }
                }
@@ -317,13 +334,13 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
 
        if (s_info.handle >= 0) {
                DbgPrint("Already activated\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        s_info.handle = open(INPUT_PATH, O_RDONLY);
        if (s_info.handle < 0) {
                ErrPrint("Unable to access the device: %s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (fcntl(s_info.handle, F_SETFD, FD_CLOEXEC) < 0)
@@ -338,7 +355,7 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
                if (close(s_info.handle) < 0)
                        ErrPrint("Failed to close handle: %s\n", strerror(errno));
                s_info.handle = -1;
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        s_info.event_handler = ecore_main_fd_handler_add(s_info.evt_pipe[PIPE_READ], ECORE_FD_READ, event_read_cb, NULL, NULL, NULL);
@@ -353,7 +370,7 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
                        ErrPrint("Failed to close handle: %s\n", strerror(errno));
 
                s_info.handle = -1;
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        status = pthread_create(&s_info.tid, NULL, event_main, NULL);
@@ -372,7 +389,7 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
                if (close(s_info.evt_pipe[PIPE_WRITE]) < 0)
                        ErrPrint("close: %s\n", strerror(errno));
 
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        s_info.event_cb = event_cb;
@@ -381,7 +398,7 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
        s_info.y = y;
 
        DbgPrint("Event handler activated\n");
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int event_deactivate(void)
@@ -392,7 +409,7 @@ HAPI int event_deactivate(void)
 
        if (s_info.handle < 0) {
                ErrPrint("Event handler is not actiavated\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        status = pthread_cancel(s_info.tid);
@@ -442,7 +459,7 @@ HAPI int event_deactivate(void)
        s_info.event_data.x = -1;
        s_info.event_data.y = -1;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int event_is_activated(void)
index 89c2a74..35b56ed 100644 (file)
@@ -23,6 +23,7 @@
 #include <Eina.h>
 #include <packet.h>
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -152,11 +153,11 @@ HAPI int fault_info_set(struct slave_node *slave, const char *pkgname, const cha
 
        pkg = package_find(pkgname);
        if (!pkg)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        ret = package_set_fault_info(pkg, util_timestamp(), id, func);
        if (ret < 0)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        dump_fault_info(slave_name(slave), slave_pid(slave), pkgname, id, func);
        ErrPrint("Set fault %s(%d)\n", !ret ? "Success" : "Failed", ret);
@@ -167,7 +168,7 @@ HAPI int fault_info_set(struct slave_node *slave, const char *pkgname, const cha
         * Update statistics
         */
        s_info.fault_mark_count++;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int fault_check_pkgs(struct slave_node *slave)
@@ -296,21 +297,21 @@ HAPI int fault_func_call(struct slave_node *slave, const char *pkgname, const ch
 
        info = malloc(sizeof(*info));
        if (!info)
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
 
        info->slave = slave;
 
        info->pkgname = strdup(pkgname);
        if (!info->pkgname) {
                DbgFree(info);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        info->filename = strdup(filename);
        if (!info->filename) {
                DbgFree(info->pkgname);
                DbgFree(info);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        info->func = strdup(func);
@@ -318,7 +319,7 @@ HAPI int fault_func_call(struct slave_node *slave, const char *pkgname, const ch
                DbgFree(info->filename);
                DbgFree(info->pkgname);
                DbgFree(info);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        info->timestamp = util_timestamp();
@@ -326,7 +327,7 @@ HAPI int fault_func_call(struct slave_node *slave, const char *pkgname, const ch
        s_info.call_list = eina_list_append(s_info.call_list, info);
 
        s_info.fault_mark_count++;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int fault_func_ret(struct slave_node *slave, const char *pkgname, const char *filename, const char *func)
@@ -357,7 +358,7 @@ HAPI int fault_func_ret(struct slave_node *slave, const char *pkgname, const cha
                return 0;
        } 
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 /* End of a file */
index fa8e122..95361b7 100644 (file)
--- a/src/fb.c
+++ b/src/fb.c
@@ -21,6 +21,7 @@
 #include <dlog.h>
 #include <Ecore_Evas.h>
 #include <Evas.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "conf.h"
@@ -38,12 +39,12 @@ struct fb_info {
 
 HAPI int fb_init(void)
 {
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int fb_fini(void)
 {
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static void *alloc_fb(void *data, int size)
@@ -151,7 +152,7 @@ HAPI int fb_create_buffer(struct fb_info *info)
        DbgPrint("Buffer handler size: %dx%d\n", ow, oh);
        if (ow == 0 && oh == 0) {
                DbgPrint("ZERO Size FB accessed\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (info->ee) {
@@ -164,13 +165,13 @@ HAPI int fb_create_buffer(struct fb_info *info)
                        ecore_evas_resize(info->ee, ow, oh);
                }
 
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        info->ee = ecore_evas_buffer_allocfunc_new(ow, oh, alloc_fb, free_fb, info);
        if (!info->ee) {
                ErrPrint("Failed to create a buffer\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        e = ecore_evas_get(info->ee);
@@ -192,14 +193,14 @@ HAPI int fb_create_buffer(struct fb_info *info)
                ecore_evas_alpha_set(info->ee, EINA_TRUE);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int fb_destroy_buffer(struct fb_info *info)
 {
        if (!info->ee) {
                ErrPrint("EE is not exists (Maybe ZERO byte ee?)\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (buffer_handler_type(info->buffer) == BUFFER_TYPE_PIXMAP) {
@@ -213,14 +214,14 @@ HAPI int fb_destroy_buffer(struct fb_info *info)
 
        ecore_evas_free(info->ee);
        info->ee = NULL;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int fb_destroy(struct fb_info *info)
 {
        fb_destroy_buffer(info);
        DbgFree(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI Ecore_Evas * const fb_canvas(struct fb_info *info)
@@ -246,7 +247,7 @@ HAPI int fb_resize(struct fb_info *info, int w, int h)
                 */
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int fb_get_size(struct fb_info *info, int *w, int *h)
index c0697f1..a704096 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <dlog.h>
 #include <Eina.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -144,14 +145,14 @@ HAPI int group_add_option(struct context_item *item, const char *key, const char
        option = calloc(1, sizeof(*option));
        if (!option) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        option->key = strdup(key);
        if (!option->key) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(option);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        option->value = strdup(value);
@@ -159,12 +160,12 @@ HAPI int group_add_option(struct context_item *item, const char *key, const char
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(option->key);
                DbgFree(option);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        option->item = item;
        item->option_list = eina_list_append(item->option_list, option);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int group_destroy_context_info(struct context_info *info)
@@ -174,7 +175,7 @@ HAPI int group_destroy_context_info(struct context_info *info)
        category = info->category;
        if (!category) {
                ErrPrint("No category found\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        category->info_list = eina_list_remove(category->info_list, info);
@@ -182,7 +183,7 @@ HAPI int group_destroy_context_info(struct context_info *info)
        del_context_item(info);
        DbgFree(info->pkgname);
        DbgFree(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI struct cluster *group_create_cluster(const char *name)
@@ -272,11 +273,11 @@ HAPI int group_destroy_cluster(struct cluster *cluster)
                if (item == cluster) {
                        s_info.cluster_list = eina_list_remove_list(s_info.cluster_list, l);
                        destroy_cluster(cluster);
-                       return 0;
+                       return LB_STATUS_SUCCESS;
                }
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 static inline void destroy_category(struct category *category)
@@ -303,7 +304,7 @@ HAPI int group_destroy_category(struct category *category)
                cluster->category_list = eina_list_remove(cluster->category_list, category);
 
        destroy_category(category);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI struct category *group_find_category(struct cluster *cluster, const char *name)
@@ -380,17 +381,17 @@ HAPI int group_context_item_add_data(struct context_item *item, const char *tag,
 
        tmp = malloc(sizeof(*tmp));
        if (!tmp)
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
 
        tmp->tag = strdup(tag);
        if (!tmp->tag) {
                DbgFree(tmp);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        tmp->data = data;
        item->data_list = eina_list_append(item->data_list, tmp);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void *group_context_item_data(struct context_item *item, const char *tag)
@@ -513,7 +514,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                        name = get_token(ptr, &len);
                        if (!name) {
                                ErrPrint("Failed to get token\n");
-                               return -EFAULT;
+                               return LB_STATUS_ERROR_FAULT;
                        }
                        /* cluster{category{context{key=value,key=value},context{key=value}}} */
                        /* cluster{category} */
@@ -527,7 +528,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (!cluster) {
                                        ErrPrint("Failed to get cluster\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                state = CATEGORY;
@@ -541,14 +542,14 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (!category) {
                                        ErrPrint("Failed to get category\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                info = group_create_context_info(category, pkgname);
                                if (!info) {
                                        ErrPrint("Failed to create ctx info\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                state = CONTEXT_ITEM;
@@ -559,7 +560,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (!item) {
                                        ErrPrint("Failed to create a context item\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                state = CONTEXT_OPTION_KEY;
@@ -570,7 +571,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                        default:
                                ErrPrint("Invalid state\n");
                                DbgFree(name);
-                               return -EFAULT;
+                               return LB_STATUS_ERROR_FAULT;
                        }
 
                        DbgFree(name);
@@ -594,7 +595,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (is_open != 0) {
                                        ErrPrint("Invalid state\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
                                cluster = group_find_cluster(name);
                                if (!cluster)
@@ -603,7 +604,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (!cluster) {
                                        ErrPrint("Failed to get cluster\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                state = CATEGORY;
@@ -613,7 +614,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (is_open != 1) {
                                        ErrPrint("Invalid state\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
                                category = group_find_category(cluster, name);
                                if (!category)
@@ -622,14 +623,14 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (!category) {
                                        ErrPrint("Failed to get category\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                info = group_create_context_info(category, pkgname);
                                if (!info) {
                                        ErrPrint("Failed to create ctx info\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                state = CONTEXT_ITEM;
@@ -643,14 +644,14 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                        if (!category) {
                                                ErrPrint("Failed to get category\n");
                                                DbgFree(name);
-                                               return -EFAULT;
+                                               return LB_STATUS_ERROR_FAULT;
                                        }
 
                                        info = group_create_context_info(category, pkgname);
                                        if (!info) {
                                                ErrPrint("Failed to create ctx info\n");
                                                DbgFree(name);
-                                               return -EFAULT;
+                                               return LB_STATUS_ERROR_FAULT;
                                        }
                                        DbgPrint("Keep this syntax only for the compatibility\n");
                                } else if (is_open == 2) {
@@ -658,13 +659,13 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                        if (!item) {
                                                ErrPrint("Failed to create a context item\n");
                                                DbgFree(name);
-                                               return -EFAULT;
+                                               return LB_STATUS_ERROR_FAULT;
                                        }
                                        state = CONTEXT_OPTION_KEY;
                                } else {
                                        ErrPrint("Invalid state\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                break;
@@ -672,7 +673,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (is_open != 3) {
                                        ErrPrint("Invalid state\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                if (group_add_option(item, key, name) < 0)
@@ -687,7 +688,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                        default:
                                ErrPrint("Invalid state (%s)\n", name);
                                DbgFree(name);
-                               return -EFAULT;
+                               return LB_STATUS_ERROR_FAULT;
                        }
 
                        DbgFree(name);
@@ -698,13 +699,13 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                } else if (*ptr == '=') {
                        if (is_open != 3 || state != CONTEXT_OPTION_KEY) {
                                ErrPrint("Invalid state\n");
-                               return -EFAULT;
+                               return LB_STATUS_ERROR_FAULT;
                        }
 
                        key = get_token(ptr, &len);
                        if (!key) {
                                ErrPrint("Failed to get token\n");
-                               return -EFAULT;
+                               return LB_STATUS_ERROR_FAULT;
                        }
 
                        state = CONTEXT_OPTION_VALUE;
@@ -715,7 +716,7 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                } else if (*ptr == '}') {
                        if (is_open <= 0) {
                                ErrPrint("Invalid state\n");
-                               return -EFAULT;
+                               return LB_STATUS_ERROR_FAULT;
                        }
 
                        name = get_token(ptr, &len);
@@ -737,14 +738,14 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                if (!category) {
                                        ErrPrint("Failed to get category\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                info = group_create_context_info(category, pkgname);
                                if (!info) {
                                        ErrPrint("Failed to create ctx info\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                DbgPrint("Keep this syntax only for the compatibility: %s\n", name);
@@ -759,14 +760,14 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                        if (!category) {
                                                ErrPrint("Failed to get category\n");
                                                DbgFree(name);
-                                               return -EFAULT;
+                                               return LB_STATUS_ERROR_FAULT;
                                        }
 
                                        info = group_create_context_info(category, pkgname);
                                        if (!info) {
                                                ErrPrint("Failed to create ctx info\n");
                                                DbgFree(name);
-                                               return -EFAULT;
+                                               return LB_STATUS_ERROR_FAULT;
                                        }
 
                                        DbgPrint("Keep this syntax only for the compatibility: %s\n", name);
@@ -776,14 +777,14 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
                                } else {
                                        ErrPrint("Invalid state\n");
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
                                break;
                        case CONTEXT_OPTION_VALUE:
                                if (is_open != 2) {
                                        ErrPrint("Invalid state (%s)\n", name);
                                        DbgFree(name);
-                                       return -EFAULT;
+                                       return LB_STATUS_ERROR_FAULT;
                                }
 
                                if (group_add_option(item, key, name) < 0)
@@ -814,9 +815,9 @@ HAPI int group_add_livebox(const char *group, const char *pkgname)
        }
 
        if (state != CLUSTER)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int group_del_livebox(const char *pkgname)
@@ -846,12 +847,12 @@ HAPI int group_del_livebox(const char *pkgname)
                        group_destroy_cluster(cluster);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int group_init(void)
 {
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int group_fini(void)
@@ -867,7 +868,7 @@ HAPI int group_fini(void)
 
                destroy_cluster(cluster);
        }
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index a0e2e7f..9415b8a 100644 (file)
@@ -27,6 +27,7 @@
 #include <packet.h>
 #include <com-core_packet.h>
 #include <livebox-service.h>
+#include <livebox-errno.h>
 
 #include "conf.h"
 #include "util.h"
@@ -188,7 +189,7 @@ static int viewer_deactivated_cb(struct client_node *client, void *data)
        DbgPrint("%d is deleted from the list of viewer of %s(%s)\n", client_pid(client), package_name(instance_package(inst)), instance_id(inst));
        if (!eina_list_data_find(inst->client_list, client)) {
                DbgPrint("Not found\n");
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
        }
 
        inst->client_list = eina_list_remove(inst->client_list, client);
@@ -208,7 +209,7 @@ static inline int pause_livebox(struct inst_info *inst)
        packet = packet_create_noack("lb_pause", "ss", package_name(inst->info), inst->id);
        if (!packet) {
                ErrPrint("Failed to create a new packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_request_only(package_slave(inst->info), package_name(inst->info), packet, 0);
@@ -222,7 +223,7 @@ static inline int resume_livebox(struct inst_info *inst)
        packet = packet_create_noack("lb_resume", "ss", package_name(inst->info), inst->id);
        if (!packet) {
                ErrPrint("Failed to create a new packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_request_only(package_slave(inst->info), package_name(inst->info), packet, 0);
@@ -245,7 +246,7 @@ static inline int instance_recover_visible_state(struct inst_info *inst)
                instance_freeze_updator(inst);
                break;
        default:
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                break;
        }
 
@@ -253,12 +254,17 @@ static inline int instance_recover_visible_state(struct inst_info *inst)
        return ret;
 }
 
-HAPI void instance_send_resized_event(struct inst_info *inst, int is_pd, int w, int h, int status)
+static inline void instance_send_resized_event(struct inst_info *inst, int is_pd, int w, int h, int status)
 {
        struct packet *packet;
        const char *pkgname;
        const char *id;
 
+       if (!inst->info) {
+               ErrPrint("Instance info is not ready to use\n");
+               return;
+       }
+
        pkgname = package_name(inst->info);
        id = inst->id;
 
@@ -282,7 +288,7 @@ HAPI int instance_unicast_created_event(struct inst_info *inst, struct client_no
        if (!client) {
                client = inst->client;
                if (!client)
-                       return 0;
+                       return LB_STATUS_SUCCESS;
        }
 
        lb_type = package_lb_type(inst->info);
@@ -319,7 +325,7 @@ HAPI int instance_unicast_created_event(struct inst_info *inst, struct client_no
                        inst->is_pinned_up);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return client_rpc_async_request(client, packet);
@@ -329,11 +335,10 @@ static int update_client_list(struct client_node *client, void *data)
 {
        struct inst_info *inst = data;
 
-       if (!instance_has_client(inst, client)) {
+       if (!instance_has_client(inst, client))
                instance_add_client(inst, client);
-       }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int instance_broadcast_created_event(struct inst_info *inst)
@@ -381,7 +386,7 @@ static int instance_broadcast_created_event(struct inst_info *inst)
                        inst->is_pinned_up);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return CLIENT_SEND_EVENT(inst, packet);
@@ -394,13 +399,13 @@ HAPI int instance_unicast_deleted_event(struct inst_info *inst, struct client_no
        if (!client) {
                client = inst->client;
                if (!client)
-                       return -EINVAL;
+                       return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("deleted", "ssd", package_name(inst->info), inst->id, inst->timestamp);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
                
        return client_rpc_async_request(client, packet);
@@ -417,7 +422,7 @@ static int instance_broadcast_deleted_event(struct inst_info *inst)
        packet = packet_create_noack("deleted", "ssd", package_name(inst->info), inst->id, inst->timestamp);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
                
        ret = CLIENT_SEND_EVENT(inst, packet);
@@ -433,7 +438,7 @@ static int client_deactivated_cb(struct client_node *client, void *data)
 {
        struct inst_info *inst = data;
        instance_destroy(inst);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int send_pd_destroyed_to_client(struct inst_info *inst, int status)
@@ -443,7 +448,7 @@ static int send_pd_destroyed_to_client(struct inst_info *inst, int status)
        packet = packet_create_noack("pd_destroyed", "ssi", package_name(inst->info), inst->id, status);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return CLIENT_SEND_EVENT(inst, packet);
@@ -470,14 +475,14 @@ HAPI int instance_event_callback_add(struct inst_info *inst, enum instance_event
        struct event_item *item;
 
        if (!event_cb)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        switch (type) {
        case INSTANCE_EVENT_DESTROY:
                item = malloc(sizeof(*item));
                if (!item) {
                        ErrPrint("Heap: %s\n", strerror(errno));
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
 
                item->event_cb = event_cb;
@@ -486,10 +491,10 @@ HAPI int instance_event_callback_add(struct inst_info *inst, enum instance_event
                inst->delete_event_list = eina_list_append(inst->delete_event_list, item);
                break;
        default:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int instance_event_callback_del(struct inst_info *inst, enum instance_event type, int (*event_cb)(struct inst_info *inst, void *data))
@@ -504,7 +509,7 @@ HAPI int instance_event_callback_del(struct inst_info *inst, enum instance_event
                        if (item->event_cb == event_cb) {
                                inst->delete_event_list = eina_list_remove(inst->delete_event_list, item);
                                free(item);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -512,7 +517,7 @@ HAPI int instance_event_callback_del(struct inst_info *inst, enum instance_event
                break;
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 static inline void destroy_instance(struct inst_info *inst)
@@ -600,14 +605,14 @@ static inline int fork_package(struct inst_info *inst, const char *pkgname)
        info = package_find(pkgname);
        if (!info) {
                ErrPrint("%s is not found\n", pkgname);
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
        }
 
        len = strlen(SCHEMA_FILE "%s%s_%d_%lf.png") + strlen(IMAGE_PATH) + strlen(package_name(info)) + 50;
        inst->id = malloc(len);
        if (!inst->id) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        snprintf(inst->id, len, SCHEMA_FILE "%s%s_%d_%lf.png", IMAGE_PATH, package_name(info), client_pid(inst->client), inst->timestamp);
@@ -629,7 +634,7 @@ static inline int fork_package(struct inst_info *inst, const char *pkgname)
                        timer_freeze(inst); /* Freeze the update timer as default */
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI struct inst_info *instance_create(struct client_node *client, double timestamp, const char *pkgname, const char *content, const char *cluster, const char *category, double period, int width, int height)
@@ -811,12 +816,12 @@ static void deactivate_cb(struct slave_node *slave, const struct packet *packet,
                }
 
                break;
-       case -EINVAL:
+       case LB_STATUS_ERROR_INVALID:
                /*!
                 * \note
                 * Slave has no instance of this package.
                 */
-       case -ENOENT:
+       case LB_STATUS_ERROR_NOT_EXIST:
                /*!
                 * \note
                 * This instance's previous state is only can be the INST_ACTIVATED.
@@ -833,7 +838,7 @@ static void deactivate_cb(struct slave_node *slave, const struct packet *packet,
                /*!
                 * \note
                 * Failed to unload this instance.
-                * This is not possible, slave will always return -ENOENT, -EINVAL, or 0.
+                * This is not possible, slave will always return LB_STATUS_ERROR_NOT_EXIST, LB_STATUS_ERROR_INVALID, or 0.
                 * but care this exceptional case.
                 */
                DbgPrint("[%s] instance destroying ret(%d)\n", package_name(inst->info), ret);
@@ -1072,8 +1077,8 @@ static void activate_cb(struct slave_node *slave, const struct packet *packet, v
                /*!
                 * \note
                 * Anyway this instance is loaded to the slave,
-                * so just increase the loaded instance counter
-                * After that, do reset jobs.
+                * just increase the loaded instance counter
+                * And then reset jobs.
                 */
                instance_set_lb_info(inst, w, h, priority, content, title);
 
@@ -1182,7 +1187,7 @@ HAPI int instance_destroy(struct inst_info *inst)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (inst->state) {
@@ -1190,15 +1195,15 @@ HAPI int instance_destroy(struct inst_info *inst)
        case INST_REQUEST_TO_DESTROY:
        case INST_REQUEST_TO_REACTIVATE:
                inst->requested_state = INST_DESTROYED;
-               return 0;
+               return LB_STATUS_SUCCESS;
        case INST_INIT:
                inst->state = INST_DESTROYED;
                inst->requested_state = INST_DESTROYED;
                instance_unref(inst);
-               return 0;
+               return LB_STATUS_SUCCESS;
        case INST_DESTROYED:
                inst->requested_state = INST_DESTROYED;
-               return 0;
+               return LB_STATUS_SUCCESS;
        default:
                break;
        }
@@ -1206,7 +1211,7 @@ HAPI int instance_destroy(struct inst_info *inst)
        packet = packet_create("delete", "ss", package_name(inst->info), inst->id);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        inst->requested_state = INST_DESTROYED;
@@ -1282,11 +1287,11 @@ HAPI int instance_state_reset(struct inst_info *inst)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (inst->state == INST_DESTROYED)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        lb_type = package_lb_type(inst->info);
        pd_type = package_pd_type(inst->info);
@@ -1308,7 +1313,7 @@ HAPI int instance_state_reset(struct inst_info *inst)
 
        inst->state = INST_INIT;
        inst->requested_state = INST_INIT;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int instance_reactivate(struct inst_info *inst)
@@ -1318,12 +1323,12 @@ HAPI int instance_reactivate(struct inst_info *inst)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        switch (inst->state) {
@@ -1331,10 +1336,10 @@ HAPI int instance_reactivate(struct inst_info *inst)
        case INST_REQUEST_TO_ACTIVATE:
        case INST_REQUEST_TO_REACTIVATE:
                inst->requested_state = INST_ACTIVATED;
-               return 0;
+               return LB_STATUS_SUCCESS;
        case INST_DESTROYED:
        case INST_ACTIVATED:
-               return 0;
+               return LB_STATUS_SUCCESS;
        case INST_INIT:
        default:
                break;
@@ -1353,11 +1358,11 @@ HAPI int instance_reactivate(struct inst_info *inst)
                        package_abi(inst->info));
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = slave_activate(package_slave(inst->info));
-       if (ret < 0 && ret != -EALREADY) {
+       if (ret < 0 && ret != LB_STATUS_ERROR_ALREADY) {
                /*!
                 * \note
                 * If the master failed to launch the slave,
@@ -1382,12 +1387,12 @@ HAPI int instance_activate(struct inst_info *inst)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        switch (inst->state) {
@@ -1395,10 +1400,10 @@ HAPI int instance_activate(struct inst_info *inst)
        case INST_REQUEST_TO_ACTIVATE:
        case INST_REQUEST_TO_DESTROY:
                inst->requested_state = INST_ACTIVATED;
-               return 0;
+               return LB_STATUS_SUCCESS;
        case INST_ACTIVATED:
        case INST_DESTROYED:
-               return 0;
+               return LB_STATUS_SUCCESS;
        case INST_INIT:
        default:
                break;
@@ -1419,11 +1424,11 @@ HAPI int instance_activate(struct inst_info *inst)
                        inst->lb.height);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = slave_activate(package_slave(inst->info));
-       if (ret < 0 && ret != -EALREADY) {
+       if (ret < 0 && ret != LB_STATUS_ERROR_ALREADY) {
                /*!
                 * \note
                 * If the master failed to launch the slave,
@@ -1597,12 +1602,18 @@ HAPI void instance_set_lb_info(struct inst_info *inst, int w, int h, double prio
        if (priority >= 0.0f && priority <= 1.0f)
                inst->lb.priority = priority;
 
+       if (inst->lb.width != w || inst->lb.height != h)
+               instance_send_resized_event(inst, IS_LB, w, h, 0);
+
        inst->lb.width = w;
        inst->lb.height = h;
 }
 
 HAPI void instance_set_pd_info(struct inst_info *inst, int w, int h)
 {
+       if (inst->pd.width != w || inst->pd.height != h)
+               instance_send_resized_event(inst, IS_PD, w, h, 0);
+
        inst->pd.width = w;
        inst->pd.height = h;
 }
@@ -1619,7 +1630,7 @@ static void pinup_cb(struct slave_node *slave, const struct packet *packet, void
                 * \todo
                 * Send pinup failed event to client.
                 */
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1628,7 +1639,7 @@ static void pinup_cb(struct slave_node *slave, const struct packet *packet, void
                 * \todo
                 * Send pinup failed event to client
                 */
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1642,7 +1653,7 @@ static void pinup_cb(struct slave_node *slave, const struct packet *packet, void
                         * \note
                         * send pinup failed event to client
                         */
-                       ret = -ENOMEM;
+                       ret = LB_STATUS_ERROR_MEMORY;
                        goto out;
                }
        
@@ -1676,23 +1687,23 @@ HAPI int instance_set_pinup(struct inst_info *inst, int pinup)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!package_pinup(inst->info))
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        if (pinup == inst->is_pinned_up)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata)
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
 
        cbdata->inst = instance_ref(inst);
        cbdata->pinup = pinup;
@@ -1702,7 +1713,7 @@ HAPI int instance_set_pinup(struct inst_info *inst, int pinup)
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
                instance_unref(cbdata->inst);
                DbgFree(cbdata);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_async_request(package_slave(inst->info), package_name(inst->info), packet, pinup_cb, cbdata, 0);
@@ -1711,31 +1722,31 @@ HAPI int instance_set_pinup(struct inst_info *inst, int pinup)
 HAPI int instance_freeze_updator(struct inst_info *inst)
 {
        if (!inst->update_timer)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        DbgPrint("Freeze the update timer (%s)\n", inst->id);
        timer_freeze(inst);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int instance_thaw_updator(struct inst_info *inst)
 {
        if (!inst->update_timer)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        if (client_is_all_paused() || setting_is_lcd_off()) {
                DbgPrint("Skip thaw (%s)\n", inst->id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (inst->visible == LB_HIDE_WITH_PAUSE) {
                DbgPrint("Live box is invisible (%s)\n", inst->id);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        DbgPrint("Thaw the update timer (%s)\n", inst->id);
        timer_thaw(inst);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI enum livebox_visible_state instance_visible_state(struct inst_info *inst)
@@ -1747,7 +1758,7 @@ HAPI int instance_set_visible_state(struct inst_info *inst, enum livebox_visible
 {
        if (inst->visible == state) {
                DbgPrint("Visibility has no changed\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        switch (state) {
@@ -1771,10 +1782,10 @@ HAPI int instance_set_visible_state(struct inst_info *inst, enum livebox_visible
                break;
 
        default:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static void resize_cb(struct slave_node *slave, const struct packet *packet, void *data)
@@ -1784,7 +1795,7 @@ static void resize_cb(struct slave_node *slave, const struct packet *packet, voi
 
        if (!packet) {
                ErrPrint("Invalid packet\n");
-               instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, -EFAULT);
+               instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, LB_STATUS_ERROR_FAULT);
                instance_unref(cbdata->inst);
                DbgFree(cbdata);
                return;
@@ -1792,13 +1803,13 @@ static void resize_cb(struct slave_node *slave, const struct packet *packet, voi
 
        if (packet_get(packet, "i", &ret) != 1) {
                ErrPrint("Invalid parameter\n");
-               instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, -EINVAL);
+               instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, LB_STATUS_ERROR_INVALID);
                instance_unref(cbdata->inst);
                DbgFree(cbdata);
                return;
        }
 
-       if (ret == 0) {
+       if (ret == LB_STATUS_SUCCESS) {
                /*!
                 * \note
                 * else waiting the first update with new size
@@ -1820,18 +1831,18 @@ HAPI int instance_resize(struct inst_info *inst, int w, int h)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                ErrPrint("Fault package: %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        cbdata->inst = instance_ref(inst);
@@ -1844,7 +1855,7 @@ HAPI int instance_resize(struct inst_info *inst, int w, int h)
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
                instance_unref(cbdata->inst);
                DbgFree(cbdata);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = slave_rpc_async_request(package_slave(inst->info), package_name(inst->info), packet, resize_cb, cbdata, 0);
@@ -1858,12 +1869,12 @@ static void set_period_cb(struct slave_node *slave, const struct packet *packet,
        struct packet *result;
 
        if (!packet) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
        if (packet_get(packet, "i", &ret) != 1) {
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1930,12 +1941,12 @@ HAPI int instance_set_period(struct inst_info *inst, double period)
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (period < 0.0f) { /* Use the default period */
@@ -1947,7 +1958,7 @@ HAPI int instance_set_period(struct inst_info *inst, double period)
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        cbdata->period = period;
@@ -1963,7 +1974,7 @@ HAPI int instance_set_period(struct inst_info *inst, double period)
                 */
                if (!ecore_timer_add(DELAY_TIME, timer_updator_cb, cbdata))
                        timer_updator_cb(cbdata);
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        packet = packet_create("set_period", "ssd", package_name(inst->info), inst->id, period);
@@ -1971,7 +1982,7 @@ HAPI int instance_set_period(struct inst_info *inst, double period)
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
                instance_unref(cbdata->inst);
                DbgFree(cbdata);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_async_request(package_slave(inst->info), package_name(inst->info), packet, set_period_cb, cbdata, 0);
@@ -1983,19 +1994,19 @@ HAPI int instance_clicked(struct inst_info *inst, const char *event, double time
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        /* NOTE: param is resued from here */
        packet = packet_create_noack("clicked", "sssddd", package_name(inst->info), inst->id, event, timestamp, x, y);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_request_only(package_slave(inst->info), package_name(inst->info), packet, 0);
@@ -2013,13 +2024,13 @@ HAPI int instance_signal_emit(struct inst_info *inst, const char *signal, const
        id = instance_id(inst);
        if (!pkgname || !id) {
                ErrPrint("Invalid instance\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        slave = package_slave(instance_package(inst));
        if (!slave) {
                ErrPrint("Slave is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack("script", "ssssddddddi",
@@ -2029,7 +2040,7 @@ HAPI int instance_signal_emit(struct inst_info *inst, const char *signal, const
                        x, y, down);
        if (!packet) {
                ErrPrint("Failed to create param\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        DbgPrint("Signal emit: %s(%s), %s(%s), %lf, %lf, %lf, %lf, %lfx%lf, %d\n", pkgname, id, signal, part, sx, sy, ex, ey, x, y, down);
@@ -2043,18 +2054,18 @@ HAPI int instance_text_signal_emit(struct inst_info *inst, const char *emission,
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        packet = packet_create_noack("text_signal", "ssssdddd", package_name(inst->info), inst->id, emission, source, sx, sy, ex, ey);
        if (!packet) {
                ErrPrint("Failed to build a packet for %s\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_request_only(package_slave(inst->info), package_name(inst->info), packet, 0);
@@ -2069,7 +2080,7 @@ static void change_group_cb(struct slave_node *slave, const struct packet *packe
        if (!packet) {
                DbgFree(cbdata->cluster);
                DbgFree(cbdata->category);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2077,7 +2088,7 @@ static void change_group_cb(struct slave_node *slave, const struct packet *packe
                ErrPrint("Invalid packet\n");
                DbgFree(cbdata->cluster);
                DbgFree(cbdata->category);
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2112,25 +2123,25 @@ HAPI int instance_change_group(struct inst_info *inst, const char *cluster, cons
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (package_is_fault(inst->info)) {
                DbgPrint("Fault package [%s]\n", package_name(inst->info));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        cbdata->cluster = strdup(cluster);
        if (!cbdata->cluster) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(cbdata);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        cbdata->category = strdup(category);
@@ -2138,7 +2149,7 @@ HAPI int instance_change_group(struct inst_info *inst, const char *cluster, cons
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(cbdata->cluster);
                DbgFree(cbdata);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        cbdata->inst = instance_ref(inst);
@@ -2150,7 +2161,7 @@ HAPI int instance_change_group(struct inst_info *inst, const char *cluster, cons
                DbgFree(cbdata->category);
                DbgFree(cbdata->cluster);
                DbgFree(cbdata);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        return slave_rpc_async_request(package_slave(inst->info), package_name(inst->info), packet, change_group_cb, cbdata, 0);
@@ -2287,10 +2298,10 @@ HAPI int instance_destroyed(struct inst_info *inst)
        case INST_DESTROYED:
                break;
        default:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /*!
@@ -2302,7 +2313,7 @@ HAPI int instance_recover_state(struct inst_info *inst)
 
        if (inst->changing_state) {
                DbgPrint("Doesn't need to recover the state\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        switch (inst->state) {
@@ -2389,7 +2400,7 @@ HAPI int instance_need_slave(struct inst_info *inst)
                        break;
                }
 
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        switch (inst->state) {
@@ -2463,33 +2474,33 @@ HAPI int instance_slave_open_pd(struct inst_info *inst, struct client_node *clie
                client = inst->pd.owner;
                if (!client) {
                        ErrPrint("Client is not valid\n");
-                       return -EINVAL;
+                       return LB_STATUS_ERROR_INVALID;
                }
        } else if (inst->pd.owner) {
                if (inst->pd.owner != client) {
                        ErrPrint("Client is already owned\n");
-                       return -EBUSY;
+                       return LB_STATUS_ERROR_ALREADY;
                }
        }
 
        slave = package_slave(instance_package(inst));
        if (!slave)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        info = instance_package(inst);
        if (!info)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        pkgname = package_name(info);
        id = instance_id(inst);
 
        if (!pkgname || !id)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        packet = packet_create_noack("pd_show", "ssiidd", pkgname, id, instance_pd_width(inst), instance_pd_height(inst), inst->pd.x, inst->pd.y);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        slave_freeze_ttl(slave);
@@ -2528,27 +2539,27 @@ HAPI int instance_slave_close_pd(struct inst_info *inst, struct client_node *cli
 
        if (inst->pd.owner != client) {
                ErrPrint("PD owner is not matched\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        slave = package_slave(instance_package(inst));
        if (!slave)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        info = instance_package(inst);
        if (!info)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        pkgname = package_name(info);
        id = instance_id(inst);
 
        if (!pkgname || !id)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        packet = packet_create_noack("pd_hide", "ss", pkgname, id);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        slave_thaw_ttl(slave);
@@ -2567,7 +2578,7 @@ HAPI int instance_client_pd_created(struct inst_info *inst, int status)
 
        if (inst->pd.need_to_send_close_event) {
                DbgPrint("PD is already created\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (package_pd_type(inst->info)) {
@@ -2590,7 +2601,7 @@ HAPI int instance_client_pd_created(struct inst_info *inst, int status)
                        inst->pd.width, inst->pd.height, status);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = CLIENT_SEND_EVENT(inst, packet);
@@ -2610,7 +2621,7 @@ HAPI int instance_client_pd_destroyed(struct inst_info *inst, int status)
 {
        if (!inst->pd.need_to_send_close_event) {
                DbgPrint("PD is not created\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        inst->pd.need_to_send_close_event = 0;
@@ -2622,30 +2633,30 @@ HAPI int instance_add_client(struct inst_info *inst, struct client_node *client)
 {
        if (inst->client == client) {
                ErrPrint("Owner cannot be the viewer\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        DbgPrint("%d is added to the list of viewer of %s(%s)\n", client_pid(client), package_name(instance_package(inst)), instance_id(inst));
        if (client_event_callback_add(client, CLIENT_EVENT_DEACTIVATE, viewer_deactivated_cb, inst) < 0) {
                ErrPrint("Failed to add a deactivate callback\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        instance_ref(inst);
        inst->client_list = eina_list_append(inst->client_list, client);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int instance_del_client(struct inst_info *inst, struct client_node *client)
 {
        if (inst->client == client) {
                ErrPrint("Owner is not in the viewer list\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        client_event_callback_del(client, CLIENT_EVENT_DEACTIVATE, viewer_deactivated_cb, inst);
        viewer_deactivated_cb(client, inst);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int instance_has_client(struct inst_info *inst, struct client_node *client)
index 061cc2d..6356d81 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -27,6 +27,7 @@
 #include <Eina.h>
 #include <sqlite3.h>
 #include <db-util.h>
+#include <livebox-errno.h>
 
 #include "debug.h"
 #include "conf.h"
@@ -74,7 +75,7 @@ static inline int load_abi_table(void)
 
        fp = fopen("/usr/share/"PACKAGE"/abi.ini", "rt");
        if (!fp)
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
 
        state = INIT;
        while ((ch = getc(fp)) != EOF && state != ERROR) {
@@ -208,7 +209,7 @@ static inline int load_abi_table(void)
        }
 
        fclose(fp);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int build_client_info(struct pkg_info *info)
@@ -223,14 +224,14 @@ static inline int build_client_info(struct pkg_info *info)
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = sqlite3_bind_text(stmt, 1, package_name(info), -1, SQLITE_TRANSIENT);
        if (ret != SQLITE_OK) {
                ErrPrint("Failed to bind a pkgname %s\n", package_name(info));
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (sqlite3_step(stmt) != SQLITE_ROW) {
@@ -238,7 +239,7 @@ static inline int build_client_info(struct pkg_info *info)
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        package_set_auto_launch(info, (const char *)sqlite3_column_text(stmt, 0));
@@ -256,7 +257,7 @@ static inline int build_client_info(struct pkg_info *info)
        sqlite3_reset(stmt);
        sqlite3_clear_bindings(stmt);
        sqlite3_finalize(stmt);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int build_provider_info(struct pkg_info *info)
@@ -270,19 +271,19 @@ static inline int build_provider_info(struct pkg_info *info)
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (sqlite3_bind_text(stmt, 1, package_name(info), -1, SQLITE_TRANSIENT) != SQLITE_OK) {
                ErrPrint("Failed to bind a pkgname(%s) - %s\n", package_name(info), sqlite3_errmsg(s_info.handle));
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (sqlite3_bind_text(stmt, 2, package_name(info), -1, SQLITE_TRANSIENT) != SQLITE_OK) {
                ErrPrint("Failed to bind a pkgname(%s) - %s\n", package_name(info), sqlite3_errmsg(s_info.handle));
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (sqlite3_step(stmt) != SQLITE_ROW) {
@@ -290,7 +291,7 @@ static inline int build_provider_info(struct pkg_info *info)
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        appid = (const char *)sqlite3_column_text(stmt, 14);
@@ -299,7 +300,7 @@ static inline int build_provider_info(struct pkg_info *info)
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        package_set_network(info, sqlite3_column_int(stmt, 0));
@@ -349,7 +350,7 @@ static inline int build_provider_info(struct pkg_info *info)
        sqlite3_reset(stmt);
        sqlite3_clear_bindings(stmt);
        sqlite3_finalize(stmt);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int build_box_size_info(struct pkg_info *info)
@@ -363,13 +364,13 @@ static inline int build_box_size_info(struct pkg_info *info)
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (sqlite3_bind_text(stmt, 1, package_name(info), -1, SQLITE_TRANSIENT) != SQLITE_OK) {
                ErrPrint("Failed to bind a pkgname(%s) - %s\n", package_name(info), sqlite3_errmsg(s_info.handle));
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        size_list = 0;
@@ -383,7 +384,7 @@ static inline int build_box_size_info(struct pkg_info *info)
        sqlite3_reset(stmt);
        sqlite3_clear_bindings(stmt);
        sqlite3_finalize(stmt);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int load_context_option(struct context_item *item, int id)
@@ -397,17 +398,17 @@ static inline int load_context_option(struct context_item *item, int id)
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = sqlite3_bind_int(stmt, 1, id);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               ret = -EIO;
+               ret = LB_STATUS_ERROR_IO;
                goto out;
        }
 
-       ret = -ENOENT;
+       ret = LB_STATUS_ERROR_NOT_EXIST;
        while (sqlite3_step(stmt) == SQLITE_ROW) {
                key = (const char *)sqlite3_column_text(stmt, 0);
                if (!key || !strlen(key)) {
@@ -445,17 +446,17 @@ static inline int load_context_item(struct context_info *info, int id)
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = sqlite3_bind_int(stmt, 1, id);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               ret = -EIO;
+               ret = LB_STATUS_ERROR_IO;
                goto out;
        }
 
-       ret = -ENOENT;
+       ret = LB_STATUS_ERROR_NOT_EXIST;
        while (sqlite3_step(stmt) == SQLITE_ROW) {
                ctx_item = (const char *)sqlite3_column_text(stmt, 0);
                option_id = sqlite3_column_int(stmt, 1);
@@ -463,7 +464,7 @@ static inline int load_context_item(struct context_info *info, int id)
                item = group_add_context_item(info, ctx_item);
                if (!item) {
                        ErrPrint("Failed to add a new context item\n");
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        break;
                }
 
@@ -494,14 +495,14 @@ static inline int build_group_info(struct pkg_info *info)
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = sqlite3_bind_text(stmt, 1, package_name(info), -1, SQLITE_TRANSIENT);
        if (ret != SQLITE_OK) {
                ErrPrint("Failed to bind a package name(%s)\n", package_name(info));
                sqlite3_finalize(stmt);
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        while (sqlite3_step(stmt) == SQLITE_ROW) {
@@ -547,7 +548,7 @@ static inline int build_group_info(struct pkg_info *info)
                if (ctx_info) {
                        ret = load_context_item(ctx_info, id);
                        if (ret < 0) {
-                               if (ret == -ENOENT) {
+                               if (ret == LB_STATUS_ERROR_NOT_EXIST) {
                                        DbgPrint("Has no specific context info\n");
                                } else {
                                        DbgPrint("Context info is not valid\n");
@@ -564,7 +565,7 @@ static inline int build_group_info(struct pkg_info *info)
        sqlite3_reset(stmt);
        sqlite3_clear_bindings(stmt);
        sqlite3_finalize(stmt);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int io_is_exists(const char *pkgname) /* Manifest Package Name */
@@ -574,25 +575,25 @@ HAPI int io_is_exists(const char *pkgname) /* Manifest Package Name */
 
        if (!s_info.handle) {
                ErrPrint("DB is not ready\n");
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = sqlite3_prepare_v2(s_info.handle, "SELECT COUNT(pkgid) FROM pkgmap WHERE appid = ?", -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = sqlite3_bind_text(stmt, 1, pkgname, -1, SQLITE_TRANSIENT);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               ret = -EIO;
+               ret = LB_STATUS_ERROR_IO;
                goto out;
        }
 
        if (sqlite3_step(stmt) != SQLITE_ROW) {
                ErrPrint("%s has no record (%s)\n", pkgname, sqlite3_errmsg(s_info.handle));
-               ret = -EIO;
+               ret = LB_STATUS_ERROR_IO;
                goto out;
        }
 
@@ -679,7 +680,7 @@ HAPI int io_crawling_liveboxes(int (*cb)(const char *pkgname, int prime, void *d
                                if (cb(pkgid, prime, data) < 0) {
                                        sqlite3_reset(stmt);
                                        sqlite3_finalize(stmt);
-                                       return -ECANCELED;
+                                       return LB_STATUS_ERROR_CANCEL;
                                }
                        }
 
@@ -700,14 +701,14 @@ HAPI int io_crawling_liveboxes(int (*cb)(const char *pkgname, int prime, void *d
 
                        if (cb(ent->d_name, -1, data) < 0) {
                                closedir(dir);
-                               return -ECANCELED;
+                               return LB_STATUS_ERROR_CANCEL;
                        }
                }
 
                closedir(dir);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int io_update_livebox_package(const char *pkgname, int (*cb)(const char *lb_pkgname, int prime, void *data), void *data)
@@ -718,23 +719,23 @@ HAPI int io_update_livebox_package(const char *pkgname, int (*cb)(const char *lb
        int ret;
 
        if (!cb || !pkgname)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        if (!s_info.handle) {
                ErrPrint("DB is not ready\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        ret = sqlite3_prepare_v2(s_info.handle, "SELECT pkgid, prime FROM pkgmap WHERE appid = ?", -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ret = sqlite3_bind_text(stmt, 1, pkgname, -1, SQLITE_TRANSIENT);
        if (ret != SQLITE_OK) {
                ErrPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -765,7 +766,7 @@ HAPI int io_load_package_db(struct pkg_info *info)
 
        if (!s_info.handle) {
                ErrPrint("DB is not ready\n");
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        ret = build_provider_info(info);
@@ -784,7 +785,7 @@ HAPI int io_load_package_db(struct pkg_info *info)
        if (ret < 0)
                return ret;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int db_init(void)
@@ -795,38 +796,38 @@ static inline int db_init(void)
        ret = db_util_open(DBFILE, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
        if (ret != SQLITE_OK) {
                ErrPrint("Failed to open a DB\n");
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (lstat(DBFILE, &stat) < 0) {
                db_util_close(s_info.handle);
                s_info.handle = NULL;
                ErrPrint("%s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (!S_ISREG(stat.st_mode)) {
                ErrPrint("Invalid file\n");
                db_util_close(s_info.handle);
                s_info.handle = NULL;
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (stat.st_size <= 0)
                DbgPrint("Size is %d (But use this ;)\n", stat.st_size);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int db_fini(void)
 {
        if (!s_info.handle)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        db_util_close(s_info.handle);
        s_info.handle = NULL;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int io_init(void)
@@ -839,19 +840,18 @@ HAPI int io_init(void)
        ret = load_abi_table();
        DbgPrint("ABI table is loaded: %d\n", ret);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int io_fini(void)
 {
        int ret;
 
-       ret = abi_del_all();
-       DbgPrint("ABI table is finalized: %d\n", ret);
+       abi_del_all();
 
        ret = db_fini();
        DbgPrint("DB finalized: %d\n", ret);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index 2ff7e33..2787e8a 100644 (file)
@@ -27,6 +27,7 @@
 #include <Eina.h>
 
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -52,7 +53,7 @@ HAPI int liveinfo_init(void)
        return 0;
 }
 
-HAPI int liveinfo_fini(void)
+HAPI void liveinfo_fini(void)
 {
        struct liveinfo *info;
 
@@ -61,8 +62,6 @@ HAPI int liveinfo_fini(void)
                unlink(info->fifo_name);
                DbgFree(info);
        }
-
-       return 0;
 }
 
 static inline int valid_requestor(pid_t pid)
@@ -126,29 +125,26 @@ HAPI int liveinfo_open_fifo(struct liveinfo *info)
        info->fp = fopen(info->fifo_name, "w");
        if (!info->fp) {
                ErrPrint("open: %s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
-HAPI int liveinfo_close_fifo(struct liveinfo *info)
+HAPI void liveinfo_close_fifo(struct liveinfo *info)
 {
        if (info->fp) {
                fclose(info->fp);
                info->fp = NULL;
        }
-
-       return 0;
 }
 
-HAPI int liveinfo_destroy(struct liveinfo *info)
+HAPI void liveinfo_destroy(struct liveinfo *info)
 {
        s_info.info_list = eina_list_remove(s_info.info_list, info);
        liveinfo_close_fifo(info);
        unlink(info->fifo_name);
        DbgFree(info);
-       return 0;
 }
 
 HAPI pid_t liveinfo_pid(struct liveinfo *info)
index afdce30..954a941 100644 (file)
@@ -131,8 +131,7 @@ static inline int app_terminate(void)
        ret = package_fini();
        DbgPrint("Finalize package info: %d\n", ret);
 
-       ret = client_fini();
-       DbgPrint("Finalize client connections : %d\n", ret);
+       client_fini();
 
        ret = server_fini();
        DbgPrint("Finalize dbus: %d\n", ret);
index 5b76c64..a007876 100644 (file)
@@ -24,6 +24,7 @@
 #include <Ecore_Evas.h>
 
 #include <packet.h>
+#include <livebox-errno.h>
 
 #include "debug.h"
 #include "util.h"
@@ -307,7 +308,7 @@ static inline int load_conf(struct pkg_info *info)
                info->script = strdup(DEFAULT_SCRIPT);
                if (!info->script) {
                        ErrPrint("Heap: %s\n", strerror(errno));
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
 
                info->abi = strdup(DEFAULT_ABI);
@@ -315,13 +316,13 @@ static inline int load_conf(struct pkg_info *info)
                        ErrPrint("Heap: %s\n", strerror(errno));
                        DbgFree(info->script);
                        info->script = NULL;
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
 
                info->pd.width = g_conf.width;
                info->pd.height = g_conf.height >> 2;
                info->lb.pinup = 1;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        info->lb.type = LB_TYPE_FILE;
@@ -338,7 +339,7 @@ static inline int load_conf(struct pkg_info *info)
                        if (!info->lb.info.script.path) {
                                ErrPrint("Heap: %s\n", strerror(errno));
                                parser_unload(parser);
-                               return -ENOMEM;
+                               return LB_STATUS_ERROR_MEMORY;
                        }
 
                        str = parser_lb_group(parser);
@@ -348,7 +349,7 @@ static inline int load_conf(struct pkg_info *info)
                                        ErrPrint("Heap: %s\n", strerror(errno));
                                        DbgFree(info->lb.info.script.path);
                                        parser_unload(parser);
-                                       return -ENOMEM;
+                                       return LB_STATUS_ERROR_MEMORY;
                                }
                        }
                }
@@ -370,7 +371,7 @@ static inline int load_conf(struct pkg_info *info)
                                        DbgFree(info->lb.info.script.group);
                                }
                                parser_unload(parser);
-                               return -ENOMEM;
+                               return LB_STATUS_ERROR_MEMORY;
                        }
 
                        str = parser_pd_group(parser);
@@ -384,7 +385,7 @@ static inline int load_conf(struct pkg_info *info)
                                                DbgFree(info->lb.info.script.group);
                                        }
                                        parser_unload(parser);
-                                       return -ENOMEM;
+                                       return LB_STATUS_ERROR_MEMORY;
                                }
                        }
                }
@@ -406,7 +407,7 @@ static inline int load_conf(struct pkg_info *info)
                }
 
                parser_unload(parser);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        str = parser_abi(parser);
@@ -425,7 +426,7 @@ static inline int load_conf(struct pkg_info *info)
                        DbgFree(info->lb.info.script.group);
                }
                parser_unload(parser);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        info->lb.timeout = parser_timeout(parser);
@@ -456,7 +457,7 @@ static inline int load_conf(struct pkg_info *info)
                        DbgFree(info->lb.info.script.group);
                }
                parser_unload(parser);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        info->secured = parser_secured(parser);
@@ -469,7 +470,7 @@ static inline int load_conf(struct pkg_info *info)
                ErrPrint("Failed to build cluster tree for %s{%s}\n", info->pkgname, group);
 
        parser_unload(parser);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI struct pkg_info *package_create(const char *pkgname)
@@ -519,7 +520,7 @@ HAPI struct pkg_info *package_create(const char *pkgname)
 HAPI int package_destroy(struct pkg_info *info)
 {
        package_unref(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI Eina_List *package_ctx_info(struct pkg_info *pkginfo)
@@ -622,25 +623,25 @@ HAPI struct inst_info *package_find_instance_by_timestamp(const char *pkgname, d
 HAPI int package_dump_fault_info(struct pkg_info *info)
 {
        if (!info->fault_info)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        ErrPrint("=============\n");
        ErrPrint("faulted at %lf\n", info->fault_info->timestamp);
        ErrPrint("Package: %s\n", info->pkgname);
        ErrPrint("Function: %s\n", info->fault_info->function);
        ErrPrint("InstanceID: %s\n", info->fault_info->filename);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int package_get_fault_info(struct pkg_info *info, double *timestamp, const char **filename, const char **function)
 {
        if (!info->fault_info)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        *timestamp = info->fault_info->timestamp;
        *filename = info->fault_info->filename;
        *function = info->fault_info->function;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int package_set_fault_info(struct pkg_info *info, double timestamp, const char *filename, const char *function)
@@ -652,7 +653,7 @@ HAPI int package_set_fault_info(struct pkg_info *info, double timestamp, const c
        fault = calloc(1, sizeof(*fault));
        if (!fault) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        fault->timestamp = timestamp;
@@ -665,7 +666,7 @@ HAPI int package_set_fault_info(struct pkg_info *info, double timestamp, const c
        if (!fault->filename) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(fault);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        fault->function = strdup(function);
@@ -673,18 +674,18 @@ HAPI int package_set_fault_info(struct pkg_info *info, double timestamp, const c
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(fault->filename);
                DbgFree(fault);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        info->fault_info = fault;
        info->fault_count++;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int package_clear_fault(struct pkg_info *info)
 {
        if (!info->fault_info)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        
        package_dump_fault_info(info);
 
@@ -692,7 +693,7 @@ HAPI int package_clear_fault(struct pkg_info *info)
        DbgFree(info->fault_info->filename);
        DbgFree(info->fault_info);
        info->fault_info = NULL;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const int const package_is_fault(const struct pkg_info *info)
@@ -747,12 +748,12 @@ HAPI int package_set_script(struct pkg_info *info, const char *script)
        tmp = strdup(script);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->script);
        info->script = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const char * const package_abi(const struct pkg_info *info)
@@ -766,12 +767,12 @@ HAPI int package_set_abi(struct pkg_info *info, const char *abi)
        tmp = strdup(abi);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->abi);
        info->abi = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const char * const package_lb_path(const struct pkg_info *info)
@@ -787,17 +788,17 @@ HAPI int package_set_lb_path(struct pkg_info *info, const char *path)
        char *tmp;
 
        if (info->lb.type != LB_TYPE_SCRIPT)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        tmp = strdup(path);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->lb.info.script.path);
        info->lb.info.script.path = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const char * const package_lb_group(const struct pkg_info *info)
@@ -813,17 +814,17 @@ HAPI int package_set_lb_group(struct pkg_info *info, const char *group)
        char *tmp;
 
        if (info->lb.type != LB_TYPE_SCRIPT)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        tmp = strdup(group);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->lb.info.script.group);
        info->lb.info.script.group = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const char * const package_pd_path(const struct pkg_info *info)
@@ -839,17 +840,17 @@ HAPI int package_set_pd_path(struct pkg_info *info, const char *path)
        char *tmp;
 
        if (info->pd.type != PD_TYPE_SCRIPT)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        tmp = strdup(path);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->pd.info.script.path);
        info->pd.info.script.path = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const char * const package_pd_group(const struct pkg_info *info)
@@ -865,17 +866,17 @@ HAPI int package_set_pd_group(struct pkg_info *info, const char *group)
        char *tmp;
 
        if (info->pd.type != PD_TYPE_SCRIPT)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        tmp = strdup(group);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->pd.info.script.group);
        info->pd.info.script.group = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI const int const package_pinup(const struct pkg_info *info)
@@ -984,12 +985,12 @@ HAPI int package_set_libexec(struct pkg_info *info, const char *libexec)
        tmp = strdup(libexec);
        if (!tmp) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(info->lb.libexec);
        info->lb.libexec = tmp;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int package_network(struct pkg_info *info)
@@ -1026,14 +1027,14 @@ static inline int assign_new_slave(struct pkg_info *info)
        s_name = util_slavename();
        if (!s_name) {
                ErrPrint("Failed to get a new slave name\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        tmp = abi_find_slave(info->abi);
        if (!tmp) {
                DbgFree(s_name);
                ErrPrint("Failed to find a proper pkgname of a slave\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        DbgPrint("Slave package: \"%s\" (abi: %s)\n", tmp, info->abi);
@@ -1044,7 +1045,7 @@ static inline int assign_new_slave(struct pkg_info *info)
                if (!s_pkgname) {
                        ErrPrint("Heap: %s\n", strerror(errno));
                        DbgFree(s_name);
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
        }
 
@@ -1062,13 +1063,13 @@ static inline int assign_new_slave(struct pkg_info *info)
                 * If the list method couldn't find an "info" from the list,
                 * it just do nothing so I'll leave this.
                 */
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
        /*!
         * \note
         * Slave is not activated yet.
         */
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int package_add_instance(struct pkg_info *info, struct inst_info *inst)
@@ -1110,7 +1111,7 @@ HAPI int package_add_instance(struct pkg_info *info, struct inst_info *inst)
        }
 
        info->inst_list = eina_list_append(info->inst_list, inst);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int package_del_instance(struct pkg_info *info, struct inst_info *inst)
@@ -1118,7 +1119,7 @@ HAPI int package_del_instance(struct pkg_info *info, struct inst_info *inst)
        info->inst_list = eina_list_remove(info->inst_list, inst);
 
        if (info->inst_list)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        if (info->slave) {
                slave_unload_package(info->slave);
@@ -1142,7 +1143,7 @@ HAPI int package_del_instance(struct pkg_info *info, struct inst_info *inst)
        if (info->is_uninstalled)
                package_destroy(info);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI Eina_List *package_instance_list(struct pkg_info *info)
index 871a6ff..f0c5963 100644 (file)
@@ -23,6 +23,7 @@
 #include <dlog.h>
 
 #include <livebox-service.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -168,12 +169,12 @@ HAPI int parser_find(const char *pkgname)
 
        filename = malloc(len);
        if (!filename)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        ret = snprintf(filename, len, CONF_PATH, pkgname, pkgname);
        if (ret < 0) {
                DbgFree(filename);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        DbgPrint("Conf file is %s for package %s\n", filename, pkgname);
@@ -186,7 +187,7 @@ HAPI int parser_find(const char *pkgname)
        }
 
        DbgFree(filename);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int parse_size(const char *buffer, unsigned int *size)
@@ -839,7 +840,7 @@ HAPI int parser_unload(struct parser *item)
        DbgFree(item->lb_path);
        DbgFree(item->filename);
        DbgFree(item);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index 72693d7..7c27a42 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <dlog.h>
 #include <package-manager.h>
+#include <livebox-errno.h>
 
 #include <Ecore.h>
 #include "util.h"
@@ -196,14 +197,14 @@ static int start_cb(const char *pkgname, const char *val, void *data)
        item = calloc(1, sizeof(*item));
        if (!item) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->pkgname = strdup(pkgname);
        if (!item->pkgname) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(item);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->status = PKGMGR_STATUS_START;
@@ -223,11 +224,11 @@ static int start_cb(const char *pkgname, const char *val, void *data)
                DbgFree(item->pkgname);
                DbgFree(item);
                ErrPrint("Invalid val: %s\n", val);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        invoke_callback(pkgname, item, 0.0f);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int icon_path_cb(const char *pkgname, const char *val, void *data)
@@ -238,7 +239,7 @@ static int icon_path_cb(const char *pkgname, const char *val, void *data)
 
        item = find_item(pkgname);
        if (!item)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        if (item->icon)
                DbgFree(item->icon);
@@ -246,10 +247,10 @@ static int icon_path_cb(const char *pkgname, const char *val, void *data)
        item->icon = strdup(val);
        if (!item->icon) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int command_cb(const char *pkgname, const char *val, void *data)
@@ -260,16 +261,16 @@ static int command_cb(const char *pkgname, const char *val, void *data)
 
        item = find_item(pkgname);
        if (!item)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        if (!is_valid_status(item, val)) {
                DbgPrint("Invalid status: %d, %s\n", item->type, val);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        item->status = PKGMGR_STATUS_COMMAND;
        invoke_callback(pkgname, item, 0.0f);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int error_cb(const char *pkgname, const char *val, void *data)
@@ -281,11 +282,11 @@ static int error_cb(const char *pkgname, const char *val, void *data)
 
        item = find_item(pkgname);
        if (!item)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        item->status = PKGMGR_STATUS_ERROR;
        invoke_callback(pkgname, item, 0.0f);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int change_pkgname_cb(const char *pkgname, const char *val, void *data)
@@ -297,17 +298,17 @@ static int change_pkgname_cb(const char *pkgname, const char *val, void *data)
 
        item = find_item(pkgname);
        if (!item)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        new_pkgname = strdup(val);
        if (!new_pkgname) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        DbgFree(item->pkgname);
        item->pkgname = new_pkgname;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int download_cb(const char *pkgname, const char *val, void *data)
@@ -321,7 +322,7 @@ static int download_cb(const char *pkgname, const char *val, void *data)
        item = find_item(pkgname);
        if (!item) {
                DbgPrint("ITEM is not started from the start_cb\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (item->type != PKGMGR_EVENT_DOWNLOAD) {
@@ -337,18 +338,18 @@ static int download_cb(const char *pkgname, const char *val, void *data)
                break;
        default:
                ErrPrint("Invalid state [%s, %s]\n", pkgname, val);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (val) {
                if (sscanf(val, "%lf", &value) != 1)
-                       value = (double)-EINVAL;
+                       value = (double)LB_STATUS_ERROR_INVALID;
        } else {
-               value = (double)-EINVAL;
+               value = (double)LB_STATUS_ERROR_INVALID;
        }
 
        invoke_download_event_handler(pkgname, item->status, value);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int progress_cb(const char *pkgname, const char *val, void *data)
@@ -362,7 +363,7 @@ static int progress_cb(const char *pkgname, const char *val, void *data)
        item = find_item(pkgname);
        if (!item) {
                ErrPrint("ITEM is not started from the start_cb\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        switch (item->status) {
@@ -373,18 +374,18 @@ static int progress_cb(const char *pkgname, const char *val, void *data)
                break;
        default:
                ErrPrint("Invalid state [%s, %s]\n", pkgname, val);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (val) {
                if (sscanf(val, "%lf", &value) != 1)
-                       value = (double)-EINVAL;
+                       value = (double)LB_STATUS_ERROR_INVALID;
        } else {
-               value = (double)-EINVAL;
+               value = (double)LB_STATUS_ERROR_INVALID;
        }
 
        invoke_callback(pkgname, item, value);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int end_cb(const char *pkgname, const char *val, void *data)
@@ -395,7 +396,7 @@ static int end_cb(const char *pkgname, const char *val, void *data)
 
        item = find_item(pkgname);
        if (!item)
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
 
        item->status = !strcasecmp(val, "ok") ? PKGMGR_STATUS_END : PKGMGR_STATUS_ERROR;
 
@@ -405,7 +406,7 @@ static int end_cb(const char *pkgname, const char *val, void *data)
        DbgFree(item->icon);
        DbgFree(item->pkgname);
        DbgFree(item);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static struct pkgmgr_handler {
@@ -437,22 +438,22 @@ static int pkgmgr_cb(int req_id, const char *type, const char *pkgname, const ch
                                                req_id, pkgname, type, key, val, ret);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int pkgmgr_init(void)
 {
        if (s_info.listen_pc)
-               return -EALREADY;
+               return LB_STATUS_ERROR_ALREADY;
 
        s_info.listen_pc = pkgmgr_client_new(PC_LISTENING);
        if (!s_info.listen_pc)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        if (pkgmgr_client_listen_status(s_info.listen_pc, pkgmgr_cb, NULL) != PKGMGR_R_OK)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int pkgmgr_fini(void)
@@ -461,10 +462,10 @@ HAPI int pkgmgr_fini(void)
        struct item *ctx;
 
        if (!s_info.listen_pc)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        if (pkgmgr_client_free(s_info.listen_pc) != PKGMGR_R_OK)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        s_info.listen_pc = NULL;
 
@@ -494,7 +495,7 @@ HAPI int pkgmgr_fini(void)
                DbgFree(ctx);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int pkgmgr_add_event_callback(enum pkgmgr_event_type type, int (*cb)(const char *pkgname, enum pkgmgr_status status, double value, void *data), void *data)
@@ -504,7 +505,7 @@ HAPI int pkgmgr_add_event_callback(enum pkgmgr_event_type type, int (*cb)(const
        item = calloc(1, sizeof(*item));
        if (!item) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->cb = cb;
@@ -528,10 +529,10 @@ HAPI int pkgmgr_add_event_callback(enum pkgmgr_event_type type, int (*cb)(const
                break;
        default:
                DbgFree(item);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void *pkgmgr_del_event_callback(enum pkgmgr_event_type type, int (*cb)(const char *pkgname, enum pkgmgr_status status, double value, void *data), void *data)
index ff8f82d..b4ff6d4 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <dlog.h>
 #include <packet.h>
+#include <livebox-errno.h>
 
 #include "slave_life.h"
 #include "slave_rpc.h"
@@ -206,13 +207,13 @@ int script_signal_emit(Evas *e, const char *part, const char *signal, double sx,
        ee = ecore_evas_ecore_evas_get(e);
        if (!ee) {
                ErrPrint("Evas has no Ecore_Evas\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = ecore_evas_data_get(ee, "script,info");
        if (!info) {
                ErrPrint("ecore_evas doesn't carry info data\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!signal || strlen(signal) == 0)
@@ -232,12 +233,12 @@ HAPI int script_handler_load(struct script_info *info, int is_pd)
 
        if (!info || !info->port) {
                ErrPrint("Script handler is not created\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->loaded > 0) {
                info->loaded++;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        ret = fb_create_buffer(info->fb);
@@ -248,7 +249,7 @@ HAPI int script_handler_load(struct script_info *info, int is_pd)
        if (!info->ee) {
                ErrPrint("Failed to get canvas\n");
                fb_destroy_buffer(info->fb);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ecore_evas_data_set(info->ee, "script,info", info);
@@ -262,7 +263,7 @@ HAPI int script_handler_load(struct script_info *info, int is_pd)
                        evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, render_post_cb);
                        evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, render_pre_cb);
                        fb_destroy_buffer(info->fb);
-                       return -EFAULT;
+                       return LB_STATUS_ERROR_FAULT;
                }
                info->loaded = 1;
                script_signal_emit(e, util_uri_to_path(instance_id(info->inst)),
@@ -277,7 +278,7 @@ HAPI int script_handler_load(struct script_info *info, int is_pd)
        ecore_evas_activate(info->ee);
        fb_sync(info->fb);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int script_handler_unload(struct script_info *info, int is_pd)
@@ -286,15 +287,15 @@ HAPI int script_handler_unload(struct script_info *info, int is_pd)
        Evas *e;
 
        if (!info || !info->port)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        info->loaded--;
        if (info->loaded > 0)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        if (info->loaded < 0) {
                info->loaded = 0;
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        e = script_handler_evas(info);
@@ -314,7 +315,7 @@ HAPI int script_handler_unload(struct script_info *info, int is_pd)
                ecore_evas_data_set(ee, "script,info", NULL);
 
        fb_destroy_buffer(info->fb);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI struct script_info *script_handler_create(struct inst_info *inst, const char *file, const char *option, int w, int h)
@@ -368,12 +369,12 @@ HAPI int script_handler_destroy(struct script_info *info)
 {
        if (!info || !info->port) {
                ErrPrint("port is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->loaded != 0) {
                ErrPrint("Script handler is not unloaded\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (info->port->destroy(info->port_data) < 0)
@@ -381,7 +382,7 @@ HAPI int script_handler_destroy(struct script_info *info)
 
        fb_destroy(info->fb);
        DbgFree(info);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int script_handler_is_loaded(struct script_info *info)
@@ -412,18 +413,18 @@ static int update_script_color(struct inst_info *inst, struct block *block, int
 
        if (!block || !block->part || !block->data) {
                ErrPrint("Block or part or data is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        e = script_handler_evas(info);
@@ -432,7 +433,7 @@ static int update_script_color(struct inst_info *inst, struct block *block, int
        else
                ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int update_script_text(struct inst_info *inst, struct block *block, int is_pd)
@@ -442,18 +443,18 @@ static int update_script_text(struct inst_info *inst, struct block *block, int i
 
        if (!block || !block->part || !block->data) {
                ErrPrint("Block or part or data is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        e = script_handler_evas(info);
@@ -461,7 +462,7 @@ static int update_script_text(struct inst_info *inst, struct block *block, int i
                info->port->update_text(info->port_data, e, block->id, block->part, block->data);
        else
                ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int update_script_image(struct inst_info *inst, struct block *block, int is_pd)
@@ -471,18 +472,18 @@ static int update_script_image(struct inst_info *inst, struct block *block, int
 
        if (!block || !block->part) {
                ErrPrint("Block or part is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        e = script_handler_evas(info);
@@ -490,7 +491,7 @@ static int update_script_image(struct inst_info *inst, struct block *block, int
                info->port->update_image(info->port_data, e, block->id, block->part, block->data, block->option);
        else
                ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int update_script_script(struct inst_info *inst, struct block *block, int is_pd)
@@ -500,18 +501,18 @@ static int update_script_script(struct inst_info *inst, struct block *block, int
 
        if (!block || !block->part) {
                ErrPrint("Block or part is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        e = script_handler_evas(info);
@@ -520,7 +521,7 @@ static int update_script_script(struct inst_info *inst, struct block *block, int
        else
                ErrPrint("Evas: (nil) id[%s] part[%s] data[%s] option[%s]\n",
                                                block->id, block->part, block->data, block->option);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int update_script_signal(struct inst_info *inst, struct block *block, int is_pd)
@@ -530,18 +531,18 @@ static int update_script_signal(struct inst_info *inst, struct block *block, int
 
        if (!block) {
                ErrPrint("block is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        e = script_handler_evas(info);
@@ -549,7 +550,7 @@ static int update_script_signal(struct inst_info *inst, struct block *block, int
                info->port->update_signal(info->port_data, e, block->id, block->part, block->data);
        else
                ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int update_script_drag(struct inst_info *inst, struct block *block, int is_pd)
@@ -560,23 +561,23 @@ static int update_script_drag(struct inst_info *inst, struct block *block, int i
 
        if (!block || !block->data || !block->part) {
                ErrPrint("block or block->data or block->part is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (sscanf(block->data, "%lfx%lf", &dx, &dy) != 2) {
                ErrPrint("Invalid format of data (DRAG data [%s])\n", block->data);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        e = script_handler_evas(info);
@@ -584,15 +585,15 @@ static int update_script_drag(struct inst_info *inst, struct block *block, int i
                info->port->update_drag(info->port_data, e, block->id, block->part, dx, dy);
        else
                ErrPrint("Evas(nil) id[%s] part[%s] %lfx%lf\n", block->id, block->part, dx, dy);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int script_handler_resize(struct script_info *info, int w, int h)
 {
        if (!info) {
        //|| (info->w == w && info->h == h)) {
-               ErrPrint("info[%p] resize is not changed\n", info);
-               return 0;
+               ErrPrint("info[%p] resize is ignored\n", info);
+               return LB_STATUS_SUCCESS;
        }
 
        fb_resize(script_handler_fb(info), w, h);
@@ -606,10 +607,20 @@ HAPI int script_handler_resize(struct script_info *info, int w, int h)
                        ErrPrint("Evas(nil) resize to %dx%d\n", w, h);
        }
 
+       if (info->w != w || info->h != h) {
+               if (instance_lb_script(info->inst) == info) {
+                       instance_set_lb_info(info->inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
+               } else if (instance_pd_script(info->inst) == info) {
+                       instance_set_pd_info(info->inst, w, h);
+               } else {
+                       ErrPrint("Script is not known\n");
+               }
+       }
+
        info->w = w;
        info->h = h;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static int update_info(struct inst_info *inst, struct block *block, int is_pd)
@@ -618,18 +629,18 @@ static int update_info(struct inst_info *inst, struct block *block, int is_pd)
 
        if (!block || !block->part || !block->data) {
                ErrPrint("block or block->part or block->data is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
        if (!info) {
                ErrPrint("info is NIL\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (!info->port) {
                ErrPrint("info->port is NIL\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!strcasecmp(block->part, INFO_SIZE)) {
@@ -637,28 +648,10 @@ static int update_info(struct inst_info *inst, struct block *block, int is_pd)
 
                if (sscanf(block->data, "%dx%d", &w, &h) != 2) {
                        ErrPrint("Invalid format for SIZE(%s)\n", block->data);
-                       return -EINVAL;
+                       return LB_STATUS_ERROR_INVALID;
                }
 
                if (!block->id) {
-                       int resized;
-
-                       if (is_pd) {
-                               resized = (instance_pd_width(inst) != w) || (instance_pd_height(inst) != h);
-                               instance_set_pd_info(inst, w, h);
-                       } else {
-                               /*!
-                                * \note
-                                * LB Size is already scaled by livebox-service.
-                                * Each livebox uses the LB_SIZE_TYPE_XXX for its size.
-                                */
-                               resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
-                               instance_set_lb_info(inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
-                       }
-
-                       if (resized)
-                               instance_send_resized_event(inst, is_pd, w, h, 0);
-
                        script_handler_resize(info, w, h);
                } else {
                        Evas *e;
@@ -677,7 +670,7 @@ static int update_info(struct inst_info *inst, struct block *block, int is_pd)
                        ErrPrint("Evas(nil): id[%s] data[%s]\n", block->id, block->data);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const char *descfile, int is_pd)
@@ -758,13 +751,13 @@ HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const ch
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance is not exists\n");
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
        }
 
        fp = fopen(descfile, "rt");
        if (!fp) {
                ErrPrint("Error: %s [%s]\n", descfile, strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        state = UNKNOWN;
@@ -787,7 +780,7 @@ HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const ch
                        if (!isspace(ch) && ch != EOF) {
                                ErrPrint("%d: Syntax error: Desc is not started with '{' or space - (%c = 0x%x)\n", lineno, ch, ch);
                                fclose(fp);
-                               return -EINVAL;
+                               return LB_STATUS_ERROR_INVALID;
                        }
                        break;
 
@@ -804,7 +797,7 @@ HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const ch
                        if (!block) {
                                ErrPrint("Heap: %s\n", strerror(errno));
                                fclose(fp);
-                               return -ENOMEM;
+                               return LB_STATUS_ERROR_MEMORY;
                        }
 
                        state = FIELD;
@@ -1133,7 +1126,7 @@ HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const ch
        }
 
        fclose(fp);
-       return 0;
+       return LB_STATUS_SUCCESS;
 
 errout:
        ErrPrint("Parse error at %d file %s\n", lineno, util_basename(descfile));
@@ -1148,7 +1141,7 @@ errout:
                DbgFree(block);
        }
        fclose(fp);
-       return -EINVAL;
+       return LB_STATUS_ERROR_INVALID;
 }
 
 HAPI int script_init(void)
@@ -1167,7 +1160,7 @@ HAPI int script_init(void)
        dir = opendir(SCRIPT_PORT_PATH);
        if (!dir) {
                ErrPrint("Error: %s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        while ((ent = readdir(dir))) {
@@ -1179,7 +1172,7 @@ HAPI int script_init(void)
                if (!path) {
                        ErrPrint("Heap: %s %d\n", strerror(errno), pathlen);
                        closedir(dir);
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
 
                snprintf(path, pathlen, "%s%s", SCRIPT_PORT_PATH, ent->d_name);
@@ -1189,7 +1182,7 @@ HAPI int script_init(void)
                        ErrPrint("Heap: %s\n", strerror(errno));
                        DbgFree(path);
                        closedir(dir);
-                       return -ENOMEM;
+                       return LB_STATUS_ERROR_MEMORY;
                }
 
                DbgPrint("Open SCRIPT PORT: %s\n", path);
@@ -1199,7 +1192,7 @@ HAPI int script_init(void)
                        ErrPrint("Error: %s\n", dlerror());
                        DbgFree(item);
                        closedir(dir);
-                       return -EFAULT;
+                       return LB_STATUS_ERROR_FAULT;
                }
 
                item->magic_id = dlsym(item->handle, "script_magic_id");
@@ -1273,14 +1266,14 @@ HAPI int script_init(void)
        }
 
        closedir(dir);
-       return 0;
+       return LB_STATUS_SUCCESS;
 
 errout:
        ErrPrint("Error: %s\n", dlerror());
        dlclose(item->handle);
        DbgFree(item);
        closedir(dir);
-       return -EFAULT;
+       return LB_STATUS_ERROR_FAULT;
 }
 
 HAPI int script_fini(void)
@@ -1301,7 +1294,7 @@ HAPI int script_fini(void)
 HAPI int script_handler_update_pointer(struct script_info *info, int x, int y, int down)
 {
        if (!info)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        info->x = x;
        info->y = y;
@@ -1311,7 +1304,7 @@ HAPI int script_handler_update_pointer(struct script_info *info, int x, int y, i
        else if (down == 1)
                info->down = 1;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index 8f9ec77..7a3d1c9 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <packet.h>
 #include <com-core_packet.h>
+#include <livebox-errno.h>
 
 #include "conf.h"
 #include "debug.h"
@@ -82,11 +83,11 @@ static int event_lb_route_cb(enum event_state state, struct event_data *event_in
 
        pkg = instance_package(inst);
        if (!pkg)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        slave = package_slave(pkg);
        if (!slave)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        switch (state) {
        case EVENT_STATE_ACTIVATE:
@@ -99,12 +100,12 @@ static int event_lb_route_cb(enum event_state state, struct event_data *event_in
                cmdstr = "lb_mouse_up";
                break;
        default:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack(cmdstr, "ssdii", package_name(pkg), instance_id(inst), util_timestamp(), event_info->x, event_info->y);
        if (!packet)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        return slave_rpc_request_only(slave, package_name(pkg), packet, 0);
 }
@@ -123,11 +124,11 @@ static int event_lb_consume_cb(enum event_state state, struct event_data *event_
 
        script = instance_lb_script(inst);
        if (!script)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        e = script_handler_evas(script);
        if (!e)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        timestamp = util_timestamp();
 
@@ -163,11 +164,11 @@ static int event_pd_route_cb(enum event_state state, struct event_data *event_in
 
        pkg = instance_package(inst);
        if (!pkg)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        slave = package_slave(pkg);
        if (!slave)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        DbgPrint("Event: %dx%d\n", event_info->x, event_info->y);
        switch (state) {
@@ -181,12 +182,12 @@ static int event_pd_route_cb(enum event_state state, struct event_data *event_in
                cmdstr = "pd_mouse_up";
                break;
        default:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        packet = packet_create_noack(cmdstr, "ssdii", package_name(pkg), instance_id(inst), util_timestamp(), event_info->x, event_info->y);
        if (!packet)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        return slave_rpc_request_only(slave, package_name(pkg), packet, 0);
 }
@@ -205,11 +206,11 @@ static int event_pd_consume_cb(enum event_state state, struct event_data *event_
 
        script = instance_pd_script(inst);
        if (!script)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        e = script_handler_evas(script);
        if (!e)
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
 
        DbgPrint("Event: %dx%d\n", event_info->x, event_info->y);
        timestamp = util_timestamp();
@@ -245,13 +246,13 @@ static struct packet *client_acquire(pid_t pid, int handle, const struct packet
        client = client_find_by_pid(pid);
        if (client) {
                ErrPrint("Client is already exists %d\n", pid);
-               ret = -EEXIST;
+               ret = LB_STATUS_ERROR_EXIST;
                goto out;
        }
 
        if (packet_get(packet, "d", &timestamp) != 1) {
                ErrPrint("Invalid arguemnt\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -265,7 +266,7 @@ static struct packet *client_acquire(pid_t pid, int handle, const struct packet
        client = client_create(pid, handle);
        if (!client) {
                ErrPrint("Failed to create a new client for %d\n", pid);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        }
 
 out:
@@ -285,7 +286,7 @@ static struct packet *cilent_release(pid_t pid, int handle, const struct packet
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
@@ -316,14 +317,14 @@ static struct packet *client_clicked(pid_t pid, int handle, const struct packet
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "sssddd", &pkgname, &id, &event, &timestamp, &x, &y);
        if (ret != 6) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -336,9 +337,9 @@ static struct packet *client_clicked(pid_t pid, int handle, const struct packet
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        else
                ret = instance_clicked(inst, event, timestamp, x, y);
 
@@ -366,14 +367,14 @@ static struct packet *client_text_signal(pid_t pid, int handle, const struct pac
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssssdddd", &pkgname, &id, &emission, &source, &sx, &sy, &ex, &ey);
        if (ret != 8) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -386,9 +387,9 @@ static struct packet *client_text_signal(pid_t pid, int handle, const struct pac
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        else
                ret = instance_text_signal_emit(inst, emission, source, sx, sy, ex, ey);
 
@@ -433,14 +434,14 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &pkgname, &id);
        if (ret != 2) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -453,9 +454,9 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        } else if (package_is_fault(instance_package(inst))) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (instance_client(inst) != client) {
                if (instance_has_client(inst, client)) {
                        struct deleted_item *item;
@@ -463,7 +464,7 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                        item = malloc(sizeof(*item));
                        if (!item) {
                                ErrPrint("Heap: %s\n", strerror(errno));
-                               ret = -ENOMEM;
+                               ret = LB_STATUS_ERROR_MEMORY;
                        } else {
                                ret = 0;
                                /*!
@@ -483,11 +484,11 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                                        client_unref(client);
                                        instance_unref(inst);
                                        DbgFree(item);
-                                       ret = -EFAULT;
+                                       ret = LB_STATUS_ERROR_FAULT;
                                }
                        }
                } else {
-                       ret = -EPERM;
+                       ret = LB_STATUS_ERROR_PERMISSION;
                }
        } else {
                ret = instance_destroy(inst);
@@ -515,14 +516,14 @@ static struct packet *client_resize(pid_t pid, int handle, const struct packet *
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssii", &pkgname, &id, &w, &h);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -535,11 +536,11 @@ static struct packet *client_resize(pid_t pid, int handle, const struct packet *
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        } else if (package_is_fault(instance_package(inst))) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (instance_client(inst) != client) {
-               ret = -EPERM;
+               ret = LB_STATUS_ERROR_PERMISSION;
        } else {
                ret = instance_resize(inst, w, h);
        }
@@ -571,14 +572,14 @@ static struct packet *client_new(pid_t pid, int handle, const struct packet *pac
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "dssssdii", &timestamp, &pkgname, &content, &cluster, &category, &period, &width, &height);
        if (ret != 8) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -588,7 +589,7 @@ static struct packet *client_new(pid_t pid, int handle, const struct packet *pac
        lb_pkgname = package_lb_pkgname(pkgname);
        if (!lb_pkgname) {
                ErrPrint("This %s has no livebox package\n", pkgname);
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -597,12 +598,12 @@ static struct packet *client_new(pid_t pid, int handle, const struct packet *pac
                info = package_create(lb_pkgname);
 
        if (!info) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_is_fault(info)) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
                ErrPrint("Not enough space\n");
-               ret = -ENOSPC;
+               ret = LB_STATUS_ERROR_NO_SPACE;
        } else {
                struct inst_info *inst;
 
@@ -617,7 +618,7 @@ static struct packet *client_new(pid_t pid, int handle, const struct packet *pac
                 * \note
                 * Using the "inst" without validate its value is at my disposal. ;)
                 */
-               ret = inst ? 0 : -EFAULT;
+               ret = inst ? 0 : LB_STATUS_ERROR_FAULT;
        }
 
        DbgFree(lb_pkgname);
@@ -642,14 +643,14 @@ static struct packet *client_change_visibility(pid_t pid, int handle, const stru
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssi", &pkgname, &id, (int *)&state);
        if (ret != 3) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -662,11 +663,11 @@ static struct packet *client_change_visibility(pid_t pid, int handle, const stru
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        } else if (package_is_fault(instance_package(inst))) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (instance_client(inst) != client) {
-               ret = -EPERM;
+               ret = LB_STATUS_ERROR_PERMISSION;
        } else {
                ret = instance_set_visible_state(inst, state);
        }
@@ -689,14 +690,14 @@ static struct packet *client_set_period(pid_t pid, int handle, const struct pack
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssd", &pkgname, &id, &period);
        if (ret != 3) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -709,11 +710,11 @@ static struct packet *client_set_period(pid_t pid, int handle, const struct pack
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        } else if (package_is_fault(instance_package(inst))) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (instance_client(inst) != client) {
-               ret = -EPERM;
+               ret = LB_STATUS_ERROR_PERMISSION;
        } else {
                ret = instance_set_period(inst, period);
        }
@@ -740,14 +741,14 @@ static struct packet *client_change_group(pid_t pid, int handle, const struct pa
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssss", &pkgname, &id, &cluster, &category);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -760,11 +761,11 @@ static struct packet *client_change_group(pid_t pid, int handle, const struct pa
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        } else if (package_is_fault(instance_package(inst))) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (instance_client(inst) != client) {
-               ret = -EPERM;
+               ret = LB_STATUS_ERROR_PERMISSION;
        } else {
                ret = instance_change_group(inst, cluster, category);
        }
@@ -792,14 +793,14 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -811,14 +812,14 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -829,7 +830,7 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -838,14 +839,14 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -853,7 +854,7 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -866,13 +867,13 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -881,7 +882,7 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -904,14 +905,14 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -923,14 +924,14 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -941,7 +942,7 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -950,14 +951,14 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -965,7 +966,7 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
                packet = packet_create_noack("pd_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -978,13 +979,13 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -993,7 +994,7 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1016,14 +1017,14 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1037,14 +1038,14 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1055,7 +1056,7 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -1064,14 +1065,14 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -1079,7 +1080,7 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
                packet = packet_create_noack("pd_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -1092,13 +1093,13 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -1108,7 +1109,7 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1131,14 +1132,14 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1151,14 +1152,14 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1169,7 +1170,7 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -1178,14 +1179,14 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -1193,7 +1194,7 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
                packet = packet_create_noack("pd_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -1206,13 +1207,13 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -1222,7 +1223,7 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1245,14 +1246,14 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1265,14 +1266,14 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1283,7 +1284,7 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -1292,14 +1293,14 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -1308,7 +1309,7 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
                packet = packet_create_noack("pd_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                 */
@@ -1320,13 +1321,13 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -1335,7 +1336,7 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1358,14 +1359,14 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1377,14 +1378,14 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1395,7 +1396,7 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -1404,14 +1405,14 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -1419,7 +1420,7 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
                packet = packet_create_noack("lb_mouse_move", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -1431,13 +1432,13 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -1446,7 +1447,7 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1475,28 +1476,28 @@ static struct packet *client_lb_mouse_set(pid_t pid, int handle, const struct pa
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1507,7 +1508,7 @@ static struct packet *client_lb_mouse_set(pid_t pid, int handle, const struct pa
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                if (event_is_activated()) {
                        if (event_deactivate() == 0)
@@ -1528,7 +1529,7 @@ static struct packet *client_lb_mouse_set(pid_t pid, int handle, const struct pa
                        instance_event_callback_add(inst, INSTANCE_EVENT_DESTROY, inst_del_cb, NULL);
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 out:
        return NULL;
@@ -1548,27 +1549,27 @@ static struct packet *client_lb_mouse_unset(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1579,7 +1580,7 @@ static struct packet *client_lb_mouse_unset(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                ret = event_deactivate();
                if (ret == 0)
@@ -1590,7 +1591,7 @@ static struct packet *client_lb_mouse_unset(pid_t pid, int handle, const struct
                        instance_event_callback_del(inst, INSTANCE_EVENT_DESTROY, inst_del_cb);
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 out:
        return NULL;
@@ -1611,28 +1612,28 @@ static struct packet *client_pd_mouse_set(pid_t pid, int handle, const struct pa
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1643,7 +1644,7 @@ static struct packet *client_pd_mouse_set(pid_t pid, int handle, const struct pa
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                if (event_is_activated()) {
                        if (event_deactivate() == 0)
@@ -1664,7 +1665,7 @@ static struct packet *client_pd_mouse_set(pid_t pid, int handle, const struct pa
                        instance_event_callback_add(inst, INSTANCE_EVENT_DESTROY, inst_del_cb, NULL);
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1686,28 +1687,28 @@ static struct packet *client_pd_mouse_unset(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1718,7 +1719,7 @@ static struct packet *client_pd_mouse_unset(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                ret = event_deactivate();
                if (ret == 0)
@@ -1729,7 +1730,7 @@ static struct packet *client_pd_mouse_unset(pid_t pid, int handle, const struct
                        instance_event_callback_del(inst, INSTANCE_EVENT_DESTROY, inst_del_cb);
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 out:
        return NULL;
@@ -1750,14 +1751,14 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1769,14 +1770,14 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1787,7 +1788,7 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -1796,14 +1797,14 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -1811,7 +1812,7 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
                packet = packet_create_noack("lb_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -1823,13 +1824,13 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -1838,7 +1839,7 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1861,14 +1862,14 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1880,14 +1881,14 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -1898,7 +1899,7 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -1907,14 +1908,14 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -1922,7 +1923,7 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -1935,13 +1936,13 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -1950,7 +1951,7 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -1973,14 +1974,14 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -1992,14 +1993,14 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2010,7 +2011,7 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2019,14 +2020,14 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2034,7 +2035,7 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
                packet = packet_create_noack("lb_mouse_down", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2047,13 +2048,13 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2063,7 +2064,7 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2086,14 +2087,14 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2105,14 +2106,14 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2123,7 +2124,7 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2132,14 +2133,14 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2147,7 +2148,7 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
                packet = packet_create_noack("lb_mouse_up", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2160,13 +2161,13 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2176,7 +2177,7 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2199,14 +2200,14 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2218,14 +2219,14 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2236,7 +2237,7 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2245,14 +2246,14 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2260,7 +2261,7 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2273,13 +2274,13 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2290,7 +2291,7 @@ static struct packet *client_pd_access_read(pid_t pid, int handle, const struct
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2313,14 +2314,14 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2332,14 +2333,14 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2350,7 +2351,7 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2359,14 +2360,14 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2374,7 +2375,7 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2387,13 +2388,13 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2404,7 +2405,7 @@ static struct packet *client_pd_access_read_prev(pid_t pid, int handle, const st
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2427,14 +2428,14 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2446,14 +2447,14 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2464,7 +2465,7 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2473,14 +2474,14 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2488,7 +2489,7 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2501,13 +2502,13 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2518,7 +2519,7 @@ static struct packet *client_pd_access_read_next(pid_t pid, int handle, const st
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2541,14 +2542,14 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2560,14 +2561,14 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2578,7 +2579,7 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2587,14 +2588,14 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2602,7 +2603,7 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2615,13 +2616,13 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2632,7 +2633,7 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2655,14 +2656,14 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 5) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2674,14 +2675,14 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2692,7 +2693,7 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2701,14 +2702,14 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2716,7 +2717,7 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2729,13 +2730,13 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2746,7 +2747,7 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2763,14 +2764,14 @@ static struct packet *client_pause_request(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is paused - manually reported\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "d", &timestamp);
        if (ret != 1) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2792,14 +2793,14 @@ static struct packet *client_resume_request(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is paused - manually reported\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "d", &timestamp);
        if (ret != 1) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2827,14 +2828,14 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2846,14 +2847,14 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not found\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2864,7 +2865,7 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2873,14 +2874,14 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
                buffer = instance_pd_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -2888,7 +2889,7 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
                packet = packet_create_noack("pd_mouse_enter", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -2901,13 +2902,13 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
 
                script = instance_pd_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -2918,7 +2919,7 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -2941,14 +2942,14 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -2960,14 +2961,14 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -2978,7 +2979,7 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -2987,14 +2988,14 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -3002,7 +3003,7 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -3015,13 +3016,13 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -3033,7 +3034,7 @@ static struct packet *client_lb_access_read(pid_t pid, int handle, const struct
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -3056,14 +3057,14 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3075,14 +3076,14 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -3093,7 +3094,7 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -3102,14 +3103,14 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -3117,7 +3118,7 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -3130,13 +3131,13 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -3148,7 +3149,7 @@ static struct packet *client_lb_access_read_prev(pid_t pid, int handle, const st
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -3171,14 +3172,14 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3190,14 +3191,14 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -3208,7 +3209,7 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -3217,14 +3218,14 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -3232,7 +3233,7 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -3245,13 +3246,13 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -3263,7 +3264,7 @@ static struct packet *client_lb_access_read_next(pid_t pid, int handle, const st
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -3286,14 +3287,14 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3305,14 +3306,14 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -3323,7 +3324,7 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -3332,14 +3333,14 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -3347,7 +3348,7 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -3360,13 +3361,13 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -3378,7 +3379,7 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -3401,14 +3402,14 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3420,14 +3421,14 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -3438,7 +3439,7 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -3447,14 +3448,14 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -3462,7 +3463,7 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -3475,13 +3476,13 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -3493,7 +3494,7 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -3516,14 +3517,14 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdii", &pkgname, &id, &timestamp, &x, &y);
        if (ret != 7) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3535,14 +3536,14 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance[%s] is not exists\n", id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        pkg = instance_package(inst);
        if (!pkg) {
                ErrPrint("Package[%s] info is not exists\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -3553,7 +3554,7 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
                 * slave has not load it, so we don't need to do anything at here!
                 */
                DbgPrint("Package[%s] is faulted\n", pkgname);
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        } else if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                struct buffer_info *buffer;
                struct slave_node *slave;
@@ -3562,14 +3563,14 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
                buffer = instance_lb_buffer(inst);
                if (!buffer) {
                        ErrPrint("Instance[%s] has no buffer\n", id);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                slave = package_slave(pkg);
                if (!slave) {
                        ErrPrint("Package[%s] has no slave\n", pkgname);
-                       ret = -EINVAL;
+                       ret = LB_STATUS_ERROR_INVALID;
                        goto out;
                }
 
@@ -3577,7 +3578,7 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
                packet = packet_create_noack("lb_mouse_leave", "ssiiddd", pkgname, id, w, h, timestamp, x, y);
                if (!packet) {
                        ErrPrint("Failed to create a packet[%s]\n", pkgname);
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
                */
@@ -3590,13 +3591,13 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
 
                script = instance_lb_script(inst);
                if (!script) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
                e = script_handler_evas(script);
                if (!e) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                        goto out;
                }
 
@@ -3608,7 +3609,7 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe
                ret = 0;
        } else {
                ErrPrint("Unsupported package\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -3846,7 +3847,7 @@ static struct packet *client_pinup_changed(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                pinup = 0;
                goto out;
        }
@@ -3854,7 +3855,7 @@ static struct packet *client_pinup_changed(pid_t pid, int handle, const struct p
        ret = packet_get(packet, "ssi", &pkgname, &id, &pinup);
        if (ret != 3) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                pinup = 0;
                goto out;
        }
@@ -3868,9 +3869,9 @@ static struct packet *client_pinup_changed(pid_t pid, int handle, const struct p
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        else
                ret = instance_set_pinup(inst, pinup);
 
@@ -3913,14 +3914,14 @@ static struct packet *client_pd_move(pid_t pid, int handle, const struct packet
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdd", &pkgname, &id, &x, &y);
        if (ret != 4) {
                ErrPrint("Parameter is not correct\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3928,9 +3929,9 @@ static struct packet *client_pd_move(pid_t pid, int handle, const struct packet
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
                instance_slave_set_pd_pos(inst, x, y);
                ret = instance_signal_emit(inst,
@@ -3949,7 +3950,7 @@ static struct packet *client_pd_move(pid_t pid, int handle, const struct packet
                                0.0, 0.0, 0.0, 0.0, x, y, 0);
        } else {
                ErrPrint("Invalid PD type\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 out:
        DbgPrint("Update PD position: %lfx%lf (%d)\n", x, y, ret);
@@ -3970,14 +3971,14 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ssdd", &pkgname, &id, &x, &y);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -3990,11 +3991,11 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        else if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE)
-               ret = -ENOSPC;
+               ret = LB_STATUS_ERROR_NO_SPACE;
        else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
                instance_slave_set_pd_pos(inst, x, y);
                ret = instance_slave_open_pd(inst, client);
@@ -4047,7 +4048,7 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
                }
        } else {
                ErrPrint("Invalid PD TYPE\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -4070,14 +4071,14 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &pkgname, &id);
        if (ret != 2) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -4090,9 +4091,9 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
         */
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
        else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
                ret = instance_signal_emit(inst,
                                "pd,hide", util_uri_to_path(instance_id(inst)),
@@ -4122,7 +4123,7 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
                }
        } else {
                ErrPrint("Invalid PD TYPE\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
        }
 
 out:
@@ -4144,7 +4145,7 @@ static struct packet *client_activate_package(pid_t pid, int handle, const struc
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                pkgname = "";
                goto out;
        }
@@ -4152,7 +4153,7 @@ static struct packet *client_activate_package(pid_t pid, int handle, const struc
        ret = packet_get(packet, "s", &pkgname);
        if (ret != 1) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                pkgname = "";
                goto out;
        }
@@ -4166,13 +4167,13 @@ static struct packet *client_activate_package(pid_t pid, int handle, const struc
        if (!package_is_lb_pkgname(pkgname)) {
                ErrPrint("%s is not a valid livebox package\n", pkgname);
                pkgname = "";
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        info = package_find(pkgname);
        if (!info)
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
        else
                ret = package_clear_fault(info);
 
@@ -4194,14 +4195,14 @@ static struct packet *client_subscribed(pid_t pid, int handle, const struct pack
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &cluster, &category);
        if (ret != 2) {
                ErrPrint("Invalid argument\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -4234,14 +4235,14 @@ static struct packet *client_delete_cluster(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "s", &cluster);
        if (ret != 1) {
                ErrPrint("Invalid parameters\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -4249,14 +4250,14 @@ static struct packet *client_delete_cluster(pid_t pid, int handle, const struct
 
        if (!strlen(cluster) || !strcasecmp(cluster, DEFAULT_CLUSTER)) {
                ErrPrint("Invalid cluster: %s\n", cluster);
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        /*!
         * \todo
         */
-       ret = -ENOSYS;
+       ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 out:
        result = packet_create_reply(packet, "i", ret);
@@ -4313,24 +4314,19 @@ static struct packet *client_update(pid_t pid, int handle, const struct packet *
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Cilent %d is not exists\n", pid);
-               ret = -ENOMEM;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &pkgname, &id);
        if (ret != 2) {
                ErrPrint("Invalid argument\n");
-               ret = -EINVAL;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
        } else if (package_is_fault(instance_package(inst))) {
-               ret = -EFAULT;
        } else if (instance_client(inst) != client) {
-               ret = -EPERM;
        } else {
                slave_rpc_request_update(pkgname, id, instance_cluster(inst), instance_category(inst));
        }
@@ -4355,14 +4351,12 @@ static struct packet *client_refresh_group(pid_t pid, int handle, const struct p
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Cilent %d is not exists\n", pid);
-               ret = -ENOMEM;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &cluster_id, &category_id);
        if (ret != 2) {
                ErrPrint("Invalid parameter\n");
-               ret = -EINVAL;
                goto out;
        }
 
@@ -4370,21 +4364,18 @@ static struct packet *client_refresh_group(pid_t pid, int handle, const struct p
 
        if (!strlen(cluster_id) || !strcasecmp(cluster_id, DEFAULT_CLUSTER)) {
                ErrPrint("Invalid cluster name: %s\n", cluster_id);
-               ret = -EINVAL;
                goto out;
        }
 
        cluster = group_find_cluster(cluster_id);
        if (!cluster) {
                ErrPrint("Cluster [%s] is not registered\n", cluster_id);
-               ret = -EINVAL;
                goto out;
        }
 
        category = group_find_category(cluster, category_id);
        if (!category) {
                ErrPrint("Category [%s] is not registered\n", category_id);
-               ret = -EINVAL;
                goto out;
        }
 
@@ -4409,28 +4400,28 @@ static struct packet *client_delete_category(pid_t pid, int handle, const struct
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &cluster, &category);
        if (ret != 2) {
                ErrPrint("Invalid paramenters\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        DbgPrint("pid[%d] cluster[%s] category[%s]\n", pid, cluster, category);
        if (!strlen(cluster) || !strcasecmp(cluster, DEFAULT_CLUSTER)) {
                ErrPrint("Invalid cluster: %s\n", cluster);
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        /*!
         * \todo
         */
-       ret = -ENOSYS;
+       ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
 
 out:
        result = packet_create_reply(packet, "i", ret);
@@ -4449,14 +4440,14 @@ static struct packet *client_unsubscribed(pid_t pid, int handle, const struct pa
        client = client_find_by_pid(pid);
        if (!client) {
                ErrPrint("Client %d is not exists\n", pid);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        ret = packet_get(packet, "ss", &cluster, &category);
        if (ret != 2) {
                ErrPrint("Invalid argument\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -4489,7 +4480,6 @@ static struct packet *slave_hello(pid_t pid, int handle, const struct packet *pa
        ret = packet_get(packet, "s", &slavename);
        if (ret != 1) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
@@ -4519,7 +4509,6 @@ static struct packet *slave_hello(pid_t pid, int handle, const struct packet *pa
                                slave = slave_create(slavename, 1, abi, pkgname);
                                if (!slave) {
                                        ErrPrint("Failed to create a new slave for %s\n", slavename);
-                                       ret = -EFAULT;
                                        goto out;
                                }
 
@@ -4533,7 +4522,6 @@ static struct packet *slave_hello(pid_t pid, int handle, const struct packet *pa
                        DbgPrint("Provider is forcely activated, pkgname(%s), abi(%s), slavename(%s)\n", pkgname, abi, slavename);
                } else {
                        ErrPrint("Slave[%d] is not exists\n", pid);
-                       ret = -ENOENT;
                        goto out;
                }
        }
@@ -4558,18 +4546,14 @@ static struct packet *slave_ping(pid_t pid, int handle, const struct packet *pac
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
        ret = packet_get(packet, "s", &slavename);
-       if (ret != 1) {
+       if (ret != 1)
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
-               goto out;
-       }
-
-       slave_rpc_ping(slave);
+       else
+               slave_rpc_ping(slave);
 
 out:
        return NULL;
@@ -4588,14 +4572,12 @@ static struct packet *slave_faulted(pid_t pid, int handle, const struct packet *
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
        ret = packet_get(packet, "ssss", &slavename, &pkgname, &id, &func);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
@@ -4605,13 +4587,11 @@ static struct packet *slave_faulted(pid_t pid, int handle, const struct packet *
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                DbgPrint("There is a no such instance(%s)\n", id);
-               ret = -ENOENT;
        } else if (instance_state(inst) == INST_DESTROYED) {
                ErrPrint("Instance(%s) is already destroyed\n", id);
-               ret = -EINVAL;
        } else {
-               DbgPrint("Destroy instance(%s)\n", id);
                ret = instance_destroy(inst);
+               DbgPrint("Destroy instance(%s) %d\n", id, ret);
        }
 
 out:
@@ -4630,14 +4610,12 @@ static struct packet *slave_call(pid_t pid, int handle, const struct packet *pac
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
        ret = packet_get(packet, "ssss", &slavename, &pkgname, &id, &func);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
@@ -4660,14 +4638,12 @@ static struct packet *slave_ret(pid_t pid, int handle, const struct packet *pack
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
        ret = packet_get(packet, "ssss", &slavename, &pkgname, &id, &func);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
@@ -4695,7 +4671,6 @@ static struct packet *slave_updated(pid_t pid, int handle, const struct packet *
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
@@ -4704,37 +4679,28 @@ static struct packet *slave_updated(pid_t pid, int handle, const struct packet *
                                                &content_info, &title);
        if (ret != 8) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
        } else if (package_is_fault(instance_package(inst))) {
                ErrPrint("Faulted instance cannot make any event.\n");
-               ret = -EFAULT;
        } else if (instance_state(inst) == INST_DESTROYED) {
                ErrPrint("Instance is already destroyed\n");
-               ret = -EINVAL;
        } else {
                char *filename;
-               int resized;
-
-               resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
-               instance_set_lb_info(inst, w, h, priority, content_info, title);
 
                switch (package_lb_type(instance_package(inst))) {
                case LB_TYPE_SCRIPT:
                        script_handler_resize(instance_lb_script(inst), w, h);
-
                        filename = util_get_file_kept_in_safe(id);
                        if (filename) {
-                               ret = script_handler_parse_desc(pkgname, id,
+                               (void)script_handler_parse_desc(pkgname, id,
                                                                filename, 0);
                                DbgFree(filename);
                        } else {
-                               ret = script_handler_parse_desc(pkgname, id,
+                               (void)script_handler_parse_desc(pkgname, id,
                                                        util_uri_to_path(id), 0);
                        }
                        break;
@@ -4744,10 +4710,8 @@ static struct packet *slave_updated(pid_t pid, int handle, const struct packet *
                         * \check
                         * text format (inst)
                         */
-                       if (resized)
-                               instance_send_resized_event(inst, IS_LB, w, h, 0);
+                       instance_set_lb_info(inst, w, h, priority, content_info, title);
                        instance_lb_updated_by_instance(inst);
-                       ret = 0;
                        break;
                }
 
@@ -4771,32 +4735,27 @@ static struct packet *slave_desc_updated(pid_t pid, int handle, const struct pac
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
        ret = packet_get(packet, "ssss", &slavename, &pkgname, &id, &descfile);
        if (ret != 4) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
-               ret = -ENOENT;
        } else if (package_is_fault(instance_package(inst))) {
                ErrPrint("Faulted package cannot make event\n");
-               ret = -EFAULT;
        } else if (instance_state(inst) == INST_DESTROYED) {
                ErrPrint("Instance is already destroyed\n");
-               ret = -EINVAL;
        } else {
                switch (package_pd_type(instance_package(inst))) {
                case PD_TYPE_SCRIPT:
                        DbgPrint("Script (%s)\n", id);
                        if (script_handler_is_loaded(instance_pd_script(inst))) {
-                               ret = script_handler_parse_desc(pkgname, id,
+                               (void)script_handler_parse_desc(pkgname, id,
                                                                descfile, 1);
                        }
                        break;
@@ -4804,12 +4763,10 @@ static struct packet *slave_desc_updated(pid_t pid, int handle, const struct pac
                        instance_set_pd_info(inst, 0, 0);
                case PD_TYPE_BUFFER:
                        instance_pd_updated(pkgname, id, descfile);
-                       ret = 0;
                        break;
                default:
                        DbgPrint("Ignore updated DESC(%s - %s - %s)\n",
                                                        pkgname, id, descfile);
-                       ret = 0;
                        break;
                }
        }
@@ -4830,24 +4787,22 @@ static struct packet *slave_deleted(pid_t pid, int handle, const struct packet *
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Slave %d is not exists\n", pid);
-               ret = -ENOENT;
                goto out;
        }
 
        ret = packet_get(packet, "sss", &slavename, &pkgname, &id);
        if (ret != 3) {
                ErrPrint("Parameter is not matched\n");
-               ret = -EINVAL;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
-       if (!inst)
-               ret = -ENOENT;
-       else if (package_is_fault(instance_package(inst)))
-               ret = -EFAULT;
-       else
+       if (!inst) {
+       } else if (package_is_fault(instance_package(inst))) {
+       } else {
                ret = instance_destroyed(inst);
+               DbgPrint("Destroy instance %d\n", ret);
+       }
 
 out:
        return NULL;
@@ -4875,7 +4830,7 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
        if (!slave) {
                ErrPrint("Failed to find a slave\n");
                id = "";
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
@@ -4883,13 +4838,13 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
        if (ret != 7) {
                ErrPrint("Invalid argument\n");
                id = "";
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
                DbgPrint("No space\n");
-               ret = -ENOSPC;
+               ret = LB_STATUS_ERROR_NO_SPACE;
                id = "";
                goto out;
        }
@@ -4898,14 +4853,14 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                DbgPrint("Package[%s] Id[%s] is not found\n", pkgname, id);
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                id = "";
                goto out;
        }
 
        pkg = instance_package(inst);
        id = "";
-       ret = -EINVAL;
+       ret = LB_STATUS_ERROR_INVALID;
        if (target == TYPE_LB) {
                if (package_lb_type(pkg) == LB_TYPE_BUFFER) {
                        struct buffer_info *info;
@@ -4918,7 +4873,7 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
                                        info = instance_lb_buffer(inst);
                                        if (!info) {
                                                ErrPrint("LB buffer is not valid\n");
-                                               ret = -EINVAL;
+                                               ret = LB_STATUS_ERROR_INVALID;
                                                id = "";
                                                goto out;
                                        }
@@ -4930,12 +4885,8 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
 
                        ret = buffer_handler_load(info);
                        if (ret == 0) {
-                               int resized;
-                               resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
                                instance_set_lb_info(inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
                                id = buffer_handler_id(info);
-                               if (resized)
-                                       instance_send_resized_event(inst, IS_LB, w, h, 0);
                                DbgPrint("Buffer handler ID: %s\n", id);
                        } else {
                                DbgPrint("Failed to load a buffer(%d)\n", ret);
@@ -4955,7 +4906,7 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
                                        info = instance_pd_buffer(inst);
                                        if (!info) {
                                                ErrPrint("PD buffer is not valid\n");
-                                               ret = -EINVAL;
+                                               ret = LB_STATUS_ERROR_INVALID;
                                                id = "";
                                                instance_client_pd_created(inst, ret);
                                                goto out;
@@ -4968,12 +4919,8 @@ static struct packet *slave_acquire_buffer(pid_t pid, int handle, const struct p
 
                        ret = buffer_handler_load(info);
                        if (ret == 0) {
-                               int resized;
-                               resized = (instance_pd_width(inst) != w) || (instance_pd_height(inst) != h);
                                instance_set_pd_info(inst, w, h);
                                id = buffer_handler_id(info);
-                               if (resized)
-                                       instance_send_resized_event(inst, IS_PD, w, h, 0);
                                DbgPrint("Buffer handler ID: %s\n", id);
                        } else {
                                DbgPrint("Failed to load a buffer (%d)\n", ret);
@@ -5011,14 +4958,14 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Failed to find a slave\n");
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                id = "";
                goto out;
        }
 
        if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
                ErrPrint("Not enough space\n");
-               ret = -ENOSPC;
+               ret = LB_STATUS_ERROR_NO_SPACE;
                id = "";
                goto out;
        }
@@ -5026,7 +4973,7 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
        ret = packet_get(packet, "isssii", &type, &slavename, &pkgname, &id, &w, &h);
        if (ret != 6) {
                ErrPrint("Invalid argument\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                id = "";
                goto out;
        }
@@ -5034,7 +4981,7 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                DbgPrint("Instance is not found[%s] [%s]\n", pkgname, id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                id = "";
                goto out;
        }
@@ -5046,12 +4993,12 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
                 * THIS statement should not be entered.
                 */
                ErrPrint("PACKAGE INFORMATION IS NOT VALID\n");
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                id = "";
                goto out;
        }
 
-       ret = -EINVAL;
+       ret = LB_STATUS_ERROR_INVALID;
        /*!
         * \note
         * Reset "id", It will be re-used from here
@@ -5069,13 +5016,8 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
                                 * id is resued for newly assigned ID
                                 */
                                if (!ret) {
-                                       int resized;
-
                                        id = buffer_handler_id(info);
-                                       resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
                                        instance_set_lb_info(inst, w, h, PRIORITY_NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
-                                       if (resized)
-                                               instance_send_resized_event(inst, IS_LB, w, h, 0);
                                }
                        }
                }
@@ -5091,12 +5033,8 @@ static struct packet *slave_resize_buffer(pid_t pid, int handle, const struct pa
                                 * id is resued for newly assigned ID
                                 */
                                if (!ret) {
-                                       int resized;
                                        id = buffer_handler_id(info);
-                                       resized = (instance_pd_width(inst) != w) || (instance_pd_height(inst) != h);
                                        instance_set_pd_info(inst, w, h);
-                                       if (resized)
-                                               instance_send_resized_event(inst, IS_PD, w, h, 0);
                                }
                        }
                }
@@ -5124,24 +5062,24 @@ static struct packet *slave_release_buffer(pid_t pid, int handle, const struct p
        slave = slave_find_by_pid(pid);
        if (!slave) {
                ErrPrint("Failed to find a slave\n");
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        if (packet_get(packet, "isss", &type, &slavename, &pkgname, &id) != 4) {
                ErrPrint("Inavlid argument\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        inst = package_find_instance_by_id(pkgname, id);
        if (!inst) {
                ErrPrint("Instance is not found [%s - %s]\n", pkgname, id);
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
-       ret = -EINVAL;
+       ret = LB_STATUS_ERROR_INVALID;
        if (type == TYPE_LB) {
                struct buffer_info *info;
 
@@ -5182,7 +5120,7 @@ static struct packet *service_change_period(pid_t pid, int handle, const struct
        ret = packet_get(packet, "ssd", &pkgname, &id, &period);
        if (ret != 3) {
                ErrPrint("Invalid packet\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -5191,9 +5129,9 @@ static struct packet *service_change_period(pid_t pid, int handle, const struct
 
                pkg = package_find(pkgname);
                if (!pkg) {
-                       ret = -ENOENT;
+                       ret = LB_STATUS_ERROR_NOT_EXIST;
                } else if (package_is_fault(pkg)) {
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                } else {
                        Eina_List *inst_list;
                        Eina_List *l;
@@ -5208,9 +5146,9 @@ static struct packet *service_change_period(pid_t pid, int handle, const struct
        } else {
                inst = package_find_instance_by_id(pkgname, id);
                if (!inst)
-                       ret = -ENOENT;
+                       ret = LB_STATUS_ERROR_NOT_EXIST;
                else if (package_is_fault(instance_package(inst)))
-                       ret = -EFAULT;
+                       ret = LB_STATUS_ERROR_FAULT;
                else
                        ret = instance_set_period(inst, period);
        }
@@ -5238,25 +5176,25 @@ static struct packet *service_update(pid_t pid, int handle, const struct packet
        ret = packet_get(packet, "ssss", &pkgname, &id, &cluster, &category);
        if (ret != 4) {
                ErrPrint("Invalid Packet\n");
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        lb_pkgname = package_lb_pkgname(pkgname);
        if (!lb_pkgname) {
                ErrPrint("Invalid package %s\n", pkgname);
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
        pkg = package_find(lb_pkgname);
        if (!pkg) {
-               ret = -ENOENT;
+               ret = LB_STATUS_ERROR_NOT_EXIST;
                goto out;
        }
 
        if (package_is_fault(pkg)) {
-               ret = -EFAULT;
+               ret = LB_STATUS_ERROR_FAULT;
                goto out;
        }
 
@@ -5289,7 +5227,7 @@ static struct packet *liveinfo_hello(pid_t pid, int handle, const struct packet
        if (packet_get(packet, "d", &timestamp) != 1) {
                ErrPrint("Invalid packet\n");
                fifo_name = "";
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -5297,7 +5235,7 @@ static struct packet *liveinfo_hello(pid_t pid, int handle, const struct packet
        if (!info) {
                ErrPrint("Failed to create a liveinfo object\n");
                fifo_name = "";
-               ret = -EINVAL;
+               ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
 
@@ -5557,7 +5495,7 @@ static struct packet *liveinfo_master_ctrl(pid_t pid, int handle, const struct p
        char *var;
        char *val;
        FILE *fp;
-       int ret = -EINVAL;
+       int ret = LB_STATUS_ERROR_INVALID;
 
        if (packet_get(packet, "sss", &cmd, &var, &val) != 3) {
                ErrPrint("Invalid argument\n");
index 3f72323..b7b50c4 100644 (file)
@@ -31,6 +31,7 @@
 #include <bundle.h>
 
 #include <packet.h>
+#include <livebox-errno.h>
 
 #include "slave_life.h"
 #include "slave_rpc.h"
@@ -120,13 +121,13 @@ static Eina_Bool slave_ttl_cb(void *data)
 static inline int xmonitor_pause_cb(void *data)
 {
        slave_pause(data);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int xmonitor_resume_cb(void *data)
 {
        slave_resume(data);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline struct slave_node *create_slave_node(const char *name, int is_secured, const char *abi, const char *pkgname)
@@ -408,7 +409,7 @@ HAPI int slave_activate(struct slave_node *slave)
         * about it is alive? or not.
         */
        if (slave->pid != (pid_t)-1)
-               return -EALREADY;
+               return LB_STATUS_ERROR_ALREADY;
 
        if (DEBUG_MODE) {
                DbgPrint("Debug Mode enabled. name[%s] secured[%d] abi[%s]\n", slave->name, slave->secured, slave->abi);
@@ -417,7 +418,7 @@ HAPI int slave_activate(struct slave_node *slave)
                param = bundle_create();
                if (!param) {
                        ErrPrint("Failed to create a bundle\n");
-                       return -EFAULT;
+                       return LB_STATUS_ERROR_FAULT;
                }
 
                bundle_add(param, BUNDLE_SLAVE_NAME, slave->name);
@@ -432,7 +433,7 @@ HAPI int slave_activate(struct slave_node *slave)
                if (slave->pid < 0) {
                        ErrPrint("Failed to launch a new slave %s (%d)\n", slave->name, slave->pid);
                        slave->pid = (pid_t)-1;
-                       return -EFAULT;
+                       return LB_STATUS_ERROR_FAULT;
                }
                DbgPrint("Slave launched %d for %s\n", slave->pid, slave->name);
 
@@ -449,7 +450,7 @@ HAPI int slave_activate(struct slave_node *slave)
         */
        slave_ref(slave);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_give_more_ttl(struct slave_node *slave)
@@ -457,20 +458,20 @@ HAPI int slave_give_more_ttl(struct slave_node *slave)
        double delay;
 
        if (!slave->secured || !slave->ttl_timer)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        delay = SLAVE_TTL - ecore_timer_pending_get(slave->ttl_timer);
        ecore_timer_delay(slave->ttl_timer, delay);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_freeze_ttl(struct slave_node *slave)
 {
        if (!slave->secured || !slave->ttl_timer)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        ecore_timer_freeze(slave->ttl_timer);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_thaw_ttl(struct slave_node *slave)
@@ -478,13 +479,13 @@ HAPI int slave_thaw_ttl(struct slave_node *slave)
        double delay;
 
        if (!slave->secured || !slave->ttl_timer)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        ecore_timer_thaw(slave->ttl_timer);
 
        delay = SLAVE_TTL - ecore_timer_pending_get(slave->ttl_timer);
        ecore_timer_delay(slave->ttl_timer, delay);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_activated(struct slave_node *slave)
@@ -514,7 +515,7 @@ HAPI int slave_activated(struct slave_node *slave)
                slave->activate_timer = NULL;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int invoke_deactivate_cb(struct slave_node *slave)
@@ -606,7 +607,7 @@ HAPI struct slave_node *slave_deactivated(struct slave_node *slave)
 
                DbgPrint("Need to reactivate a slave\n");
                ret = slave_activate(slave);
-               if (ret < 0 && ret != -EALREADY)
+               if (ret < 0 && ret != LB_STATUS_ERROR_ALREADY)
                        ErrPrint("Failed to reactivate a slave\n");
        } else if (slave_loaded_instance(slave) == 0) {
                /*!
@@ -706,7 +707,7 @@ HAPI int slave_event_callback_add(struct slave_node *slave, enum slave_event eve
        ev = calloc(1, sizeof(*ev));
        if (!ev) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        ev->slave = slave;
@@ -752,10 +753,10 @@ HAPI int slave_event_callback_add(struct slave_node *slave, enum slave_event eve
                break;
        default:
                DbgFree(ev);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event event, int (*cb)(struct slave_node *, void *), void *data)
@@ -770,7 +771,7 @@ HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event eve
                        if (ev->evt_cb == cb && ev->cbdata == data) {
                                slave->event_deactivate_list = eina_list_remove(slave->event_deactivate_list, ev);
                                DbgFree(ev);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -779,7 +780,7 @@ HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event eve
                        if (ev->evt_cb == cb && ev->cbdata == data) {
                                slave->event_delete_list = eina_list_remove(slave->event_delete_list, ev);
                                DbgFree(ev);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -788,7 +789,7 @@ HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event eve
                        if (ev->evt_cb == cb && ev->cbdata == data) {
                                slave->event_activate_list = eina_list_remove(slave->event_activate_list, ev);
                                DbgFree(ev);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -797,7 +798,7 @@ HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event eve
                        if (ev->evt_cb == cb && ev->cbdata == data) {
                                slave->event_pause_list = eina_list_remove(slave->event_pause_list, ev);
                                DbgFree(ev);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -806,7 +807,7 @@ HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event eve
                        if (ev->evt_cb == cb && ev->cbdata == data) {
                                slave->event_resume_list = eina_list_remove(slave->event_resume_list, ev);
                                DbgFree(ev);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -815,15 +816,15 @@ HAPI int slave_event_callback_del(struct slave_node *slave, enum slave_event eve
                        if (ev->evt_cb == cb && ev->cbdata == data) {
                                slave->event_fault_list = eina_list_remove(slave->event_fault_list, ev);
                                DbgFree(ev);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
        default:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 HAPI int slave_set_data(struct slave_node *slave, const char *tag, void *data)
@@ -833,19 +834,19 @@ HAPI int slave_set_data(struct slave_node *slave, const char *tag, void *data)
        priv = calloc(1, sizeof(*priv));
        if (!priv) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        priv->tag = strdup(tag);
        if (!priv->tag) {
                ErrPrint("Heap: %s\n", strerror(errno));
                DbgFree(priv);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        priv->data = data;
        slave->data_list = eina_list_append(slave->data_list, priv);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void *slave_del_data(struct slave_node *slave, const char *tag)
@@ -1059,12 +1060,12 @@ HAPI const pid_t const slave_pid(const struct slave_node *slave)
 HAPI int slave_set_pid(struct slave_node *slave, pid_t pid)
 {
        if (!slave)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        DbgPrint("Slave PID is updated to %d from %d\n", pid, slave->pid);
 
        slave->pid = pid;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline void invoke_resumed_cb(struct slave_node *slave)
@@ -1166,10 +1167,10 @@ HAPI int slave_resume(struct slave_node *slave)
        case SLAVE_REQUEST_TO_LAUNCH:
        case SLAVE_REQUEST_TO_TERMINATE:
        case SLAVE_TERMINATED:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        case SLAVE_RESUMED:
        case SLAVE_REQUEST_TO_RESUME:
-               return 0;
+               return LB_STATUS_SUCCESS;
        default:
                break;
        }
@@ -1179,7 +1180,7 @@ HAPI int slave_resume(struct slave_node *slave)
        packet = packet_create("resume", "d", timestamp);
        if (!packet) {
                ErrPrint("Failed to prepare param\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        slave->state = SLAVE_REQUEST_TO_RESUME;
@@ -1195,10 +1196,10 @@ HAPI int slave_pause(struct slave_node *slave)
        case SLAVE_REQUEST_TO_LAUNCH:
        case SLAVE_REQUEST_TO_TERMINATE:
        case SLAVE_TERMINATED:
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        case SLAVE_PAUSED:
        case SLAVE_REQUEST_TO_PAUSE:
-               return 0;
+               return LB_STATUS_SUCCESS;
        default:
                break;
        }
@@ -1208,7 +1209,7 @@ HAPI int slave_pause(struct slave_node *slave)
        packet = packet_create("pause", "d", timestamp);
        if (!packet) {
                ErrPrint("Failed to prepare param\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        slave->state = SLAVE_REQUEST_TO_PAUSE;
index 4853d97..fd513ca 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <packet.h>
 #include <com-core_packet.h>
+#include <livebox-errno.h>
 
 #include "debug.h"
 #include "slave_life.h"
@@ -123,7 +124,7 @@ static int slave_async_cb(pid_t pid, int handle, const struct packet *packet, vo
 
        if (!command) {
                ErrPrint("Packet is NIL\n");
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        /*!
@@ -152,7 +153,7 @@ static int slave_async_cb(pid_t pid, int handle, const struct packet *packet, vo
 
 out:
        destroy_command(command);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static Eina_Bool command_consumer_cb(void *data)
@@ -282,7 +283,7 @@ static int slave_deactivate_cb(struct slave_node *slave, void *data)
                 * \note
                 * Return negative value will remove this callback from the event list of the slave
                 */
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (rpc->pong_timer) {
@@ -323,7 +324,7 @@ static int slave_deactivate_cb(struct slave_node *slave, void *data)
         */
        rpc->ping_count = 0;
        rpc->next_ping_count = 1;
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static Eina_Bool ping_timeout_cb(void *data)
@@ -370,7 +371,7 @@ HAPI int slave_rpc_async_request(struct slave_node *slave, const char *pkgname,
                        ret_cb(slave, NULL, data);
 
                packet_unref(packet);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        command->ret_cb = ret_cb;
@@ -383,7 +384,7 @@ HAPI int slave_rpc_async_request(struct slave_node *slave, const char *pkgname,
                if (ret_cb)
                        ret_cb(slave, NULL, data);
                destroy_command(command);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (rpc->handle < 0) {
@@ -392,7 +393,7 @@ HAPI int slave_rpc_async_request(struct slave_node *slave, const char *pkgname,
                        int ret;
                        DbgPrint("Activate slave forcely\n");
                        ret = slave_activate(slave);
-                       if (ret < 0 && ret != -EALREADY) {
+                       if (ret < 0 && ret != LB_STATUS_ERROR_ALREADY) {
 
                                if (ret_cb)
                                        ret_cb(slave, NULL, data);
@@ -407,7 +408,7 @@ HAPI int slave_rpc_async_request(struct slave_node *slave, const char *pkgname,
                else
                        rpc->pending_list = eina_list_append(rpc->pending_list, command);
 
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (urgent)
@@ -415,7 +416,7 @@ HAPI int slave_rpc_async_request(struct slave_node *slave, const char *pkgname,
        else
                push_command(command);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_request_only(struct slave_node *slave, const char *pkgname, struct packet *packet, int urgent)
@@ -427,7 +428,7 @@ HAPI int slave_rpc_request_only(struct slave_node *slave, const char *pkgname, s
        if (!command) {
                ErrPrint("Failed to create a command\n");
                packet_unref(packet);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        command->ret_cb = NULL;
@@ -438,7 +439,7 @@ HAPI int slave_rpc_request_only(struct slave_node *slave, const char *pkgname, s
        if (!rpc) {
                ErrPrint("Slave has no RPC\n");
                destroy_command(command);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        if (rpc->handle < 0) {
@@ -449,7 +450,7 @@ HAPI int slave_rpc_request_only(struct slave_node *slave, const char *pkgname, s
 
                        DbgPrint("Activate slave forcely\n");
                        ret = slave_activate(slave);
-                       if (ret < 0 && ret != -EALREADY) {
+                       if (ret < 0 && ret != LB_STATUS_ERROR_ALREADY) {
                                destroy_command(command);
                                return ret;
                        }
@@ -460,7 +461,7 @@ HAPI int slave_rpc_request_only(struct slave_node *slave, const char *pkgname, s
                else
                        rpc->pending_list = eina_list_append(rpc->pending_list, command);
 
-               return 0;
+               return LB_STATUS_SUCCESS;
        }
 
        if (urgent)
@@ -468,7 +469,7 @@ HAPI int slave_rpc_request_only(struct slave_node *slave, const char *pkgname, s
        else
                push_command(command);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_update_handle(struct slave_node *slave, int handle)
@@ -478,7 +479,7 @@ HAPI int slave_rpc_update_handle(struct slave_node *slave, int handle)
 
        rpc = slave_data(slave, "rpc");
        if (!rpc)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        DbgPrint("SLAVE: New handle assigned for %d, %d\n", slave_pid(slave), handle);
        rpc->handle = handle;
@@ -501,7 +502,7 @@ HAPI int slave_rpc_update_handle(struct slave_node *slave, int handle)
                push_command(command);
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_init(struct slave_node *slave)
@@ -511,12 +512,12 @@ HAPI int slave_rpc_init(struct slave_node *slave)
        rpc = calloc(1, sizeof(*rpc));
        if (!rpc) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        if (slave_set_data(slave, "rpc", rpc) < 0) {
                DbgFree(rpc);
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        slave_event_callback_add(slave, SLAVE_EVENT_DEACTIVATE, slave_deactivate_cb, NULL);
@@ -525,7 +526,7 @@ HAPI int slave_rpc_init(struct slave_node *slave)
        rpc->next_ping_count = 1;
        rpc->handle = -1;
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_fini(struct slave_node *slave)
@@ -534,7 +535,7 @@ HAPI int slave_rpc_fini(struct slave_node *slave)
 
        rpc = slave_del_data(slave, "rpc");
        if (!rpc)
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
 
        slave_event_callback_del(slave, SLAVE_EVENT_DEACTIVATE, slave_deactivate_cb, NULL);
 
@@ -542,7 +543,7 @@ HAPI int slave_rpc_fini(struct slave_node *slave)
                ecore_timer_del(rpc->pong_timer);
 
        DbgFree(rpc);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_ping(struct slave_node *slave)
@@ -552,12 +553,12 @@ HAPI int slave_rpc_ping(struct slave_node *slave)
        rpc = slave_data(slave, "rpc");
        if (!rpc) {
                ErrPrint("Slave RPC is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!slave_is_activated(slave)) {
                ErrPrint("Slave is not activated\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        rpc->ping_count++;
@@ -568,7 +569,7 @@ HAPI int slave_rpc_ping(struct slave_node *slave)
        rpc->next_ping_count++;
 
        ecore_timer_reset(rpc->pong_timer);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_ping_freeze(struct slave_node *slave)
@@ -578,16 +579,16 @@ HAPI int slave_rpc_ping_freeze(struct slave_node *slave)
        rpc = slave_data(slave, "rpc");
        if (!rpc) {
                ErrPrint("Slave RPC is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!slave_is_activated(slave)) {
                ErrPrint("Slave is not activated\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ecore_timer_freeze(rpc->pong_timer);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int slave_rpc_ping_thaw(struct slave_node *slave)
@@ -597,16 +598,16 @@ HAPI int slave_rpc_ping_thaw(struct slave_node *slave)
        rpc = slave_data(slave, "rpc");
        if (!rpc) {
                ErrPrint("Slave RPC is not valid\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!slave_is_activated(slave)) {
                ErrPrint("Slave is not activated\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        ecore_timer_thaw(rpc->pong_timer);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void slave_rpc_request_update(const char *pkgname, const char *id, const char *cluster, const char *category)
index 28c042d..60fdea3 100644 (file)
@@ -28,6 +28,7 @@
 #include <dlog.h>
 #include <Eina.h>
 #include <Ecore.h>
+#include <livebox-errno.h>
 
 #include "util.h"
 #include "debug.h"
@@ -67,12 +68,12 @@ HAPI int util_check_ext(const char *filename, const char *check_ptr)
        name_len = strlen(filename);
        while (--name_len >= 0 && *check_ptr) {
                if (filename[name_len] != *check_ptr)
-                       return -EINVAL;
+                       return LB_STATUS_ERROR_INVALID;
 
                check_ptr ++;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int check_native_livebox(const char *pkgname)
@@ -87,18 +88,18 @@ static inline int check_native_livebox(const char *pkgname)
        path = malloc(len + 1);
        if (!path) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        snprintf(path, len, "%s%s/libexec/liblive-%s.so", ROOT_PATH, pkgname, pkgname);
        if (access(path, F_OK | R_OK) != 0) {
                ErrPrint("%s is not a valid package\n", pkgname);
                DbgFree(path);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        DbgFree(path);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline int check_web_livebox(const char *pkgname)
@@ -112,31 +113,31 @@ static inline int check_web_livebox(const char *pkgname)
        path = malloc(len + 1);
        if (!path) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        snprintf(path, len, "/opt/usr/apps/%s/res/wgt/livebox/index.html", pkgname);
        if (access(path, F_OK | R_OK) != 0) {
                ErrPrint("%s is not a valid package\n", pkgname);
                DbgFree(path);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        DbgFree(path);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int util_validate_livebox_package(const char *pkgname)
 {
        if (!pkgname) {
                ErrPrint("Invalid argument\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (!check_native_livebox(pkgname) || !check_web_livebox(pkgname))
-               return 0;
+               return LB_STATUS_SUCCESS;
 
-       return -EINVAL;
+       return LB_STATUS_ERROR_INVALID;
 }
 
 HAPI int util_unlink(const char *filename)
@@ -149,21 +150,21 @@ HAPI int util_unlink(const char *filename)
        descfile = malloc(desclen);
        if (!descfile) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        ret = snprintf(descfile, desclen, "%s.desc", filename);
        if (ret < 0) {
                ErrPrint("Error: %s\n", strerror(errno));
                DbgFree(descfile);
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        (void)unlink(descfile);
        DbgFree(descfile);
        (void)unlink(filename);
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI char *util_slavename(void)
@@ -434,18 +435,18 @@ HAPI int util_unlink_files(const char *folder)
 
        if (lstat(folder, &info) < 0) {
                ErrPrint("Error: %s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        if (!S_ISDIR(info.st_mode)) {
                ErrPrint("Error: %s is not a folder", folder);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        handle = opendir(folder);
        if (!handle) {
                ErrPrint("Error: %s\n", strerror(errno));
-               return -EIO;
+               return LB_STATUS_ERROR_IO;
        }
 
        while ((entry = readdir(handle))) {
@@ -470,7 +471,7 @@ HAPI int util_unlink_files(const char *folder)
        }
 
        closedir(handle);
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 /* End of a file */
index 2260133..829d81b 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <gio/gio.h>
 #include <dlog.h>
+#include <livebox-errno.h>
 
 #include "conf.h"
 #include "debug.h"
@@ -97,14 +98,14 @@ static inline int get_pid(Ecore_X_Window win)
                                sizeof(int), &in_pid, &num) == EINA_FALSE) {
                if (ecore_x_netwm_pid_get(win, &pid) == EINA_FALSE) {
                        ErrPrint("Failed to get PID from a window 0x%X\n", win);
-                       return -EINVAL;
+                       return LB_STATUS_ERROR_INVALID;
                }
        } else if (in_pid) {
                pid = *(int *)in_pid;
                DbgFree(in_pid);
        } else {
                ErrPrint("Failed to get PID\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        return pid;
@@ -162,7 +163,7 @@ HAPI int xmonitor_update_state(int target_pid)
        int pid;
 
        if (!USE_XMONITOR)
-               return 0;
+               return LB_STATUS_SUCCESS;
 
        win = ecore_x_window_focus_get();
 
@@ -174,7 +175,7 @@ HAPI int xmonitor_update_state(int target_pid)
                        DbgPrint("Client window has no focus now\n");
                        client_paused(client);
                }
-               return -ENOENT;
+               return LB_STATUS_ERROR_NOT_EXIST;
        }
 
        client = client_find_by_pid(pid);
@@ -185,7 +186,7 @@ HAPI int xmonitor_update_state(int target_pid)
                        DbgPrint("Client window has no focus now\n");
                        client_paused(client);
                }
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
        if (target_pid != pid) {
@@ -197,7 +198,7 @@ HAPI int xmonitor_update_state(int target_pid)
        }
 
        xmonitor_handle_state_changes();
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static Eina_Bool client_cb(void *data, int type, void *event)
@@ -320,7 +321,7 @@ HAPI int xmonitor_pause(struct client_node *client)
        DbgPrint("%d is paused\n", client_pid(client));
        client_paused(client);
        xmonitor_handle_state_changes();
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int xmonitor_resume(struct client_node *client)
@@ -328,7 +329,7 @@ HAPI int xmonitor_resume(struct client_node *client)
        DbgPrint("%d is resumed\n", client_pid(client));
        client_resumed(client);
        xmonitor_handle_state_changes();
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 static inline void disable_xmonitor(void)
@@ -352,7 +353,7 @@ static inline int enable_xmonitor(void)
                                                        create_cb, NULL);
        if (!s_info.create_handler) {
                ErrPrint("Failed to add create event handler\n");
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        s_info.destroy_handler =
@@ -362,7 +363,7 @@ static inline int enable_xmonitor(void)
                ErrPrint("Failed to add destroy event handler\n");
                ecore_event_handler_del(s_info.create_handler);
                s_info.create_handler = NULL;
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        s_info.client_handler =
@@ -374,11 +375,11 @@ static inline int enable_xmonitor(void)
                ecore_event_handler_del(s_info.destroy_handler);
                s_info.create_handler = NULL;
                s_info.destroy_handler = NULL;
-               return -EFAULT;
+               return LB_STATUS_ERROR_FAULT;
        }
 
        sniff_all_windows();
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int xmonitor_init(void)
@@ -391,12 +392,12 @@ HAPI int xmonitor_init(void)
        }
 
        s_info.paused = client_is_all_paused() || setting_is_lcd_off();
-       if (s_info.paused) {
+       if (s_info.paused)
                touch_paused_file();
-       } else {
+       else
                remove_paused_file();
-       }
-       return 0;
+
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI void xmonitor_fini(void)
@@ -412,7 +413,7 @@ HAPI int xmonitor_add_event_callback(enum xmonitor_event event, int (*cb)(void *
        item = malloc(sizeof(*item));
        if (!item) {
                ErrPrint("Heap: %s\n", strerror(errno));
-               return -ENOMEM;
+               return LB_STATUS_ERROR_MEMORY;
        }
 
        item->cb = cb;
@@ -428,10 +429,10 @@ HAPI int xmonitor_add_event_callback(enum xmonitor_event event, int (*cb)(void *
        default:
                ErrPrint("Invalid event type\n");
                DbgFree(item);
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return 0;
+       return LB_STATUS_SUCCESS;
 }
 
 HAPI int xmonitor_del_event_callback(enum xmonitor_event event, int (*cb)(void *user_data), void *user_data)
@@ -446,7 +447,7 @@ HAPI int xmonitor_del_event_callback(enum xmonitor_event event, int (*cb)(void *
                        if (item->cb == cb && item->user_data == user_data) {
                                s_info.pause_list = eina_list_remove(s_info.pause_list, item);
                                DbgFree(item);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
@@ -456,16 +457,16 @@ HAPI int xmonitor_del_event_callback(enum xmonitor_event event, int (*cb)(void *
                        if (item->cb == cb && item->user_data == user_data) {
                                s_info.resume_list = eina_list_remove(s_info.resume_list, item);
                                DbgFree(item);
-                               return 0;
+                               return LB_STATUS_SUCCESS;
                        }
                }
                break;
        default:
                ErrPrint("Invalid event type\n");
-               return -EINVAL;
+               return LB_STATUS_ERROR_INVALID;
        }
 
-       return -ENOENT;
+       return LB_STATUS_ERROR_NOT_EXIST;
 }
 
 HAPI int xmonitor_is_paused(void)