2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
32 char *pkgname; /*!< Slave package name */
41 HAPI int abi_add_entry(const char *abi, const char *pkgname)
45 item = malloc(sizeof(*item));
47 ErrPrint("Failed to add a new entry for abi[%s - %s]\n", abi, pkgname);
51 item->abi = strdup(abi);
53 ErrPrint("Heap: %s\n", strerror(errno));
58 item->pkgname = strdup(pkgname);
60 ErrPrint("Heap: %s\n", strerror(errno));
66 s_abi.list = eina_list_append(s_abi.list, item);
70 HAPI int abi_update_entry(const char *abi, const char *pkgname)
77 _pkgname = strdup(pkgname);
79 ErrPrint("Heap: %s\n", strerror(errno));
83 EINA_LIST_FOREACH_SAFE(s_abi.list, l, n, item) {
84 if (!strcasecmp(item->abi, abi)) {
85 DbgFree(item->pkgname);
86 item->pkgname = _pkgname;
95 HAPI int abi_del_entry(const char *abi)
101 EINA_LIST_FOREACH_SAFE(s_abi.list, l, n, item) {
102 if (!strcasecmp(item->abi, abi)) {
103 s_abi.list = eina_list_remove(s_abi.list, item);
105 DbgFree(item->pkgname);
114 HAPI int abi_del_all(void)
118 EINA_LIST_FREE(s_abi.list, item) {
120 DbgFree(item->pkgname);
127 HAPI const char *abi_find_slave(const char *abi)
132 EINA_LIST_FOREACH(s_abi.list, l, item) {
133 if (!strcasecmp(item->abi, abi))
134 return item->pkgname;
140 HAPI const char *abi_find_by_pkgname(const char *pkgname)
145 EINA_LIST_FOREACH(s_abi.list, l, item) {
146 if (!strcmp(item->pkgname, pkgname))