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 #include <sys/types.h>
32 static void _print_help(const char *cmd)
34 fprintf(stderr, "Usage:\n");
35 fprintf(stderr, "\n");
36 fprintf(stderr, "[Add a desktop]\n");
37 fprintf(stderr, " %s add <PACKAGE NAME>\n", cmd);
38 fprintf(stderr, "\n");
39 fprintf(stderr, " Ex) %s add com.samsung.menu-screen\n", cmd);
40 fprintf(stderr, "\n");
41 fprintf(stderr, "[Update a desktop]\n");
42 fprintf(stderr, " %s update <PACKAGE NAME>\n", cmd);
43 fprintf(stderr, "\n");
44 fprintf(stderr, " Ex) %s update com.samsung.menu-screen\n", cmd);
45 fprintf(stderr, "\n");
46 fprintf(stderr, "[Remove a desktop]\n");
47 fprintf(stderr, " %s remove <PACKAGE NAME>\n", cmd);
48 fprintf(stderr, "\n");
49 fprintf(stderr, " Ex) %s remove com.samsung.menu-screen\n", cmd);
50 fprintf(stderr, "\n");
53 static ail_error_e _add_desktop(const char *package)
58 return AIL_ERROR_FAIL;
60 ret = ail_desktop_add(package);
61 if (ret != AIL_ERROR_OK)
62 return AIL_ERROR_FAIL;
67 static ail_error_e _update_desktop(const char *package)
72 return AIL_ERROR_FAIL;
74 ret = ail_desktop_update(package);
75 if (ret != AIL_ERROR_OK)
76 return AIL_ERROR_FAIL;
81 static ail_error_e _remove_desktop(const char *package)
86 return AIL_ERROR_FAIL;
88 ret = ail_desktop_remove(package);
89 if (ret != AIL_ERROR_OK)
90 return AIL_ERROR_FAIL;
95 int main(int argc, char **argv)
97 ail_error_e ret = AIL_ERROR_OK;
100 if (!strncmp(argv[1], "add", 3))
101 ret = _add_desktop(argv[2]);
102 else if (!strncmp(argv[1], "update", 6))
103 ret = _update_desktop(argv[2]);
104 else if (!strncmp(argv[1], "remove", 6))
105 ret = _remove_desktop(argv[2]);
107 fprintf(stderr, "%s is a invalid command\n", argv[1]);
109 _print_help(argv[0]);
113 if (ret != AIL_ERROR_OK)
114 fprintf(stderr, "There are some problems\n");