2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TABLE_COUNTERS_H__
18 #define __TABLE_COUNTERS_H__
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;
33 typedef stc_cb_ret_e(*table_counters_info_cb)(const table_counters_info *info,
36 stc_error_e table_counters_get(long long int restriction_id,
37 table_counters_info *info);
39 stc_error_e table_counters_update_counters(const table_counters_info *info);
41 stc_error_e table_counters_get_timestamps(long long int restriction_id,
42 table_counters_info *info);
44 stc_error_e table_counters_update_timestamps(const table_counters_info *info);
46 stc_error_e table_counters_delete(long long int restriction_id);
48 stc_error_e table_counters_prepare(sqlite3 *db);
50 void table_counters_finalize(void);
52 #endif /*__TABLE_COUNTERS_H__ */