Fix wrong rua_stat_init parameter
[platform/core/appfw/librua.git] / include / rua_internal.h
1 /*
2  * Copyright (c) 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 /**
18  * @file        rua.h
19  * @brief       RUA INTERNAL API declaration header file.
20  * @author      hyunho kang (hhstark.kang@samsung.com)
21  * @version     0.1
22  * @history     0.1: RUA INTERNAL API Declarations, structure declaration
23  */
24
25 #ifndef __RUA_INTERNAL_H__
26 #define __RUA_INTERNAL_H__
27
28 #include <sqlite3.h>
29 #include <bundle.h>
30 #include <time.h>
31 #include <dlog.h>
32
33 #include "rua.h"
34
35 #ifndef API
36 #define API __attribute__ ((visibility("default")))
37 #endif
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #ifdef LOG_TAG
44 #undef LOG_TAG
45 #endif
46
47 #define LOG_TAG "RUA"
48 #define RUA_DB_NAME     ".rua.db"
49 #define RUA_HISTORY     "rua_history"
50 #define QUERY_MAXLEN    4096
51 #define Q_LATEST \
52         "select pkg_name from rua_history " \
53         "order by launch_time desc limit 1 "
54
55 /**
56  * @brief       Delete history from DB
57  * @return      0 on success, otherwise a nagative error value
58  * @retval      0 on successful
59  * @retval      -1 on failed
60  */
61 API int rua_db_delete_history(bundle *b);
62
63 /**
64  * @brief       Add application to recently used application list
65  * @param[in]   rec  record to add history
66  * @return      0 on success, otherwise a nagative error value
67  * @retval      0 on successful
68  * @retval      -1 on failed
69  */
70 API int rua_db_add_history(struct rua_rec *rec);
71
72 #ifdef __cplusplus
73 }
74 #endif
75 #endif                          /*__RUA_INTERNAL_H__*/