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

Contents of /lbbs/include/section_list_loader.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations)
Sat Oct 4 03:21:59 2025 UTC (5 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.15: +5 -0 lines
Content type: text/x-chdr
Locate at next unread article by pressing 'S' in article list

1 /***************************************************************************
2 section_list_loader.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 _SECTION_LIST_LOADER_H_
18 #define _SECTION_LIST_LOADER_H_
19
20 #include "menu.h"
21 #include "section_list.h"
22 #include <mysql/mysql.h>
23
24 #define ERR_UNKNOWN_SECTION -101
25 #define LOAD_ARTICLE_COUNT_LIMIT 1000
26
27 extern int section_list_loader_pid;
28 extern int last_article_op_log_mid;
29
30 extern int load_section_config_from_db(int update_gen_ex);
31
32 // Input global_lock = 0 : lock / unlock corresponding section per article
33 // 1 : lock / unlock all sections per invocation
34 // Return on success : count of appended articles (>= 0)
35 // failure : lock / unlock error (-1)
36 // : unknown section found (ERR_UNKNOWN_SECTION)
37 extern int append_articles_from_db(int32_t start_aid, int global_lock, int article_count_limit);
38
39 extern int set_last_article_op_log_from_db(void);
40
41 // Return on success : count of appended articles (>= 0)
42 // failure : lock / unlock error (-1)
43 // : unknown section found (ERR_UNKNOWN_SECTION)
44 extern int apply_article_op_log_from_db(int op_count_limit);
45
46 extern int section_list_loader_launch(void);
47
48 // Return on success : real page_id (>= 0)
49 // failure : error number (< 0)
50 extern int query_section_articles(SECTION_LIST *p_section, int page_id, ARTICLE *p_articles[],
51 int *p_article_count, int *p_page_count, int *p_ontop_start_offset);
52
53 // Input direction = 0 : locate p_article_cur
54 // -1 : p_article_cur->p_topic_prior
55 // 1 : p_article_cur->p_topic_next
56 // Return on success : found (1)
57 // : not found (0)
58 // failure : error number (< 0)
59 extern int locate_article_in_section(SECTION_LIST *p_section, const ARTICLE *p_article_cur, int direction, int step,
60 int *p_page_id, int *p_visible_offset, int *p_article_count);
61
62 // Return on success : found (1)
63 // : not found (0)
64 // failure : error number (< 0)
65 extern int scan_unread_article_in_section(SECTION_LIST *p_section, const ARTICLE *p_article_cur, const ARTICLE **pp_article_unread);
66
67 extern int get_section_ex_menu_set(SECTION_LIST *p_section, MENU_SET *p_ex_menu_set);
68
69 #endif //_SECTION_LIST_LOADER_H_

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