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>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
27 #ifndef NATIVEINSTALLER_H_
28 #define NATIVEINSTALLER_H_
32 #endif /* __cplusplus */
34 #include "native_installer_util.h"
37 #define PM_LIKELY(expr) __builtin_expect((expr), 1)
38 #define PM_UNLIKELY(expr) __builtin_expect((expr), 0)
40 /* backend state to be used for recovery */
43 GOT_PACKAGE_INFO_SUCCESSFULLY,
44 DPKG_REQUEST_COMPLETED,
50 char package_name[128]; /* 32: linux username limit */
51 char version[11]; /* ###.###.### */
54 typedef struct pkginfo_st pkginfo;
58 * @in :pPkgFilePath : Package file path
59 * @in :bForceInstall: Whether we need to forceful overwrite.
60 * If package already installed then reinstall the application
61 * @in :installOptions: install options
63 int _pkgmgr_package_install(char *ppkgfilepath, bool bforceinstall,
64 char *installoptions);
67 * get the package information for the requested installed application
68 * return the package information
69 * @in :pkgName : package name for which information is requested
71 pkginfo *_pkgmgr_get_installed_pkg_info(char *pkgname);
74 * Uninstall the Application
75 * @in :pkgName : application name to be uninstalled
77 int _pkgmgr_package_uninstall(char *pkgname);
79 pkginfo *_pkgmgr_get_pkg_info(char *pkgfilepath, int *errno,
80 bool *alreayinstalled);
82 /* Dbus related prototype */
83 int _broadcast_status_notification(char *pkgname, char *key, char *val);
85 /* DPKG operations prototype */
86 int _pkgmgr_dpkg_uninstall_pkg(char *pkgname);
87 int _pkgmgr_dpkg_install_pkg(char *pkgfilepath, char *installoptions);
88 int _pkgmgr_dpkg_upgrade_pkg(char *pkgfilepath, char *installoptions);
89 int _pkgmgr_clear_private_data(char *pkgname);
90 int _set_backend_state(int state);
91 int _get_backend_state();
92 int _get_backend_state_info();
93 int _set_backend_state_info(int state);
94 int _get_last_input_info(char **pkgname, int *preqcommand, int *poptions);
95 void _save_last_input_info(char *pkgname, int reqcommand, int options);
96 /* For third party apps*/
97 int _set_event_notification(int value);
98 int _unset_event_notification();
99 pkginfo *_pkgmgr_txt_parser_read_manifest(char *manifestfile);
100 void stat_cb(const char *pkg_name, const char *key, const char *val);
104 #endif /* __cplusplus */
106 #endif /* NATIVEINSTALLER_H_ */