/[LeafOK_CVS]/lbbs/include/article_view_log.h
ViewVC logotype

Annotation of /lbbs/include/article_view_log.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations)
Tue Nov 4 13:49:50 2025 UTC (4 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.4: +7 -15 lines
Content type: text/x-chdr
Update file header information comments

1 sysadm 1.5 /* SPDX-License-Identifier: GPL-3.0-or-later */
2     /*
3     * article_view_log
4     * - data persistence and query of article view log
5     *
6     * Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>
7     */
8 sysadm 1.1
9     #ifndef _ARTICLE_VIEW_LOG_H_
10     #define _ARTICLE_VIEW_LOG_H_
11    
12     #include <stdint.h>
13    
14 sysadm 1.4 #define MAX_VIEWED_AID_INC_CNT 1000
15 sysadm 1.1
16     struct article_view_log_t
17     {
18 sysadm 1.3 int uid;
19 sysadm 1.1 int32_t *aid_base;
20     int aid_base_cnt;
21 sysadm 1.4 int32_t aid_inc[MAX_VIEWED_AID_INC_CNT];
22 sysadm 1.1 int aid_inc_cnt;
23     };
24     typedef struct article_view_log_t ARTICLE_VIEW_LOG;
25    
26 sysadm 1.3 extern ARTICLE_VIEW_LOG BBS_article_view_log;
27    
28 sysadm 1.1 // Load baseline view log from DB
29     extern int article_view_log_load(int uid, ARTICLE_VIEW_LOG *p_view_log, int keep_inc);
30     // Clear data
31 sysadm 1.2 extern int article_view_log_unload(ARTICLE_VIEW_LOG *p_view_log);
32 sysadm 1.1 // Save incremental view log to DB
33 sysadm 1.3 extern int article_view_log_save_inc(const ARTICLE_VIEW_LOG *p_view_log);
34 sysadm 1.1 // Merge incremental view log to baseline, without DB read / write
35     extern int article_view_log_merge_inc(ARTICLE_VIEW_LOG *p_view_log);
36    
37     // Check if specific article was viewed
38     extern int article_view_log_is_viewed(int32_t aid, const ARTICLE_VIEW_LOG *p_view_log);
39     // Set specific article as viewed
40     extern int article_view_log_set_viewed(int32_t aid, ARTICLE_VIEW_LOG *p_view_log);
41    
42     #endif //_ARTICLE_VIEW_LOG_H_

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1