2032a12bb0ccc814a71dbc6795eb75af70c08235
[framework/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 enum command {
30         INVALID_CMD = -1,
31         INSTALL_CMD = 1,
32         DELETE_CMD = 2,
33         UPDATE_CMD = 3,
34         RECOVER_CMD = 4,
35         CLEARDATA_CMD = 5,
36         MOVE_CMD = 6,
37         SMACK_CMD = 7,
38         EFLWGT_INSTALL_CMD = 8,
39         CORETPK_INSTALL_CMD = 11,
40         CORETPK_DIRECTORY_INSTALL_CMD = 12,
41         CORETPK_REINSTALL_CMD = 13,
42         CORETPK_CSC_CMD = 14,
43         CORETPK_WATCH_INSTALL_CMD = 15,
44 #ifdef _APPFW_FEATURE_EXPANSION_PKG_INSTALL
45         INSTALL_TEP_CMD = 16,
46 #endif
47 #ifdef _APPFW_FEATURE_DELTA_UPDATE
48         CORETPK_DELTA_INSTALL_CMD = 17,
49 #endif
50 #ifdef _APPFW_FEATURE_MOUNT_INSTALL
51         CORETPK_MOUNT_INSTALL_CMD = 18,
52 #endif
53         RPM_CMD_MAX = 99,
54 };
55
56 struct ri_frontend_cmdline_arg_t {
57         int req_cmd;
58         char *pkgid;
59         char *keyid;
60 #ifdef _APPFW_FEATURE_EXPANSION_PKG_INSTALL
61         char *tep_path;
62         int tep_move;
63 #endif
64         int move_type;
65         char *clientid;
66 #ifdef _APPFW_FEATURE_SUPPORT_DEBUGMODE_FOR_SDK
67         bool debug_mode;
68 #endif
69         char *optional_data;
70         char *pkg_chksum;
71 };
72 typedef struct ri_frontend_cmdline_arg_t ri_frontend_cmdline_arg;
73
74 struct ri_frontend_data_t {
75         ri_frontend_cmdline_arg *args;
76         char *security_cookie;
77         char *error;
78 };
79 typedef struct ri_frontend_data_t ri_frontend_data;
80
81
82
83 int _ri_cmdline_destroy(ri_frontend_data *data);
84 int _ri_cmdline_process(ri_frontend_data *data);
85 int _ri_parse_command_arg(int argc, char **argv);
86 int _ri_parse_cmdline(int argc, char **argv, ri_frontend_cmdline_arg *data);
87 void _ri_stat_cb(const char *pkgid, const char *key, const char *val);
88
89 #endif                          /* __RPM_FRONTEND_H_ */