[comp.sources.unix] v19i062: NN, a Usenet news reader, Part01/15

rsalz@uunet.uu.net (Rich Salz) (06/23/89)

Submitted-by: storm@texas.dk (Kim F. Storm)
Posting-number: Volume 19, Issue 62
Archive-name: nn/part01

This distribution contains release 6.3 of nn.

nn is a menu based (point and shoot) netnews reader with a complete
set of features to satisfy both the expert and the novice user.  Since
its first release in Denmark in 1984 (!) and in Europe in 1988, it has
replaced rn and other well-known news readers at many sites.

Some of the key features of nn are:

 *  Menu-based article selection prior to reading the articles
    with the articles sorted according to subject & posting time!

    Significantly reduces the time spent on news reading.  
    No keystorkes are wasted on articles you don't want to read, and 
    only the articles selected on the menu will be read.

 *  Digests are automatically split and presented as ordinary articles!
    You can transparently save and respond to individual subarticles.
 
 *  Full folder support: read, save, and delete individual articles.

 *  Online help and manual.
    
 *  Built-in unshar and patch functions.
 
 *  Easy remapping of keys with advanced macro definition features.
 
 *  Automatic kill & selection of articles based on subject or author.

 *  User specified presentation sequence of news groups based on the
    news group hierarchy.

 *  Whole classes of news groups can easily be unsubscribed
    permanently, e.g. talk.all and all.politics

 *  Blindingly fast 'search for subject'.  On my Texas S1500 system, 
    nn uses less than 20 seconds to find all articles on a specific
    subject among 64000 articles in all groups!

 *  News collection and presentation is extremely fast, because nn
    uses its own database on top of the standard news system.
 
 *  In a distributed environment, the database can be shared among all 
    hosts on the network.  Only one daemon is needed on the news server
    for all hosts.  This works in a heterogenous environment as well.
 
 *  NNTP is also supported (using a local database for speed).
 
Because of the database, nn starts almost equally fast (in a few
seconds), no matter whether you have 100 or 10000 unread articles!
The database takes up some disk space, but dramatically improves speed
and functionality.  The amount of disk space consumed is approx. 1Mb
per 10000 articles.


#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
# This is part 1 of a multipart archive                                    
# do not concatenate these parts, unpack them in order with /bin/sh        
#
#	Run the following text with /bin/sh to create:
#	  README
#	  INSTALLATION
#	  MANIFEST
#	  NEWS-6.3
#	  NNTP
#	  PROBLEMS
#	  Makefile
#	  active.c
#	  admin.c
#	  answer.c
#	  articles.c
#	  articles.h
#	  aux.sh
#	  back_act.sh
#	  collect.c
#	  config.h-dist
#	  cvt-help.c
#	  data.h
#	  date_regexp.c
#	  db.c
#	  db.h
#	  debug.h
#	  digest.c
#	  execute.c
#	  expire.c
#	  folder.c
#	  global.c
#	  global.h
#	  group.c
#	  help.commands
#	  help.extended
#	  help.help
#	  help.map
#	  help.menu
#	  help.more
#	  help.read
#	  help.set
#	  help.show
#	  help.variables
#	  help.welcome
#	  init.c
#	  init.sample
#	  install_aux
#	  keymap.c
#	  keymap.h
#	  kill.c
#	  log_entry.c
#	  m-att3b.h
#	  m-dec3100.h
#	  m-gould.h
#	  m-hp9000.h
#	  m-m680x0.h
#	  m-sparc.h
#	  m-sun.h
#	  m-sun386i.h
#	  m-template.h
#	  m-vax.h
#	  macro.c
#	  master.c
#	  match.c
#	  match.h
#	  menu.c
#	  menu.h
#	  mk_online_man
#	  more.c
#	  news.c
#	  news.h
#	  nn.1
#	  nn.c
#	  nnadmin.1m
#	  nncheck.1
#	  nngoback.1
#	  nngoback.sh
#	  nngrep.1
#	  nngrep.sh
#	  nnmail.c
#	  nnmaster.1m
#	  nnquery.sh
#	  nntidy.1
#	  nntidy.sh
#	  nntp.c
#	  nntp.h
#	  nnusage.1m
#	  nnusage.sh
#	  options.c
#	  options.h
#	  pack_date.c
#	  pack_name.c
#	  pack_subject.c
#	  patchlevel.h
#	  prefix.sh
#	  rc.c
#	  regexp.c
#	  regexp.h
#	  reroute.c
#	  routes.sample
#	  s-bsd4-2.h
#	  s-bsd4-3.h
#	  s-hpux.h
#	  s-hpux2-1.h
#	  s-sunos3.h
#	  s-sunos4-0.h
#	  s-template.h
#	  s-tower32.h
#	  s-usg3-1.h
#	  save.c
#	  selection.c
#	  sequence.c
#	  term.c
#	  term.h
#	  unshar.c
#	  update.c
#	  update.h
#	  vararg.h
#	  variable.c
#	  xmakefile
#
if test -r s2_seq_.tmp
then echo "Must unpack archives in sequence!"
     next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
     exit 1; fi
echo "x - extracting README (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > README &&
XINTRODUCTION TO NN
X------------------
X
XThis distribution contains release 6.3 of nn.
X
Xnn is a menu based (point and shoot) netnews reader with a complete
Xset of features to satisfy both the expert and the novice user.  Since
Xits first release in Denmark in 1984 (!) and in Europe in 1988, it has
Xreplaced rn and other well-known news readers at many sites.
X
XSome of the key features of nn are:
X
X *  Menu-based article selection prior to reading the articles
X    with the articles sorted according to subject & posting time!
X
X    Significantly reduces the time spent on news reading.  
X    No keystorkes are wasted on articles you don't want to read, and 
X    only the articles selected on the menu will be read.
X
X *  Digests are automatically split and presented as ordinary articles!
X    You can transparently save and respond to individual subarticles.
X 
X *  Full folder support: read, save, and delete individual articles.
X
X *  Online help and manual.
X    
X *  Built-in unshar and patch functions.
X 
X *  Easy remapping of keys with advanced macro definition features.
X 
X *  Automatic kill & selection of articles based on subject or author.
X
X *  User specified presentation sequence of news groups based on the
X    news group hierarchy.
X
X *  Whole classes of news groups can easily be unsubscribed
X    permanently, e.g. talk.all and all.politics
X
X *  Blindingly fast 'search for subject'.  On my Texas S1500 system, 
X    nn uses less than 20 seconds to find all articles on a specific
X    subject among 64000 articles in all groups!
X
X *  News collection and presentation is extremely fast, because nn
X    uses its own database on top of the standard news system.
X 
X *  In a distributed environment, the database can be shared among all 
X    hosts on the network.  Only one daemon is needed on the news server
X    for all hosts.  This works in a heterogenous environment as well.
X 
X *  NNTP is also supported (using a local database for speed).
X 
XBecause of the database, nn starts almost equally fast (in a few
Xseconds), no matter whether you have 100 or 10000 unread articles!
XThe database takes up some disk space, but dramatically improves speed
Xand functionality.  The amount of disk space consumed is approx. 1Mb
Xper 10000 articles.
X
X
XDISTRIBUTION
X------------
X
XThe package is posted as 15 separate shar archives on comp.sources.unix.
XIt is unpacked by applying /bin/sh to each archive in turn.  
XEverything is a little less than 730Kb, including documentation.
X
XIt is also available via anonymous ftp from 
X
X	host: freja.diku.dk (129.142.96.1) 
X	file: /pub/misc/nn-6.3.tar.Z	(compressed tar)
X
X
X
XCOPYRIGHT
X---------
X
XCopyright (c) 1989 by Kim Fabricius Storm.
X
XNot derived from licensed software.
X
XPermission is granted to anyone to use, modify, and reuse this
Xsoftware for any purpose on any computer system, and to redistribute
Xit freely, subject to the following restrictions:
X
X1. The author is not responsible for the consequences of use of this
X   software, no matter how awful, even if they arise from defects in
X   it.
X
X2. The origin of this software must not be misrepresented, either by
X   explicit claim or by omission.
X
X3. Altered versions must be plainly marked as such, and must not be
X   misrepresented as being the original software.
X
X
XThe following code modules have been incorporated into nn, and the
Xabove copyright notice does not apply to these modules; they include
Xtheir own copyright notices (or have none):
X
Xregexp.c:	Copyright (c) 1986 by University of Toronto.
X	 	Written by Henry Spencer.
X
Xunshar.c:	No copyright notice.
X		Written by K. Greer, S. Shafer, and M. Mauldin
X
X
XINSTALLATION
X------------
X
XThe installation procedure is described in the file INSTALLATION.
X
XYou may also find useful information in the files PROBLEMS and NNTP.
X
XThe file NEWS-6.3 describes the major changes from release 6.1 to 6.3.
X
X
XBUGS and MAILING LIST
X---------------------
X
XPlease send bug reports (and fixes) to the following address:
X	nn-bugs@dkuug.dk
X
XYou may also use nn-bugs for suggestions for improvements (missing
Xfeatures in nn are considered to be bugs :-)
X
XWe have a moderated mailing list for users of nn.  Its address is
X	nn-info@dkuug.dk
X
XIf you like to join the nn mailing list, send a request to
X	nn-info-request@dkuug.dk
X
X
XACKNOWLEDGEMENTS
X----------------
X
XMy thanks goes to Rene' Seindal for his help before and after the
Xfirst major release of nn in Europe.  He did intensive testing & bug
Xfixing & ported it to BSD 4.3 & SunOS, he is administering the nn-info
Xlist, and he has also written the NNTP code for nn.
X
XSince the development of nn is now on its fifth year, many persons
Xhave contributed to nn with ideas and critisism, have helped me debug
Xthe software by patiently using alpha and beta versions, have provided
Xbug fixes, and have helped porting it to other systems:
X
XJan H. Andersen, Norman H. Azadian, P{r Emanuelsson, Bruce Fisher,
XMatthias Frei, S|ren O. Jensen, Poul-Henning Kamp, Michael Knudsen,
XTor Lillqvist, Kim Chr. Madsen, Lars Mathiesen, Dennis Olsson,
XCarl-Lykke Pedersen (when he finishes the GNU-emacs front-end :-),
XAlan Rooks, Rene' Seindal, Keld Simonsen, Jon Vos, Johan Vromans, Tom
XVijlbrief, Per Westerlund.
X
XI would like this list to be complete, but it is impossible for me
Xto remember all the names of the people who have contributed to the
Xevolution of nn.  My excuses to those who are not on the list.
X
X
X
XKim Fabricius Storm
XTexas Instruments, Denmark
X
XEmail: storm@texas.dk   
XSnail: Marielundvej 46E, DK-2730 Herlev, Denmark
Xtel:   +45 429 17 400      fax:   +45 429 18 400
NO_NEWS_IS_GOOD_NEWS
chmod 0644 README || echo "restore of README fails"
set `wc -c README`;Sum=$1
if test "$Sum" != "5549"
then echo original size 5549, current size $Sum;fi
echo "x - extracting INSTALLATION (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > INSTALLATION &&
XCONFIGURATION AND INSTALLATION OF NN
X------------------------------------
X
XThis file describes the necessary steps to configure and install nn.
XYou are advised to read this file before proceeding with the
Xinstallation.  
X
XIf you want to use NNTP (accessing news from a remote host), you must
Xalso read the file NNTP.
X
XThe file PROBLEMS contains descriptions of problems previously seen
Xwhen installing nn.  If you run into problems, consult that file
Xbefore mailing us about it.
X
XThe '#' prompts are used in the examples when super user privileges are
Xrequired to execute the command.
X
X
XCONFIGURATION OF MAKEFILE
X-------------------------
X
XCheck the 'Makefile' file and supply the proper values for the
Xfollowing parameters:
X
XCC	The command to invoke the C compiler
X
XCPP	The command to invoke the C preprocessor with the result
X	written to the standard output stream.
X
XCFLAGS	Flags to the C compiler  (e.g. -O or -g)
X
X
XCREATE CONFIGURATION FILE config.h
X----------------------------------
X
X	$ cp config.h-dist config.h
X
X
XEDIT config.h TO REFLECT YOUR SYSTEM
X------------------------------------
X
XThe config.h file contains verbose comments explaining the meaning
Xof each parameter in the file.  Follow the instructions carefully.
X
X
XAmong the things you have to select are two system and machine
Xdependent files.  The following system files are delivered with nn:
X
X	s-bsd4-2.h	For 4.2 BSD and Ultrix systems
X	s-bsd4-3.h	For 4.3 BSD systems
X	s-hpux.h	For HPUX (series 320)
X	s-hpux2-1.h	For HPUX 2.1 (series 800)
X	s-sunos3.h	For SunOS 3
X	s-sunos4-0.h	For SunOS 4.0
X	s-tower32.h	For NCR tower
X	s-usg3-1.h	For most system V systems (also 2.2)
X
XThe following machine description files are delivered with nn:
X
X	m-att3b.h	For AT&T 3b2 (with s-usg3-1.h)
X	m-dec3100.h	For DECstation 3100 (with s-bsd4-2.h)
X	m-gould.h	For Gould PN6000 (with s-bsd4-3.h)
X	m-hp9000.h	For HP9000 series 320 and 800 (at least)
X	m-m680x0.h	For 68000 family processors
X	m-sparc.h	For SPARC processors
X	m-sun.h		For 680x0 based SUNs
X	m-sun386i.h	For 80386 based SUNs
X	m-vax.h		For VAX family
X
XIf you cannot use one of these configuration files, create your own 
Xbased on the following template files (send the new system and/or
Xmachine files to nn-bugs@dkuug.dk):
X
X	s-template.h
X	m-template.h
X
X
XThe following directories must be defined in config.h:
X
XBIN_DIRECTORY
X	The directory where you want the user programs to be
X	installed.  The following programs will be installed in that 
X	directory:
X
X	nn		The news reader program
X	nnadmin		The administration program (link to nn)
X	nncheck		Check for unread articles (link to nn)
X	nngoback	Mark older articles as unread
X	nngrep		Grep for news groups
X	nntidy		Cleans up the rc file
X	nnquery		Show which users read which groups
X	nnusage		Show usage statistics
X	nnmail		A mailer that understands domain addressing.
X
X	If you already run a domain based mailer, nnmail will not be
X	installed!
X
X	
XLIB_DIRECTORY
X	The directory where nn's auxiliary programs and files will
X	be installed.  Since it contains binary files and per system
X	data, it should not be shared in a network environment without
X	some considerations.  The programs in this directory are:
X
X	aux	The shell script used in connection with replies etc.
X		It knows about common editors like vi and gnu emacs to
X		have them position the cursor appropriately.  To add
X		support for your own favourite editor, you should edit
X		the file aux.sh, not the compiled `aux' script!
X
X	back_act
X		Program to make daily copies of the active file to
X		allow nngoback to work.
X		
X	date_regexp
X		Program used by nngoback to extract information from
X		the history file (it builds a big regexp for egrep).
X
X	log_entry
X		Program to make entries in the Log file.
X
X	nnmaster
X		The program building and maintaining nn's database.
X
X
XDB_DIRECTORY 
X	The directory where nn's private database (containing
X	extracted article header information) can reside.  This
X	directory is intended to be shared together with the news
X	spool directory in a networked environment provided that
X	NETWORK_DATABASE is defined in config.h.
X
X	This directory requires some disk space to hold the necessary
X	information.  On average about 100 bytes per article in the
X	system, or about 5% of the space allocated to the news articles.
X	
X	If you share /usr/spool/news via NFS or RFS, you can set DB to
X	something like /usr/spool/news/.nn to share it as well.
X
X
XConsult the file NNTP for a description of how to use NNTP with nn.
X
XThe files config.h and NNTP describes how to share the database
Xbetween several machines (also when you don't use NNTP).
X
X
XCOMPILE THE SOFTWARE
X--------------------
X
XIf you are making a complete package with both master and client, do
X
X	$ make all
X
XIf you want to share a database which resides on another host (through
XNFS/RFS/rdist), you don't need a master on the local system, so you
Xcan do the following instead:
X
X	$ make client
X
X
XINSTALL THE SOFTWARE
X--------------------
X
XUnless you have defined yourself as the owner of the nn package and
Xhave write permission on all the necessary directories, you will need
Xto be superuser to install nn, so start with
X
X	$ su
X
XTo install a complete package do
X
X	# make install
X
XIf you are only installing an nn client which is accessing a remote
Xdatabase through NFS (no local nnmaster) do
X
X	# make install.client
X
XNotice that every time you install the package, the file update.h is
Xmodified to make a new update level for the version in the source
Xdirectory.  This means that doing make install twice in a row will
Xcause make to relink all the programs during the second install.
X
XWhen you have installed the package, you are ready to generate the
Xonline manual.  The following command will install the generated
Xmanual directly in the LIB_DIRECTORY, but you can move it manually to
XDB_DIRECTORY if you want to share it on the network (nn will look for
Xit in both directories):
X
X	# make online
X
X
XINITIALIZE DATABASE
X-------------------
X
XIf you installed a complete package, you now have to initialize the
Xdatabase:
X
X	$ su		 -- also as superuser
X	# make initdb
X
XIf something goes wrong in this step, e.g. problems with the active
Xfile, you will have to execute the following command to repeat the
Xinitialization of the database:
X
X	# LIB_DIRECTORY/nnmaster -I
X
X
XSTART THE MASTER PROCESS
X------------------------
X
XWhen the database is ready, start nnmaster to enter the existing
Xarticles into the database.  If you use the following command,
Xnnmaster will fork and return immediately; its background child will
Xcontinue to update the database whenever new articles arrive:
X
X	$ LIB_DIRECTORY/nnmaster -r -C -E
X
XNOTICE:  It may take quite a while before all existing articles have
Xbeen entered into the database.  You can use the nnadmin program's
XUpdate and Stat commands to trace the progress and the Log command to
Xsee if it has finished (a C entry will occur).
X
X
XPREPARE TO START THE NNMASTER PROGRAM WHEN THE SYSTEM IS BOOTED
X---------------------------------------------------------------
X
XPlace the following commands in a file which is executed at boot time:
X
X	rm -f LIB_DIRECTORY/MPID
X	LIB_DIRECTORY/nnmaster -r -C -E
X
XDepending on the organization of start-up scripts on your system, you
Xmay have to create a new file for these commands
X	/etc/rc.d/start.nn
Xor you simply place them in a suitable place in the file
X	/etc/rc
X
XAlternatively, you can arrange for cron to run the master regularly.
XIn this case, you should not use the -r and -C options.  Instead, you
Xshould let cron execute the command 'nnadmin Z' once a day to
Xvalidate the database.
X
XWARNING: If you share the database via NFS or RFS, nnmaster should run
X	 only on the system where the database actually resides!!
X
X
XSETUP EXPIRE ON THE DATABASE
X----------------------------
X
XTo run expire on the database, you simply have to execute the
Xfollowing command (with sufficient privileges):
X
X	BIN_DIRECTORY/nnadmin EW
X
XYou should arrange for expire to be run on nn's database whenever you
Xhave run expire on the news directories.
X
XSupposing you run the expire from your crontab, you may simply add the
Xabove command to the crontab at an appropriate time when you are
Xcertain that news' expire is completed.
X
X
XINITIATE SAVING A COPY OF THE ACTIVE FILE ONCE A DAY
X----------------------------------------------------
X
XThe nngoback program will operate faster and in all environments (also
XNNTP and shared databases) when the program LIB_DIRECTORY/back_act is
Xexecuted once (and only once) every day to maintain suitable copies of
Xthe active files for the last 14 days.  In a network environment, it
Xshould execute on the same host as the nnmaster.
X
XSimply arrange for back_act to be invoked by cron once a day
X(preferably just before the batch of news for `today' arrives).  For
Xexample, assuming the news is received just before midnight (syntax
Xand location of crontab entry may vary):
X
XIn /usr/spool/cron/crontabs/news (System V):
X	00 23 * * * LIB_DIRECTORY/back_act
Xor in /usr/lib/crontab (BSD):
X	00 23 * * * su - news LIB_DIRECTORY/back_act
X
X
XINSTALL AND EDIT GLOBAL FILES
X-----------------------------
X
XDepending on your needs, you should create the following files in the
XLIB_DIRECTORY on each host running nn:
X
Xinit
X	The global init file for all users on the system.
X	You should at least put a global presentation sequence here.
X
X	You may use init.sample as a starting point.
X
Xroutes
X	Configuration file for the domain address remapping
X	done by nn in reply addresses and the nnmail program.
X	You may use routes.sample as a starting point (it briefly
X	describes how to build a routes file).
X	It should NOT be created if you already run a domain based
X	mailer, i.e. when HAVE_ROUTING is defined in config.h.
X
X	NB: nnmail is not a supported part of nn - if you really want
X	    to run a domain-based mailer, get smail 2.5 or later.
X	
X"NNTP_SERVER"  (location & name is defined in config.h)
X	Contains the host name of the NNTP-server when NNTP is used.
X
X
XUPDATING THE SOFTWARE
X---------------------
X
XPatches to this software will be distributes as context diff's which
Xcan be applied using Larry Wall's `patch' program.
X
XAfter applying the patches, you will need to redo the compilation and
Xinstallation steps:
X
X	$ patch < PATCH_FILE	(or use nn's :patch command)
X	$ make all
X	$ su
X	# make install
X
XTo be able to install a new nnmaster, the currently running master (if
Xany) will be stopped automatically, and it has to be started manually
Xwhen the installation is complete (unless it is setup to be run by cron).
X
XNotice that unless it is explicitly required in the patch, there is no
Xneed to reinitialize the database after applying the patch.
NO_NEWS_IS_GOOD_NEWS
chmod 0644 INSTALLATION || echo "restore of INSTALLATION fails"
set `wc -c INSTALLATION`;Sum=$1
if test "$Sum" != "10601"
then echo original size 10601, current size $Sum;fi
echo "x - extracting MANIFEST (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > MANIFEST &&
XREADME
XINSTALLATION
XMANIFEST
XNEWS-6.3
XNNTP
XPROBLEMS
XMakefile
Xactive.c
Xadmin.c
Xanswer.c
Xarticles.c
Xarticles.h
Xaux.sh
Xback_act.sh
Xcollect.c
Xconfig.h-dist
Xcvt-help.c
Xdata.h
Xdate_regexp.c
Xdb.c
Xdb.h
Xdebug.h
Xdigest.c
Xexecute.c
Xexpire.c
Xfolder.c
Xglobal.c
Xglobal.h
Xgroup.c
Xhelp.commands
Xhelp.extended
Xhelp.help
Xhelp.map
Xhelp.menu
Xhelp.more
Xhelp.read
Xhelp.set
Xhelp.show
Xhelp.variables
Xhelp.welcome
Xinit.c
Xinit.sample
Xinstall_aux
Xkeymap.c
Xkeymap.h
Xkill.c
Xlog_entry.c
Xm-att3b.h
Xm-dec3100.h
Xm-gould.h
Xm-hp9000.h
Xm-m680x0.h
Xm-sparc.h
Xm-sun.h
Xm-sun386i.h
Xm-template.h
Xm-vax.h
Xmacro.c
Xmaster.c
Xmatch.c
Xmatch.h
Xmenu.c
Xmenu.h
Xmk_online_man
Xmore.c
Xnews.c
Xnews.h
Xnn.1
Xnn.c
Xnnadmin.1m
Xnncheck.1
Xnngoback.1
Xnngoback.sh
Xnngrep.1
Xnngrep.sh
Xnnmail.c
Xnnmaster.1m
Xnnquery.sh
Xnntidy.1
Xnntidy.sh
Xnntp.c
Xnntp.h
Xnnusage.1m
Xnnusage.sh
Xoptions.c
Xoptions.h
Xpack_date.c
Xpack_name.c
Xpack_subject.c
Xpatchlevel.h
Xprefix.sh
Xrc.c
Xregexp.c
Xregexp.h
Xreroute.c
Xroutes.sample
Xs-bsd4-2.h
Xs-bsd4-3.h
Xs-hpux.h
Xs-hpux2-1.h
Xs-sunos3.h
Xs-sunos4-0.h
Xs-template.h
Xs-tower32.h
Xs-usg3-1.h
Xsave.c
Xselection.c
Xsequence.c
Xterm.c
Xterm.h
Xunshar.c
Xupdate.c
Xupdate.h
Xvararg.h
Xvariable.c
Xxmakefile
NO_NEWS_IS_GOOD_NEWS
chmod 0644 MANIFEST || echo "restore of MANIFEST fails"
set `wc -c MANIFEST`;Sum=$1
if test "$Sum" != "1137"
then echo original size 1137, current size $Sum;fi
echo "x - extracting NEWS-6.3 (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > NEWS-6.3 &&
XNew features in release 6.3 (compared to release 6.1.5):
X--------------------------------------------------------
X
XMajor improvements:
X	NNTP support
X	nn can now use/update .newsrc (to a limited extent)
X	Presentation of article header can be customized
X	Full macro support
X	Full folder maintenance
X	Completion help available using '?' key
X	Backup of rc file works!
X	Much faster nngoback - not based on history file.
X
XChanges in standard key mappings:
X	reading mode Z -> goto-menu
X	reading mode N -> next-group
X	reading mode p -> previous (was print)
X	reading mode P -> print (was previous)
X
XNew commands:
X	leave-article
X	:define
X	:man
X	:map both ...
X	:patch
X	:pwd
X	:rmail
X	:show groups unsub
X	
XNew variables:
X	backup		(New functionality! It is set by default)
X	confirm-append
X	default-save-file
X	delay-redraw
X	header-lines
X	mail
X	mail-format
X	mark-overlap
X	newsrc
X	overlap
X	patch-cmd
X	quick-save
X	retry-on-error
X	save-report
X	word-key
X
XNew options:
X	-m
X	-s/	(regexp matching)
X
XDescription of new features (in mixed order):
X---------------------------------------------
X
XNNTP support has been added (thanks to Rene Seindal @ diku.dk).
X
XOnline manual.
X
XRegular expression search in reading mode:  / and .
X
XRegular expression matching for subjects in -s/ option and G=/ command.
X
XArticles can be saved in a mail compatible format by setting the
Xmail-format variable.
X
XThe article selection save files are now kept in network format if
XNETWORK_DATABASE is defined, so reading news from different machines
Xshould now work in a heterogeneous environment.
X
XAdded $F which expands to the group name with / instead of .  E.g. $F
Xin rec.music.synth produces rec/music/synth
X
XFolder name "+" is expanded to the file name found in the new
Xdefault-save-file variable (default +$F).
X
XWhen saving articles, the prompting for a file name can be disabled by
Xsetting the quick-save variable (saving will be done in the default
Xsave file).
X
Xnn will ask for confirmation before appending to existing files when
Xconfirm-append is set.
X
XThe message after each save can be disabled by unsetting the
Xsave-report variable.
X
XThe manual has been corrected to use the proper names for the
Xmail-record and news-record variables.
X
X:unshar will create the directory if is does not exist.
X
XCustomized article header presentation through setting of header-lines
Xvariable.
X
XComplete variable settings are now shown by :set
X
XFull macro support - you can now bind any sequence of commands to a
Xsingle key (see the define command).
X
XIndividual articles in a folder can now be cancelled!  I.e. folders
Xare now fully supported:  you can save, print, respond to, and cancel
Xseparate articles in the folders created by nn. (Try the G +folder command).
X
XA global init file is now supported rather than just a global sequence file.
X(You should avoid using the sequence file, because it might go away in
Xa future release.)
X
XNn will now remember which articles you have seen on the menu (but not
Xnecessarily selected) when you quit.  Confirming the question "use old
Xselections" now also implies that nn will start on the same menu page
Xas the one you quitted on.
X
XThere is a retry-on-error variable which can be set to a number of
Xtimes attempts to open an article should be done before giving up.
X
XYou can now specify per group default save files in the init file (in
Xthe group sequence).
X
XS+ is an addition to the old S* command which saves all the selected
Xarticles in the group!
X
XWhen you have given a command that clears the screen, the screen is
Xnow redrawn by default when the command terminates.  To get the 6.1
Xbehaviour (prompt for a new : command), you must set the delay-redraw
Xvariable.  
X
XWhen input completion is possible, you can now use the ? key to get a
Xlist of the possible completions.
X
XCompletion is now possible when entering an extended command
X(:command) - both for the command name itself and the arguments.
X(The only exception is when entering the VALUE of a variable.)
X
XThe 'backup' variable now works "the right way": It makes a backup of
Xthe rc file on start-up.  nn can then update the rc file after reading
Xeach group (increased security), and still restore the old rc file
Xwith the :q! command.  The backup variable is now set by default.
X
XYou can set the 'mail' variable to make nn check for the arrival of
Xmail, and you can use the ':rmail' command to read the mail!  (But it
Xis not a full mail interface, e.g. you cannot delete messages, cc:
Xfields are not supported if you reply to a message, etc.)
X
Xnn will now synchronize with the .newsrc file if the "newsrc" variable
Xis set.  However, it does NOT understand about individual articles
Xthat are marked as unread (e.g. 5-8 in 1-4,9-24) - it will silently
Xmark such articles as read (e.g. read the above as 1-24).
X  I don't know anybody who uses this, but if somebody wants to improve
Xon it, feel free to do it.  If you just want to to use rn from time to
Xtime, the current support will be sufficient if you always read all
Xthe articles in a group once you have started reading it (or you read
Xthe articles in the normal article number order).
X
XWhen saving an article with a full or partial header in a folder,
Xlegal article header lines in the body of the article are now 
Xescaped with a tilde, e.g. ~From: ....., to avoid having the
Xarticles split improperly when the folder is later opened by nn.
X
XThere is a new C)onf command to nnadmin to print the current
Xconfiguration (directories, files, network, etc.).
X
XThe G (goto-group) command now allows you to jump to an unread group
Xin the group sequence without entering a new recursive menu level.
X
XThe manual nn.1 has been clarified regarding the effect of options:
XThe init file is read prior to parsing the options, and the options
Xwill TOGGLE the CURRENT value of boolean variables.
X
X
XRemoved backwards compatibility
X-------------------------------
X
XSupport for upgrading from release 3, 4, or 5 has been removed, since
Xthe sites using these releases have all updated to 6.1.
X
XAlso the support for pre 2.11 news has been removed (OLD_NEWS).
X
NO_NEWS_IS_GOOD_NEWS
chmod 0644 NEWS-6.3 || echo "restore of NEWS-6.3 fails"
set `wc -c NEWS-6.3`;Sum=$1
if test "$Sum" != "6040"
then echo original size 6040, current size $Sum;fi
echo "x - extracting NNTP (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > NNTP &&
XNNTP SUPPORT
X------------
X
XThis file describes the NNTP support available in nn release 6.3.
XThe NNTP support was implemented by Rene Seindal, seindal@diku.dk
X
X
XPREREQUISITES
X-------------
X
XBefore you can use the NNTP part of nn, you need to get and install
Xthe nntp-1.5 distribution with patches 1-3.  It is available from
Xseveral ftp-sites in the USA.  It is also available on freja.diku.dk
X(ip 129.142.96.1) together with the nn 6.3 distribution.
X
XYou also need read-access to an NNTP-server.
X
X
XHOW IT WORKS
X------------
X
XNNTP is supported both in nn and nnmaster.  When NNTP is used, the
Xdatabase with the header information used by nn is still maintained on
Xthe local system (because NNTP does not know about the nn database
X(yet?)).
X
XWhen the master is set up to use NNTP, it will connect to the NNTP-
Xserver in each iteration of the collection (the interval set with -r),
Xget a copy of the active file, and incorporate the new articles into
Xthe database.  To do this, the master will temporarily transfer one
Xarticle at a time from the NNTP-server to the local system.
X
XWhen the articles are read with nn, it will use the local database to
Xpresent the menus, and fetch the articles from the NNTP-server as they
Xare requested by the user.  It will connect to the NNTP server the
Xfirst time it is necessary to fetch an article.
X
XNeither nnmaster, nor nn will use NNTP if they run on the NNTP-server
Xitself (they will directly access the news files).
X
XBoth nn and nnmaster access the server in reading mode.  The master
Xand all client MUST use the same server at all times, since the local
Xdatabase contains article numbers, that are only unique for each
XNNTP-server.
X
X
XSHARING THE DATABASE
X--------------------
X
XYou must also decide whether you want to share the database between
Xyour local news clients, and how you are going to do it.
X
XThe database will take up some disk space, normally about 1Mb per
X10.000 articles.  There are several ways to manage this space.
X
XThis simplest solution, is to let each client run it own master,
Xi.e., have its own database.  This means, of course, no sharing.
X
XAlternatively, one host can run the master, and distribute the
Xdatabase to the others via e.g., rdist.  This doesn't save disk space,
Xbut saves load on the NNTP-server.
X
XLast, the database can be shared with NFS/RFS (see the description of
XNETWORK_DATABASE in the config.h file).
X
XThe possibility of making a `nndb-server' stands open.  It could be
Xrealized either as a separate server, running under inetd, or it could
Xbe incorporated into nntpd.  It has not been implemented, but might be
Xpart of a future release (any volunteers?).
X
X
XCONFIGURATION
X-------------
X
XTo use NNTP in nn, you must edit the relevant parts of config.h:
X
XNNTP
X	You enable the use of NNTP by defining the macro NNTP.
X
XNNTP_SERVER 
X	Both the master and the clients will look up their NNTP-server
X	in the file given by the macro NNTP_SERVER.  If the name is
X	not an absolute path name, it is taken to be relative to
X	LIB_DIRECTORY.
X	
X	The format of the file is compatible with the one used in
X	clientlib.c in the nntp-1.5 distribution, i.e., the first
X	non-blank line, not starting with '#' is taken to be the name
X	of the NNTP-server.  This file MUST be present, and must
X	contain a valid host name.
X
X
XTuning
X------
X
XBoth the server and each client maintains a cache of recently accessed
Xarticles, to minimize communication with the server (mainly to avoid
Xfetching large digests continuously).  The master needs the cache when
Xit splits digests, and the clients need it, because nn has a tendency
Xto reopen the articles several times.
X
XThe master's cache is kept in LIB_DIRECTORY, and each client's cache
Xare kept in the users .nn directory.  The constant NNTPCACHE (defined
Xin nntp.c but can be redefined in config.h) defines the size of the
Xcache, whose optimal size depends on the amount of news kept on line
Xon the NNTP-server.  Values of 5-10 gives reasonable results.  The
Xeffect is most striking when reading digested news.
X
X
XINSTALLATION
X------------
X
XMaking and installing nn using NNTP does not differ from a non-NNTP nn
Xinstallation, except for the differences in the configuration and the
Xneed to specify the NNTP server in the NNTP_SERVER file.
X
XNotice however, that the NNTP_SERVER file must be properly initialized
Xbefore doing the 'make initdb'.
X
XIf something goes wrong in the initialization of the database, you
Xwill have to run 'nnmaster -I' again by hand.
X
X
XPROBLEMS
X--------
X
XThere are some problems with the current implementation, mostly in
Xconnection with error conditions.  Almost any error will cause a
Xpanic-like reaction.  The master simply closes the connection and
Xreturns to the main loop, and nn terminates the session.
X
XThe client program, nn, has a simple attitude towards such accidents.
XIt prints a message, clears the cache, and exits.  This means that you
Xcan't have an nn suspended for very long before the connection times
Xout, and nn will exit the next time you try to access an article.
XThis is clearly wrong.  It should at least just close the connection,
Xand reopen it the next time a request to the server comes in.
X
XIn spite of these drawbacks, in general it works ok.  The NNTP code
Xhas been in use for several months now, in a generally satisfying
Xmanner.
X
XAlternative implementations can be conceived, especially in the
Xmaster.  The master normally collects articles by rereading the active
Xfile, looking for changed article numbers.  For each group with new
Xarticles, it reads the new articles and adds them to the database.
XThis scheme has been kept in the NNTP-based master, to keep the
Xchanges at a minimum.
X
XAn alternative solution could be to use NEWNEWS to get a list of new
Xarticles since last collect, and fetch each article in sequence.  This
Xrequires the NNTP-server to return the article number in the response
Xto an ARTICLE request (as required in rfc 977), but apparently version
X1.5 of the NNTP-server does not do this.
X
XSuggestions and improvements are very much welcome.  Send your
Xcontributions to nn-bugs@dkuug.dk.
NO_NEWS_IS_GOOD_NEWS
chmod 0644 NNTP || echo "restore of NNTP fails"
set `wc -c NNTP`;Sum=$1
if test "$Sum" != "6063"
then echo original size 6063, current size $Sum;fi
echo "x - extracting PROBLEMS (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > PROBLEMS &&
XHere is a collection of some of the problems people have had with
Xinstallation and operation of nn in the past.
X
X
XFILE PERMISSIONS
X----------------
X
XYou should run as root when installing the package & db, because some
Xdirectories might be created in places where ordinary users are not
Xallowed to write, and secondly because it is not allowed to change the
Xowner of a file (nnmaster) on some systems.
X
XThis might be the cause of your problems.
X
XIn general, the permissions and ownership of the various programs
Xshould be set to allow the following access:
X
X- To let the nnmaster READ the news directory (no problem since
X  /usr/spool/news normally has mode 755),
X  
X- To let the nnmaster WRITE in the db-directory and files
X  
X- To let ordinary users programs (i.e. nn) READ the db-directory.
X  
XFor example,
X  			owner   group   mode
X  db-directory & files:	news	news	755
X  nnmaster:		news	news	6755 (suid)
X  nn etc:		storm	other	755
X
X
XEXPIRED ARTICLES STILL SHOW UP ON THE MENUS
X-------------------------------------------
X
XThis common problem is caused by the way the nnmaster "detects" that
Xexpire has been run on a news group: It compares the number of the
Xfirst article in the active file with the first article in the data
Xbase.  As long as they are identical, nnmaster believes that expire
Xhas not been run.
X
XHowever, if the first article has an expiration date sometime in the
Xfuture it is not removed, although many of the following articles may
Xvery well have been removed.
X
XTo overcome this problem, you can instruct the nnmaster to recollect
Xall groups once a week, or after expire has been run.  You do this by
Xinserting the following command in the crontab to be executed at a
Xsuitable time (with permissions of the owner of nnmaster):
X
X	/usr/local/bin/nnadmin I
X
X
XABOUT BLOCKED GROUPS
X--------------------
X
XA group is blocked while the nnmaster is collecting new articles in
Xthat group.  In a newly initialized database, all groups will be
Xblocked until the nnmaster has collected them the first time, which
Xmay take an hour or so the first time you run nnmaster -r.
X
XThis means that there may not be any news to read for a while after
Xyou have just started the nnmaster the first time.
X  
X  
XPROBLEMS SENDING MAIL
X---------------------
X
XSome people have experienced problems sending mail.
X
XIn one case, the recmail program was corrupted.
X
XIn another case, uux was not silent causing the trace file (in the aux
Xscript) to be non-empty which fooled nn to think that nothing had been
Xsent (although it did).  If you get failed reply/follow-up messages
Xlook for a line saying something like "uucp job XXXXX" - This is
Xcaused by the environment setting JOBNO=ON.
X  
XAlso notice that some recmail programs may treat a line consisting of
Xa single period in the first position as end-of-file.
X
X
XACCESSING NEWS REMOTELY  
X-------------------------
X
XI have received the following problem description which seems to
Xindicate a network problem.  You can now set the variable
X	retry-on-error
Xto the number of times nn should try to open an article (you may
Xwant to do this in the global init file!):
X  
X   We are running on a VAXstation 2000, with the news accessed
X   remotely, so I get a lot of "can't read" errors.  It seems to
X   me these errors should ALWAYS require acknowledgement before
X   clearing the message, and should offer the possibility to
X   re-try the operation (which usually then works for us).
X
X
X
XECHOING TYPED CHARACTERS
X------------------------
X
Xnn does not echo the characters you type except when you are entering
Xa string, e.g. a file name.  Instead it attempts to make a significant
Xchange to the data displayed on the screen.  On a slow system this may
Xbe seen as a drawback; on fast systems it is an intended feature!
X
Xnn uses raw mode when reading from the keyboard and cooked mode when
Xprinting on the screen (it flips forth and back).  This has caused
Xproblems on some systems (e.g. the 3B2) where the tty driver is
Xlocated on a dedicated IOprocessor, which for some reason handles
Xioctl's "out of band".  I have tried to work around these problems by
Xoutputting \r\n sequences where \n should have been sufficient.
X
Xnn also intentionally discards type-ahead at certain points.
X
XOn some systems, TCSETAF also flushes the output queue; you may try to
Xreplace it by TCSETAW followed by TCFLSH.
X
X
XNNMASTER WILL NOT START
X-----------------------
X
XIf no nnmaster is running, and nnmaster refuses to start up, you
Xshould check for the existence of the MPID file in the LIB directory,
XIf it exists, it should be removed.
X
X
XWARNINGS DURING COMPILATION
X---------------------------
X
XIf you get a syntax error when compiling the folder.c file, you
Xprobably have defined HAVE_DIRECTORY in the s- file, but even though
Xthe include file exists, it does not define the DIR type.  Either get
Xhold of a public domain directory package (look in the gnu
Xdistribution), or just undefine HAVE_DIRECTORY which causes nn to use
X(much slower) shell commands for file name completion (and disables
Xthe ?-help for file names).
X
XIf the linker complains about not finding the function `strcspn'
X(whice should be in most standard libraries these days), define the
Xsymbol STRCSPN in config.h to use the version in regexp.c.
X
X
XFORMATTING THE MANUALS
X----------------------
X
XMany versions of the -man package may have problems handling the `@'
Xcharacters as hanging tags (.TP).  Fix your man package by
Xsubstituting ALL occurrences of the @ character in tmac.an (or perhaps
Xtmac.an.new) by a BEL (^G) character.
X
X
XRESIZING
X--------
X
XResizing only works with termcap (on BSD systems)!
X
XIf resizing occurs while reading an article, the article is repositioned
Xon the first page of the article.
X
X
XNNMASTER AND NN DOES NOT FIND ANY NEWS
X--------------------------------------
X
XThis problem has been seen on some Xenix ports.  I have not had the
Xtime to dig further into this problem.  If you succeeds in porting nn
Xto Xenix (286/386), send me the patches + s- and m- files.
X
XIn release 6.3, some changes to the way files are opened may solve
Xthis problem, but I have not tested 6.3 on Xenix.
X
X
XTHE DATABASE BECOMES CORRUPTED FOR NO APPARENT REASON
X-----------------------------------------------------
X
XThis has been seen on some systems in the past.
XThree causes for these problems have been identified:
X
X- There was a serious bug in rel. 6.1 which was solved by patch # 5.
X  Actually, there were no errors in the database, but nn misinterpreted
X  some information, and reported that the database was corrupted.
X
X- Some .o files had not been recompiled by make after modifying the
X  config.h file (this happened on SunOS 4.0 which seems to forget to
X  update file modification times for some files (has anybody seen this
X  before?)).
X	  
X- There may still be a bug in the default expire code (when nnmaster
X  is invoked WITHOUT the -E option) which causes the master to lose
X  either the first or the last article in the group.  Until we have
X  this problem sorted out (or determined that there isn't a bug), the
X  use of -E on the nnmaster is recommended.
X
X  
X8 BIT SUPPORT
X-------------
X
XI am rather embarrassed to admit that a program leaving Denmark in
X1989 does not support 8 bit character sets - however, that is the
Xplain truth.  Currently, all characters typed on the keyboard are
Xstripped to 7 bits, and only printable characters in the 7 bit ASCII
Xcharacter set are (normally) displayed on the screen.  (You can set
X'monitor' to see all the characters in an article).
X
XAnyway, ISO 8859/1 support is next on my agenda.
X
X
XMAIL RECORDS
X------------
X
XThere are some things you have to consider in connection with the mail
Xand news record files:
X
X - When you :mail to yourself, a copy is not saved in the mail-record.
X
X - If the mail/post fails, the message is saved in ~/dead.letter instead
X
X - Since the posting is performed in the background and it may take
X   upto a minute to complete posting an article, updating news-record
X   will not happen instantly.
X		
X - In previous releases the mail header created by nn in the record
X   files are not recognized by the digest splitting code in nn, i.e.
X   the always appear to contain a single article.  This is fixed in
X   release 6.3, but you may have old folders which nn will not be able
X   to split (there is no From: line).
X
X   
XNNTP PROBLEMS
X-------------
X
XA few problems with the current NNTP support are described in the NNTP
Xfile. 
X
X
XOTHER PROBLEMS (you might call them bugs)
X-----------------------------------------
X
XThe 'master flags' set on a group with nnadmin are forgotten if the
Xdatabase is reinitialized with nnmaster -I.
X
XThe article selections saved between sessions are kept in a machine
Xdependent format, so if a user reads news on different architectures
Xthe selection files may be misinterpreted if they cannot be ignored
X(there is a magic number in them).
NO_NEWS_IS_GOOD_NEWS
chmod 0644 PROBLEMS || echo "restore of PROBLEMS fails"
set `wc -c PROBLEMS`;Sum=$1
if test "$Sum" != "8837"
then echo original size 8837, current size $Sum;fi
echo "x - extracting Makefile (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > Makefile &&
X#
X# Makefile for nn release 6.3
X#
X# Specify your favourite compiler, preprocessor, and compiler flags:
X#
X# Some alternatives for CPP might be /lib/cpp and $(CC) -P
X# Common values for CFLAGS are '-O -s' or '-g'
X#
X
XCC =		cc
XCPP =		$(CC) -E
XCFLAGS =	
XMAKE =		make
X
X#
X# Before compiling, read the instructions in the file INSTALLATION!
X# -----------------------------------------------------------------
X#
X#	make all	compile programs
X#	make install	install programs
X#	make initdb	initialize database
X#	make clean	remove all make'd files from source directory
X#
X# no changes are needed below this line
X#
X
XSHELL = /bin/sh
X
Xall: ymakefile
X	$(MAKE) $(MFLAGS) -f ymakefile all
X
Xlint: ymakefile
X	$(MAKE) -f ymakefile lint
X
Xinstall: ymakefile
X	$(MAKE) $(MFLAGS) -f ymakefile install
X
Xinitdb: ymakefile
X	$(MAKE) $(MFLAGS) -f ymakefile initdb
X
Xonline: ymakefile
X	$(MAKE) $(MFLAGS) -f ymakefile online.manual
X
Xclient: ymakefile
X	$(MAKE) $(MFLAGS) -f ymakefile client
X
Xinstall.client: ymakefile
X	$(MAKE) $(MFLAGS) -f ymakefile install.client
X
Xymakefile: Makefile xmakefile config.h
X	cp xmakefile MF.c
X	$(CPP) -DCOMPILER="$(CC)" -DPREPROC="$(CPP)" \
X	       -DCDEBUG="$(CFLAGS)" MF.c | \
X	sed -e '1,/MAKE WILL CUT HERE/d' \
X	    -e '/^#/d' \
X	    -e '/^[ \f	]$$/d' \
X	    -e '/^[ /]*[*]/d' | \
X	sed -n -e '/^..*$$/p' > ymakefile
X	rm -f MF.c
X
X#
X# clean up 
X#	Will remove object and executeable files.
X#
X
Xclean:	ymakefile
X	make -f ymakefile clean
X	rm -f *.o *~ ymakefile
X
X#
X# distribution
X#
X
Xdistrib:
X	[ ! -d DIST ]
X	mkdir DIST
X	cp `cat MANIFEST` DIST
X	echo '#define UPDATE 0' > DIST/update.h
X	cd DIST ; shar -v -s -d'NO_NEWS_IS_GOOD_NEWS' \
X		  -onn-6.3. -l50 `cat MANIFEST`
X
X
NO_NEWS_IS_GOOD_NEWS
chmod 0644 Makefile || echo "restore of Makefile fails"
set `wc -c Makefile`;Sum=$1
if test "$Sum" != "1661"
then echo original size 1661, current size $Sum;fi
echo "x - extracting active.c (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > active.c &&
X/*
X * read/update incore copy of active file
X */
X
X#include "config.h"
X
X#ifdef NNTP
Xchar news_active[FILENAME];
X#else
Xchar news_active[] = NEWS_ACTIVE;
X#endif
X
Xvisit_active_file()
X{
X    FILE *act;
X    char line[512];
X    register char *cp, *name;
X    register group_header *gh;
X    group_header *add_new_group();
X
X#ifdef NNTP
X    FILE *nntp_act;
X    
X    nntp_act = NULL;
X
X    if (use_nntp)
X	nntp_get_active();
X    else
X	if (is_master)		/* copy 'active' to DB/ACTIVE */
X	    nntp_act = open_file(relative(db_directory, "ACTIVE"), OPEN_CREATE | MUST_EXIST);
X#endif
X
X    act = open_file(news_active, OPEN_READ|MUST_EXIST);
X    
X    while (fgets(line, 512, act)) {
X#ifdef NNTP
X	if (nntp_act != NULL)
X	    fputs(line, nntp_act);
X#endif	
X	cp = line;
X	while (*cp && isspace(*cp)) cp++; /* eat blank lines */
X	if (*cp == NUL || *cp == '#') continue;
X	
X	/* cp -> NAME space 00888 ... nl */
X	name = cp;
X	while (*cp != ' ') cp++;
X	*cp++ = NUL;
X	
X	gh = lookup(name);
X	if (gh == NULL) {
X	    /* new group */
X	    gh = add_new_group(name);
X	    if (gh == NULL) continue;
X	}
X	
X	while (*cp && isspace(*cp)) cp++;
X	gh->last_article = atol(cp);
X
X	while (*cp && isdigit(*cp)) cp++;
X	while (*cp && isspace(*cp)) cp++;
X	
X	if (*cp == NUL) {
X	    log_entry('E', "Error in active file for entry %s", name);
X	    continue;
X	}
X
X	gh->first_article = atol(cp);
X	if (gh->first_article == 0) gh->first_article = 1;
X
X	while (*cp && isdigit(*cp)) cp++;
X	while (*cp && isspace(*cp)) cp++;
X	if (*cp == NUL) continue;
X	
X	if (*cp == 'm') 
X	    gh->group_flag |= G_MODERATED;
X	else
X	    gh->group_flag &= ~G_MODERATED;
X    }
X
X    fclose(act);
X#ifdef NNTP
X    if (nntp_act != NULL)
X	fclose(nntp_act);
X#endif    
X}
X
NO_NEWS_IS_GOOD_NEWS
chmod 0644 active.c || echo "restore of active.c fails"
set `wc -c active.c`;Sum=$1
if test "$Sum" != "1677"
then echo original size 1677, current size $Sum;fi
echo "x - extracting admin.c (Text)"
sed 's/^X//' << 'NO_NEWS_IS_GOOD_NEWS' > admin.c &&
X/*
X * nnadmin - nn administator program
X */
X
X#include <signal.h>
X#include <errno.h>
X#include "config.h"
X#include "db.h"
X#include "term.h"
X
Xstatic char *pre_input;
Xstatic int verbose = 1;
X
Xextern int group_completion();
X
X
Xstatic get_cmd(prompt1, prompt2)
Xchar *prompt1, *prompt2;
X{
X    char c;
X
X    if (s_hangup) {
X	printf("\nnnmaster hangup\n");
X	nn_exit(0);
X    }
X
X    if (pre_input) {
X	if ((c = *pre_input++) == NUL)
X	    nn_exit(0);
X    } else {
X	if (prompt1) printf("%s\n", prompt1);
X	if (prompt2) printf("%s >>>", prompt2);
X	fl;
X        raw();
X	c = get_c();
X	no_raw();
X	printf("%c\n\n\r", c);
X    }
X    
X    if (islower(c)) 
X	c = toupper(c);
X	
X    return c;
X}
X
X
Xstatic long get_entry(prompt_str, min_val, max_val)
Xchar *prompt_str;
Xlong min_val, max_val;
X{
X    char buf[100];
X    int val;
X    
X loop:
X    
X    printf("%s %ld..%ld (or all): ", prompt_str, min_val, max_val);
X    fl;
X    gets(buf);
X    if (buf[0] == 'a')
X	return -1;
X
X    val =  atol(buf);
X    if (val < min_val || val > max_val) goto loop;
X    
X    return val;
X}
X
X
Xstatic admin_confirm(action)
Xchar *action;
X{
X    char buffer[100];
X
X    if (pre_input) return 1;
X    
X    sprintf(buffer, "Confirm %s  Y)es N)o", action);
X    
X    return get_cmd((char *)NULL, buffer) == 'Y';
X}
X
X
Xadmin_mode(input_string)
Xchar *input_string;
X{
X    if (input_string && *input_string) {
X	pre_input = input_string;
X    } else {
X	pre_input = NULL;
X	printf("\nMaster is%s running\n",
X	       access(relative(lib_directory, "MPID"), 0) ? " NOT" : "");
X    }
X    
X    for (;;) {
X	switch(get_cmd(
X"\nU)pdate W)akeup M)aster G)roups L)og S)tat C)onf E)xpire I)nit V)alidate Q)uit",
X"ADMIN")) {
X	    
X	 case 'M':
X	    master_admin();
X	    break;
X
X	 case 'W':
X	    kill_master_1(SIGALRM);
X	    break;
X	    
X	 case 'E':
X	    if (admin_confirm("Expire All Groups"))
X		send_master('X', -1L, 0L);
X	    break;
X
X	 case 'I':
X	    if (admin_confirm("INITIALIZATION, i.e. recollect all groups"))
X		send_master('R', -1L, 0L);
X	    break;
X
X	 case 'G':
X	    group_admin();
X	    break;
X	    
X	 case 'L':
X	    log_admin();
X	    break;
X	    
X	 case 'S':
X	    master_status();
X	    break;
X
X	 case 'C':
X	    show_config();
X	    break;
X	    
X	 case 'U':
X	    update_master();
X	    break;
X
X	 case 'Z':
X	    verbose = 0;
X	    /* FALL THRU */
X	 case 'V':
X	    validate_groups();
X	    verbose = 1;
X	    break;
X
X	 case '=':
X	    verbose = !verbose;
X	    break;
X	    
X	 case 'Q':
X	    return;
X	}
X    }    
X}
X
Xstatic update_master()
X{
X    extern FILE *master_file;
X    register group_header *gh;
X    int ngp;
X    
X    ngp = master.number_of_groups;
X    
X    rewind(master_file);
X    db_read_master(master_file, &master);
X    
X    if (master.number_of_groups != ngp) {
X	printf("\nNumber of groups changed from %d to %d\n",
X	       ngp, master.number_of_groups);
NO_NEWS_IS_GOOD_NEWS
echo "End of part 1"
echo "File admin.c is continued in part 2"
echo "2" > s2_seq_.tmp
exit 0
---
Kim F. Storm        storm@texas.dk        Tel +45 429 174 00
Texas Instruments, Marielundvej 46E, DK-2730 Herlev, Denmark
	  No news is good news, but nn is better!

-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.