2 * Copyright (c) 2000 - 2017 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.
21 #include <bundle_internal.h>
22 #include "syspopup_caller.h"
24 static int __foreach_cb(const char *popup_name, const char *appid,
27 printf("system popup name [%s] appid [%s]\n", popup_name, appid);
31 static void usage(void)
33 printf("[usage] sp_test launch/destroy/foreach popup_name..."
34 "(key1,val1,key2,val2,...)\n");
37 int main(int argc, char **argv)
48 if (strcmp(argv[1], "launch") == 0) {
49 if ((argc < 3) || (argc % 2 == 0)) {
55 for (i = 3; i < argc; i = i + 2)
56 bundle_add(b, argv[i], argv[i + 1]);
57 ret = syspopup_launch(argv[2], b);
62 } else if (strcmp(argv[1], "destroy") == 0) {
63 ret = syspopup_destroy_all();
66 } else if (strcmp(argv[1], "foreach") == 0) {
67 ret = syspopup_foreach_info(__foreach_cb, NULL);