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.
27 /* ecore-glib integration */
31 extern int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
35 /* call real create callback*/
40 /* call real resume callback*/
42 printf("=================================\n");
43 printf("resumed - %d\n", times++);
44 printf("=================================\n");
47 static Eina_Bool send_result(void *data)
53 aul_create_result_bundle(kb, &res_b);
57 aul_send_service_result(res_b);
65 static void prt_bundle(const char *key, const char *value, void *d)
67 printf("bundle - key: %s, value: %s\n", key, value);
70 int do_start(void *data)
79 printf("=================================\n");
80 printf("start callback with glib - %d\n", times++);
81 printf("=================================\n");
83 tmp = bundle_get_val(kb, AUL_K_STARTTIME);
85 sscanf(tmp, "%ld/%ld", &tv.tv_sec, &tv.tv_usec);
86 gettimeofday(&cur, NULL);
87 timersub(&cur, &tv, &res);
88 printf("=================================\n");
89 printf("launched time = %ld sec %ld msec\n", res.tv_sec,
91 printf("=================================\n");
93 bundle_del(kb, AUL_K_STARTTIME);
95 bundle_iterate(kb, prt_bundle, NULL);
97 ecore_timer_add(5, send_result, bundle_dup(kb));
102 static int aul_handler(aul_type type, bundle *kb, void *data)
122 int app_dead_handler(int pid, void *data)
124 printf("===> %s : %d\n", __FUNCTION__, pid);
128 int app_launch_handler(int pid, void *data)
130 printf("===> %s : %d\n", __FUNCTION__, pid);
134 __attribute__ ((visibility("default")))
135 int main(int argc, char **argv)
141 if (aul_launch_init(aul_handler, NULL) < 0)
142 printf("error aul_init\n");
143 if (aul_launch_argv_handler(argc, argv) < 0)
144 printf("error argv\n");
146 aul_listen_app_dead_signal(app_dead_handler, NULL);
148 aul_listen_app_launch_signal(app_launch_handler, NULL);
151 printf("child test\n");
155 ecore_main_loop_begin();
159 /* vi: set ts=8 sts=8 sw=8: */
163 /* vi: set ts=8 sts=8 sw=8: */