Fixed 64 bit type format
[platform/core/connectivity/stc-manager.git] / src / database / include / table-counters.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 #ifndef __TABLE_COUNTERS_H__
18 #define __TABLE_COUNTERS_H__
19
20 typedef struct {
21         long long int restriction_id;
22         long long int data_counter;
23         long long int warn_counter;
24         long long int monthly_counter;
25         long long int weekly_counter;
26         long long int daily_counter;
27         int32_t month_start_date;
28         long long int month_start_ts;
29         long long int week_start_ts;
30         long long int day_start_ts;
31 } table_counters_info;
32
33 typedef stc_cb_ret_e(*table_counters_info_cb)(const table_counters_info *info,
34                                               void *user_data);
35
36 stc_error_e table_counters_get(long long int restriction_id,
37                                table_counters_info *info);
38
39 stc_error_e table_counters_update_counters(const table_counters_info *info);
40
41 stc_error_e table_counters_get_timestamps(long long int restriction_id,
42                                         table_counters_info *info);
43
44 stc_error_e table_counters_update_timestamps(const table_counters_info *info);
45
46 stc_error_e table_counters_delete(long long int restriction_id);
47
48 stc_error_e table_counters_prepare(sqlite3 *db);
49
50 void table_counters_finalize(void);
51
52 #endif /*__TABLE_COUNTERS_H__ */