gih900@csc.anu.oz (Geoff Huston) (11/25/89)
+-+-+-+ Beginning of part 4 +-+-+-+ X--- 141,149 ----- X case DIR_REGISTER: X put_line("NEWS - Directory of Registered Newsgroups",0); X break; X+ case DIR_UNREGISTER: X+ put_line("NEWS - Directory of UNRegistered Newsgroups",0); X+ break; X `125 X put_line(class_name(),0); V sprintf(err_oline," Number %-*.*s Count Unread",SUBJLEN,SUBJLEN," XGroup"); X************** X*** 215,220 X `125 X else if (cli$present(c$dsc("NEW")) == CLI$_PRESENT) dir_type = DIR_NEW; V else if (cli$present(c$dsc("REGISTER")) == CLI$_PRESENT) dir_type = DIR X_REGISTER; X else if (!class_len) `123 X force_recalc = 0; X dir_type = cur_dir_type; X--- 218,225 ----- X `125 X else if (cli$present(c$dsc("NEW")) == CLI$_PRESENT) dir_type = DIR_NEW; V else if (cli$present(c$dsc("REGISTER")) == CLI$_PRESENT) dir_type = DIR X_REGISTER; X+ else if (cli$present(c$dsc("UNREGISTERED")) == CLI$_PRESENT) X+ dir_type = DIR_UNREGISTER; X else if (!class_len) `123 X force_recalc = 0; X dir_type = cur_dir_type; X************** X*** 256,261 X break; X case DIR_REGISTER: X incl_grp = (ga[gindx]->grp_reg); X break; X `125 X if (incl_grp && class_check(gindx)) `123 X--- 261,269 ----- X break; X case DIR_REGISTER: X incl_grp = (ga[gindx]->grp_reg); X+ break; X+ case DIR_UNREGISTER: X+ incl_grp = (ga[gindx]->grp_reg == 0); X break; X `125 X if (incl_grp && class_check(gindx)) `123 $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSDISPLAY.DIFF" $ CHECKSUM_IS = 1762604156 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsdisplay.c X--- [.news_src]newsdisplay.c X************** X*** 278,284 X strcpy(resp,"10000"); X trm = SMG$K_TRM_DOWN; X `125 V! else if (!strncmp(resp,"top",min(3,strlen(resp))) && (*(resp + 1) = X= 'o')) `123 X strcpy(resp,"10000"); X trm = SMG$K_TRM_UP; X `125 X--- 278,286 ----- X strcpy(resp,"10000"); X trm = SMG$K_TRM_DOWN; X `125 X! else if ( !strncmp(resp,"top",min(3,strlen(resp))) X! && (*(resp + 1) == 'o') X! && (strlen(resp) <= 3)) `123 X strcpy(resp,"10000"); X trm = SMG$K_TRM_UP; X `125 $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSDIST.DIFF" $ CHECKSUM_IS = 559246916 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsdist.c X--- [.news_src]newsdist.c X************** X*** 213,218 X tolist[IO_SIZE], X *cp1, X *cp2; X sys_filter_t *fmp, *f1; X dist_entry_t *tmp, *t1 = distfile; X `032 X--- 213,219 ----- X tolist[IO_SIZE], X *cp1, X *cp2; X+ int n; X sys_filter_t *fmp, *f1; X dist_entry_t *tmp, *t1 = distfile; X `032 X************** X*** 216,223 X sys_filter_t *fmp, *f1; X dist_entry_t *tmp, *t1 = distfile; X `032 X! if (sscanf(s,"%s %s",node,tolist) != 2) return; X! cp1 = tolist; X tmp = malloc(sizeof *tmp); X strcpy((tmp->from_name = malloc(strlen(node) + 1)),node); X tmp->to_names = 0; X--- 217,228 ----- X sys_filter_t *fmp, *f1; X dist_entry_t *tmp, *t1 = distfile; X `032 X! cp1 = s;`009`009`009`009/* s is compressed, stripped string */ X! while (isgraph(*cp1)) cp1++; `009/* scan accross node word */ X! if (!*cp1) cp1 = 0; X! else *cp1++ = '\0'; `009/* and null terminate node word */ X! strcpy(node,s); V! if (!strlen(node)) return; `009`009/* handle the case of the string " " * X/ X tmp = malloc(sizeof *tmp); X strcpy((tmp->from_name = malloc(strlen(node) + 1)),node); X tmp->to_names = 0; X************** X*** 221,238 X tmp = malloc(sizeof *tmp); X strcpy((tmp->from_name = malloc(strlen(node) + 1)),node); X tmp->to_names = 0; X! do `123 X! if (cp2 = strchr(cp1,',')) *cp2++ = '\0'; X! fmp = malloc(sizeof *fmp); X! strcpy((fmp->sys_filtnam = malloc(strlen(cp1) + 1)),cp1); X! fmp->sys_fnext = 0; X! if (!tmp->to_names) tmp->to_names = f1 = fmp; X! else `123 X! f1->sys_fnext = fmp; X! f1 = fmp; X! `125 X! cp1 = cp2; X! `125 while (cp1); X tmp->next = 0; X if (!distfile) distfile = tmp; X else `123 X--- 226,250 ----- X tmp = malloc(sizeof *tmp); X strcpy((tmp->from_name = malloc(strlen(node) + 1)),node); X tmp->to_names = 0; X! if (cp1) `123 `009`009`009/* now handle following words */ X! while (cp2 = strchr(cp1,' ')) *cp2 = ','; `009/* convert ' ' -> ',' */ X! strcpy(tolist,cp1); X! cp1 = tolist; X! do `123 X! if (cp2 = strchr(cp1,',')) *cp2++ = '\0'; X! if (strlen(cp1)) `123 X! fmp = malloc(sizeof *fmp); X! strcpy((fmp->sys_filtnam = malloc(strlen(cp1) + 1)),cp1); X! fmp->sys_fnext = 0; X! if (!tmp->to_names) tmp->to_names = f1 = fmp; X! else `123 X! f1->sys_fnext = fmp; X! f1 = fmp; X! `125 X! `125 X! cp1 = cp2; X! `125 while (cp1); X! `125 X tmp->next = 0; X if (!distfile) distfile = tmp; X else `123 X************** X*** 559,565 X if (!strlen(s->sys_file)) continue; X if (test_accept(newsgroups,distribution,s->sys_f)) `123 X if (*s->sys_type == 'n') `123 X! if (fpo = fopen(s->sys_file,"a","rfm=var","rat=cr")) `123 X fprintf(fpo,"%s\n",message_id); X fclose(fpo); X `125 X--- 571,584 ----- X if (!strlen(s->sys_file)) continue; X if (test_accept(newsgroups,distribution,s->sys_f)) `123 X if (*s->sys_type == 'n') `123 X! if (!(fpo = fopen(s->sys_file,"a","rfm=var","rat=cr"))) `123 V! sleep(1); /* assume append open due to multiple write - wait a bi Xt - X! if the append still fails try to open a new version X! before giving up. */ X! if (!(fpo = fopen(s->sys_file,"a","rfm=var","rat=cr"))) X! fpo = fopen(s->sys_file,"w","rfm=var","rat=cr"); X! `125 X! if (fpo) `123 X fprintf(fpo,"%s\n",message_id); X fclose(fpo); X `125 X************** X*** 585,591 X `032 X n_char = (*(s->sys_type + 1) == 'n'); X if (*s->sys_type != 'b') X! fpo = fopen(s->sys_file,"w","rfm=var","rat=cr"); X else `123 X if (!stat(s->sys_file,&batfile_stat)) `123 V if ((batfile_stat.st_size + infile_stat.st_size) > NEWS_BATCH_S XIZE) X--- 604,610 ----- X `032 X n_char = (*(s->sys_type + 1) == 'n'); X if (*s->sys_type != 'b') V! fpo = fopen(s->sys_file,"w","rfm=var","rat=cr","alq=30","deq=30") X; X else `123 X if (!stat(s->sys_file,&batfile_stat)) `123 V if ((batfile_stat.st_size + infile_stat.st_size) > NEWS_BATCH_S XIZE) X************** X*** 589,596 X else `123 X if (!stat(s->sys_file,&batfile_stat)) `123 V if ((batfile_stat.st_size + infile_stat.st_size) > NEWS_BATCH_S XIZE) X! fpo = fopen(s->sys_file,"w","rfm=var","rat=cr"); X! else fpo = fopen(s->sys_file,"a"); X `125 X else fpo = fopen(s->sys_file,"w","rfm=var","rat=cr"); X if (!fpo) `123 X--- 608,618 ----- X else `123 X if (!stat(s->sys_file,&batfile_stat)) `123 V if ((batfile_stat.st_size + infile_stat.st_size) > NEWS_BATCH_S XIZE) V! fpo = fopen(s->sys_file,"w","rfm=var","rat=cr","alq=30","deq= X30"); X! else `123 X! if (!(fpo = fopen(s->sys_file,"a"))) V! fpo = fopen(s->sys_file,"w","rfm=var","rat=cr","alq=30","de Xq=30"); X! `125 X `125 V else fpo = fopen(s->sys_file,"w","rfm=var","rat=cr","alq=30","deq X=30"); X if (!fpo) `123 X************** X*** 592,598 X fpo = fopen(s->sys_file,"w","rfm=var","rat=cr"); X else fpo = fopen(s->sys_file,"a"); X `125 X! else fpo = fopen(s->sys_file,"w","rfm=var","rat=cr"); X if (!fpo) `123 X fclose(fpi); X continue; X--- 614,620 ----- V fpo = fopen(s->sys_file,"w","rfm=var","rat=cr","alq=30","de Xq=30"); X `125 X `125 V! else fpo = fopen(s->sys_file,"w","rfm=var","rat=cr","alq=30","deq X=30"); X if (!fpo) `123 X fclose(fpi); X continue; $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSEXTERN.DIFF" $ CHECKSUM_IS = 1985495058 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsextern.h X--- [.news_src]newsextern.h $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSEXTRACT.DIFF" $ CHECKSUM_IS = 1181743897 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsextract.c X--- [.news_src]newsextract.c X************** X*** 234,242 X `125 X if (append_ofile) fprintf(fpextract,"\f\n"); X append_ofile = 1; X! if (w_ok) sprintf(xfrbuf,"X-NEWS: %s %s: %d\n", V! news_node,ga[g]->grp_name,ga[g]->grp_ia[m].itm_nu Xm); X! fputs(xfrbuf,fpextract); X err_line(xfrbuf); X if (m_seen) item_update(g,m); X while (fgets(xfrbuf,510,fpr)) `123 X--- 234,244 ----- X `125 X if (append_ofile) fprintf(fpextract,"\f\n"); X append_ofile = 1; X! if (w_ok) `123 X! sprintf(xfrbuf,"X-NEWS: %s %s: %d\n", X! news_node,ga[g]->grp_name,ga[g]->grp_ia[m].itm_num); X! fputs(xfrbuf,fpextract); X! `125 X err_line(xfrbuf); X if (m_seen) item_update(g,m); X while (fgets(xfrbuf,510,fpr)) `123 $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSFILES.DIFF" $ CHECKSUM_IS = 1411852509 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsfiles.c X--- [.news_src]newsfiles.c X************** X*** 67,72 X i->f.fab$b_org = FAB$C_SEQ; X i->f.fab$b_rat = FAB$M_CR; X i->f.fab$b_rfm = FAB$C_VAR; X i->f.fab$l_xab = &(i->p); X i->p = cc$rms_xabpro; X i->p.xab$w_pro = prot; X--- 67,75 ----- X i->f.fab$b_org = FAB$C_SEQ; X i->f.fab$b_rat = FAB$M_CR; X i->f.fab$b_rfm = FAB$C_VAR; X+ i->f.fab$l_alq = 4; X+ i->f.fab$w_deq = 32; X+ i->f.fab$l_fop `124= FAB$M_TEF; X i->f.fab$l_xab = &(i->p); X i->p = cc$rms_xabpro; X i->p.xab$w_pro = prot; $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSFORWARD.DIFF" $ CHECKSUM_IS = 1985494578 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsforward.c X--- [.news_src]newsforward.c $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSHELP.DIFF" $ CHECKSUM_IS = 1985494842 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newshelp.c X--- [.news_src]newshelp.c $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSINCLUDE.DIFF" $ CHECKSUM_IS = 1985494578 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsinclude.h X--- [.news_src]newsinclude.h $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSMOD.DIFF" $ CHECKSUM_IS = 1985494578 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsmod.c X--- [.news_src]newsmod.c $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSMODE.DIFF" $ CHECKSUM_IS = 1985494842 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newsmode.c X--- [.news_src]newsmode.c $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSPOST.DIFF" $ CHECKSUM_IS = 341141708 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X*** [.news_v59_src]newspost.c X--- [.news_src]newspost.c X************** X*** 220,226 X * Parse the newsgroup specification, building a comma separated list. X */ `032 X `032 X! parse_newsgroups(newslist,dflt,ask,use_aliases) X char *newslist, *dflt; X int ask, use_aliases; X `123 X--- 220,226 ----- X * Parse the newsgroup specification, building a comma separated list. X */ `032 X `032 X! parse_newsgroups(newslist,dflt,ask,use_aliases,auth_check) X char *newslist, *dflt; X int ask, use_aliases, auth_check; X `123 X************** X*** 222,228 X `032 X parse_newsgroups(newslist,dflt,ask,use_aliases) X char *newslist, *dflt; X! int ask, use_aliases; X `123 X char newsgroups[256]; X short newsgroups_len; X--- 222,228 ----- X `032 X parse_newsgroups(newslist,dflt,ask,use_aliases,auth_check) X char *newslist, *dflt; X! int ask, use_aliases, auth_check; X `123 X char newsgroups[256]; X short newsgroups_len; X************** X*** 236,242 X if (status == RMS$_EOF) longjmp(env,2); X newsgroups[newsgroups_len] = '\0'; X if (use_aliases) strcpy(newsgroups,aliases(newsgroups)); X! auth_list(newsgroups); X strcpy(newslist,newsgroups); X `125 X else `123 X--- 236,242 ----- X if (status == RMS$_EOF) longjmp(env,2); X newsgroups[newsgroups_len] = '\0'; X if (use_aliases) strcpy(newsgroups,aliases(newsgroups)); X! if (auth_check) auth_list(newsgroups); X strcpy(newslist,newsgroups); X `125 X else `123 X************** X*** 244,250 X do `123 X newsgroups[newsgroups_len] = '\0'; X if (use_aliases) strcpy(newsgroups,aliases(newsgroups)); X! if (auth_list(newsgroups)) `123 X strcat(newslist,newsgroups); X strcat(newslist,","); X `125 X--- 244,250 ----- X do `123 X newsgroups[newsgroups_len] = '\0'; X if (use_aliases) strcpy(newsgroups,aliases(newsgroups)); X! if (!auth_check `124`124 auth_list(newsgroups)) `123 X strcat(newslist,newsgroups); X strcat(newslist,","); X `125 X************** X*** 302,309 X * post a new news item X */ X `032 X! do_posting(postfile) X! int postfile; X `123 X char ngroup[512], X post_dist[132], post_path[132], X--- 302,310 ----- X * post a new news item X */ X `032 X! static X! do_posting(postfile,crosspost) X! int postfile, crosspost; X `123 X char ngroup[512], X post_dist[132], post_path[132], X************** X*** 313,318 X xfrbuf[512], X *cp1, *cp2, X distribution[512], id[256], from[256], follow_groups[512], V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25 X6], X mod_address[132], post_address[256], X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa; X--- 314,320 ----- X xfrbuf[512], X *cp1, *cp2, X distribution[512], id[256], from[256], follow_groups[512], X+ xnewsgroups[512], xfollowgroups[512], V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25 X6], X mod_address[132], post_address[256], control_val[256], X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa; X************** X*** 314,320 X *cp1, *cp2, X distribution[512], id[256], from[256], follow_groups[512], V followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25 X6], X! mod_address[132], post_address[256], X *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa; X int approval_required = 0, X fd, X--- 316,322 ----- -+-+-+-+-+ End of part 4 +-+-+-+-+-