5ae2bd97a30ede49d7fa33d900a0773098ad1c09
[platform/core/appfw/slp-pkgmgr.git] / server / include / pkgmgr-server.h
1 /*
2  * slp-pkgmgr
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef _PKGMGR_SERVER_H_
24 #define _PKGMGR_SERVER_H_
25
26 #ifdef LOG_TAG
27 #undef LOG_TAG
28 #endif /* LOG_TAG */
29 #define LOG_TAG "PKGMGR_SERVER"
30 #include "package-manager-debug.h"
31
32 #define CONF_FILE "/etc/package-manager/server/.config"
33 #define DESKTOP_FILE_DIRS "/usr/share/install-info/desktop.conf"
34
35 #define PKG_BACKEND "backend:"
36 #define PKG_CONF_PATH "/etc/package-manager/pkg_path.conf"
37
38 #define MAX_REQ_ID_LEN 256
39 #define MAX_PKG_TYPE_LEN 128
40 #define MAX_PKG_NAME_LEN 256
41 #define MAX_PKG_ARGS_LEN 4096
42 #define DESKTOP_FILE_DIRS_NUM 1024
43
44 typedef struct {
45         char req_id[MAX_REQ_ID_LEN];
46         int req_type;
47         uid_t uid;
48         char pkg_type[MAX_PKG_TYPE_LEN];
49         char pkgid[MAX_PKG_NAME_LEN];
50         char args[MAX_PKG_ARGS_LEN];
51 } pm_dbus_msg;
52
53 typedef struct backend_info_t {
54         int pid;
55         uid_t uid;
56         char pkgtype[MAX_PKG_TYPE_LEN];
57         char pkgid[MAX_PKG_NAME_LEN];
58         char args[MAX_PKG_ARGS_LEN];
59 } backend_info;
60
61 struct pm_inotify_paths_t {
62         int wd;
63         char *path;
64 };
65 typedef struct pm_inotify_paths_t pm_inotify_paths;
66
67 char *_get_backend_cmd(char *type);
68 void _pm_desktop_file_monitor_init();
69 void _pm_desktop_file_monitor_fini();
70 int _pm_desktop_file_dir_search(pm_inotify_paths *paths, int number);
71
72 #endif/*  _PKGMGR_SERVER_H_ */