4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
26 #include "simple_util.h"
28 GSList *app_status_info_list = NULL;
30 int _add_app_status_info_list(char *appid, int pid)
33 app_status_info_t *info_t = NULL;
35 for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
37 info_t = (app_status_info_t *)iter->data;
38 if(pid == info_t->pid) {
43 info_t = malloc(sizeof(app_status_info_t));
44 strncpy(info_t->appid, appid, MAX_PACKAGE_STR_SIZE-1);
45 info_t->status = STATUS_LAUNCHING;
47 app_status_info_list = g_slist_append(app_status_info_list, info_t);
49 for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
51 info_t = (app_status_info_t *)iter->data;
53 _D("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);
59 int _update_app_status_info_list(int pid, int status)
62 app_status_info_t *info_t = NULL;
64 for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
66 info_t = (app_status_info_t *)iter->data;
67 if(pid == info_t->pid) {
68 info_t->status = status;
73 for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
75 info_t = (app_status_info_t *)iter->data;
77 _D("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);
83 int _remove_app_status_info_list(int pid)
86 app_status_info_t *info_t = NULL;
88 for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
90 info_t = (app_status_info_t *)iter->data;
91 if(pid == info_t->pid) {
92 app_status_info_list = g_slist_remove(app_status_info_list, info_t);
98 for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
100 info_t = (app_status_info_t *)iter->data;
102 _D("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);