home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1466 < prev    next >
Internet Message Format  |  1990-12-28  |  49KB

  1. From: sob@lib.tmc.edu (Stan Barber)
  2. Newsgroups: alt.sources
  3. Subject: rrn/rn combo kit part 9 of 9
  4. Message-ID: <435@lib.tmc.edu>
  5. Date: 14 Jun 90 03:29:56 GMT
  6.  
  7. #! /bin/sh
  8.  
  9. # Make a new directory for the rn sources, cd to it, and run kits 1 thru 9 
  10. # through sh.  When all 9 kits have been run, read README.
  11.  
  12. echo "This is rn kit 9 (of 9).  If kit 9 is complete, the line"
  13. echo '"'"End of kit 9 (of 9)"'" will echo at the end.'
  14. echo ""
  15. export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
  16. echo Extracting only.c
  17. cat >only.c <<'!STUFFY!FUNK!'
  18. /* $Header: only.c,v 4.3 85/05/01 11:45:21 lwall Exp $
  19.  *
  20.  * $Log:    only.c,v $
  21.  * Revision 4.3  85/05/01  11:45:21  lwall
  22.  * Baseline for release with 4.3bsd.
  23.  * 
  24.  */
  25.  
  26. #include "EXTERN.h"
  27. #include "common.h"
  28. #include "search.h"
  29. #include "util.h"
  30. #include "final.h"
  31. #include "ngsrch.h"
  32. #include "INTERN.h"
  33. #include "only.h"
  34.  
  35. void
  36. only_init()
  37. {
  38.     ;
  39. }
  40.  
  41. void
  42. setngtodo(pat)
  43. char *pat;
  44. {
  45.     char *s;
  46.  
  47. #ifdef ONLY
  48.     if (!*pat)
  49.     return;
  50.     if (maxngtodo < NGMAX) {
  51.     ngtodo[maxngtodo] = savestr(pat);
  52. #ifdef SPEEDOVERMEM
  53. #ifndef lint
  54.     compextodo[maxngtodo] = (COMPEX*)safemalloc(sizeof(COMPEX));
  55. #endif lint
  56.     init_compex(compextodo[maxngtodo]);
  57.     compile(compextodo[maxngtodo],pat,TRUE,TRUE);
  58.     if ((s = ng_comp(compextodo[maxngtodo],pat,TRUE,TRUE)) != Nullch) {
  59.                         /* compile regular expression */
  60.         printf("\n%s\n",s) FLUSH;
  61.         finalize(1);
  62.     }
  63. #endif
  64.     maxngtodo++;
  65.     }
  66. #else
  67.     notincl("o");
  68. #endif
  69. }
  70.  
  71. /* if command line list is non-null, is this newsgroup wanted? */
  72.  
  73. bool
  74. inlist(ngnam)
  75. char *ngnam;
  76. {
  77. #ifdef ONLY
  78.     register int i;
  79. #ifdef SPEEDOVERMEM
  80.  
  81.     if (maxngtodo == 0)
  82.     return TRUE;
  83.     for (i=0; i<maxngtodo; i++) {
  84.     if (execute(compextodo[i],ngnam))
  85.         return TRUE;
  86.     }
  87.     return FALSE;
  88. #else
  89.     COMPEX ilcompex;
  90.     char *s;
  91.  
  92.     if (maxngtodo == 0)
  93.     return TRUE;
  94.     init_compex(&ilcompex);
  95.     for (i=0; i<maxngtodo; i++) {
  96.     if ((s = ng_comp(&ilcompex,ngtodo[i],TRUE,TRUE)) != Nullch) {
  97.                         /* compile regular expression */
  98.         printf("\n%s\n",s) FLUSH;
  99.         finalize(1);
  100.     }
  101.     
  102.     if (execute(&ilcompex,ngnam) != Nullch) {
  103.         free_compex(&ilcompex);
  104.         return TRUE;
  105.     }
  106.     }
  107.     free_compex(&ilcompex);
  108.     return FALSE;
  109. #endif
  110. #else
  111.     return TRUE;
  112. #endif
  113. }
  114.  
  115. #ifdef ONLY
  116. void
  117. end_only()
  118. {
  119.     if (maxngtodo) {            /* did they specify newsgroup(s) */
  120.     int whicharg;
  121.  
  122. #ifdef VERBOSE
  123.     IF(verbose)
  124.         printf("\nRestriction %s%s removed.\n",ngtodo[0],
  125.         maxngtodo > 1 ? ", etc." : nullstr) FLUSH;
  126.     ELSE
  127. #endif
  128. #ifdef TERSE
  129.         fputs("\nExiting \"only\".\n",stdout) FLUSH;
  130. #endif
  131.     for (whicharg = 0; whicharg < maxngtodo; whicharg++) {
  132.         free(ngtodo[whicharg]);
  133. #ifdef SPEEDOVERMEM
  134.         free_compex(compextodo[whicharg]);
  135. #ifndef lint
  136.         free((char*)compextodo[whicharg]);
  137. #endif lint
  138. #endif
  139.     }
  140.     maxngtodo = 0;
  141.     }
  142. }
  143. #endif
  144. !STUFFY!FUNK!
  145. echo Extracting ndir.c
  146. cat >ndir.c <<'!STUFFY!FUNK!'
  147. /* $Header: ndir.c,v 4.3.1.5 90/03/22 23:04:47 sob Exp $
  148.  *
  149.  * $Log:    ndir.c,v $
  150.  * Revision 4.3.1.5  90/03/22  23:04:47  sob
  151.  * Fixes provided by Wayne Davison <drivax!davison>
  152.  * 
  153.  * Revision 4.3.1.3  85/05/23  11:19:24  lwall
  154.  * Oops, shouldn't have included sys/types.h again.
  155.  * 
  156.  * Revision 4.3.1.2  85/05/15  14:46:00  lwall
  157.  * Changed short to ino_t, which may be ushort on some systems.
  158.  * 
  159.  * Revision 4.3.1.1  85/05/10  11:35:34  lwall
  160.  * Branch for patches.
  161.  * 
  162.  * Revision 4.3  85/05/01  11:42:55  lwall
  163.  * Baseline for release with 4.3bsd.
  164.  * 
  165.  */
  166.  
  167. #include "EXTERN.h"
  168. #include "common.h"
  169. #include "INTERN.h"
  170. #include "ndir.h"
  171.  
  172. #ifdef USENDIR
  173. /*
  174.  * support for Berkeley directory reading routine on a V7 file system
  175.  */
  176.  
  177. /*
  178.  * open a directory.
  179.  */
  180. DIR *
  181. opendir(name)
  182. char *name;
  183. {
  184.     register DIR *dirp;
  185.     register int fd;
  186.     char *malloc();
  187.  
  188.     if ((fd = open(name, 0)) == -1)
  189.         return NULL;
  190.     if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
  191.         close (fd);
  192.         return NULL;
  193.     }
  194.     dirp->dd_fd = fd;
  195.     dirp->dd_loc = 0;
  196.     return dirp;
  197. }
  198.  
  199. /*
  200.  * read an old style directory entry and present it as a new one
  201.  */
  202. #ifndef pyr
  203. #define    ODIRSIZ    14
  204.  
  205. struct    olddirect {
  206.     ino_t    od_ino;
  207.     char    od_name[ODIRSIZ];
  208. };
  209. #else    an Pyramid in the ATT universe
  210. #define    ODIRSIZ    248
  211.  
  212. struct    olddirect {
  213.     long    od_ino;
  214.     short    od_fill1, od_fill2;
  215.     char    od_name[ODIRSIZ];
  216. };
  217. #endif
  218.  
  219. /*
  220.  * get next entry in a directory.
  221.  */
  222. struct direct *
  223. readdir(dirp)
  224. register DIR *dirp;
  225. {
  226.     register struct olddirect *dp;
  227.     static struct direct dir;
  228.  
  229.     for (;;) {
  230.         if (dirp->dd_loc == 0) {
  231.             dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
  232.                 DIRBLKSIZ);
  233.             if (dirp->dd_size <= 0)
  234.                 return NULL;
  235.         }
  236.         if (dirp->dd_loc >= dirp->dd_size) {
  237.             dirp->dd_loc = 0;
  238.             continue;
  239.         }
  240.         dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc);
  241.         dirp->dd_loc += sizeof(struct olddirect);
  242.         if (dp->od_ino == 0)
  243.             continue;
  244.         dir.d_ino = dp->od_ino;
  245.         strncpy(dir.d_name, dp->od_name, ODIRSIZ);
  246.         dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */
  247.         dir.d_namlen = strlen(dir.d_name);
  248.         dir.d_reclen = DIRSIZ(&dir);
  249.         return (&dir);
  250.     }
  251. }
  252.  
  253. /*
  254.  * close a directory.
  255.  */
  256. void
  257. closedir(dirp)
  258. register DIR *dirp;
  259. {
  260.     close(dirp->dd_fd);
  261.     dirp->dd_fd = -1;
  262.     dirp->dd_loc = 0;
  263.     free(dirp);
  264. }
  265. #endif USENDIR
  266. !STUFFY!FUNK!
  267. echo Extracting backpage.c
  268. cat >backpage.c <<'!STUFFY!FUNK!'
  269. /* $Header: backpage.c,v 4.3 85/05/01 11:36:03 lwall Exp $
  270.  *
  271.  * $Log:    backpage.c,v $
  272.  * Revision 4.3  85/05/01  11:36:03  lwall
  273.  * Baseline for release with 4.3bsd.
  274.  * 
  275.  */
  276.  
  277. #include "EXTERN.h"
  278. #include "common.h"
  279. #include "intrp.h"
  280. #include "final.h"
  281. #include "INTERN.h"
  282. #include "backpage.h"
  283.  
  284. ART_LINE maxindx = -1;
  285. long lseek();
  286.  
  287. void
  288. backpage_init()
  289. {
  290.     char *varyname;
  291.     
  292.     varyname = filexp(VARYNAME);
  293.     close(creat(varyname,0600));
  294.     varyfd = open(varyname,2);
  295.     UNLINK(varyname);
  296.     if (varyfd < 0) {
  297.     printf(cantopen,varyname) FLUSH;
  298.     sig_catcher(0);
  299.     }
  300.     
  301. }
  302.  
  303. /* virtual array read */
  304.  
  305. ART_POS
  306. vrdary(indx)
  307. ART_LINE indx;
  308. {
  309.     int subindx;
  310.     long offset;
  311.  
  312. #ifdef DEBUGGING
  313.     if (indx > maxindx) {
  314.     printf("vrdary(%ld) > %ld\n",(long)indx, (long)maxindx) FLUSH;
  315.     return 0;
  316.     }
  317. #endif
  318.     if (indx < 0)
  319.     return 0;
  320.     subindx = indx % VARYSIZE;
  321.     offset = (indx - subindx) * sizeof(varybuf[0]);
  322.     if (offset != oldoffset) {
  323.     if (oldoffset >= 0) {
  324. #ifndef lint
  325.         (void)lseek(varyfd,oldoffset,0);
  326.         write(varyfd, (char *)varybuf,sizeof(varybuf));
  327. #endif lint
  328.     }
  329. #ifndef lint
  330.     (void)lseek(varyfd,offset,0);
  331.     read(varyfd,(char *)varybuf,sizeof(varybuf));
  332. #endif lint
  333.     oldoffset = offset;
  334.     }
  335.     return varybuf[subindx];
  336. }
  337.  
  338. /* write to virtual array */
  339.  
  340. void
  341. vwtary(indx,newvalue)
  342. ART_LINE indx;
  343. ART_POS newvalue;
  344. {
  345.     int subindx;
  346.     long offset;
  347.  
  348. #ifdef DEBUGGING
  349.     if (indx < 0)
  350.     printf("vwtary(%ld)\n",(long)indx) FLUSH;
  351.     if (!indx)
  352.     maxindx = 0;
  353.     if (indx > maxindx) {
  354.     if (indx != maxindx + 1)
  355.         printf("indx skipped %d-%d\n",maxindx+1,indx-1) FLUSH;
  356.     maxindx = indx;
  357.     }
  358. #endif
  359.     subindx = indx % VARYSIZE;
  360.     offset = (indx - subindx) * sizeof(varybuf[0]);
  361.     if (offset != oldoffset) {
  362.     if (oldoffset >= 0) {
  363. #ifndef lint
  364.         (void)lseek(varyfd,oldoffset,0);
  365.         write(varyfd,(char *)varybuf,sizeof(varybuf));
  366. #endif lint
  367.     }
  368. #ifndef lint
  369.     (void)lseek(varyfd,offset,0);
  370.     read(varyfd,(char *)varybuf,sizeof(varybuf));
  371. #endif lint
  372.     oldoffset = offset;
  373.     }
  374.     varybuf[subindx] = newvalue;
  375. }
  376.  
  377. !STUFFY!FUNK!
  378. echo Extracting subs.help.SH
  379. cat >subs.help.SH <<'!STUFFY!FUNK!'
  380. case $CONFIG in
  381.     '') . config.sh ;;
  382. esac
  383. echo "Extracting subs.help (with variable substitutions)"
  384. $spitshell >subs.help <<!GROK!THIS!
  385. $startsh
  386. # $Header: subs.help.SH,v 4.3.2.1 89/11/26 18:38:47 sob Locked $
  387. # $Log:    subs.help.SH,v $
  388. # Revision 4.3.2.1  89/11/26  18:38:47  sob
  389. # *** empty log message ***
  390. # Revision 4.3  85/05/01  11:50:50  lwall
  391. # Baseline for release with 4.3bsd.
  392.  
  393. $pager <<'EOT'
  394. Valid substitutions are:
  395.  
  396. a    Current article number
  397. A    Full name of current article (%P/%c/%a)
  398. b    Destination of last save command, often a mailbox
  399. B    Bytes to ignore at beginning of last saved article
  400. c    Current newsgroup, directory form
  401. C    Current newsgroup, dot form
  402. d    Full name of newsgroup directory (%P/%c)
  403. D    Distribution line from current article
  404. f    Who the current article is from
  405. F    Newsgroups to followup to (from Newsgroups and Followup-To)
  406. h    (This help message)
  407. H    Host name (yours)
  408. i    Message-I.D. line from current article, with <>
  409. I    Reference indicator mark (see -F switch)
  410. l    News administrator's login name, if any
  411. L    Login name (yours)
  412. m    Current mode, first letter of (init,newsgroup,article,pager,misc)
  413. M    Number of article marked with M
  414. n    Newsgroups from current article
  415. N    Full name (yours)
  416. o    Organization (yours)
  417. O    Original working directory (where you ran rn from)
  418. p    Your private news directory (from -d)
  419. P    Public news spool directory
  420. r    Last reference (parent article id)
  421. R    References list for followup article
  422. s    Subject, with all Re's and (nf)'s stripped off
  423. S    Subject, with one Re stripped off
  424. t    New To line derived from From and Reply-To (Internet format)
  425. T    New To line derived from Path
  426. u    Number of unread articles
  427. U    Number of unread articles not counting current article
  428. x    News library directory
  429. X    Rn library directory
  430. z    Length of current article in bytes
  431. ~    Your home directory
  432. .    Directory containing . files
  433. $    Current process number
  434. /    Last search string
  435. ESC    Run preceding command through % interpretation
  436. EOT
  437. !GROK!THIS!
  438. $eunicefix subs.help
  439. chmod 755 subs.help
  440. !STUFFY!FUNK!
  441. echo Extracting bits.h
  442. cat >bits.h <<'!STUFFY!FUNK!'
  443. /* $Header: bits.h,v 4.3.1.2 86/11/03 09:49:58 lwall Exp $
  444.  *
  445.  * $Log:    bits.h,v $
  446.  * Revision 4.3.1.2  86/11/03  09:49:58  lwall
  447.  * Added firstbit variable.
  448.  * 
  449.  * Revision 4.3.1.1  85/05/10  11:31:52  lwall
  450.  * Branch for patches.
  451.  * 
  452.  * Revision 4.3  85/05/01  11:36:39  lwall
  453.  * Baseline for release with 4.3bsd.
  454.  * 
  455.  */
  456.  
  457. EXT char *ctlarea INIT(Nullch);    /* one bit for each article in current newsgroup */
  458.             /* with the following interpretation: */
  459.             /*    0 => unread  */
  460.             /*    1 => read    */
  461.  
  462. /* if subscripting is faster than shifting on your machine, define this */
  463. #undef USESUBSCRIPT
  464. #ifdef USESUBSCRIPT
  465. EXT char powerof2[] INIT({1,2,4,8,16,32,64,128});
  466. #define pow2(x) powerof2[x]
  467. #else
  468. #define pow2(x) (1 << (x))
  469. #endif
  470.  
  471. #ifdef lint
  472. EXT bool nonesuch INIT(FALSE);
  473. #define ctl_set(a)
  474. #define ctl_clear(a)
  475. #define ctl_read(a) nonesuch
  476. #define was_read(a) nonesuch
  477. #else
  478. #define ctl_set(a) (ctlarea[(OFFSET(a)) / BITSPERBYTE] |= pow2((OFFSET(a)) % BITSPERBYTE))
  479. #define ctl_clear(a) (ctlarea[(OFFSET(a)) / BITSPERBYTE] &= ~pow2((OFFSET(a)) % BITSPERBYTE))
  480. #define ctl_read(a) ((ctlarea[(OFFSET(a)) / BITSPERBYTE] & pow2((OFFSET(a)) % BITSPERBYTE)) != 0)
  481.  
  482. #define was_read(a) ((a)<firstbit || ctl_read(a))
  483. #endif lint
  484.  
  485. EXT ART_NUM absfirst INIT(0);    /* 1st real article in current newsgroup */
  486. EXT ART_NUM firstart INIT(0);    /* minimum unread article number in newsgroup */
  487. EXT ART_NUM firstbit INIT(0);    /* minimum valid bit, usually == firstart */
  488. EXT ART_NUM lastart INIT(0);    /* maximum article number in newsgroup */
  489.  
  490. #ifdef DELAYMARK
  491. EXT FILE *dmfp INIT(Nullfp);
  492. EXT char *dmname INIT(Nullch);
  493. EXT int dmcount INIT(0);
  494. #endif
  495.  
  496. void    bits_init();
  497. void    checkpoint_rc();
  498. void    restore_ng();
  499. void    onemore();
  500. void    oneless();
  501. void    unmark_as_read();
  502. void    delay_unmark();
  503. void    mark_as_read();
  504. void    check_first();
  505. #ifdef DELAYMARK
  506.     void    yankback();
  507. #endif
  508. int    chase_xrefs();
  509. int    initctl();
  510. void    grow_ctl();
  511. !STUFFY!FUNK!
  512. echo Extracting getactive.c
  513. cat >getactive.c <<'!STUFFY!FUNK!'
  514. /* $Header: getactive.c,v 1.2 89/11/28 01:50:22 sob Locked $
  515.  *
  516.  * $Log:    getactive.c,v $
  517.  * Revision 1.2  89/11/28  01:50:22  sob
  518.  * Changed so that it won't give makedepend problems with SERVER is not defined.
  519.  * 
  520.  * Revision 1.1  89/11/06  00:50:14  sob
  521.  * Initial revision
  522.  * 
  523.  *
  524.  */
  525. #include <stdio.h>
  526. #include "config.h"
  527. #include "EXTERN.h"
  528. #ifdef SERVER
  529. #include "server.h"
  530. #endif
  531.  
  532. main(argc, argv)
  533.     int        argc;
  534.     char         *argv[];
  535. {
  536.     char        ser_line[256];
  537.     int        response;
  538.     register char    *server;
  539.     register FILE    *actfp;
  540.  
  541.     if (argc != 2) {
  542.         fprintf(stderr, "Usage: getactive filename\n");
  543.         exit(1);
  544.     }
  545.  
  546.     server = getserverbyfile(SERVER_FILE);
  547.     if (server == NULL) {
  548.         fprintf(stderr, "Couldn't get name of news server from %s\n",
  549.             SERVER_FILE);
  550.         fprintf(stderr,
  551.       "Either fix this file, or put NNTPSERVER in your environment.\n");
  552.         exit(1);
  553.     }
  554.  
  555.     response = server_init(server);
  556.     if (response < 0) {
  557.         fprintf(stderr,
  558.             "getactive: Can't get active file from server %s.\n",
  559.                 server);
  560.         exit(1);
  561.     }
  562.  
  563.     if (handle_server_response(response, server) < 0)
  564.         exit(1);
  565.  
  566.     put_server("LIST");    /* tell server we want the active file */
  567.     (void) get_server(ser_line, sizeof(ser_line));
  568.     if (*ser_line != CHAR_OK) {        /* and then see if that's ok */
  569.         fprintf(stderr,
  570.             "getactive: Can't get active file from server.\n");
  571.         fprintf(stderr, "Server said: %s\n", ser_line);
  572.         exit(1);
  573.     }
  574.  
  575.     actfp = fopen(argv[1], "w");        /* and get ready */
  576.     if (actfp == NULL) {
  577.         close_server();
  578.         perror(argv[1]);
  579.         exit(1);
  580.     }
  581.  
  582.     while (get_server(ser_line, sizeof(ser_line)) >= 0) {  /* while */
  583.         if (ser_line[0] == '.')        /* there's another line */
  584.             break;            /* get it and write it to */
  585.         if (actfp != NULL) {        /* the temporary active file */
  586.             fputs(ser_line, actfp);
  587.             putc('\n', actfp);
  588.         }
  589.     }
  590.  
  591.     (void) fclose(actfp);
  592.     close_server();
  593. }
  594. !STUFFY!FUNK!
  595. echo Extracting ng.help.SH
  596. cat >ng.help.SH <<'!STUFFY!FUNK!'
  597. case $CONFIG in
  598.     '') . config.sh ;;
  599. esac
  600. echo "Extracting ng.help (with variable substitutions)"
  601. $spitshell >ng.help <<!GROK!THIS!
  602. $startsh
  603. # $Header: ng.help.SH,v 4.3 85/05/01 11:44:34 lwall Exp $
  604. # $Log:    ng.help.SH,v $
  605. # Revision 4.3  85/05/01  11:44:34  lwall
  606. # Baseline for release with 4.3bsd.
  607.  
  608. $pager <<'EOT'
  609. Newsgroup Selection commands:
  610.  
  611. y,SP    Do this newsgroup now.
  612. .cmd    Do this newsgroup, executing cmd as first command.
  613. =    Equivalent to .=<carriage return>.
  614. u    Unsubscribe from this newsgroup.
  615. c    Catch up (mark this newsgroup all read).
  616.  
  617. n    Go to the next newsgroup with unread news.
  618. N    Go to the next newsgroup.
  619. p    Go to the previous newsgroup with unread news.
  620. P    Go to the previous newsgroup.
  621. -    Go to the previously displayed newsgroup.
  622. 1    Go to the first newsgroup.
  623. ^    Go to the first newsgroup with unread news.
  624. $    Go to the last newsgroup.
  625. g name    Go to the named newsgroup.  Subscribe to new newsgroups this way too.
  626. /pat    Search forward for newsgroup matching pattern.
  627. ?pat    Search backward for newsgroup matching pattern.
  628.     (Use * and ? style patterns.  Append r to include read newsgroups.)
  629. l pat    List unsubscribed newsgroups containing pattern.
  630. m name    Move named newsgroup elsewhere (no name moves current newsgroup).
  631. o pat    Only display newsgroups matching pattern.  Omit pat to unrestrict.
  632. a pat    Like o, but also scans for unsubscribed newsgroups matching pattern.
  633. L    List current .newsrc.
  634. &    Print current command-line switch settings.
  635. &switch {switch}
  636.     Set (or unset) more command-line switches.
  637. &&    Print current macro definitions.
  638. &&def    Define a new macro.
  639. !cmd    Shell escape.
  640. q    Quit rn.
  641. ^K    Edit the global KILL file.  Use commands like /pattern/j to suppress
  642.     pattern in every newsgroup.
  643. v    Print version.
  644. EOT
  645. !GROK!THIS!
  646. $eunicefix ng.help
  647. chmod 755 ng.help
  648. !STUFFY!FUNK!
  649. echo Extracting newsgroups.1
  650. cat >newsgroups.1 <<'!STUFFY!FUNK!'
  651. ''' $Header: newsgroups.1,v 4.3 85/05/01 11:43:32 lwall Exp $
  652. ''' 
  653. ''' $Log:    newsgroups.1,v $
  654. ''' Revision 4.3  85/05/01  11:43:32  lwall
  655. ''' Baseline for release with 4.3bsd.
  656. ''' 
  657. ''' 
  658. .de Sh
  659. .br
  660. .ne 5
  661. .PP
  662. \fB\\$1\fR
  663. .PP
  664. ..
  665. .de Sp
  666. .if t .sp .5v
  667. .if n .sp
  668. ..
  669. '''
  670. '''     Set up \*(-- to give an unbreakable dash;
  671. '''     string Tr holds user defined translation string.
  672. '''     Bell System Logo is used as a dummy character.
  673. '''
  674. .ie n \{\
  675. .tr \(bs-\*(Tr
  676. .ds -- \(bs-
  677. .if (\n(.H=4u)&(1m=24u) .ds -- \(bs\h'-12u'\(bs\h'-12u'-\" diablo 10 pitch
  678. .if (\n(.H=4u)&(1m=20u) .ds -- \(bs\h'-12u'\(bs\h'-8u'-\" diablo 12 pitch
  679. .ds L" ""
  680. .ds R" ""
  681. .ds L' '
  682. .ds R' '
  683. 'br\}
  684. .el\{\
  685. .ds -- \(em\|
  686. .tr \*(Tr
  687. .ds L" ``
  688. .ds R" ''
  689. .ds L' `
  690. .ds R' '
  691. 'br\}
  692. .TH NEWSGROUPS 1 LOCAL
  693. .SH NAME
  694. newsgroups - a program to list unsubscribed newsgroups.
  695. .SH SYNOPSIS
  696. .B newsgroups pattern flag
  697. .SH DESCRIPTION
  698. The
  699. .I newsgroups
  700. program compares your .newsrc file with the file of active newsgroups,
  701. and prints a list of unsubscribed newsgroups matching pattern.
  702. If the second argument \*(L"flag\*(R" is present, only newsgroups not
  703. found in your .newsrc are listed, and the display is not paged.
  704. If the second argument is missing, the display is paged, and an additional
  705. list of unsubscribed newsgroups occurring in your .newsrc is printed.
  706. .SH ENVIRONMENT
  707. .IP DOTDIR 8
  708. Where to find your .newsrc, if not in your home directory.
  709. .Sp
  710. Default: $HOME
  711. .IP HOME 8
  712. Your home directory.
  713. .Sp
  714. Default: $LOGDIR
  715. .IP LOGDIR 8
  716. Your home directory if HOME is undefined.
  717. .SH FILES
  718. /usr/lib/news/active or a reasonable facsimile
  719. .br
  720. ${DOTDIR-{$HOME-$LOGDIR}}/.newsrc
  721. .SH SEE ALSO
  722. rn(1), newsrc(5)
  723. .SH DIAGNOSTICS
  724. .SH BUGS
  725. The flag argument is a kludge.
  726. !STUFFY!FUNK!
  727. echo Extracting pager.help.SH
  728. cat >pager.help.SH <<'!STUFFY!FUNK!'
  729. case $CONFIG in
  730.     '') . config.sh ;;
  731. esac
  732. echo "Extracting pager.help (with variable substitutions)"
  733. $spitshell >pager.help <<!GROK!THIS!
  734. $startsh
  735. # $Header: pager.help.SH,v 4.3 85/05/01 11:45:31 lwall Exp $
  736. #
  737. # $Log:    pager.help.SH,v $
  738. # Revision 4.3  85/05/01  11:45:31  lwall
  739. # Baseline for release with 4.3bsd.
  740.  
  741. $pager <<'EOT'
  742. Paging commands:
  743.  
  744. SP    Display the next page.
  745. x    Display the next page decrypted (rot13).
  746. d    Display half a page more.
  747. CR    Display one more line.
  748. ^R,v,^X    Restart the current article (v=verbose header, ^X=rot13).
  749. ^B    Back up one page.
  750. ^L,X    Refresh the screen (X=rot13).
  751. g pat    Go to (search forward within article for) pattern.
  752. G    Search again for current pattern within article.
  753. ^G    Search for next line beginning with \"Subject:\".
  754. TAB    Search for next line beginning with a different character.
  755. q    Quit the pager, go to end of article.  Leave article read or unread.
  756. j    Junk this article (mark it read).  Goes to end of article.
  757.  
  758. The following commands skip the rest of the current article, then behave
  759. just as if typed to the 'What next?' prompt at the end of the article:
  760.  
  761. n    Scan forward for next unread article.
  762. N    Go to next article.
  763. ^N    Scan forward for next unread article with same title.
  764. p,P,^P    Same as n,N,^N, only going backwards.
  765. -    Go to previously displayed article.
  766.  
  767. The following commands also take you to the end of the article.
  768. Type h at end of article for a description of these commands:
  769.  
  770.     # $ & / = ? c C f F k K ^K m M number r R ^R s S u v w W Y ^ |
  771.  
  772. (To return to the middle of the article after one of these commands, type ^L.)
  773. EOT
  774. !GROK!THIS!
  775. $eunicefix pager.help
  776. chmod 755 pager.help
  777. !STUFFY!FUNK!
  778. echo Extracting range.c
  779. cat >range.c <<'!STUFFY!FUNK!'
  780. #ifndef lint
  781. static char * rcsid ="$Header: range.c,v 1.1 89/11/08 03:45:39 sob Locked $";
  782. #endif
  783. /*
  784. ***************************************************************************
  785. This work in its current form is Copyright 1989 Stan Barber
  786. This software may be distributed freely as long as no profit is made from
  787. such distribution and this notice is reproducted in whole.
  788. ***************************************************************************
  789. This software is provided on an "as is" basis with no guarantee of 
  790. usefulness or correctness of operation for any purpose, intended or
  791. otherwise. The author is in no way liable for this software's performance
  792. or any damage it may cause to any data of any kind anywhere.
  793. ***************************************************************************
  794. */
  795. /*
  796.  * $Log:    range.c,v $
  797.  * Revision 1.1  89/11/08  03:45:39  sob
  798.  * Initial revision
  799.  * 
  800.  *
  801.  */
  802.  
  803. #include <stdio.h>
  804. extern char *rindex();
  805. char * progname;
  806.  
  807. main(argc,argv)
  808. char *argv[];
  809. int argc;
  810. {
  811.     int x,y,i;
  812.  
  813.  
  814.     if ((progname = rindex(argv[0],'/'))== NULL)
  815.         progname = argv[0];
  816.     else progname++;
  817.     
  818.  
  819.     if (argc != 3) usage();
  820.     x = atoi(argv[1]);
  821.     y = atoi(argv[2]);
  822.     if (y < x) usage();
  823.     y++;
  824.  
  825.     for (i=x;i < y;i++)
  826.     printf("%d ",i);
  827.     printf("\n");
  828.  
  829.     exit(0);
  830. }
  831.  
  832. usage(){
  833.     fprintf(stderr,"Usage: %s startnumber endnumber\n",progname);
  834.     exit(-1);
  835. }
  836. !STUFFY!FUNK!
  837. echo Extracting newsnews.SH
  838. cat >newsnews.SH <<'!STUFFY!FUNK!'
  839. case $CONFIG in
  840.     '') . config.sh ;;
  841. esac
  842. echo "Extracting newsnews (with variable substitutions)"
  843. cat >newsnews <<!GROK!THIS!
  844.             *** NEWS NEWS ***
  845.  
  846. Welcome to rn.  There are more options to rn than you want to think about, so
  847. we won't list them here.  If you want to find out about them, read the manual
  848. page(s).  There are some important things to remember, though:
  849.  
  850.   * Rn is not a modified readnews.  Don't expect the commands to be identical.
  851.   * Rn runs in cbreak mode.  This means you don't have to type carriage return
  852.     on single character commands.  (There are some multi-character commands.)
  853.   * At ANY prompt in rn, you may type 'h' for help.  There are many different
  854.     help menus, depending on where you are in rn.  Typing <esc>h in the
  855.     middle of a multi-character command will list escape substitutions.
  856.   * Typing a space to any prompt means to do the normal thing.  You could
  857.     spend all day reading news and never hit anything but the space bar.
  858.  
  859. This particular message comes from $rnlib/newsnews.  You will only
  860. see it once.  You news administrator should feel free to substitute his or
  861. her own message whenever something new happens to rn, and then the file
  862. will again be displayed, just once for each person.
  863.  
  864. Larry Wall    lwall@jpl-devvax.jpl.nasa.gov
  865. !GROK!THIS!
  866. $eunicefix newsnews
  867. !STUFFY!FUNK!
  868. echo Extracting last.c
  869. cat >last.c <<'!STUFFY!FUNK!'
  870. /* $Header: last.c,v 4.3.2.1 89/12/20 23:23:07 sob Exp $
  871.  *
  872.  * $Log:    last.c,v $
  873.  * Revision 4.3.2.1  89/12/20  23:23:07  sob
  874.  * .rnlast sometimes is a null file. This gives bogus information when
  875.  * restarting rn following an abnormal termination. This bug was reported
  876.  * by weening@gang-of-four.stanford.edu
  877.  * 
  878.  * Revision 4.3  85/05/01  11:42:16  lwall
  879.  * Baseline for release with 4.3bsd.
  880.  * 
  881.  */
  882.  
  883. #include "EXTERN.h"
  884. #include "common.h"
  885. #include "rn.h"
  886. #include "util.h"
  887. #include "intrp.h"
  888. #include "INTERN.h"
  889. #include "last.h"
  890.  
  891. char *lastname = Nullch;    /* path name of .rnlast file */
  892.  
  893. void
  894. last_init(tcbuf)
  895. char *tcbuf;
  896. {
  897.     lastname = savestr(filexp(LASTNAME));
  898.     if ((tmpfp = fopen(lastname,"r")) != Nullfp &&
  899.     fgets(tcbuf,1024,tmpfp) != Nullch) {
  900.     tcbuf[strlen(tcbuf)-1] = '\0';
  901.     lastngname = savestr(tcbuf);
  902.     fgets(tcbuf,1024,tmpfp);
  903.     lasttime = atol(tcbuf);
  904.     fgets(tcbuf,1024,tmpfp);
  905.     lastactsiz = atol(tcbuf);
  906.     fclose(tmpfp);
  907.     }
  908.     else {
  909.     lastngname = nullstr;
  910.     lasttime = 0;
  911.     lastactsiz = 0;
  912.     }
  913. }
  914.  
  915. /* put out certain values for next run of rn */
  916.  
  917. void
  918. writelast()
  919. {
  920.     if ((tmpfp = fopen(lastname,"w")) != Nullfp) {
  921.     fprintf(tmpfp,"%s\n%ld\n%ld\n",
  922.         (ngname==Nullch?nullstr:ngname),(long)lasttime,(long)lastactsiz);
  923.     fclose(tmpfp);
  924.     }
  925.     else
  926.     printf(cantcreate,lastname) FLUSH;
  927. }
  928. !STUFFY!FUNK!
  929. echo Extracting rcstuff.h
  930. cat >rcstuff.h <<'!STUFFY!FUNK!'
  931. /* $Header: rcstuff.h,v 4.3 85/05/01 11:46:49 lwall Exp $
  932.  *
  933.  * $Log:    rcstuff.h,v $
  934.  * Revision 4.3  85/05/01  11:46:49  lwall
  935.  * Baseline for release with 4.3bsd.
  936.  * 
  937.  */
  938.  
  939. EXT char *rcline[MAXRCLINE];/* pointers to lines of .newsrc */
  940. EXT ART_UNREAD toread[MAXRCLINE];
  941.             /* number of articles to be read in newsgroup */
  942.             /* <0 => invalid or unsubscribed newsgroup */
  943. #define TR_ONE ((ART_UNREAD) 1)
  944. #define TR_NONE ((ART_UNREAD) 0)
  945. #define TR_UNSUB ((ART_UNREAD) -1)
  946.             /* keep this one as -1, some tests use >= TR_UNSUB */
  947. #define TR_BOGUS ((ART_UNREAD) -2)
  948. #define TR_JUNK ((ART_UNREAD) -3)
  949.  
  950. EXT char rcchar[MAXRCLINE]; /* holds the character : or ! while spot is \0 */
  951. EXT char rcnums[MAXRCLINE]; /* offset from rcline to numbers on line */
  952. EXT ACT_POS softptr[MAXRCLINE];
  953.             /* likely ptr to active file entry for newsgroup */
  954. EXT bool paranoid INIT(FALSE);    /* did we detect some inconsistency in .newsrc? */
  955.  
  956. bool    rcstuff_init();
  957. bool    get_ng();    /* return TRUE if newsgroup can be found or added */
  958. NG_NUM    add_newsgroup();
  959. #ifdef RELOCATE
  960.     NG_NUM    relocate_newsgroup();    /* move newsgroup around */
  961. #endif
  962. void    list_newsgroups();
  963. NG_NUM    find_ng();    /* return index of newsgroup */
  964. void    cleanup_rc();
  965. void    sethash();
  966. int    hash();
  967. void    newsrc_check();
  968. void    write_rc();
  969. void    get_old_rc();
  970. !STUFFY!FUNK!
  971. echo Extracting mbox.saver.SH
  972. cat >mbox.saver.SH <<'!STUFFY!FUNK!'
  973. case $CONFIG in
  974.     '') . config.sh ;;
  975. esac
  976. echo "Extracting mbox.saver (with variable substitutions)"
  977. $spitshell >mbox.saver <<!GROK!THIS!
  978. $startsh
  979. # $Header: mbox.saver.SH,v 4.3.2.2 90/03/17 20:44:54 sob Exp $
  980. # $Log:    mbox.saver.SH,v $
  981. # Revision 4.3.2.2  90/03/17  20:44:54  sob
  982. # Modify Article header to place the colon after Article.
  983. # Revision 4.3.2.1  89/11/28  00:05:47  sob
  984. # Branch for RN/RRN combo patches
  985. # Revision 4.3.1.2  85/05/20  15:55:37  lwall
  986. # Turned $5 into \$5.
  987. # Revision 4.3.1.1  85/05/10  11:35:30  lwall
  988. # Branch for patches.
  989. # Revision 4.3  85/05/01  11:42:51  lwall
  990. # Baseline for release with 4.3bsd.
  991. #    Arguments:
  992. #    1 Full name of article (%A)
  993. #    2 Public news spool directory (%P)
  994. #    3 Directory of current newsgroup (%c)
  995. #    4 Article number (%a)
  996. #    5 Where in article to start (%B)
  997. #    6 Newsgroup name (%C)
  998. #    7 Save destination (%b)
  999. #    8 First line of message, normally From...
  1000. #
  1001. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  1002.  
  1003. ( $echo "\$8"
  1004.   case "\$5" in
  1005.   0) $echo "Article: \$4 of \$6" ;;
  1006.   esac
  1007.   $tail +\$5c \$1 | $sed "s/^From />From /"
  1008.   $echo ""
  1009.   $echo "" ) >> \$7
  1010. !GROK!THIS!
  1011. $eunicefix mbox.saver
  1012. chmod 755 mbox.saver
  1013. !STUFFY!FUNK!
  1014. echo Extracting artio.h
  1015. cat >artio.h <<'!STUFFY!FUNK!'
  1016. /* $Header: artio.h,v 4.3.2.2 89/11/27 01:27:53 sob Locked $
  1017.  *
  1018.  * $Log:    artio.h,v $
  1019.  * Revision 4.3.2.2  89/11/27  01:27:53  sob
  1020.  * Altered NNTP code per ideas suggested by Bela Lubkin
  1021.  * <filbo@gorn.santa-cruz.ca.us>
  1022.  * 
  1023.  * Revision 4.3.2.1  89/11/26  22:41:24  sob
  1024.  * Added RRN support
  1025.  * 
  1026.  * Revision 4.3  85/05/01  11:35:43  lwall
  1027.  * Baseline for release with 4.3bsd.
  1028.  * 
  1029.  */
  1030.  
  1031. EXT ART_POS artpos INIT(0);    /* byte position in article file */
  1032.  
  1033. EXT ART_LINE artline INIT(0);        /* current line number in article file */
  1034. EXT FILE *artfp INIT(Nullfp);        /* current article file pointer */
  1035. EXT ART_NUM openart INIT(0);        /* what is the currently open article number? */
  1036. #ifdef LINKART
  1037.     EXT char *linkartname INIT(nullstr);/* real name of article for Eunice */
  1038. #endif
  1039. #ifdef SERVER
  1040. EXT ART_PART openpart INIT(0);    /* how much of that article do we have? */
  1041. FILE    *nntpopen();        /* get an article unless already retrieved */
  1042.  
  1043. void    nntpclose();
  1044. /* MUST be in increasing order of completeness! */
  1045. #define STAT 1                /* test for existence only */
  1046. #define HEAD 2                /* if only header items are desired */
  1047. #define ARTICLE 3            /* retreive full article  */
  1048. #endif
  1049.  
  1050. void    artio_init();
  1051. FILE    *artopen();        /* open an article unless already opened */
  1052. !STUFFY!FUNK!
  1053. echo Extracting kitlists.c
  1054. cat >kitlists.c <<'!STUFFY!FUNK!'
  1055. /* $Header: kitlists.c,v 4.3.2.1 89/11/08 03:19:35 sob Locked $
  1056.  *
  1057.  * $Log:    kitlists.c,v $
  1058.  * Revision 4.3.2.1  89/11/08  03:19:35  sob
  1059.  * Removed some dependencies.
  1060.  * 
  1061.  * Revision 4.3  85/05/01  11:42:08  lwall
  1062.  * Baseline for release with 4.3bsd.
  1063.  * 
  1064.  */
  1065.  
  1066. #include <stdio.h>
  1067.  
  1068. #define MAXKIT 100
  1069. #define MAXKITSIZE 63000
  1070. #define KITOVERHEAD 700
  1071. #define FILEOVERHEAD 80
  1072.  
  1073. long tot[MAXKIT];
  1074. FILE *outfp[MAXKIT];        /* of course, not this many file descriptors */
  1075.  
  1076. main(argc,argv)
  1077. int argc;
  1078. char **argv;
  1079. {
  1080.     FILE *inp, *popen();
  1081.     char buf[1024], filnam[128];
  1082.     char *index();
  1083.     register char *s;
  1084.     register int i, newtot;
  1085.     
  1086.     sprintf(buf,"\
  1087. ls -l `awk '{print $1}' <%s'` | awk '{print $8 \" \" $4}' | sort +1nr\
  1088. ", argc > 1 ? argv[1] : "MANIFEST.new");
  1089.     inp = popen(buf,"r");
  1090.  
  1091.     while (fgets(buf,1024,inp) != (char *)NULL) {
  1092.     s = index(buf,' ');
  1093.     *s++ = '\0';
  1094.     for (i=1;
  1095.       (newtot = tot[i] + atol(s) + FILEOVERHEAD) > MAXKITSIZE-KITOVERHEAD;
  1096.       i++) 
  1097.         ;
  1098.     if (!tot[i]) {
  1099.         sprintf(filnam,"kit%d.list",i);
  1100.         outfp[i] = fopen(filnam,"w");
  1101.     }
  1102.     tot[i] = newtot;
  1103.     printf("Adding %s to kit %d giving %d bytes\n",buf,i,newtot);
  1104.     fprintf(outfp[i],"%s\n",buf);
  1105.     }
  1106. }
  1107. !STUFFY!FUNK!
  1108. echo Extracting artstate.h
  1109. cat >artstate.h <<'!STUFFY!FUNK!'
  1110. /* $Header: artstate.h,v 4.3.1.2 85/05/13 09:30:30 lwall Exp $
  1111.  *
  1112.  * $Log:    artstate.h,v $
  1113.  * Revision 4.3.1.2  85/05/13  09:30:30  lwall
  1114.  * Added CUSTOMLINES option.
  1115.  * 
  1116.  * Revision 4.3.1.1  85/05/10  11:31:32  lwall
  1117.  * Branch for patches.
  1118.  * 
  1119.  * Revision 4.3  85/05/01  11:35:59  lwall
  1120.  * Baseline for release with 4.3bsd.
  1121.  * 
  1122.  */
  1123.  
  1124. EXT bool reread INIT(FALSE);        /* consider current art temporarily */
  1125.                     /* unread? */
  1126. EXT bool do_fseek INIT(FALSE);    /* should we back up in article file? */
  1127.  
  1128. EXT bool oldsubject INIT(FALSE);    /* not 1st art in subject thread */
  1129. EXT ART_LINE topline INIT(-1);        /* top line of current screen */
  1130. EXT bool do_hiding INIT(TRUE);        /* hide header lines with -h? */
  1131. #ifdef ROTATION
  1132. EXT bool rotate INIT(FALSE);        /* has rotation been requested? */
  1133. #endif
  1134. EXT char *prompt;            /* pointer to current prompt */
  1135.  
  1136. EXT char *firstline INIT(Nullch);            /* special first line? */
  1137. #ifdef CUSTOMLINES
  1138. EXT char *hideline INIT(Nullch);        /* custom line hiding? */
  1139. EXT char *pagestop INIT(Nullch);        /* custom page terminator? */
  1140. EXT COMPEX hide_compex;
  1141. EXT COMPEX page_compex;
  1142. #endif
  1143. !STUFFY!FUNK!
  1144. echo Extracting makedir.SH
  1145. cat >makedir.SH <<'!STUFFY!FUNK!'
  1146. case $CONFIG in
  1147.     '') . config.sh ;;
  1148. esac
  1149. echo "Extracting makedir (with variable substitutions)"
  1150. $spitshell >makedir <<!GROK!THIS!
  1151. $startsh
  1152. # $Header: makedir.SH,v 4.3 85/05/01 11:42:31 lwall Exp $
  1153. # $Log:    makedir.SH,v $
  1154. # Revision 4.3  85/05/01  11:42:31  lwall
  1155. # Baseline for release with 4.3bsd.
  1156.  
  1157. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  1158.  
  1159. case \$# in
  1160.   0)
  1161.     $echo "makedir pathname filenameflag"
  1162.     exit 1
  1163.     ;;
  1164. esac
  1165.  
  1166. : guarantee one slash before 1st component
  1167. case \$1 in
  1168.   /*) ;;
  1169.   *)  set ./\$1 \$2 ;;
  1170. esac
  1171.  
  1172. : strip last component if it is to be a filename
  1173. case X\$2 in
  1174.   X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;;
  1175.   *)  set \$1 ;;
  1176. esac
  1177.  
  1178. : return reasonable status if nothing to be created
  1179. if $test -d "\$1" ; then
  1180.     exit 0
  1181. fi
  1182.  
  1183. list=''
  1184. while true ; do
  1185.     case \$1 in
  1186.     */*)
  1187.     list="\$1 \$list"
  1188.     set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\`
  1189.     ;;
  1190.     *)
  1191.     break
  1192.     ;;
  1193.     esac
  1194. done
  1195.  
  1196. set \$list
  1197.  
  1198. for dir do
  1199.     $mkdir \$dir >/dev/null 2>&1
  1200. done
  1201. !GROK!THIS!
  1202. $eunicefix makedir
  1203. chmod 755 makedir
  1204. !STUFFY!FUNK!
  1205. echo Extracting search.h
  1206. cat >search.h <<'!STUFFY!FUNK!'
  1207. /* $Header: search.h,v 4.3 85/05/01 11:50:46 lwall Exp $
  1208.  *
  1209.  * $Log:    search.h,v $
  1210.  * Revision 4.3  85/05/01  11:50:46  lwall
  1211.  * Baseline for release with 4.3bsd.
  1212.  * 
  1213.  */
  1214.  
  1215. #ifndef NBRA
  1216. #define    NBRA    10        /* the maximum number of meta-brackets in an
  1217.                    RE -- \( \) */
  1218. #define NALTS    10        /* the maximum number of \|'s */
  1219.  
  1220. typedef struct {    
  1221.     char *expbuf;        /* The compiled search string */
  1222.     int eblen;            /* Length of above buffer */
  1223.     char *alternatives[NALTS];    /* The list of \| seperated alternatives */
  1224.     char *braslist[NBRA];    /* RE meta-bracket start list */
  1225.     char *braelist[NBRA];    /* RE meta-bracket end list */
  1226.     char *brastr;        /* saved match string after execute() */
  1227.     char nbra;            /* The number of meta-brackets int the most
  1228.                    recenlty compiled RE */
  1229.     bool do_folding;        /* fold upper and lower case? */
  1230. } COMPEX;
  1231.  
  1232. void    search_init();
  1233. void    init_compex();
  1234. void    free_compex();
  1235. char    *getbracket();
  1236. void    case_fold();
  1237. char    *compile(); 
  1238. void    grow_eb();
  1239. char    *execute(); 
  1240. bool    advance();
  1241. bool    backref(); 
  1242. bool    cclass(); 
  1243. #endif
  1244. !STUFFY!FUNK!
  1245. echo Extracting norm.saver.SH
  1246. cat >norm.saver.SH <<'!STUFFY!FUNK!'
  1247. case $CONFIG in
  1248.     '') . config.sh ;;
  1249. esac
  1250. echo "Extracting norm.saver (with variable substitutions)"
  1251. $spitshell >norm.saver <<!GROK!THIS!
  1252. $startsh
  1253. # $Header: norm.saver.SH,v 4.3.2.1 89/11/28 00:08:01 sob Locked $
  1254. # $Log:    norm.saver.SH,v $
  1255. # Revision 4.3.2.1  89/11/28  00:08:01  sob
  1256. # Branch for RN/RRN combo.
  1257. # Revision 4.3.1.2  85/05/20  15:56:24  lwall
  1258. # Turned $5 into \$5.
  1259. # Revision 4.3.1.1  85/05/10  11:36:52  lwall
  1260. # Branch for patches.
  1261. # Revision 4.3  85/05/01  11:45:16  lwall
  1262. # Baseline for release with 4.3bsd.
  1263. #    Arguments:
  1264. #    1 Full name of article (%A)
  1265. #    2 Public news spool directory (%P)
  1266. #    3 Directory of current newsgroup (%c)
  1267. #    4 Article number (%a)
  1268. #    5 Where in article to start (%B)
  1269. #    6 Newsgroup name (%C)
  1270. #    7 Save destination (%b)
  1271. #
  1272. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  1273.  
  1274. ( case "\$5" in
  1275.   0) $echo "Article \$4 of \$6:" ;;
  1276.   esac
  1277.   $tail +\$5c \$1
  1278.   $echo ""
  1279.   $echo "" ) >> \$7
  1280. !GROK!THIS!
  1281. $eunicefix norm.saver
  1282. chmod 755 norm.saver
  1283. !STUFFY!FUNK!
  1284. echo Extracting ng.h
  1285. cat >ng.h <<'!STUFFY!FUNK!'
  1286. /* $Header: ng.h,v 4.3 85/05/01 11:44:29 lwall Exp $
  1287.  *
  1288.  * $Log:    ng.h,v $
  1289.  * Revision 4.3  85/05/01  11:44:29  lwall
  1290.  * Baseline for release with 4.3bsd.
  1291.  * 
  1292.  */
  1293.  
  1294. EXT ART_NUM art INIT(0);    /* current or prospective article # */
  1295.  
  1296. EXT int checkcount INIT(0);    /* how many articles have we read */
  1297.             /*   in the current newsgroup since */
  1298.             /*   the last checkpoint? */
  1299. EXT int docheckwhen INIT(20);    /* how often to do checkpoint */
  1300.  
  1301. #ifdef MAILCALL
  1302. EXT int mailcount INIT(0);            /* check for mail when 0 mod 10 */
  1303. #endif
  1304. EXT char *mailcall INIT(nullstr);
  1305.  
  1306. EXT bool forcelast INIT(FALSE);            /* ought we show "End of newsgroup"? */
  1307. EXT bool forcegrow INIT(FALSE);        /* do we want to recalculate size */
  1308.                     /* of newsgroup, e.g. after posting? */
  1309.  
  1310. #define NG_ERROR -1
  1311. #define NG_NORM 0
  1312. #define NG_ASK 1
  1313. #define NG_MINUS 2
  1314.  
  1315. void    ng_init();
  1316. int    do_newsgroup();
  1317. int    art_switch();
  1318. #ifdef MAILCALL
  1319.     void    setmail();
  1320. #endif
  1321. void    setdfltcmd();
  1322. !STUFFY!FUNK!
  1323. echo Extracting util.h
  1324. cat >util.h <<'!STUFFY!FUNK!'
  1325. /* $Header: util.h,v 4.3 85/05/01 11:51:58 lwall Exp $
  1326.  *
  1327.  * $Log:    util.h,v $
  1328.  * Revision 4.3  85/05/01  11:51:58  lwall
  1329.  * Baseline for release with 4.3bsd.
  1330.  * 
  1331.  */
  1332.  
  1333. EXT bool waiting INIT(FALSE);        /* are we waiting for subprocess (in doshell)? */
  1334. EXT int len_last_line_got INIT(0);
  1335.             /* strlen of some_buf after */
  1336.             /*  some_buf = get_a_line(bufptr,buffersize,fp) */
  1337.  
  1338. /* is the string for makedir a directory name or a filename? */
  1339.  
  1340. #define MD_DIR 0
  1341. #define MD_FILE 1
  1342.  
  1343. void    util_init();
  1344. int    doshell();
  1345. char    *safemalloc();
  1346. char    *saferealloc();
  1347. char    *safecpy();
  1348. char    *safecat();
  1349. char    *cpytill();
  1350. char    *instr();
  1351. #ifdef SETUIDGID
  1352.     int        eaccess();
  1353. #endif
  1354. char    *getwd();
  1355. void    cat();
  1356. void    prexit();
  1357. char    *get_a_line();
  1358. char    *savestr();
  1359. int    makedir();
  1360. void    setenv();
  1361. int    envix();
  1362. void    notincl();
  1363. char    *getval();
  1364. void    growstr();
  1365. void    setdef();
  1366. !STUFFY!FUNK!
  1367. echo Extracting ngdata.h
  1368. cat >ngdata.h <<'!STUFFY!FUNK!'
  1369. /* $Header: ngdata.h,v 4.3.2.1 89/11/06 00:41:21 sob Locked $
  1370.  *
  1371.  * $Log:    ngdata.h,v $
  1372.  * Revision 4.3.2.1  89/11/06  00:41:21  sob
  1373.  * Added RRN support from NNTP 1.5
  1374.  * 
  1375.  * Revision 4.3  85/05/01  11:44:48  lwall
  1376.  * added to local RCS
  1377.  * 
  1378.  * Revision 4.3  85/05/01  11:44:48  lwall
  1379.  * Baseline for release with 4.3bsd.
  1380.  * 
  1381.  */
  1382.  
  1383. EXT FILE *actfp INIT(Nullfp);    /* the active file */
  1384. EXT bool writesoft INIT(FALSE);    /* rewrite the soft pointer file? */
  1385. EXT int softtries INIT(0), softmisses INIT(0);
  1386.  
  1387. #ifdef SERVER
  1388.     EXT char active_name[256];
  1389. #endif
  1390.  
  1391. #ifdef CACHEFIRST
  1392.     EXT ART_NUM abs1st[MAXRCLINE];    /* 1st real article in newsgroup */
  1393. #else
  1394. # ifdef MININACT
  1395.     EXT ART_NUM abs1st INIT(0);
  1396. # endif
  1397. #endif
  1398.  
  1399. EXT char *moderated;
  1400.  
  1401. void    ngdata_init();
  1402. ART_NUM    getngsize();
  1403. ACT_POS findact();
  1404. ART_NUM    getabsfirst();
  1405. ART_NUM    getngmin();
  1406. !STUFFY!FUNK!
  1407. echo Extracting rn.h
  1408. cat >rn.h <<'!STUFFY!FUNK!'
  1409. /* $Header: rn.h,v 4.3 85/05/01 11:48:19 lwall Exp $
  1410.  *
  1411.  * $Log:    rn.h,v $
  1412.  * Revision 4.3  85/05/01  11:48:19  lwall
  1413.  * Baseline for release with 4.3bsd.
  1414.  * 
  1415.  */
  1416.  
  1417. EXT char *ngname INIT(Nullch);        /* name of current newsgroup */
  1418. EXT int ngnlen INIT(0);            /* current malloced size of ngname */
  1419. EXT char *ngdir INIT(Nullch);        /* same thing in directory name form */
  1420. EXT int ngdlen INIT(0);            /* current malloced size of ngdir */
  1421.  
  1422. EXT NG_NUM ng INIT(0);        /* current newsgroup index into rcline and toread */
  1423. EXT NG_NUM current_ng INIT(0);    /* stable current newsgroup so we can ditz with ng */
  1424. EXT NG_NUM starthere INIT(0);   /* set to the first newsgroup with unread news on startup */
  1425. EXT char *spool INIT(Nullch);        /* public news spool directory */
  1426.  
  1427. void    rn_init();
  1428. void    main();
  1429. void    set_ngname();
  1430. char    *getngdir();
  1431. !STUFFY!FUNK!
  1432. echo Extracting intrp.h
  1433. cat >intrp.h <<'!STUFFY!FUNK!'
  1434. /* $Header: intrp.h,v 4.3 85/05/01 11:41:48 lwall Exp $
  1435.  *
  1436.  * $Log:    intrp.h,v $
  1437.  * Revision 4.3  85/05/01  11:41:48  lwall
  1438.  * Baseline for release with 4.3bsd.
  1439.  * 
  1440.  */
  1441.  
  1442. EXT char *lib INIT(Nullch);        /* news library */
  1443. EXT char *rnlib INIT(Nullch);        /* private news program library */
  1444. EXT char *origdir INIT(Nullch);        /* cwd when rn invoked */
  1445. EXT char *homedir INIT(Nullch);        /* login directory */
  1446. EXT char *dotdir INIT(Nullch);        /* where . files go */
  1447. EXT char *logname INIT(Nullch);        /* login id */
  1448. EXT char *sitename INIT(Nullch);    /* host name */
  1449.  
  1450. #ifdef NEWSADMIN
  1451.     EXT char newsadmin[] INIT(NEWSADMIN);/* news administrator */
  1452.     EXT int newsuid INIT(0);
  1453. #endif
  1454.  
  1455. void    intrp_init();
  1456. char    *filexp();
  1457. char    *dointerp();
  1458. void    interp();
  1459. void    refscpy();
  1460. char    *getrealname();
  1461. !STUFFY!FUNK!
  1462. echo Extracting Wishlist
  1463. cat >Wishlist <<'!STUFFY!FUNK!'
  1464. Generalized article set manipulation
  1465.     Interface to subject listing.
  1466.     Recursive newsgroup visitation.
  1467. Virtual article abstract type to allow the following:
  1468.     Personalized header munging via % subs.
  1469.     Undigestification.
  1470.     Personal archive perusal.
  1471.     Mail handling.
  1472. Parent command (waiting for ARTFILE interface and recursive newsgroups).
  1473. Merge Pnews and postnews.
  1474. Vnews duplicate suppression algorithm for sites that can't do Xref patch.
  1475. Dynamic allocation of stuff currently restricted by MAXRCLINE.
  1476.     (And pull parallel arrays into array of structs).
  1477. Separation of .newsrc functions and newsgroup functions to separate processes
  1478.     communicating via pipes (to make fit on non-separate-I-and-D pdp11,
  1479.     or unreasonable facsimiles thereof).
  1480. Faster!!!
  1481. Smaller!!!
  1482. More general!!!
  1483. Perfect?
  1484. !STUFFY!FUNK!
  1485. echo Extracting makekit
  1486. cat >makekit <<'!STUFFY!FUNK!'
  1487. #!/bin/sh
  1488. # $Header: makekit,v 4.3 85/05/01 11:42:38 lwall Exp $
  1489. #
  1490. # $Log:    makekit,v $
  1491. # Revision 4.3  85/05/01  11:42:38  lwall
  1492. # Baseline for release with 4.3bsd.
  1493.  
  1494. numkits=$#
  1495. for kitlist in $*; do
  1496.     kit=`basename $kitlist .list`
  1497.     kitnum=`expr "$kit" : 'kit\([0-9][0-9]*\)'`
  1498.     echo "*** Making $kit ***"
  1499.     kitleader "$kit" "$kitnum" "$numkits"
  1500.     for file in `/bin/cat $kitlist`; do
  1501.     echo $file
  1502.     echo "echo Extracting $file" >> $kit
  1503.     if egrep '^\.$' $file; then
  1504.         echo "sed >$file <<'!STUFFY!FUNK!' -e 's/X//'" >> $kit
  1505.         sed <$file >>$kit -e 's/^/X/'
  1506.     else
  1507.         echo "cat >$file <<'!STUFFY!FUNK!'" >> $kit
  1508.         /bin/cat $file >> $kit
  1509.     fi
  1510.     echo "!STUFFY!FUNK!" >> $kit
  1511.     done
  1512.     kittrailer "$kit" "$kitnum" "$numkits"
  1513. done
  1514. !STUFFY!FUNK!
  1515. echo Extracting final.h
  1516. cat >final.h <<'!STUFFY!FUNK!'
  1517. /* $Header: final.h,v 4.3 85/05/01 11:38:17 lwall Exp $
  1518.  * 
  1519.  * $Log:    final.h,v $
  1520.  * Revision 4.3  85/05/01  11:38:17  lwall
  1521.  * Baseline for release with 4.3bsd.
  1522.  * 
  1523.  */
  1524.  
  1525. /* cleanup status for fast exits */
  1526.  
  1527. EXT bool panic INIT(FALSE);        /* we got hung up or something-- */
  1528.                     /*  so leave tty alone */
  1529. EXT bool rc_changed INIT(FALSE);    /* need we rewrite .newsrc? */
  1530. EXT bool doing_ng INIT(FALSE);        /* do we need to reconstitute */
  1531.                     /* current rc line? */
  1532.  
  1533. EXT char int_count INIT(0);        /* how many interrupts we've had */
  1534.  
  1535. /* signal catching routines */
  1536.  
  1537. int    int_catcher();
  1538. int    sig_catcher();
  1539. #ifdef SIGTSTP
  1540.     int    stop_catcher();
  1541.     int    cont_catcher();
  1542. #endif
  1543.  
  1544. void    final_init();
  1545. void    finalize();
  1546. !STUFFY!FUNK!
  1547. echo Extracting manimake
  1548. cat >manimake <<'!STUFFY!FUNK!'
  1549. #!/bin/sh
  1550. # $Header: manimake,v 4.3 85/05/01 11:42:46 lwall Exp $
  1551. #
  1552. # $Log:    manimake,v $
  1553. # Revision 4.3  85/05/01  11:42:46  lwall
  1554. # Baseline for release with 4.3bsd.
  1555.  
  1556. : make MANIFEST and MANIFEST.new say the same thing
  1557. if test -f MANIFEST.new; then
  1558.     cat <<'EOH' > MANIFEST
  1559. After all the rn kits are run you should have the following files:
  1560.  
  1561. Filename    Kit Description
  1562. --------    --- -----------
  1563. EOH
  1564.     sort MANIFEST.new >.mani
  1565.     grep . kit*.list | sed 's/^kit\(.*\)\.list:\$*\(.*\)$/\2 |\1|/' | \
  1566.     sort | \
  1567.     join -a1 - .mani | \
  1568.     awk -F'|' '{printf "%-16s%2s %s\n",$1,$2,$3}' | \
  1569.     unexpand >> MANIFEST
  1570.     rm .mani
  1571. else
  1572.     echo "You don't have a MANIFEST.new file.  Run manifake."
  1573. fi
  1574. !STUFFY!FUNK!
  1575. echo Extracting kittrailer
  1576. cat >kittrailer <<'!STUFFY!FUNK!'
  1577. #! /bin/sh
  1578. # $Header: kittrailer,v 4.3 85/05/01 11:42:11 lwall Exp $
  1579. #
  1580. # $Log:    kittrailer,v $
  1581. # Revision 4.3  85/05/01  11:42:11  lwall
  1582. # Baseline for release with 4.3bsd.
  1583.  
  1584. rangelist=`range 1 $3`
  1585. cat >>$1 <<EOT
  1586. echo ""
  1587. echo "End of kit $2 (of $3)"
  1588. cat /dev/null >kit${2}isdone
  1589. config=true
  1590. for iskit in $rangelist; do
  1591.     if test -f kit\${iskit}isdone; then
  1592.     echo "You have run kit \${iskit}."
  1593.     else
  1594.     echo "You still need to run kit \${iskit}."
  1595.     config=false
  1596.     fi
  1597. done
  1598. case \$config in
  1599.     true)
  1600.     echo "You have run all your kits.  Please read README and then type Configure."
  1601.     chmod 755 Configure
  1602.     ;;
  1603. esac
  1604. : I do not append .signature, but someone might mail this.
  1605. exit
  1606. EOT
  1607. !STUFFY!FUNK!
  1608. echo Extracting only.h
  1609. cat >only.h <<'!STUFFY!FUNK!'
  1610. /* $Header: only.h,v 4.3 85/05/01 11:45:27 lwall Exp $
  1611.  *
  1612.  * $Log:    only.h,v $
  1613.  * Revision 4.3  85/05/01  11:45:27  lwall
  1614.  * Baseline for release with 4.3bsd.
  1615.  * 
  1616.  */
  1617.  
  1618. #ifndef NBRA
  1619. #include "search.h"
  1620. #endif
  1621.  
  1622. #ifdef ONLY
  1623.     EXT char *ngtodo[NGMAX];        /* restrictions in effect */
  1624. #   ifdef SPEEDOVERMEM
  1625.     EXT COMPEX *compextodo[NGMAX];    /* restrictions in compiled form */
  1626. #   endif
  1627. #endif
  1628.  
  1629. EXT int maxngtodo INIT(0);            /*  0 => no restrictions */
  1630.                     /* >0 => # of entries in ngtodo */
  1631.  
  1632. void    only_init();
  1633. bool    inlist();    /* return TRUE if ngname is in command line list */
  1634.             /* or if there was no list */
  1635. void    setngtodo();
  1636. #ifdef ONLY
  1637.     void    end_only();
  1638. #endif
  1639. !STUFFY!FUNK!
  1640. echo Extracting kfile.h
  1641. cat >kfile.h <<'!STUFFY!FUNK!'
  1642. /* $Header: kfile.h,v 4.3 85/05/01 11:42:00 lwall Exp $
  1643.  *
  1644.  * $Log:    kfile.h,v $
  1645.  * Revision 4.3  85/05/01  11:42:00  lwall
  1646.  * Baseline for release with 4.3bsd.
  1647.  * 
  1648.  */
  1649.  
  1650. #define KF_GLOBAL 0
  1651. #define KF_LOCAL 1
  1652.  
  1653. #ifdef KILLFILES
  1654. EXT FILE *globkfp INIT(Nullfp);        /* global article killer file */
  1655. EXT FILE *localkfp INIT(Nullfp);    /* local (for this newsgroup) */
  1656.                     /*  article killer file */
  1657. #endif
  1658.  
  1659. void    kfile_init();
  1660. int    do_kfile();
  1661. void    kill_unwanted();
  1662. int    edit_kfile();
  1663. void    open_kfile();
  1664. void    kf_append();
  1665. void    setthru();
  1666.  
  1667. !STUFFY!FUNK!
  1668. echo Extracting backpage.h
  1669. cat >backpage.h <<'!STUFFY!FUNK!'
  1670. /* $Header: backpage.h,v 4.3 85/05/01 11:36:11 lwall Exp $
  1671.  *
  1672.  * $Log:    backpage.h,v $
  1673.  * Revision 4.3  85/05/01  11:36:11  lwall
  1674.  * Baseline for release with 4.3bsd.
  1675.  * 
  1676.  */
  1677.  
  1678. /* things for doing the 'back page' command */
  1679.  
  1680. EXT int varyfd INIT(0);            /* virtual array file for storing  */
  1681.                     /* file offsets */
  1682. EXT ART_POS varybuf[VARYSIZE];        /* current window onto virtual array */
  1683.  
  1684. EXT long oldoffset INIT(-1);        /* offset to block currently in window */
  1685.  
  1686. void    backpage_init();
  1687. ART_POS    vrdary();
  1688. void    vwtary();
  1689. !STUFFY!FUNK!
  1690. echo Extracting ngsrch.h
  1691. cat >ngsrch.h <<'!STUFFY!FUNK!'
  1692. /* $Header: ngsrch.h,v 4.3 85/05/01 11:44:56 lwall Exp $
  1693.  *
  1694.  * $Log:    ngsrch.h,v $
  1695.  * Revision 4.3  85/05/01  11:44:56  lwall
  1696.  * Baseline for release with 4.3bsd.
  1697.  * 
  1698.  */
  1699.  
  1700. #ifdef NGSEARCH
  1701. #define NGS_ABORT 0
  1702. #define NGS_FOUND 1
  1703. #define NGS_INTR 2
  1704. #define NGS_NOTFOUND 3
  1705.  
  1706. EXT bool ng_doread INIT(FALSE);        /* search read newsgroups? */
  1707. #endif
  1708.  
  1709. void    ngsrch_init();
  1710. #ifdef NGSEARCH 
  1711.     int        ng_search();
  1712.     bool    ng_wanted();
  1713. #endif
  1714. #ifdef NGSORONLY
  1715.     char    *ng_comp();
  1716. #endif
  1717. !STUFFY!FUNK!
  1718. echo Extracting manifake
  1719. cat >manifake <<'!STUFFY!FUNK!'
  1720. #!/bin/sh
  1721. # $Header: manifake,v 4.3 85/05/01 11:42:41 lwall Exp $
  1722. #
  1723. # $Log:    manifake,v $
  1724. # Revision 4.3  85/05/01  11:42:41  lwall
  1725. # Baseline for release with 4.3bsd.
  1726.  
  1727. : make MANIFEST and MANIFEST.new say the same thing
  1728. if test ! -f MANIFEST.new; then
  1729.     if test -f MANIFEST; then
  1730.     sed <MANIFEST >MANIFEST.new \
  1731.         -e '1,/---/d' \
  1732.         -e 's/\([     ][     ]*\)[0-9]*  */\1/'
  1733.     else
  1734.     echo "Make a MANIFEST.new file, with names and descriptions."
  1735.     fi
  1736. fi
  1737. !STUFFY!FUNK!
  1738. echo Extracting respond.h
  1739. cat >respond.h <<'!STUFFY!FUNK!'
  1740. /* $Header: respond.h,v 4.3 85/05/01 11:47:50 lwall Exp $
  1741.  *
  1742.  * $Log:    respond.h,v $
  1743.  * Revision 4.3  85/05/01  11:47:50  lwall
  1744.  * Baseline for release with 4.3bsd.
  1745.  * 
  1746.  */
  1747.  
  1748. EXT char *savedest INIT(Nullch);    /* value of %b */
  1749. EXT ART_POS savefrom INIT(0);        /* value of %B */
  1750. EXT char *headname INIT(Nullch);
  1751.  
  1752. #define SAVE_ABORT 0
  1753. #define SAVE_DONE 1
  1754.  
  1755. void    respond_init();
  1756. int    save_article();
  1757. int    cancel_article();
  1758. void    reply();
  1759. void    followup();
  1760. void    invoke();
  1761. !STUFFY!FUNK!
  1762. echo Extracting cheat.h
  1763. cat >cheat.h <<'!STUFFY!FUNK!'
  1764. /* $Header: cheat.h,v 4.3 85/05/01 11:36:58 lwall Exp $
  1765.  *
  1766.  * $Log:    cheat.h,v $
  1767.  * Revision 4.3  85/05/01  11:36:58  lwall
  1768.  * Baseline for release with 4.3bsd.
  1769.  * 
  1770.  */
  1771.  
  1772. #ifdef ARTSEARCH
  1773. EXT ART_NUM srchahead INIT(0);     /* are we in subject scan mode? */
  1774.                 /* (if so, contains art # found or -1) */
  1775. #endif
  1776.  
  1777. #ifdef PENDING
  1778. #   ifdef CACHESUBJ
  1779.     EXT ART_NUM subj_to_get;
  1780. #   endif
  1781. #endif
  1782.  
  1783. void    cheat_init();
  1784. void    look_ahead();
  1785. void    collect_subjects();
  1786. !STUFFY!FUNK!
  1787. echo Extracting last.h
  1788. cat >last.h <<'!STUFFY!FUNK!'
  1789. /* $Header: last.h,v 4.3 85/05/01 11:42:22 lwall Exp $
  1790.  *
  1791.  * $Log:    last.h,v $
  1792.  * Revision 4.3  85/05/01  11:42:22  lwall
  1793.  * Baseline for release with 4.3bsd.
  1794.  * 
  1795.  */
  1796.  
  1797. EXT char *lastngname INIT(Nullch);    /* last newsgroup read, from .rnlast file */
  1798. EXT long lasttime INIT(0);    /* time last rn was started up */
  1799. EXT long lastactsiz INIT(0);    /* size of active file when rn last started up */
  1800.  
  1801. void    last_init();
  1802. void    writelast();
  1803. !STUFFY!FUNK!
  1804. echo Extracting rcln.h
  1805. cat >rcln.h <<'!STUFFY!FUNK!'
  1806. /* $Header: rcln.h,v 4.3 85/05/01 11:45:52 lwall Exp $
  1807.  *
  1808.  * $Log:    rcln.h,v $
  1809.  * Revision 4.3  85/05/01  11:45:52  lwall
  1810.  * Baseline for release with 4.3bsd.
  1811.  * 
  1812.  */
  1813.  
  1814. #ifdef DEBUGGING
  1815. EXT ART_NUM ngmax[MAXRCLINE];
  1816. #endif
  1817.  
  1818. void    rcln_init();
  1819. #ifdef CATCHUP
  1820.     void    catch_up();
  1821. #endif
  1822. int    addartnum();
  1823. #ifdef MCHASE
  1824.     void    subartnum();
  1825. #endif
  1826. void    prange();
  1827. void    set_toread();
  1828. void    checkexpired();
  1829. !STUFFY!FUNK!
  1830. echo Extracting sw.h
  1831. cat >sw.h <<'!STUFFY!FUNK!'
  1832. /* $Header: sw.h,v 4.3 85/05/01 11:51:07 lwall Exp $
  1833.  *
  1834.  * $Log:    sw.h,v $
  1835.  * Revision 4.3  85/05/01  11:51:07  lwall
  1836.  * Baseline for release with 4.3bsd.
  1837.  * 
  1838.  */
  1839.  
  1840. #ifdef INNERSEARCH
  1841. EXT int gline INIT(0);
  1842. #endif
  1843.  
  1844. void    sw_init();
  1845. void    sw_file();
  1846. void    sw_list();
  1847. void    decode_switch();
  1848. void    pr_switches();
  1849. void    cwd_check();
  1850. !STUFFY!FUNK!
  1851. echo Extracting init.h
  1852. cat >init.h <<'!STUFFY!FUNK!'
  1853. /* $Header: init.h,v 4.3 85/05/01 11:40:46 lwall Exp $
  1854.  *
  1855.  * $Log:    init.h,v $
  1856.  * Revision 4.3  85/05/01  11:40:46  lwall
  1857.  * Baseline for release with 4.3bsd.
  1858.  * 
  1859.  */
  1860.  
  1861. EXT char *lockname INIT(nullstr);
  1862.  
  1863. bool    initialize();
  1864. void    lock_check();
  1865. void    newsnews_check();
  1866. void    version_check();
  1867. !STUFFY!FUNK!
  1868. echo Extracting help.h
  1869. cat >help.h <<'!STUFFY!FUNK!'
  1870. /* $Header: help.h,v 4.3 85/05/01 11:39:19 lwall Exp $
  1871.  *
  1872.  * $Log:    help.h,v $
  1873.  * Revision 4.3  85/05/01  11:39:19  lwall
  1874.  * Baseline for release with 4.3bsd.
  1875.  * 
  1876.  */
  1877.  
  1878. void    help_init();
  1879. int    help_ng();
  1880. int    help_art();
  1881. int    help_page();
  1882. #ifdef ESCSUBS
  1883.     int    help_subs();
  1884. #endif
  1885. !STUFFY!FUNK!
  1886. echo Extracting addng.h
  1887. cat >addng.h <<'!STUFFY!FUNK!'
  1888. /* $Header: addng.h,v 4.3 85/05/01 11:34:48 lwall Exp $
  1889.  *
  1890.  * $Log:    addng.h,v $
  1891.  * Revision 4.3  85/05/01  11:34:48  lwall
  1892.  * Baseline for release with 4.3bsd.
  1893.  * 
  1894.  */
  1895.  
  1896. void    addng_init();
  1897. #ifdef FINDNEWNG
  1898.     bool    newlist();
  1899.     long    birthof();
  1900.     bool    scanactive();
  1901. #endif
  1902. !STUFFY!FUNK!
  1903. echo Extracting EXTERN.h
  1904. cat >EXTERN.h <<'!STUFFY!FUNK!'
  1905. /* $Header: EXTERN.h,v 4.3 85/05/01 11:58:01 lwall Exp $
  1906.  *
  1907.  * $Log:    EXTERN.h,v $
  1908.  * Revision 4.3  85/05/01  11:58:01  lwall
  1909.  * Baseline for release with 4.3bsd.
  1910.  * 
  1911.  */
  1912.  
  1913. #undef EXT
  1914. #define EXT extern
  1915.  
  1916. #undef INIT
  1917. #define INIT(x)
  1918.  
  1919. #undef DOINIT
  1920. !STUFFY!FUNK!
  1921. echo Extracting INTERN.h
  1922. cat >INTERN.h <<'!STUFFY!FUNK!'
  1923. /* $Header: INTERN.h,v 4.3 85/05/01 11:33:16 lwall Exp $
  1924.  *
  1925.  * $Log:    INTERN.h,v $
  1926.  * Revision 4.3  85/05/01  11:33:16  lwall
  1927.  * Baseline for release with 4.3bsd.
  1928.  * 
  1929.  */
  1930.  
  1931. #undef EXT
  1932. #define EXT
  1933.  
  1934. #undef INIT
  1935. #define INIT(x) = x
  1936.  
  1937. #define DOINIT
  1938. !STUFFY!FUNK!
  1939. echo Extracting makedist
  1940. cat >makedist <<'!STUFFY!FUNK!'
  1941. #!/bin/sh
  1942. # $Header: makedist,v 4.3 85/05/01 11:42:35 lwall Exp $
  1943. #
  1944. # $Log:    makedist,v $
  1945. # Revision 4.3  85/05/01  11:42:35  lwall
  1946. # Baseline for release with 4.3bsd.
  1947.  
  1948. rm -f kit*.list
  1949. manifake
  1950. kitlists
  1951. manimake
  1952. makekit kit*.list
  1953. !STUFFY!FUNK!
  1954. echo ""
  1955. echo "End of kit 9 (of 9)"
  1956. cat /dev/null >kit9isdone
  1957. config=true
  1958. for iskit in 1 2 3 4 5 6 7 8 9 ; do
  1959.     if test -f kit${iskit}isdone; then
  1960.     echo "You have run kit ${iskit}."
  1961.     else
  1962.     echo "You still need to run kit ${iskit}."
  1963.     config=false
  1964.     fi
  1965. done
  1966. case $config in
  1967.     true)
  1968.     echo "You have run all your kits.  Please read README and then type Configure."
  1969.     chmod 755 Configure
  1970.     ;;
  1971. esac
  1972. : I do not append .signature, but someone might mail this.
  1973. exit
  1974.