[news.software.anu-news] NEWS V5.9C diff 09/21

gih900@csc.anu.oz (Geoff Huston) (12/21/89)

+-+-+-+ Beginning of part 9 +-+-+-+
X+     ga_size = ca_i - 1;
X+     `125
X+`032
X    sysprv();
X    if (regr = fopen("NEWS_MANAGER:NEWS.CLASSES","r")) `123
X      char class[132], *cp, *cp2, *cp3;
X**************
X*** 340,347
X    if (screen_active) `123
X      if (force_dir) do_dir(force_dir,0);
X      else `123
X!       if (!*profile_dirstr) `123
X!         char *gotenv;
X `032
X          if (gotenv = getenv("NEWS_DEFAULT_DIRECTORY")) `123
X            char try_command[256];
X--- 374,380 -----
X    if (screen_active) `123
X      if (force_dir) do_dir(force_dir,0);
X      else `123
X!       char *gotenv, try_command[256];
X `032
V        if ((!*profile_dirstr) && (gotenv = getenv("NEWS_DEFAULT_DIRECTORY"))
X) `123
X  `009strcpy(try_command,"DIRECTORY/");
X**************
X*** 343,357
X        if (!*profile_dirstr) `123
X          char *gotenv;
X `032
X!         if (gotenv = getenv("NEWS_DEFAULT_DIRECTORY")) `123
X!           char try_command[256];
X!`032
X!           strcpy(try_command,"DIRECTORY/");
X!           strcat(try_command,gotenv);
X!           if (cli$dcl_parse(c$dsc(try_command),&newscmd,0,0) & 1)
X!             strcpy(profile_dirstr,gotenv);
X!           `125
X!         `125
X        if (*profile_dirstr) `123
X          char dir_command[256];
X `032
X--- 376,387 -----
X      else `123
X        char *gotenv, try_command[256];
X `032
V!       if ((!*profile_dirstr) && (gotenv = getenv("NEWS_DEFAULT_DIRECTORY"))
X) `123
X! `009strcpy(try_command,"DIRECTORY/");
X! `009strcat(try_command,gotenv);
X! `009if (cli$dcl_parse(c$dsc(try_command),&newscmd,0,0) & 1)
X! `009  strcpy(profile_dirstr,gotenv);
X! `009`125
X        if (*profile_dirstr) `123
X  `009strcpy(try_command,"DIRECTORY/");
X  `009strcat(try_command,profile_dirstr);
X**************
X*** 353,365
X            `125
X          `125
X        if (*profile_dirstr) `123
X!         char dir_command[256];
X!`032
X!         strcpy(dir_command,"DIRECTORY/");
X!         strcat(dir_command,profile_dirstr);
X!         if (cli$dcl_parse(c$dsc(dir_command),&newscmd,0,0) & 1)
X!           cli$dispatch();
X!         else *profile_dirstr = '\0';
X          `125
X        if ((!*profile_dirstr) && (old_dir_lev))
X          do_dir(old_dir_lev,curr_class);
X--- 383,392 -----
X  `009  strcpy(profile_dirstr,gotenv);
X  `009`125
X        if (*profile_dirstr) `123
X! `009strcpy(try_command,"DIRECTORY/");
X! `009strcat(try_command,profile_dirstr);
X! `009if (cli$dcl_parse(c$dsc(try_command),&newscmd,0,0) & 1) cli$dispatch();
X! `009else *profile_dirstr = '\0';
X          `125
V        if ((!*profile_dirstr) && old_dir_lev) do_dir(old_dir_lev,curr_class)
X;
X        `125
X**************
X*** 361,368
X            cli$dispatch();
X          else *profile_dirstr = '\0';
X          `125
X!       if ((!*profile_dirstr) && (old_dir_lev))
X!         do_dir(old_dir_lev,curr_class);
X        `125
X      if (save_curr_g != curr_g) return(0);
X      `125
X--- 388,394 -----
X  `009if (cli$dcl_parse(c$dsc(try_command),&newscmd,0,0) & 1) cli$dispatch();
X  `009else *profile_dirstr = '\0';
X          `125
V!       if ((!*profile_dirstr) && old_dir_lev) do_dir(old_dir_lev,curr_class)
X;
X        `125
X  `009`009`009/* if (save_curr_g != curr_g) */
X        return(0);
X**************
X*** 364,370
X        if ((!*profile_dirstr) && (old_dir_lev))
X          do_dir(old_dir_lev,curr_class);
X        `125
X!     if (save_curr_g != curr_g) return(0);
X      `125
X `032
X    if ((new_vals == 3) && (ga[curr_g]->grp_count)) `123
X--- 390,397 -----
X          `125
V        if ((!*profile_dirstr) && old_dir_lev) do_dir(old_dir_lev,curr_class)
X;
X        `125
X! `009`009`009/* if (save_curr_g != curr_g) */
X!       return(0);
X      `125
X `032
X    if ((new_vals == 3) && (ga[curr_g]->grp_count)) `123
X**************
X*** 403,409
X    GRP_PTR l_ga;
X `032
X                          /* open a new version of the register file */
X!   if (!(regr = fopen(news_register,"w"))) `123
X      err_line("Cannot access NEWS register file");
X      return(0);
X      `125
X--- 430,436 -----
X    GRP_PTR l_ga;
X `032
X                          /* open a new version of the register file */
X!   if (!(regr = fopen(news_register,"w","mbc=40"))) `123
X      err_line("Cannot access NEWS register file");
X      return(0);
X      `125
X**************
X*** 441,449
X `032
X                          /* if not mapped into memory then check if the
X                             old reg string still exists - if so then
V!                            write it out - (this is a bit of a fudge - If th
Xe
X!                            paste value is greater than 511 then it is the
V!                            return value of the malloc in read_reg_file()!)
X */
X      if (!l_ia) `123
X        if (l_ga->grp_reg_text) sprintf(inline," %s\n",l_ga->grp_reg_text);
X        else sprintf(inline," <0\n");
X--- 468,474 -----
X `032
X                          /* if not mapped into memory then check if the
X                             old reg string still exists - if so then
X!                            write it out. */
X      if (!l_ia) `123
X        if (l_ga->grp_reg_text) `123
X          putl(" ",regr);
X**************
X*** 445,453
X                             paste value is greater than 511 then it is the
V                             return value of the malloc in read_reg_file()!)
X */
X      if (!l_ia) `123
X!       if (l_ga->grp_reg_text) sprintf(inline," %s\n",l_ga->grp_reg_text);
X!       else sprintf(inline," <0\n");
X!       putl(inline,regr);
X        continue;
X        `125
X `032
X--- 470,481 -----
X                             old reg string still exists - if so then
X                             write it out. */
X      if (!l_ia) `123
X!       if (l_ga->grp_reg_text) `123
X!         putl(" ",regr);
X!         putl(l_ga->grp_reg_text,regr);
X!         putl("\n",regr);
X!         `125
X!       else putl(" <0\n",regr);
X        continue;
X        `125
X `032
X**************
X*** 1352,1358
X `032
X      if (!(ks + kf + kh)) ks = 1;
X      dflt = ga[curr_g]->grp_name;
X!     parse_newsgroups(newslist,dflt,1,0);
V      if (!*newslist) return(err_line("\tError: Kill - No newsgroup specified
X\n"),0);
X      if (ks) `123
X          ks = 1;
X--- 1380,1386 -----
X `032
X      if (!(ks + kf + kh)) ks = 1;
X      dflt = ga[curr_g]->grp_name;
X!     parse_newsgroups(newslist,dflt,1,0,0);
V      if (!*newslist) return(err_line("\tError: Kill - No newsgroup specified
X\n"),0);
X      if (ks) `123
X          ks = 1;
X**************
X*** 1527,1533
X          kf = c->k_itm_from;
X          kh = c->k_itm_header;
X          err_line("\tNewsgroups to which this kill filter applies\n");
X!         parse_newsgroups(newslist,kng,1,0);
X          err_line("\tSubject: line to filter (empty line if not used)\n");
V          get_input_dflt(&kt_dsc,c$dsc("Kill_Subject: "),&kt_len,(kt ? c$dsc(
Xkt) : 0),&trm);
X          nkt[kt_len] = '\0';
X--- 1555,1561 -----
X          kf = c->k_itm_from;
X          kh = c->k_itm_header;
X          err_line("\tNewsgroups to which this kill filter applies\n");
X!         parse_newsgroups(newslist,kng,1,0,0);
X          err_line("\tSubject: line to filter (empty line if not used)\n");
V          get_input_dflt(&kt_dsc,c$dsc("Kill_Subject: "),&kt_len,(kt ? c$dsc(
Xkt) : 0),&trm);
X          nkt[kt_len] = '\0';
X**************
X*** 2241,2246
X        profile_flags `124= PROFILE_CLASS;
X        strcpy(profile_classstr,&inline[6]);
X        `125
X      else if (!strncmp(inline,"EDIT=",5)) `123
X        profile_flags `124= PROFILE_EDIT;
X        strcpy(profile_editstr,&inline[5]);
X--- 2269,2282 -----
X        profile_flags `124= PROFILE_CLASS;
X        strcpy(profile_classstr,&inline[6]);
X        `125
X+     else if (!strncmp(inline,"RC-ORDER",8)) `123
X+       reorder_groups = 1;
X+       if (!profile_filter) include_all_groups = 1;
X+       `125
X+     else if (!strncmp(inline,"RC-FILTER",9)) `123
X+       profile_filter = 1;
X+       include_all_groups = 0;
X+       `125
X      else if (!strncmp(inline,"EDIT=",5)) `123
X        profile_flags `124= PROFILE_EDIT;
X        strcpy(profile_editstr,&inline[5]);
X**************
X*** 2391,2396
X          putl(profile_autostr,f);
X          putl("\n",f);
X          `125
X      if (profile_flags & PROFILE_CLASS) `123
X          putl("CLASS=",f);
X          putl(profile_classstr,f);
X--- 2427,2434 -----
X          putl(profile_autostr,f);
X          putl("\n",f);
X          `125
X+     if (reorder_groups) putl("RC-ORDER\n",f);
X+     if (profile_filter) putl("RC-FILTER\n",f);
X      if (profile_flags & PROFILE_CLASS) `123
X          putl("CLASS=",f);
X          putl(profile_classstr,f);
X**************
X*** 2521,2526
X      sprintf(err_oline,"KeyDefs File: %s",profile_keydefs);
X      put_line(err_oline,0);
X      `125
X    put_line("",1);
X    return(0);
X  `125
X--- 2559,2568 -----
X      sprintf(err_oline,"KeyDefs File: %s",profile_keydefs);
X      put_line(err_oline,0);
X      `125
X+   if (reorder_groups)`032
V+     put_line("RCOrder: Newsgroup Display ordering taken from newsrc file",0
X);
X+   if (profile_filter)
X+     put_line("RCFilter: Newsgroups Filter based on  newsrc file",0);
X    put_line("",1);
X    return(0);
X  `125
X**************
X*** 2562,2567
X        ++errs;
X        `125
X      `125
X    if ((status = cli$present(c$dsc("CLASS"))) == CLI$_NEGATED) `123
X      if (!temp) profile_flags &= `126PROFILE_CLASS;
X      `125
X--- 2604,2616 -----
X        ++errs;
X        `125
X      `125
X+`032
V+   if ((status = cli$present(c$dsc("RCORDER"))) == CLI$_NEGATED) reorder_gro
Xups = 0;
X+   else if (status & 1) reorder_groups = 1;
X+`032
V+   if ((status = cli$present(c$dsc("RCFILTER"))) == CLI$_NEGATED) profile_fi
Xlter = 0;
X+   else if (status & 1) profile_filter = 1;
X+`032
X    if ((status = cli$present(c$dsc("CLASS"))) == CLI$_NEGATED) `123
X      if (!temp) profile_flags &= `126PROFILE_CLASS;
X      `125
X**************
X*** 2849,2855
X    if (gotenv = getenv("NEWSRC")) strcpy(news_register,gotenv);
X    else if (gotenv = getenv("NEWS_REGISTER")) strcpy(news_register,gotenv);
X    else strcpy(news_register,User_file);
X!   if (!(regr = fopen(news_register,"r"))) clsfiles(0);
X    if (!(inline = fgetl(regr))) clsallfiles(0);
X    while (inline = fgetl(regr)) `123
X      if (!(cp = strchr(inline,'('))) clsallfiles(no_new_news);
X--- 2898,2904 -----
X    if (gotenv = getenv("NEWSRC")) strcpy(news_register,gotenv);
X    else if (gotenv = getenv("NEWS_REGISTER")) strcpy(news_register,gotenv);
X    else strcpy(news_register,User_file);
X!   if (!(regr = fopen(news_register,"r","mbc=40"))) clsfiles(0);
X    if (!(inline = fgetl(regr))) clsallfiles(0);
X    while (inline = fgetl(regr)) `123
X      if (!(cp = strchr(inline,'('))) clsallfiles(no_new_news);
$ GOSUB UNPACK_FILE

$ FILE_IS = "NEWSREAD.DIFF"
$ CHECKSUM_IS = 1831558372
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X*** [.news_v59_src]newsread.c
X--- [.news_src]newsread.c
X**************
X*** 742,748
X   *  read command processing
X   */
X `032
X! do_read()
X  `123
X      char item[SUBJLEN];
X      $DESCRIPTOR(item_dsc,item);
X--- 742,750 -----
X   *  read command processing
X   */
X `032
X! readtitle(h,r13,str,new_qual)
X!   int h, r13, new_qual;
X!   char *str;
X  `123
X    char *w_str,
X         c_str[SUBJLEN];
X**************
X*** 744,754
X `032
X  do_read()
X  `123
X!     char item[SUBJLEN];
X!     $DESCRIPTOR(item_dsc,item);
X!     short   item_len;
X!     int h = 0,
X!         rot13 = 0;
X `032
X      tpucall = 0;
X      if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X--- 746,755 -----
X    int h, r13, new_qual;
X    char *str;
X  `123
X!   char *w_str,
X!        c_str[SUBJLEN];
X!   int i;
X!   ITM_PTR iap;
X `032
X    if ((!curr_g) `124`124 (news_context < 2) `124`124 (curr_i < 1)) `123
X      err_line("Error: Read - No Newsgroup selected");
X**************
X*** 750,784
X      int h = 0,
X          rot13 = 0;
X `032
X!     tpucall = 0;
X!     if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X!     if (cli$present(c$dsc("TPU")) & 1) tpucall = 1;
X!     if (cli$present(c$dsc("EDITOR")) & 1) tpucall = 1;
X!     else if (cli$present(c$dsc("ROT13")) & 1) rot13 = 1;
V!     if (cli$present(c$dsc("FOLLOWUP")) & 1) return(do_readfollow(h,rot13,(c
Xli$present(c$dsc("NEW")) & 1)),0);
X!     if (cli$present(c$dsc("NEW")) & 1) return(do_readnew(h,rot13,0),0);
V!     if (cli$present(c$dsc("NEXT")) & 1) return(do_readnext(h,rot13,tpucall)
X,0);
X!     if (cli$present(c$dsc("PARENT")) & 1) return(do_readparent(h,rot13),0);
V!     if (cli$present(c$dsc("TOPIC")) & 1) return(do_readancestor(h,rot13,tpu
Xcall),0);
V!     if (cli$present(c$dsc("IDENTIFIER")) & 1) return(do_readident(h,rot13),
X0);
X!     if (cli$present(c$dsc("MARKER")) & 1) return(do_readmark(h,rot13),0);
X!     if (cli$present(c$dsc("PREV")) & 1) return(do_readprev(h,rot13),0);
V!     if ((cli$present(c$dsc("LAST")) & 1) `124`124 (cli$present(c$dsc("BACK"
X)) & 1)) `123
X!         if ((news_context > 1) && curr_g && (curr_i > 0)) `123
X!             if (cur_up_itm(curr_g,1,0) == 1) `123
X!                 item_update(curr_g,curr_i);
X!                 do_display(h,tpucall,rot13);
X!                 `125
X!             `125
X!         return(0);
X!         `125
V!     if (cli$get_value(c$dsc("NEWSITEM"),&item_dsc,&item_len) != CLI$_ABSENT
X) `123
X!         if (curr_g) `123
X!             item[item_len] = '\0';
X!             do_readfind(item,h,rot13);
X!             `125
X!         `125
X!     else if ((curr_g) && (curr_i > 0) && (news_context > 1)) `123
X          item_update(curr_g,curr_i);
X          do_display(h,tpucall,rot13);
X          `125
X--- 751,831 -----
X    int i;
X    ITM_PTR iap;
X `032
X!   if ((!curr_g) `124`124 (news_context < 2) `124`124 (curr_i < 1)) `123
X!     err_line("Error: Read - No Newsgroup selected");
X!     return(0);
X!     `125
X!`032
X!   iap = ga[curr_g]->grp_ia;
X!   w_str = malloc(strlen(str)+3);
X!   s_to_lower(str);
X!   strcpy(w_str,"*");
X!   strcat(w_str+1,str);
X!   strcat(w_str,"*");
X!   for (i = curr_i+1; i <= ga[curr_g]->grp_count; ++i) `123
X!     if (   !new_qual
X!         `124`124 (iap[i].itm_flags & NEWS_M_UNREAD)) `123
X!       strcpy(c_str,iap[i].itm_title);
X!       s_to_lower(c_str);
X!       if (wild_match(c_str,w_str)) break;
X!       `125
X!     `125
X!   free(w_str);
X!   if (i <= ga[curr_g]->grp_count) `123
X!     cur_set_itm(curr_g,i);
X!     item_update(curr_g,curr_i);
X!     do_display(h,tpucall,r13);
X!     `125
X!   else `123
X!     sprintf(err_oline,"Subject: %s - not located\n",str);
X!     err_line(err_oline);
X!     `125
X! `125
X!`032
X! do_read()
X! `123
X!   static char subj[128];
X!   static $DESCRIPTOR(subj_dsc,subj);
X!   char item[128];
X!   $DESCRIPTOR(item_dsc,item);
X!   short item_len;
X!   int h = 0,
X!       rot13 = 0;
X!`032
X!   tpucall = 0;
X!   if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X!   if (cli$present(c$dsc("TPU")) & 1) tpucall = 1;
X!   if (cli$present(c$dsc("EDITOR")) & 1) tpucall = 1;
X!   else if (cli$present(c$dsc("ROT13")) & 1) rot13 = 1;
-+-+-+-+-+ End of part 9 +-+-+-+-+-