/[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.4 - (hide annotations)
Mon Oct 13 00:18:40 2025 UTC (5 months ago) by sysadm
Branch: MAIN
Changes since 1.3: +2 -2 lines
Content type: text/x-chdr
Rename constant to avoid conflict

1 sysadm 1.1 /***************************************************************************
2     article_view_log.h - description
3     -------------------
4     Copyright : (C) 2004-2025 by Leaflet
5     Email : leaflet@leafok.com
6     ***************************************************************************/
7    
8     /***************************************************************************
9     * *
10     * This program is free software; you can redistribute it and/or modify *
11     * it under the terms of the GNU General Public License as published by *
12     * the Free Software Foundation; either version 3 of the License, or *
13     * (at your option) any later version. *
14     * *
15     ***************************************************************************/
16    
17     #ifndef _ARTICLE_VIEW_LOG_H_
18     #define _ARTICLE_VIEW_LOG_H_
19    
20     #include <stdint.h>
21    
22 sysadm 1.4 #define MAX_VIEWED_AID_INC_CNT 1000
23 sysadm 1.1
24     struct article_view_log_t
25     {
26 sysadm 1.3 int uid;
27 sysadm 1.1 int32_t *aid_base;
28     int aid_base_cnt;
29 sysadm 1.4 int32_t aid_inc[MAX_VIEWED_AID_INC_CNT];
30 sysadm 1.1 int aid_inc_cnt;
31     };
32     typedef struct article_view_log_t ARTICLE_VIEW_LOG;
33    
34 sysadm 1.3 extern ARTICLE_VIEW_LOG BBS_article_view_log;
35    
36 sysadm 1.1 // Load baseline view log from DB
37     extern int article_view_log_load(int uid, ARTICLE_VIEW_LOG *p_view_log, int keep_inc);
38     // Clear data
39 sysadm 1.2 extern int article_view_log_unload(ARTICLE_VIEW_LOG *p_view_log);
40 sysadm 1.1 // Save incremental view log to DB
41 sysadm 1.3 extern int article_view_log_save_inc(const ARTICLE_VIEW_LOG *p_view_log);
42 sysadm 1.1 // Merge incremental view log to baseline, without DB read / write
43     extern int article_view_log_merge_inc(ARTICLE_VIEW_LOG *p_view_log);
44    
45     // Check if specific article was viewed
46     extern int article_view_log_is_viewed(int32_t aid, const ARTICLE_VIEW_LOG *p_view_log);
47     // Set specific article as viewed
48     extern int article_view_log_set_viewed(int32_t aid, ARTICLE_VIEW_LOG *p_view_log);
49    
50     #endif //_ARTICLE_VIEW_LOG_H_

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