Update source from tizen 2.3
[platform/core/base/rpm-installer.git] / frontend / inc / rpm-frontend.h
1 /*
2  * rpm-installer
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 __RPM_FRONTEND_H_
24 #define __RPM_FRONTEND_H_
25
26 #include <pkgmgr_installer.h>
27 #include <bundle.h>
28
29 #ifndef APP_DIR
30 #define APP_DIR "/usr"
31 #endif                          /* APP_DIR */
32
33 #ifndef LOCALE_PATH
34 #define LOCALE_PATH             APP_DIR"/share/locale"
35 #endif                          /* LOCALE_PATH */
36
37 #ifndef PACKAGE
38 #define PACKAGE "rpm-installer"
39 #endif                          /* PACKAGE */
40
41 #define RPM_INSTALLER_VERSION "20141016.1"
42
43 enum command {
44         INVALID_CMD = -1,
45         INSTALL_CMD = 1,
46         DELETE_CMD = 2,
47         UPDATE_CMD = 3,
48         RECOVER_CMD = 4,
49         CLEARDATA_CMD = 5,
50         MOVE_CMD = 6,
51         SMACK_CMD = 7,
52         EFLWGT_INSTALL_CMD = 8,
53         ENABLE_CMD = 9,
54         DISABLE_CMD = 10,
55         CORETPK_INSTALL_CMD = 11,
56         CORETPK_DIRECTORY_INSTALL_CMD = 12,
57         CORETPK_REINSTALL_CMD = 13,
58         RPM_CMD_MAX = 14,
59 };
60
61 struct ri_frontend_cmdline_arg_t {
62         int req_cmd;
63         char *pkgid;
64         char *keyid;
65         int move_type;
66         char *clientid;
67 };
68 typedef struct ri_frontend_cmdline_arg_t ri_frontend_cmdline_arg;
69
70 struct ri_frontend_data_t {
71         ri_frontend_cmdline_arg *args;
72         char *security_cookie;
73         char *error;
74 };
75 typedef struct ri_frontend_data_t ri_frontend_data;
76
77
78
79 int _ri_cmdline_destroy(ri_frontend_data *data);
80 int _ri_cmdline_process(ri_frontend_data *data);
81 int _ri_parse_hybrid(int argc, char **argv);
82 int _ri_parse_cmdline(int argc, char **argv, ri_frontend_cmdline_arg *data);
83 void _ri_stat_cb(const char *pkgid, const char *key, const char *val);
84
85 #endif                          /* __RPM_FRONTEND_H_ */