struct category_subscribe_item *item;
Eina_List *l;
+ if (!category) {
+ ErrPrint("category: %p\n", category);
+ return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ }
+
EINA_LIST_FOREACH(client->category_subscribe_list, l, item) {
+ DbgPrint("item[%p], item->category[%p], category[%p]\n", item, item->category, category);
if (!strcasecmp(item->category, category)) {
DbgPrint("[%s] is already subscribed\n");
return DBOX_STATUS_ERROR_ALREADY;
return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
}
+ DbgPrint("Subscribe category[%s]\n", item->category);
client->category_subscribe_list = eina_list_append(client->category_subscribe_list, item);
return DBOX_STATUS_ERROR_NONE;
}
Eina_List *l;
Eina_List *n;
+ if (!category) {
+ ErrPrint("category: %p\n", category);
+ return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ }
+
EINA_LIST_FOREACH_SAFE(client->category_subscribe_list, l, n, item) {
if (!strcasecmp(category, item->category)) {
client->category_subscribe_list = eina_list_remove(client->category_subscribe_list, item);
struct category_subscribe_item *item;
Eina_List *l;
+ if (!category) {
+ DbgPrint("category[%p]\n", category);
+ return 0;
+ }
+
EINA_LIST_FOREACH(client->category_subscribe_list, l, item) {
+ DbgPrint("item[%p], item->cateogyr[%p], category[%p]\n", item, item->category, category);
if (!strcasecmp(item->category, category)) {
return 1;
}
{
struct subscribe_item *item;
+ if (!cluster || !category) {
+ ErrPrint("Cluster[%p] Category[%p]\n", cluster, category);
+ return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ }
+
item = malloc(sizeof(*item));
if (!item) {
ErrPrint("Heap: %s\n", strerror(errno));
Eina_List *l;
Eina_List *n;
+ if (!cluster || !category) {
+ ErrPrint("cluster: %p, category: %p\n", cluster, category);
+ return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ }
+
EINA_LIST_FOREACH_SAFE(client->subscribe_list, l, n, item) {
if (!strcasecmp(cluster, item->cluster) && !strcasecmp(category, item->category)) {
client->subscribe_list = eina_list_remove(client->subscribe_list, item);
struct subscribe_item *item;
Eina_List *l;
+ if (!cluster || !category) {
+ ErrPrint("cluster: %p, category: %p\n", cluster, category);
+ return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ }
+
EINA_LIST_FOREACH(client->subscribe_list, l, item) {
if (!strcmp(item->cluster, "*")) {
return 1;
EINA_LIST_FOREACH(s_info.pkg_list, l, info) {
EINA_LIST_FOREACH(info->inst_list, i_l, inst) {
if (instance_client(inst) == client) {
+ DbgPrint("Skip owner\n");
continue;
}
if (!client_is_subscribed_group(client, instance_cluster(inst), instance_category(inst))
&& !client_is_subscribed_by_category(client, package_category(instance_package(inst))))
{
+ DbgPrint("Not subscribed [%s]\n", package_category(instance_package(inst)));
continue;
}
/* Will be send a created event after the instance gets created event */
switch (alter) {
case ALTER_CREATE:
+ DbgPrint("ALTER_CREATE\n");
if (!instance_has_client(inst, client)) {
instance_add_client(inst, client);
}
break;
case ALTER_DESTROY:
+ DbgPrint("ALTER_DESTROY\n");
if (instance_has_client(inst, client)) {
instance_del_client(inst, client);
}
*/
switch (alter) {
case ALTER_CREATE:
+ DbgPrint("ALTER_CREATE\n");
if (!instance_has_client(inst, client)) {
instance_unicast_created_event(inst, client);
instance_add_client(inst, client);
}
break;
case ALTER_DESTROY:
+ DbgPrint("ALTER_DESTROY\n");
if (instance_has_client(inst, client)) {
instance_unicast_deleted_event(inst, client, DBOX_STATUS_ERROR_NONE);
instance_del_client(inst, client);
break;
default:
- DbgPrint("%s(%s) is not activated (%d)\n",
- package_name(info), instance_id(inst), instance_state(inst));
+ DbgPrint("%s(%s) is not activated (%d)\n", package_name(info), instance_id(inst), instance_state(inst));
break;
}
}