2 * ail_list.c is based on ail_filter.c
4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
26 #include "ail_private.h"
28 ail_cb_ret_e appinfo_list_appid_namefunc(const ail_appinfo_h appinfo, void *user_data, uid_t uid)
30 char *package_str_name = NULL;
31 char *package_str_appid = NULL;
32 char *package_str_x_slp_exe = NULL;
34 ail_appinfo_get_str(appinfo, AIL_PROP_X_SLP_APPID_STR, &package_str_appid);
35 ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &package_str_name);
36 ail_appinfo_get_str(appinfo, AIL_PROP_X_SLP_EXE_PATH, &package_str_x_slp_exe);
38 printf("'%s' '%s' '%s'\n", package_str_appid, package_str_name, package_str_x_slp_exe);
40 free(package_str_appid);
41 free(package_str_name);
42 free(package_str_x_slp_exe);
44 return AIL_CB_RET_CONTINUE;
47 int main(int argc, char *argv[])
50 printf("Please use it as non root user\n");
54 printf("Application List for user %lu\n", (long)getuid());
55 printf("User's Application \n");
56 printf("APPID NAME EXEPATH \n");
58 ail_filter_list_usr_appinfo_foreach(NULL, appinfo_list_appid_namefunc, NULL, getuid());
60 printf("Global's / Common Applications \n");
61 printf("APPID NAME EXEPATH \n");
63 ail_filter_list_appinfo_foreach(NULL, appinfo_list_appid_namefunc, NULL);
65 printf("=================================================\n");