remove 'preload_list.txt' which is not manageable.
[platform/core/appfw/pkgmgr-info.git] / parser / pkgmgr_parser_db.h
1 /*
2  * pkgmgr-info
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
24 /**
25  * @file                pkgmgr_parser_db.h
26  * @author      Shobhit Srivastava <shobhit.s@samsung.com>
27  * @version     0.1
28  * @brief               This file declares API to store/retrieve manifest data in DB
29  *
30  * @addtogroup APPLICATION_FRAMEWORK
31  * @{
32  *
33   * @defgroup   PackageManagerParserDB
34  * @section     Header Header file to include:
35  * @code
36  * #include <pkgmgr_parser_db.h>
37  * @endcode
38  *
39  * @}
40  */
41
42 #ifndef __PKGMGR_PARSER_DB_H__
43 #define __PKGMGR_PARSER_DB_H__
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 #include "pkgmgr_parser.h"
49 /**
50  * @fn int pkgmgr_parser_insert_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid)
51  * @fn int pkgmgr_parser_insert_manifest_info_in_db(manifest_x *mfx)
52  * @brief       This API inserts the parsed manifest info in db
53  *
54  * @par         This API is for package-manager installer backends
55  * @par Sync (or) Async : Synchronous API
56  *
57  * @param[in]   mfx     pointer to manifest info
58  * @param[in]   uid     the addressee user id of the instruction
59  * @return      0 if success, error code(<0) if fail
60  * @pre         None
61  * @post                None
62  * @see         pkgmgr_parser_update_manifest_info_in_db()
63  * @see         pkgmgr_parser_delete_manifest_info_from_db()
64  * @code
65 static int insert_manifest_data(manifest_x *mfx)
66 {
67         int ret = 0;
68         ret = pkgmgr_parser_insert_manifest_info_in_db(mfx);
69         if (ret < 0)
70                 return -1;
71         return 0;
72 }
73  * @endcode
74  */
75 int pkgmgr_parser_insert_manifest_info_in_db(manifest_x *mfx);
76 int pkgmgr_parser_insert_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid);
77
78 /**
79  * @fn int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx)
80  * @fn int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx)
81  * @brief       This API updates the manifest info in db
82  *
83  * @par         This API is for package-manager installer backends
84  * @par Sync (or) Async : Synchronous API
85  *
86  * @param[in]   mfx     pointer to manifest info
87  * @param[in]   uid     the addressee user id of the instruction
88  * @return      0 if success, error code(<0) if fail
89  * @pre         None
90  * @post                None
91  * @see         pkgmgr_parser_insert_manifest_info_in_db()
92  * @see         pkgmgr_parser_delete_manifest_info_from_db()
93  * @code
94 static int update_manifest_data(manifest_x *mfx)
95 {
96         int ret = 0;
97         ret = pkgmgr_parser_update_manifest_info_in_db(mfx);
98         if (ret < 0)
99                 return -1;
100         return 0;
101 }
102  * @endcode
103  */
104 int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx);
105 int pkgmgr_parser_update_manifest_info_in_usr_db(manifest_x *mfx, uid_t uid);
106
107 /**
108  * @fn int pkgmgr_parser_update_tep_info_in_db(const char * pkgid, const char * tep_path)
109  * @fn int pkgmgr_parser_update_tep_info_in_usr_db(const char * pkgid, const char * tep_path,uid_t uid)
110  * @brief       This API updates the tep info in db
111  *
112  * @par         This API is for package-manager installer backends
113  * @par Sync (or) Async : Synchronous API
114  *
115  * @param[in]   pkgid   pointer to pkgid
116  * @param[in]   tep_path        path of tep file
117  * @return      0 if success, error code(<0) if fail
118  * @pre         None
119  * @post                None
120  * @code
121 static int update_tep_data(const char *pkgid, *tep_path)
122 {
123         int ret = 0;
124         ret = pkgmgr_parser_update_tep_info_in_db(pkgid, tep_path);
125         if (ret < 0)
126                 return -1;
127         return 0;
128 }
129  * @endcode
130  */
131 int pkgmgr_parser_update_tep_info_in_db(const char *pkgid, const char *tep_path);
132 int pkgmgr_parser_update_tep_info_in_usr_db(const char *pkgid, const char *tep_path, uid_t uid);
133
134 /**
135  * @fn int pkgmgr_parser_delete_manifest_info_from_usr_db(manifest_x *mfx, uid_t uid)
136  * @fn int pkgmgr_parser_delete_manifest_info_from_db(manifest_x *mfx)
137  * @brief       This API deletes the parsed manifest info from db
138  *
139  * @par         This API is for package-manager installer backends
140  * @par Sync (or) Async : Synchronous API
141  *
142  * @param[in]   mfx     pointer to manifest info
143  * @param[in]   uid     the addressee user id of the instruction
144  * @return      0 if success, error code(<0) if fail
145  * @pre         None
146  * @post                None
147  * @see         pkgmgr_parser_update_manifest_info_in_db()
148  * @see         pkgmgr_parser_insert_manifest_info_in_db()
149  * @code
150 static int delete_manifest_data(manifest_x *mfx)
151 {
152         int ret = 0;
153         ret = pkgmgr_parser_delete_manifest_info_from_db(mfx);
154         if (ret < 0)
155                 return -1;
156         return 0;
157 }
158  * @endcode
159  */
160 int pkgmgr_parser_delete_manifest_info_from_db(manifest_x *mfx);
161 int pkgmgr_parser_delete_manifest_info_from_usr_db(manifest_x *mfx, uid_t uid);
162
163 int pkgmgr_parser_update_preload_info_in_db();
164 int pkgmgr_parser_update_preload_info_in_usr_db(uid_t uid);
165
166 int pkgmgr_parser_create_and_initialize_db(uid_t uid);
167
168
169 /** @} */
170 #ifdef __cplusplus
171 }
172 #endif
173 #endif                          /* __PKGMGR_PARSER_DB_H__ */
174 /**
175  * @}
176  * @}
177  */