Fix coding style according to tizen rule
[platform/core/security/drm-service-core-tizen.git] / tappsd / inc / DTapps2SqliteDB.h
1 /*
2  * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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  * @file    DTapps2SqliteDB.h
18  * @brief   DataBase.
19  */
20 #ifndef __DTAPPS_SQLITE_DB_H__
21 #define __DTAPPS_SQLITE_DB_H__
22
23 #include "TADC_Core.h"
24 #include "drm_intf_tapps.h"
25
26 #define DTAPPS_SQL_FREE_TABLE sqlite3_free_table
27
28 typedef struct _tagTAPPSSqliteSelectTable {
29         sqlite3 *handle;
30         char **result;
31         int n_rows;
32         int n_cols;
33 } TAPPSSqliteSelectTable;
34
35 /* Declarations for DB Wrappers */
36 BOOL DTappsDBOpen(void *&pDb, const char *CallingFun);
37 BOOL DTappsDBGet(void *&pDBConnection);
38 BOOL DTappsDBClose(const char *CallingFun);
39 BOOL DTappsDBBeginImmedTrans(const char *CallingFun);
40 BOOL DTappsDBCommit(const char *CallingFun);
41 BOOL DTappsDBRollback(const char *CallingFun);
42 BOOL DTappsExecuteSQL(void *pDB, const char *query);
43 BOOL DTappsSQLGetTable(void *pDB, const char *query,
44                                            TAPPSSqliteSelectTable *select_table);
45 char *DTappsGetSQLCreateTable(const char *tableName);
46 void *DTappsStmtPrepare(void *pDB, const char *query);
47 int DTappsStmtBindParam(
48         void *pStmt,
49         unsigned int dIdx,
50         unsigned int Type,
51         void *pParam,
52         unsigned int dParamSize);
53 int DTappsStmtExecute(void *pStmt);
54 int DTappsStmtRelease(void *pStmt);
55 BOOL DTapps_DB_Install(const char *sql_query);
56 BOOL DTapps_Read_DB(const char *sql_query,
57                                         TAPPSSqliteSelectTable *select_table);
58
59 #endif /*__DTAPPS_SQLITE_DB_H__ */