| 19 |
|
|
| 20 |
#include <stdint.h> |
#include <stdint.h> |
| 21 |
|
|
| 22 |
#define MAX_AID_INC_CNT 100000 |
#define MAX_AID_INC_CNT 1000 |
| 23 |
|
|
| 24 |
struct article_view_log_t |
struct article_view_log_t |
| 25 |
{ |
{ |
| 26 |
|
int uid; |
| 27 |
int32_t *aid_base; |
int32_t *aid_base; |
| 28 |
int aid_base_cnt; |
int aid_base_cnt; |
| 29 |
int32_t aid_inc[MAX_AID_INC_CNT]; |
int32_t aid_inc[MAX_AID_INC_CNT]; |
| 31 |
}; |
}; |
| 32 |
typedef struct article_view_log_t ARTICLE_VIEW_LOG; |
typedef struct article_view_log_t ARTICLE_VIEW_LOG; |
| 33 |
|
|
| 34 |
|
extern ARTICLE_VIEW_LOG BBS_article_view_log; |
| 35 |
|
|
| 36 |
// Load baseline view log from DB |
// Load baseline view log from DB |
| 37 |
extern int article_view_log_load(int uid, ARTICLE_VIEW_LOG *p_view_log, int keep_inc); |
extern int article_view_log_load(int uid, ARTICLE_VIEW_LOG *p_view_log, int keep_inc); |
| 38 |
// Clear data |
// Clear data |
| 39 |
extern int article_view_log_unload(int uid, ARTICLE_VIEW_LOG *p_view_log); |
extern int article_view_log_unload(ARTICLE_VIEW_LOG *p_view_log); |
| 40 |
// Save incremental view log to DB |
// Save incremental view log to DB |
| 41 |
extern int article_view_log_save_inc(int uid, const ARTICLE_VIEW_LOG *p_view_log); |
extern int article_view_log_save_inc(const ARTICLE_VIEW_LOG *p_view_log); |
| 42 |
// Merge incremental view log to baseline, without DB read / write |
// Merge incremental view log to baseline, without DB read / write |
| 43 |
extern int article_view_log_merge_inc(ARTICLE_VIEW_LOG *p_view_log); |
extern int article_view_log_merge_inc(ARTICLE_VIEW_LOG *p_view_log); |
| 44 |
|
|