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.
25 #include <sys/types.h>
31 #define TMP_FILE "/tmp/.testpkg"
36 static bundle *create_internal_bundle(int start)
44 for (i = start; i < gargc - 1; i++) {
45 if ((i + 1) > gargc - 1)
46 bundle_add(kb, gargv[i], " ");
49 strncpy(arg, gargv[i + 1], 1024);
50 val_array[0] = strtok(arg,",");
51 while(val_array[j] = strtok(NULL,","))
56 bundle_add(kb, gargv[i], gargv[i + 1]);
58 bundle_add_str_array(kb, gargv[i], val_array, j);
72 kb = create_internal_bundle(2);
74 printf("bundle creation fail\n");
78 pid = aul_launch_app(gargv[1], kb);
84 /* Write the package name to TMP_FILE*/
85 fp = fopen(TMP_FILE, "w");
88 ret = fprintf(fp, "%d", pid);
96 void print_usage(char *progname)
98 printf("[usage] %s <pkgname> <key1> <val1> <key2> <val2> ...\n",
102 static Eina_Bool run_func(void *data)
105 printf("... successfully launched\n");
107 printf("... launch failed\n");
110 ecore_main_loop_quit();
115 int main(int argc, char **argv)
118 /* Checking the User ID*/
119 if (getuid() != ROOT_UID) {
120 fprintf(stderr, "permission error\n");
125 print_usage(argv[0]);
134 aul_launch_init(NULL, NULL);
136 ecore_idler_add(run_func, NULL);
138 ecore_main_loop_begin();