Make error status code more portable.
If the livebox_create function has updaetd content, try send it to the provider.
Change-Id: I2851d03c1f0a2bbc6c28abfdfd4c46161a0953f1
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 */
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);
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)
+/*
+ * 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;
*/
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);
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);
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 */
#include <Eina.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
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);
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)
_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) {
}
DbgFree(_pkgname);
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
}
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;
DbgFree(item->pkgname);
DbgFree(item);
}
-
- return 0;
}
HAPI const char *abi_find_slave(const char *abi)
#include <dlog.h>
#include <packet.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "conf.h"
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;
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);
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);
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) {
}
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline void *acquire_gem(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);
buffer->state = DESTROYED;
DbgFree(buffer);
- return 0;
+ return LB_STATUS_SUCCESS;
}
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) {
gem->data = NULL;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
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();
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;
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)
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);
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;
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);
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)
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 */
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);
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)
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) {
break;
default:
ErrPrint("Invalid buffer\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
break;
}
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);
DbgFree(info->id);
info->id = new_id;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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)
DbgFree(info->id);
info->id = new_id;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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;
}
/*!
DbgFree(info->id);
info->id = new_id;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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) {
break;
default:
ErrPrint("Invalid buffer\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
break;
}
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) {
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)
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) {
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;
}
/*!
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);
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)
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);
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)
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;
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);
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;
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);
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)
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);
s_info.err_base = 0;
DbgFree(deviceName);
DbgFree(driverName);
- return 0;
+ return LB_STATUS_SUCCESS;
}
s_info.fd = open(deviceName, O_RDWR);
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);
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);
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)
s_info.slp_bufmgr = NULL;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <dlog.h>
#include <packet.h>
+#include <livebox-errno.h>
#include "client_life.h"
#include "instance.h"
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;
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)
if (!cb) {
ErrPrint("Invalid callback (cb == NULL)\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
switch (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;
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;
break;
}
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
}
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)
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;
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)
handler = malloc(sizeof(*handler));
if (!handler) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
handler->cbdata = data;
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)
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;
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;
break;
}
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
}
HAPI int client_subscribe(struct client_node *client, const char *cluster, const char *category)
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);
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)
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)
int cnt;
if (!cb || !cluster || !category)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
cnt = 0;
EINA_LIST_FOREACH(s_info.client_list, l, client) {
continue;
if (cb(client, data) < 0)
- return -ECANCELED;
+ return LB_STATUS_ERROR_CANCEL;
cnt++;
}
}
packet_unref(packet);
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <dlog.h>
#include <com-core_packet.h>
#include <packet.h>
+#include <livebox-errno.h>
#include "client_life.h"
#include "instance.h"
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);
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)
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));
}
DbgPrint("End: Destroying command\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
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);
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)
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)
rpc = client_data(client, RPC_TAG);
if (!rpc) {
DbgPrint("Client has no RPC\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
return rpc->handle;
#include <ctype.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "conf.h"
#include "util.h"
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;
} while (c != EOF);
fclose(fp);
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <dlog.h>
#include <Eina.h>
+#include <livebox-errno.h>
#include "conf.h"
#include "debug.h"
struct timeval tv;
if (!s_info.fp)
- return -EIO;
+ return LB_STATUS_ERROR_IO;
if (gettimeofday(&tv, NULL) < 0) {
tv.tv_sec = 0;
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;
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);
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);
fclose(s_info.fp);
s_info.fp = NULL;
}
-
- return 0;
}
+/*
+ * 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>
#include <Eina.h>
#include <Ecore.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
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)
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)
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;
break;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
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;
}
if (offset == sizeof(input_event)) {
offset = 0;
if (processing_input_event(&input_event) < 0) {
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
break;
}
}
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)
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);
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);
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;
s_info.y = y;
DbgPrint("Event handler activated\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
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);
s_info.event_data.x = -1;
s_info.event_data.y = -1;
- return 0;
+ return LB_STATUS_SUCCESS;
}
HAPI int event_is_activated(void)
#include <Eina.h>
#include <packet.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
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);
* Update statistics
*/
s_info.fault_mark_count++;
- return 0;
+ return LB_STATUS_SUCCESS;
}
HAPI int fault_check_pkgs(struct slave_node *slave)
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);
DbgFree(info->filename);
DbgFree(info->pkgname);
DbgFree(info);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
info->timestamp = util_timestamp();
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)
return 0;
}
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
}
/* End of a file */
#include <dlog.h>
#include <Ecore_Evas.h>
#include <Evas.h>
+#include <livebox-errno.h>
#include "util.h"
#include "conf.h"
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)
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) {
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);
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) {
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)
*/
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
HAPI int fb_get_size(struct fb_info *info, int *w, int *h)
#include <dlog.h>
#include <Eina.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
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);
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)
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);
del_context_item(info);
DbgFree(info->pkgname);
DbgFree(info);
- return 0;
+ return LB_STATUS_SUCCESS;
}
HAPI struct cluster *group_create_cluster(const char *name)
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)
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)
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)
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} */
if (!cluster) {
ErrPrint("Failed to get cluster\n");
DbgFree(name);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
state = CATEGORY;
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;
if (!item) {
ErrPrint("Failed to create a context item\n");
DbgFree(name);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
state = CONTEXT_OPTION_KEY;
default:
ErrPrint("Invalid state\n");
DbgFree(name);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
DbgFree(name);
if (is_open != 0) {
ErrPrint("Invalid state\n");
DbgFree(name);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
cluster = group_find_cluster(name);
if (!cluster)
if (!cluster) {
ErrPrint("Failed to get cluster\n");
DbgFree(name);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
state = CATEGORY;
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)
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;
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) {
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;
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)
default:
ErrPrint("Invalid state (%s)\n", name);
DbgFree(name);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
DbgFree(name);
} 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;
} else if (*ptr == '}') {
if (is_open <= 0) {
ErrPrint("Invalid state\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
name = get_token(ptr, &len);
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);
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);
} 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)
}
if (state != CLUSTER)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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)
destroy_cluster(cluster);
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <packet.h>
#include <com-core_packet.h>
#include <livebox-service.h>
+#include <livebox-errno.h>
#include "conf.h"
#include "util.h"
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);
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);
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);
instance_freeze_updator(inst);
break;
default:
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
break;
}
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;
if (!client) {
client = inst->client;
if (!client)
- return 0;
+ return LB_STATUS_SUCCESS;
}
lb_type = package_lb_type(inst->info);
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);
{
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)
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);
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);
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);
{
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)
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);
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;
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))
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;
break;
}
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
}
static inline void destroy_instance(struct inst_info *inst)
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);
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)
}
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.
/*!
* \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);
/*!
* \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);
if (!inst) {
ErrPrint("Invalid instance handle\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
switch (inst->state) {
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;
}
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;
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);
inst->state = INST_INIT;
inst->requested_state = INST_INIT;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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) {
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;
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,
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) {
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;
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,
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;
}
* \todo
* Send pinup failed event to client.
*/
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
* \todo
* Send pinup failed event to client
*/
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
* \note
* send pinup failed event to client
*/
- ret = -ENOMEM;
+ ret = LB_STATUS_ERROR_MEMORY;
goto out;
}
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;
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);
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)
{
if (inst->visible == state) {
DbgPrint("Visibility has no changed\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
switch (state) {
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)
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;
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
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);
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);
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;
}
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 */
cbdata = malloc(sizeof(*cbdata));
if (!cbdata) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
cbdata->period = 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);
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);
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);
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",
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);
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);
if (!packet) {
DbgFree(cbdata->cluster);
DbgFree(cbdata->category);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
ErrPrint("Invalid packet\n");
DbgFree(cbdata->cluster);
DbgFree(cbdata->category);
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
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);
ErrPrint("Heap: %s\n", strerror(errno));
DbgFree(cbdata->cluster);
DbgFree(cbdata);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
cbdata->inst = instance_ref(inst);
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);
case INST_DESTROYED:
break;
default:
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
/*!
if (inst->changing_state) {
DbgPrint("Doesn't need to recover the state\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
switch (inst->state) {
break;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
switch (inst->state) {
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);
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);
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)) {
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);
{
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;
{
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)
#include <Eina.h>
#include <sqlite3.h>
#include <db-util.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "conf.h"
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) {
}
fclose(fp);
- return 0;
+ return LB_STATUS_SUCCESS;
}
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) {
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));
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)
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) {
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);
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));
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)
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;
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)
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)) {
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);
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;
}
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) {
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");
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 */
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;
}
if (cb(pkgid, prime, data) < 0) {
sqlite3_reset(stmt);
sqlite3_finalize(stmt);
- return -ECANCELED;
+ return LB_STATUS_ERROR_CANCEL;
}
}
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)
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;
}
if (!s_info.handle) {
ErrPrint("DB is not ready\n");
- return -EIO;
+ return LB_STATUS_ERROR_IO;
}
ret = build_provider_info(info);
if (ret < 0)
return ret;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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)
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 */
#include <Eina.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
return 0;
}
-HAPI int liveinfo_fini(void)
+HAPI void liveinfo_fini(void)
{
struct liveinfo *info;
unlink(info->fifo_name);
DbgFree(info);
}
-
- return 0;
}
static inline int valid_requestor(pid_t pid)
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)
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);
#include <Ecore_Evas.h>
#include <packet.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "util.h"
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);
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;
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);
ErrPrint("Heap: %s\n", strerror(errno));
DbgFree(info->lb.info.script.path);
parser_unload(parser);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
}
}
DbgFree(info->lb.info.script.group);
}
parser_unload(parser);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
str = parser_pd_group(parser);
DbgFree(info->lb.info.script.group);
}
parser_unload(parser);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
}
}
}
parser_unload(parser);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
str = parser_abi(parser);
DbgFree(info->lb.info.script.group);
}
parser_unload(parser);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
info->lb.timeout = parser_timeout(parser);
DbgFree(info->lb.info.script.group);
}
parser_unload(parser);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
info->secured = parser_secured(parser);
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)
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)
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)
fault = calloc(1, sizeof(*fault));
if (!fault) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
fault->timestamp = timestamp;
if (!fault->filename) {
ErrPrint("Heap: %s\n", strerror(errno));
DbgFree(fault);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
fault->function = strdup(function);
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);
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)
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)
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)
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)
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)
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)
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)
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)
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);
if (!s_pkgname) {
ErrPrint("Heap: %s\n", strerror(errno));
DbgFree(s_name);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
}
* 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)
}
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)
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);
if (info->is_uninstalled)
package_destroy(info);
- return 0;
+ return LB_STATUS_SUCCESS;
}
HAPI Eina_List *package_instance_list(struct pkg_info *info)
#include <dlog.h>
#include <livebox-service.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
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);
}
DbgFree(filename);
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline int parse_size(const char *buffer, unsigned int *size)
DbgFree(item->lb_path);
DbgFree(item->filename);
DbgFree(item);
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <dlog.h>
#include <package-manager.h>
+#include <livebox-errno.h>
#include <Ecore.h>
#include "util.h"
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;
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)
item = find_item(pkgname);
if (!item)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
if (item->icon)
DbgFree(item->icon);
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)
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)
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)
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)
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) {
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)
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) {
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)
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;
DbgFree(item->icon);
DbgFree(item->pkgname);
DbgFree(item);
- return 0;
+ return LB_STATUS_SUCCESS;
}
static struct pkgmgr_handler {
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)
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;
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)
item = calloc(1, sizeof(*item));
if (!item) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
item->cb = cb;
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)
#include <dlog.h>
#include <packet.h>
+#include <livebox-errno.h>
#include "slave_life.h"
#include "slave_rpc.h"
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)
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);
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);
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)),
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)
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);
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)
{
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)
fb_destroy(info->fb);
DbgFree(info);
- return 0;
+ return LB_STATUS_SUCCESS;
}
HAPI int script_handler_is_loaded(struct script_info *info)
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);
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)
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);
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)
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);
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)
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);
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)
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);
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)
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);
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);
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)
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)) {
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;
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)
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;
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;
if (!block) {
ErrPrint("Heap: %s\n", strerror(errno));
fclose(fp);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
state = FIELD;
}
fclose(fp);
- return 0;
+ return LB_STATUS_SUCCESS;
errout:
ErrPrint("Parse error at %d file %s\n", lineno, util_basename(descfile));
DbgFree(block);
}
fclose(fp);
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
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))) {
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);
ErrPrint("Heap: %s\n", strerror(errno));
DbgFree(path);
closedir(dir);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
DbgPrint("Open SCRIPT PORT: %s\n", path);
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");
}
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)
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;
else if (down == 1)
info->down = 1;
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <packet.h>
#include <com-core_packet.h>
+#include <livebox-errno.h>
#include "conf.h"
#include "debug.h"
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:
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);
}
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();
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) {
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);
}
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();
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", ×tamp) != 1) {
ErrPrint("Invalid arguemnt\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
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:
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;
}
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, ×tamp, &x, &y);
if (ret != 6) {
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)
- 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);
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;
}
*/
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);
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;
}
*/
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;
item = malloc(sizeof(*item));
if (!item) {
ErrPrint("Heap: %s\n", strerror(errno));
- ret = -ENOMEM;
+ ret = LB_STATUS_ERROR_MEMORY;
} else {
ret = 0;
/*!
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);
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;
}
*/
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);
}
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", ×tamp, &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;
}
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;
}
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;
* \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);
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;
}
*/
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);
}
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;
}
*/
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);
}
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;
}
*/
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);
}
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, ×tamp, &x, &y);
if (ret != 5) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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)
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;
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, ×tamp, &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;
}
* 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)
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;
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, ×tamp, &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;
}
* 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)
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:
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, ×tamp, &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;
}
* 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)
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;
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 5) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 5) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 5) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 5) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 5) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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", ×tamp);
if (ret != 1) {
ErrPrint("Invalid parameter\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
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", ×tamp);
if (ret != 1) {
ErrPrint("Invalid parameter\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
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, ×tamp, &x, &y);
if (ret != 7) {
ErrPrint("Invalid parameter\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 found\n", pkgname);
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 7) {
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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 7) {
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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 7) {
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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 7) {
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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 7) {
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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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, ×tamp, &x, &y);
if (ret != 7) {
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;
}
* 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;
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;
}
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;
}
*/
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;
}
ret = 0;
} else {
ErrPrint("Unsupported package\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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;
}
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;
}
*/
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);
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;
}
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,
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);
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;
}
*/
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);
}
} else {
ErrPrint("Invalid PD TYPE\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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;
}
*/
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)),
}
} else {
ErrPrint("Invalid PD TYPE\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
out:
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;
}
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;
}
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);
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;
}
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;
}
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);
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));
}
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;
}
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;
}
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);
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;
}
ret = packet_get(packet, "s", &slavename);
if (ret != 1) {
ErrPrint("Parameter is not matched\n");
- ret = -EINVAL;
goto out;
}
slave = slave_create(slavename, 1, abi, pkgname);
if (!slave) {
ErrPrint("Failed to create a new slave for %s\n", slavename);
- ret = -EFAULT;
goto out;
}
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;
}
}
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;
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;
}
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:
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;
}
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;
}
slave = slave_find_by_pid(pid);
if (!slave) {
ErrPrint("Slave %d is not exists\n", pid);
- ret = -ENOENT;
goto out;
}
&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;
* \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;
}
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;
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;
}
}
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;
if (!slave) {
ErrPrint("Failed to find a slave\n");
id = "";
- ret = -ENOENT;
+ ret = LB_STATUS_ERROR_NOT_EXIST;
goto out;
}
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;
}
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;
info = instance_lb_buffer(inst);
if (!info) {
ErrPrint("LB buffer is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
id = "";
goto out;
}
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);
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;
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);
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;
}
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;
}
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;
}
* 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
* 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);
}
}
}
* 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);
}
}
}
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;
ret = packet_get(packet, "ssd", &pkgname, &id, &period);
if (ret != 3) {
ErrPrint("Invalid packet\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
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;
} 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);
}
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;
}
if (packet_get(packet, "d", ×tamp) != 1) {
ErrPrint("Invalid packet\n");
fifo_name = "";
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
if (!info) {
ErrPrint("Failed to create a liveinfo object\n");
fifo_name = "";
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
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");
#include <bundle.h>
#include <packet.h>
+#include <livebox-errno.h>
#include "slave_life.h"
#include "slave_rpc.h"
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)
* 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);
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);
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);
*/
slave_ref(slave);
- return 0;
+ return LB_STATUS_SUCCESS;
}
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)
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)
slave->activate_timer = NULL;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline int invoke_deactivate_cb(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) {
/*!
ev = calloc(1, sizeof(*ev));
if (!ev) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
ev->slave = slave;
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)
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;
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;
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;
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;
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;
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)
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)
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)
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;
}
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;
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;
}
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;
#include <packet.h>
#include <com-core_packet.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "slave_life.h"
if (!command) {
ErrPrint("Packet is NIL\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
/*!
out:
destroy_command(command);
- return 0;
+ return LB_STATUS_SUCCESS;
}
static Eina_Bool command_consumer_cb(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) {
*/
rpc->ping_count = 0;
rpc->next_ping_count = 1;
- return 0;
+ return LB_STATUS_SUCCESS;
}
static Eina_Bool ping_timeout_cb(void *data)
ret_cb(slave, NULL, data);
packet_unref(packet);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
command->ret_cb = ret_cb;
if (ret_cb)
ret_cb(slave, NULL, data);
destroy_command(command);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
if (rpc->handle < 0) {
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);
else
rpc->pending_list = eina_list_append(rpc->pending_list, command);
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (urgent)
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)
if (!command) {
ErrPrint("Failed to create a command\n");
packet_unref(packet);
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
command->ret_cb = NULL;
if (!rpc) {
ErrPrint("Slave has no RPC\n");
destroy_command(command);
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
if (rpc->handle < 0) {
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;
}
else
rpc->pending_list = eina_list_append(rpc->pending_list, command);
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (urgent)
else
push_command(command);
- return 0;
+ return LB_STATUS_SUCCESS;
}
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;
push_command(command);
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
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);
rpc->next_ping_count = 1;
rpc->handle = -1;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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);
ecore_timer_del(rpc->pong_timer);
DbgFree(rpc);
- return 0;
+ return LB_STATUS_SUCCESS;
}
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++;
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)
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)
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)
#include <dlog.h>
#include <Eina.h>
#include <Ecore.h>
+#include <livebox-errno.h>
#include "util.h"
#include "debug.h"
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)
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)
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)
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)
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))) {
}
closedir(handle);
- return 0;
+ return LB_STATUS_SUCCESS;
}
/* End of a file */
#include <gio/gio.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "conf.h"
#include "debug.h"
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;
int pid;
if (!USE_XMONITOR)
- return 0;
+ return LB_STATUS_SUCCESS;
win = ecore_x_window_focus_get();
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);
DbgPrint("Client window has no focus now\n");
client_paused(client);
}
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (target_pid != pid) {
}
xmonitor_handle_state_changes();
- return 0;
+ return LB_STATUS_SUCCESS;
}
static Eina_Bool client_cb(void *data, int type, void *event)
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)
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)
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 =
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 =
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)
}
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)
item = malloc(sizeof(*item));
if (!item) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
item->cb = cb;
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)
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;
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)