Fixed 64 bit type format
[platform/core/connectivity/stc-manager.git] / src / database / include / db-internal.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * This file declares methods and variables which will be used by
19  * stc-db module internally.
20  *
21  * @file        db-internal.h
22  */
23
24 #ifndef __STC_DB_INTERNAL_H__
25 #define __STC_DB_INTERNAL_H__
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 /*****************************************************************************
32  * Macros and Typedefs
33  *****************************************************************************/
34
35 #define DB_ACTION(command) do { \
36         if ((command) != SQLITE_OK) { \
37                 error_code = STC_ERROR_DB_FAILED; \
38                 __STC_LOG_FUNC_EXIT__; \
39                 goto handle_error; \
40         } \
41 } while (0)
42
43 /*****************************************************************************
44  * Enumerations and Structures
45  *****************************************************************************/
46
47 void stc_db_finalize_statistics(void);
48
49 stc_error_e stc_db_initialize_once(void);
50 sqlite3 *stc_db_get_database(void);
51
52 #ifdef __cplusplus
53 }
54 #endif /* __cplusplus */
55
56 #endif /* _STC_DB_INTERNAL_H_ */