Fix sample codes for notification_set/get_led
[platform/core/api/notification.git] / include / notification_db.h
1 /*
2  * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
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 #ifndef __NOTIFICATION_DB_H__
18 #define __NOTIFICATION_DB_H__
19
20 #include <bundle.h>
21 #include <sqlite3.h>
22 #include <tzplatform_config.h>
23
24 #define DBPATH tzplatform_mkpath(TZ_SYS_DB, ".notification.db")
25 #define NOTIFICATION_QUERY_MAX 4096
26 #define NOTIFICATION_EMPTY_STR ""
27 #define NOTIFICATION_CHECK_STR(p) ((p) ? (p) : NOTIFICATION_EMPTY_STR)
28
29 sqlite3 *notification_db_open(const char *dbfile);
30 int notification_db_close(sqlite3 **db);
31 int notification_db_exec(sqlite3 *db, const char *query, int *num_changes);
32 char *notification_db_column_text(sqlite3_stmt *stmt, int col);
33 bundle *notification_db_column_bundle(sqlite3_stmt *stmt, int col);
34 int notification_db_init();
35
36 #endif /* __NOTIFICATION_DB_H__ */
37