[news.software.anu-news] NEWS V5.9B diff/patch 7/11

gih900@csc.anu.oz (Geoff Huston) (11/25/89)

+-+-+-+ Beginning of part 7 +-+-+-+
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;
V!   if (cli$present(c$dsc("FOLLOWUP")) & 1) return(do_readfollow(h,rot13,(cli
X$present(c$dsc("NEW")) & 1)),0);
X!   if (cli$present(c$dsc("SUBJECT")) & 1) `123
X!     if (   (cli$get_value(c$dsc("SUBJECT"),&item_dsc,&item_len) & 1)
V!         `124`124 (get_input_dflt(&item_dsc,c$dsc("Read/Subject="),&item_len
X,c$dsc(subj),0) & 1)) `123
X!       item[item_len] = '\0';
X!       strcpy(subj,item);
V!       if (item_len) readtitle(h,rot13,subj,(cli$present(c$dsc("NEW")) & 1))
X;
X!       `125
X!     return(0);
X!     `125
X!   if (cli$present(c$dsc("TITLE")) & 1) `123
X!     if (   (cli$get_value(c$dsc("TITLE"),&item_dsc,&item_len) & 1)
V!         && (get_input_dflt(&item_dsc,c$dsc("Read/Title="),&item_len,c$dsc(s
Xubj),0) & 1)) `123
X!       subj[item_len] = '\0';
X!       strcpy(subj,item);
V!       if (item_len) readtitle(h,rot13,subj,(cli$present(c$dsc("NEW")) & 1))
X;
X!       `125
X!     return(0);
X!     `125
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),0
X);
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,tpuca
Xll),0);
V!   if (cli$present(c$dsc("IDENTIFIER")) & 1) return(do_readident(h,rot13),0)
X;
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**************
X*** 782,787
X          item_update(curr_g,curr_i);
X          do_display(h,tpucall,rot13);
X          `125
X      return(0);
X  `125
X  `012
X--- 829,835 -----
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**************
X*** 783,788
X          do_display(h,tpucall,rot13);
X          `125
X      return(0);
X  `125
X  `012
X  /*
X--- 831,848 -----
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+   return(0);
X  `125
X  `012
X  /*
X**************
X*** 869,876
X  `012
X  do_back_note()
X  `123
X!     int h = 0,
X!         rot13 = 0;
X `032
X      tpucall = 0;
X      if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X--- 929,936 -----
X  `012
X  do_back_note()
X  `123
X!   int h = 0,
X!       rot13 = 0;
X `032
X    tpucall = 0;
X    if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X**************
X*** 872,891
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;
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!         else err_line("\tBACK: No previous item\n");
X!         `125
X!     else err_line("\tBACK: No newsgroup open\n");
X!     return(0);
X  `125
X `032
X  do_back_reply()
X--- 932,951 -----
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;
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!     else err_line("\tBACK: No previous item\n");
X!     `125
X!   else err_line("\tBACK: No newsgroup open\n");
X!   return(0);
X  `125
X `032
X  do_back_reply()
X**************
X*** 890,897
X `032
X  do_back_reply()
X  `123
X!     int h = 0,
X!         rot13 = 0;
X `032
X      tpucall = 0;
X      if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X--- 950,957 -----
X `032
X  do_back_reply()
X  `123
X!   int h = 0,
X!       rot13 = 0;
X `032
X    tpucall = 0;
X    if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X**************
X*** 893,907
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;
X!     if ((news_context > 1) && curr_g && (curr_i > 0))
X!         return(do_readparent(h,rot13),0);
X!     else err_line("\tBACK: No newsgroup open\n");
X!     return(0);
X  `125
X `032
X  do_topic()
X--- 953,967 -----
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;
X!   if ((news_context > 1) && curr_g && (curr_i > 0))
X!     return(do_readparent(h,rot13),0);
X!   else err_line("\tBACK: No newsgroup open\n");
X!   return(0);
X  `125
X `032
X  do_topic()
X**************
X*** 906,913
X `032
X  do_topic()
X  `123
X!     int h = 0,
X!         rot13 = 0;
X `032
X      tpucall = 0;
X      if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X--- 966,973 -----
X `032
X  do_topic()
X  `123
X!   int h = 0,
X!       rot13 = 0;
X `032
X    tpucall = 0;
X    if (cli$present(c$dsc("HEADER")) & 1) h = 1;
X**************
X*** 909,923
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;
X!     if ((news_context > 1) && curr_g && (curr_i > 0))
X!         return(do_readancestor(h,rot13,tpucall),0);
X!     else err_line("\tTOPIC: No newsgroup open\n");
X!     return(0);
X  `125
X `032
X  do_last()
X--- 969,983 -----
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;
X!   if ((news_context > 1) && curr_g && (curr_i > 0))
X!     return(do_readancestor(h,rot13,tpucall),0);
X!   else err_line("\tTOPIC: No newsgroup open\n");
X!   return(0);
X  `125
X `032
X  do_last()
$ GOSUB UNPACK_FILE

$ FILE_IS = "NEWSREGISTER.DIFF"
$ CHECKSUM_IS = 1985494786
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X*** [.news_v59_src]newsregister.c
X--- [.news_src]newsregister.c
$ GOSUB UNPACK_FILE

$ FILE_IS = "NEWSREMCLIENT.DIFF"
$ CHECKSUM_IS = 1986004863
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X*** [.news_v59_src]newsremclient.c
X--- [.news_src]newsremclient.c
X**************
X*** 38,44
X  **          database at that time become inaccessible, even for subsequent
X  **          NEWS invocations (connection attempts to the remote server are
X  **          lost.) net_write() - Stuart McGraw
X! **        - Add support for SRI Multinet - Mats Sundvall
X  **--
X  **/
X  `012
X--- 38,44 -----
X  **          database at that time become inaccessible, even for subsequent
X  **          NEWS invocations (connection attempts to the remote server are
X  **          lost.) net_write() - Stuart McGraw
X! **        - Add support for MULTINET Multinet - Mats Sundvall
X  **--
X  **/
X  `012
X**************
X*** 52,58
X `032
X  #define CMUTCP     1
X  #define WINTCP     2
X! #define SRITCP     3
X `032
X  #ifdef SRI
X  #define SRI`009   1
X--- 52,58 -----
X `032
X  #define CMUTCP     1
X  #define WINTCP     2
X! #define MULTINETTCP     3
X `032
X  #ifdef MULTINET
X  #define MULTINET`009   1
X**************
X*** 54,61
X  #define WINTCP     2
X  #define SRITCP     3
X `032
X! #ifdef SRI
X! #define SRI`009   1
X  #else
X  #ifdef TWG
X  #define TWG        1
X--- 54,61 -----
X  #define WINTCP     2
X  #define MULTINETTCP     3
X `032
X! #ifdef MULTINET
X! #define MULTINET`009   1
X  #else
X  #ifdef TWG
X  #define TWG        1
X**************
X*** 62,68
X  #endif
X  #endif
X `032
X! #if TWG `124`124 SRI
X  #include <types.h>
X  #include <socket.h>
X  #include <netdb.h>
X--- 62,68 -----
X  #endif
X  #endif
X `032
X! #if TWG `124`124 MULTINET
X  #include <types.h>
X  #include <socket.h>
X  #include <netdb.h>
X**************
X*** 265,272
X  #if TWG
X    else if (proto == WINTCP) `123
X      if (sys$assign(c$dsc("INET:"),&net_chan,0,0) & 1) `123
X! #elif SRI
X!   else if (proto == SRITCP) `123
X      if (sys$assign(c$dsc("INET0:"),&net_chan,0,0) & 1) `123
X  #endif
X  #if TWG `124`124 SRI
X--- 265,272 -----
X  #if TWG
X    else if (proto == WINTCP) `123
X      if (sys$assign(c$dsc("INET:"),&net_chan,0,0) & 1) `123
X! #elif MULTINET
X!   else if (proto == MULTINETTCP) `123
X      if (sys$assign(c$dsc("INET0:"),&net_chan,0,0) & 1) `123
X  #endif
X  #if TWG `124`124 MULTINET
X**************
X*** 269,275
X    else if (proto == SRITCP) `123
X      if (sys$assign(c$dsc("INET0:"),&net_chan,0,0) & 1) `123
X  #endif
X! #if TWG `124`124 SRI
X        if (   (sys$qiow(0,net_chan,IO$_SOCKET,&read_iosb,0,0,
X                         AF_INET,SOCK_STREAM,0,0,0,0) & 1)
X            && (read_iosb.iostatus & 1)) `123
X--- 269,275 -----
X    else if (proto == MULTINETTCP) `123
X      if (sys$assign(c$dsc("INET0:"),&net_chan,0,0) & 1) `123
X  #endif
X! #if TWG `124`124 MULTINET
X        if (   (sys$qiow(0,net_chan,IO$_SOCKET,&read_iosb,0,0,
X                         AF_INET,SOCK_STREAM,0,0,0,0) & 1)
X            && (read_iosb.iostatus & 1)) `123
X**************
X*** 346,352
-+-+-+-+-+ End of part 7 +-+-+-+-+-