?? rthread.c
字號:
boolprev_art_with_subj(){ register ARTICLE *ap = artp, *ap2; register SUBJECT *sp; bool try_this_subj_again = TRUE; if (!ap) return FALSE; sp = ap->subj; do { ap2 = ap->subj->articles; if (ap2 == ap) ap = Nullart; else { while (ap2 && ap2->subj_next != ap) ap2 = ap2->subj_next; ap = ap2; } if (!ap) { if (try_this_subj_again) { ap = sp->articles; while (ap->subj_next) ap = ap->subj_next; try_this_subj_again = FALSE; } else { if (!art) art = lastart; return FALSE; } } } while ((ap->flags & (AF_READ|AF_MISSING)) || (selected_only && !(ap->flags & AF_SEL))); artp = ap; art = article_num(ap); return TRUE;}/* Select a single article.*/voidselect_article(ap, sel_flags)register ARTICLE *ap;int sel_flags;{ int desired_flags = (sel_rereading? AF_READ : 0);#ifdef VERBOSE bool echo; if (sel_flags & AF_ECHO) { echo = TRUE; sel_flags &= ~AF_ECHO; } else echo = FALSE;#else sel_flags &= ~AF_ECHO;#endif if (sel_flags & (AF_AUTOSELECT|AF_AUTOSELECTALL)) save_ids = TRUE; if ((ap->flags & (AF_MISSING|AF_READ)) == desired_flags) { if (!(ap->flags & sel_mask)) { selected_count++;#ifdef VERBOSE if (echo) { IF(verbose) fputs("\tSelected",stdout); }#endif } ap->flags = (ap->flags & ~AF_DEL) | sel_mask | sel_flags; } else ap->flags |= sel_flags; if (!(ap->subj->flags & sel_mask)) selected_subj_cnt++; ap->subj->flags = (ap->subj->flags&~SF_DEL)|sel_mask|sel_flags|SF_VISIT; if (sel_mode == SM_THREAD) { if ((ap = ap->subj->thread) != NULL) ap->subj->flags |= SF_VISIT; } selected_only = (selected_only || selected_count != 0);}/* Select all the articles in a subject.*/voidselect_subject(subj, sel_flags)SUBJECT *subj;int sel_flags;{ register ARTICLE *ap; int desired_flags = (sel_rereading? AF_READ : 0); int old_count = selected_count; if (sel_flags & (AF_AUTOSELECT|AF_AUTOSELECTALL)) { save_ids = TRUE; if (sel_flags & AF_AUTOSELECTALL) subj->flags |= SF_AUTOSELECT; } for (ap = subj->articles; ap; ap = ap->subj_next) { if ((ap->flags & (AF_MISSING|AF_READ|sel_mask)) == desired_flags) { ap->flags |= sel_mask | sel_flags; selected_count++; } else ap->flags |= sel_flags; } if (selected_count > old_count) { if (!(subj->flags & sel_mask)) selected_subj_cnt++; subj->flags = (subj->flags & ~SF_DEL) | sel_mask | SF_VISIT | SF_WASSELECTED; if (sel_mode == SM_THREAD) { if ((ap = subj->thread) != NULL) ap->subj->flags |= SF_VISIT; } selected_only = TRUE; } else subj->flags |= SF_WASSELECTED;}/* Select all the articles in a thread.*/voidselect_thread(thread, sel_flags)register ARTICLE *thread;int sel_flags;{ register SUBJECT *sp; sp = thread->subj; do { select_subject(sp, sel_flags); sp = sp->thread_link; } while (sp != thread->subj);}/* Select the subthread attached to this article.*/voidselect_subthread(ap, sel_flags)register ARTICLE *ap;int sel_flags;{ register ARTICLE *limit; SUBJECT *subj; int desired_flags = (sel_rereading? AF_READ : 0); int old_count = selected_count; if (!ap) return; subj = ap->subj; for (limit = ap; limit; limit = limit->parent) { if (limit->sibling) { limit = limit->sibling; break; } } if (sel_flags & (AF_AUTOSELECT|AF_AUTOSELECTALL)) save_ids = TRUE; for (; ap != limit; ap = bump_art(ap)) { if ((ap->flags & (AF_MISSING|AF_READ|sel_mask)) == desired_flags) { ap->flags |= sel_mask | sel_flags; selected_count++; } else ap->flags |= sel_flags; } if (selected_count > old_count) { if (!(subj->flags & sel_mask)) selected_subj_cnt++; subj->flags = (subj->flags & ~SF_DEL) | sel_mask | SF_VISIT; if (sel_mode == SM_THREAD) { if ((ap = subj->thread) != NULL) ap->subj->flags |= SF_VISIT; } selected_only = TRUE; }}/* Deselect a single article.*/voiddeselect_article(ap)register ARTICLE *ap;{ if (ap->flags & sel_mask) { ap->flags &= ~sel_mask; if (!selected_count--) selected_count = 0;#ifdef VERBOSE if (mode != 't') { IF(verbose) fputs("\tDeselected",stdout); }#endif } if (sel_rereading && sel_mode == SM_ARTICLE) ap->flags |= AF_DEL;}/* Deselect all the articles in a subject.*/voiddeselect_subject(subj)SUBJECT *subj;{ register ARTICLE *ap; for (ap = subj->articles; ap; ap = ap->subj_next) { if (ap->flags & sel_mask) { ap->flags &= ~sel_mask; if (!selected_count--) selected_count = 0; } } if (subj->flags & sel_mask) { subj->flags &= ~sel_mask; selected_subj_cnt--; } subj->flags &= ~(SF_VISIT | SF_WASSELECTED); if (sel_rereading) subj->flags |= SF_DEL; else subj->flags &= ~SF_DEL;}/* Deselect all the articles in a thread.*/voiddeselect_thread(thread)register ARTICLE *thread;{ register SUBJECT *sp; sp = thread->subj; do { deselect_subject(sp); sp = sp->thread_link; } while (sp != thread->subj);}/* Deselect everything.*/voiddeselect_all(){ register SUBJECT *sp; for (sp = first_subject; sp; sp = sp->next) deselect_subject(sp); selected_count = selected_subj_cnt = 0; sel_page_sp = 0; sel_page_app = 0; sel_last_ap = 0; sel_last_sp = 0; selected_only = FALSE;}/* Kill all unread articles attached to the given subject.*/voidkill_subject(subj, kill_flags)SUBJECT *subj;int kill_flags;{ register ARTICLE *ap; register int killmask = ((kill_flags&KF_ALL)? AF_READ:(AF_READ|sel_mask)); if (kill_flags & KF_KILLFILE) { save_ids = TRUE; kill_flags = AF_AUTOKILLALL; } else kill_flags = 0; for (ap = subj->articles; ap; ap = ap->subj_next) { if (!(ap->flags & killmask)) set_read(ap); ap->flags |= kill_flags; } subj->flags &= ~(SF_VISIT | SF_WASSELECTED);}/* Kill all unread articles attached to the given thread.*/voidkill_thread(thread, kill_flags)register ARTICLE *thread;int kill_flags;{ register SUBJECT *sp; sp = thread->subj; do { kill_subject(sp, kill_flags); sp = sp->thread_link; } while (sp != thread->subj);}/* Kill the subthread attached to this article.*/voidkill_subthread(ap, kill_flags)register ARTICLE *ap;int kill_flags;{ register ARTICLE *limit; if (!ap) return; for (limit = ap; limit; limit = limit->parent) { if (limit->sibling) { limit = limit->sibling; break; } } if (kill_flags & KF_KILLFILE) { save_ids = TRUE; kill_flags = AF_AUTOKILL; } else kill_flags = 0; for (; ap != limit; ap = bump_art(ap)) { if (!(ap->flags & (AF_READ|AF_MISSING))) set_read(ap); ap->flags |= kill_flags; }}/* Unkill all the articles attached to the given subject.*/voidunkill_subject(subj)SUBJECT *subj;{ register ARTICLE *ap; for (ap = subj->articles; ap; ap = ap->subj_next) { if (sel_rereading) { if ((ap->flags & (AF_DELSEL|AF_MISSING)) == AF_DELSEL) { if (ap->flags & AF_READ) toread[ng]++; ap->flags = (ap->flags & ~(AF_DELSEL|AF_READ)) | AF_SEL; } else ap->flags &= ~(AF_DEL|AF_DELSEL); } else { if ((ap->flags & (AF_READ|AF_MISSING)) == AF_READ) onemore(ap); if (selected_only && !(ap->flags & (AF_SEL|AF_READ))) { ap->flags = (ap->flags & ~AF_DEL) | AF_SEL; selected_count++; } } } if (!sel_rereading && selected_only && !(subj->flags & SF_SEL)) { subj->flags |= SF_SEL | SF_VISIT | SF_WASSELECTED; if (sel_mode == SM_THREAD) { if ((ap = subj->thread) != NULL) ap->subj->flags |= SF_VISIT; } selected_subj_cnt++; } subj->flags &= ~(SF_DEL|SF_DELSEL);}/* Unkill all the articles attached to the given thread.*/voidunkill_thread(thread)register ARTICLE *thread;{ register SUBJECT *sp; sp = thread->subj; do { unkill_subject(sp); sp = sp->thread_link; } while (sp != thread->subj);}/* Unkill the subthread attached to this article.*/voidunkill_subthread(ap)register ARTICLE *ap;{ register ARTICLE *limit; register SUBJECT *sp; if (!ap) return; for (limit = ap; limit; limit = limit->parent) { if (limit->sibling) { limit = limit->sibling; break; } } sp = ap->subj; for (; ap != limit; ap = bump_art(ap)) { if ((ap->flags & (AF_READ|AF_MISSING)) == AF_READ) onemore(ap); if (selected_only && !(ap->flags & AF_SEL)) { ap->flags |= AF_SEL; selected_count++; } } if (!(sp->flags & sel_mask)) selected_subj_cnt++; sp->flags = (sp->flags & ~SF_DEL) | SF_SEL | SF_VISIT; if (sel_mode == SM_THREAD) { if ((ap = sp->thread) != NULL) ap->subj->flags |= SF_VISIT; } selected_only = (selected_only || selected_count != 0);}/* Kill all unread articles attached to the given subject.*/voidclear_subject(subj)SUBJECT *subj;{ register ARTICLE *ap; for (ap = subj->articles; ap; ap = ap->subj_next) { ap->flags &= ~AF_AUTOFLAGS; } subj->flags &= ~(SF_WASSELECTED | SF_AUTOSELECT);}/* Kill all unread articles attached to the given thread.*/voidclear_thread(thread)register ARTICLE *thread;{ register SUBJECT *sp; sp = thread->subj; do { clear_subject(sp); sp = sp->thread_link; } while (sp != thread->subj);}/* Kill the subthread attached to this article.*/voidclear_subthread(ap)register ARTICLE *ap;{ register ARTICLE *limit; if (!ap) return; for (limit = ap; limit; limit = limit->parent) { if (limit->sibling) { limit = limit->sibling; break; } } for (; ap != limit; ap = bump_art(ap)) { ap->flags &= ~AF_AUTOFLAGS; }}ARTICLE *subj_art(sp)SUBJECT *sp;{ register ARTICLE *ap = Nullart; int art_mask = (selected_only? AF_SEL : 0); bool TG_save = ThreadedGroup; ThreadedGroup = (sel_mode == SM_THREAD); ap = first_art(sp); while (ap && (ap->flags & (art_mask|AF_READ)) != art_mask) ap = next_art(ap); if (!ap) { reread = TRUE; ap = first_art(sp); if (art_mask) { while (ap && !(ap->flags & AF_SEL)) ap = next_art(ap); if (!ap) ap = first_art(sp); } } ThreadedGroup = TG_save; return ap;}/* Find the next thread (first if art > lastart). If articles are selected,** only choose from threads with selected articles.*/voidnext_subject(){ register SUBJECT *sp; register ARTICLE *ap; sp = ((ap = artp) ? ap->subj->next : first_subject); for (; sp; sp = sp->next) { if (sp->flags & SF_VISIT) { if ((ap = subj_art(sp)) != Nullart) { art = article_num(ap); artp = ap; return; }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -