| 1 |
/*************************************************************************** |
/* SPDX-License-Identifier: GPL-3.0-or-later */ |
| 2 |
article_favor.h - description |
/* |
| 3 |
------------------- |
* article_favor |
| 4 |
Copyright : (C) 2004-2025 by Leaflet |
* - data model and basic operations of user favorite articles |
| 5 |
Email : leaflet@leafok.com |
* |
| 6 |
***************************************************************************/ |
* Copyright (C) 2004-2026 Leaflet <leaflet@leafok.com> |
| 7 |
|
*/ |
|
/*************************************************************************** |
|
|
* * |
|
|
* This program is free software; you can redistribute it and/or modify * |
|
|
* it under the terms of the GNU General Public License as published by * |
|
|
* the Free Software Foundation; either version 3 of the License, or * |
|
|
* (at your option) any later version. * |
|
|
* * |
|
|
***************************************************************************/ |
|
| 8 |
|
|
| 9 |
#ifndef _ARTICLE_FAVOR_H_ |
#ifndef _ARTICLE_FAVOR_H_ |
| 10 |
#define _ARTICLE_FAVOR_H_ |
#define _ARTICLE_FAVOR_H_ |
| 12 |
#include "section_list.h" |
#include "section_list.h" |
| 13 |
#include <stdint.h> |
#include <stdint.h> |
| 14 |
|
|
| 15 |
#define MAX_FAVOR_AID_BASE_CNT 10000 |
enum article_favor_constant_t |
| 16 |
#define MAX_FAVOR_AID_INC_CNT 1000 |
{ |
| 17 |
|
MAX_FAVOR_AID_BASE_CNT = 10000, |
| 18 |
|
MAX_FAVOR_AID_INC_CNT = 1000, |
| 19 |
|
}; |
| 20 |
|
|
| 21 |
struct article_favor_t |
struct article_favor_t |
| 22 |
{ |
{ |
| 44 |
// Set specific article as favorite |
// Set specific article as favorite |
| 45 |
extern int article_favor_set(int32_t aid, ARTICLE_FAVOR *p_favor, int state); |
extern int article_favor_set(int32_t aid, ARTICLE_FAVOR *p_favor, int state); |
| 46 |
|
|
| 47 |
extern int query_favor_articles(ARTICLE_FAVOR *p_favor, int page_id, ARTICLE **p_articles, |
extern int query_favor_articles(ARTICLE_FAVOR *p_favor, int page_id, const ARTICLE **p_articles, |
| 48 |
char p_snames[][BBS_section_name_max_len + 1], int *p_article_count, int *p_page_count); |
char p_snames[][BBS_section_name_max_len + 1], int *p_article_count, int *p_page_count); |
| 49 |
|
|
| 50 |
#endif //_ARTICLE_FAVOR_H_ |
#endif //_ARTICLE_FAVOR_H_ |