/[LeafOK_CVS]/lbbs/src/section_list_loader.c
ViewVC logotype

Diff of /lbbs/src/section_list_loader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.61 by sysadm, Tue Nov 4 01:49:26 2025 UTC Revision 1.62 by sysadm, Tue Nov 4 06:28:14 2025 UTC
# Line 1063  int locate_article_in_section(SECTION_LI Line 1063  int locate_article_in_section(SECTION_LI
1063          return (ret < 0 ? ret : (p_article == NULL ? 0 : 1));          return (ret < 0 ? ret : (p_article == NULL ? 0 : 1));
1064  }  }
1065    
1066    int last_article_in_section(SECTION_LIST *p_section, const ARTICLE **pp_article)
1067    {
1068            int ret = 0;
1069    
1070            const ARTICLE *p_article;
1071    
1072            if (p_section == NULL || pp_article == NULL)
1073            {
1074                    log_error("NULL pointer error\n");
1075                    return -1;
1076            }
1077    
1078            *pp_article = NULL;
1079    
1080            // acquire lock of section
1081            if ((ret = section_list_rd_lock(p_section)) < 0)
1082            {
1083                    log_error("section_list_rd_lock(sid = %d) error\n", p_section->sid);
1084                    return -2;
1085            }
1086    
1087            for (p_article = p_section->p_article_tail;
1088                     p_article && p_article != p_section->p_article_head && !p_article->visible;
1089                     p_article = p_article->p_prior)
1090                    ;
1091    
1092            if (p_article && p_article->visible)
1093            {
1094                    *pp_article = p_article;
1095                    ret = 1;
1096            }
1097    
1098            // release lock of section
1099            if (section_list_rd_unlock(p_section) < 0)
1100            {
1101                    log_error("section_list_rd_unlock(sid = %d) error\n", p_section->sid);
1102                    ret = -2;
1103            }
1104    
1105            return ret;
1106    }
1107    
1108  int scan_unread_article_in_section(SECTION_LIST *p_section, const ARTICLE *p_article_cur, const ARTICLE **pp_article_unread)  int scan_unread_article_in_section(SECTION_LIST *p_section, const ARTICLE *p_article_cur, const ARTICLE **pp_article_unread)
1109  {  {
1110          ARTICLE *p_article;          ARTICLE *p_article;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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