Merge "Adding Mime types parsing" into tizen_2.1
[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 /**
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  * @return      0 if success, error code(<0) if fail
59  * @pre         None
60  * @post                None
61  * @see         pkgmgr_parser_update_manifest_info_in_db()
62  * @see         pkgmgr_parser_delete_manifest_info_from_db()
63  * @code
64 static int insert_manifest_data(manifest_x *mfx)
65 {
66         int ret = 0;
67         ret = pkgmgr_parser_insert_manifest_info_in_db(mfx);
68         if (ret < 0)
69                 return -1;
70         return 0;
71 }
72  * @endcode
73  */
74 int pkgmgr_parser_insert_manifest_info_in_db(manifest_x *mfx);
75
76 /**
77  * @fn int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx)
78  * @brief       This API updates the manifest info in db
79  *
80  * @par         This API is for package-manager installer backends
81  * @par Sync (or) Async : Synchronous API
82  *
83  * @param[in]   mfx     pointer to manifest info
84  * @return      0 if success, error code(<0) if fail
85  * @pre         None
86  * @post                None
87  * @see         pkgmgr_parser_insert_manifest_info_in_db()
88  * @see         pkgmgr_parser_delete_manifest_info_from_db()
89  * @code
90 static int update_manifest_data(manifest_x *mfx)
91 {
92         int ret = 0;
93         ret = pkgmgr_parser_update_manifest_info_in_db(mfx);
94         if (ret < 0)
95                 return -1;
96         return 0;
97 }
98  * @endcode
99  */
100 int pkgmgr_parser_update_manifest_info_in_db(manifest_x *mfx);
101
102 /**
103  * @fn int pkgmgr_parser_delete_manifest_info_from_db(manifest_x *mfx)
104  * @brief       This API deletes the parsed manifest info from db
105  *
106  * @par         This API is for package-manager installer backends
107  * @par Sync (or) Async : Synchronous API
108  *
109  * @param[in]   mfx     pointer to manifest info
110  * @return      0 if success, error code(<0) if fail
111  * @pre         None
112  * @post                None
113  * @see         pkgmgr_parser_update_manifest_info_in_db()
114  * @see         pkgmgr_parser_insert_manifest_info_in_db()
115  * @code
116 static int delete_manifest_data(manifest_x *mfx)
117 {
118         int ret = 0;
119         ret = pkgmgr_parser_delete_manifest_info_from_db(mfx);
120         if (ret < 0)
121                 return -1;
122         return 0;
123 }
124  * @endcode
125  */
126 int pkgmgr_parser_delete_manifest_info_from_db(manifest_x *mfx);
127
128 int pkgmgr_parser_check_and_create_db();
129 int pkgmgr_parser_initialize_db();
130 /** @} */
131 #ifdef __cplusplus
132 }
133 #endif
134 #endif                          /* __PKGMGR_PARSER_DB_H__ */
135 /**
136  * @}
137  * @}
138  */