home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume31 / tin / part12 < prev    next >
Encoding:
Text File  |  1992-07-07  |  54.6 KB  |  1,979 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  3. Subject:  v31i012:  tin - threaded full screen newsreader v1.1 PL4, Part12/15
  4. Message-ID: <1992Jul7.181957.7872@sparky.imd.sterling.com>
  5. X-Md4-Signature: f819ab6f185de78ee8eef31ffa05e6eb
  6. Date: Tue, 7 Jul 1992 18:19:57 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain%anl433.uucp@Germany.EU.net (Iain Lea)
  10. Posting-number: Volume 31, Issue 12
  11. Archive-name: tin/part12
  12. Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
  13. Supersedes: tin: Volume 30, Issue 1-14
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  20. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  21. # Contents:  FAQ INSTALL kill.c tin.h
  22. # Wrapped by kent@sparky on Mon Jun 29 23:35:14 1992
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 12 (of 15)."'
  26. if test -f 'FAQ' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'FAQ'\"
  28. else
  29.   echo shar: Extracting \"'FAQ'\" \(14588 characters\)
  30.   sed "s/^X//" >'FAQ' <<'END_OF_FILE'
  31. X[ NOTE: IGNORE THIS DOCUMENT UNTIL A LATER DATE - IT IS NOT COMPLETE - Iain ]
  32. X[ THIS DOCUMENT USES THE NN FAQ AS ITS BASE WITH PERMISSION FROM BILL WOHLER]
  33. X
  34. XSubject: TIN Frequently Asked Questions (FAQ) with Answers
  35. XSummary: This document answers Frequently Asked Questions about TIN,
  36. X     a menu-based, point and shoot, USENET news reader.
  37. XKeywords: FAQ tin news question answer newsrc digest article nntp
  38. X          newsgroup cancel mail signature header netnews usenet kill
  39. XFollowup-To: poster
  40. X
  41. XArchive-name: tin-faq/part01
  42. XLast-modified: 01/05/92
  43. X  
  44. X  This is a living list of frequently asked questions on the Usenet
  45. X  news reader TIN (Tass & Iain's Newsreader). The point of this is to
  46. X  circulate existing information, and avoid rehashing old answers.
  47. X  Better to build on top than start again.  Please read this document
  48. X  before posting to a newsgroup concerning tin.
  49. X  
  50. X  This article is posted monthly.  If it has already expired and
  51. X  you're not reading this, you can hope that you saved the last bit of
  52. X  question 3 so that you can get a copy yourself.
  53. X  
  54. X  When someone posts a frequently-asked question, I will point out to
  55. X  them that the answer is here to ensure that everybody gets their
  56. X  question answered fully and to eliminate unnecessary traffic in this
  57. X  newsgroup.  Posted answers that are in the FAQ are just as annoying as
  58. X  posted questions that are in the FAQ!
  59. X  
  60. X  Your comments, additions and fixes to this list are welcome: please
  61. X  send them to Iain Lea (iain%anl433.uucp@Germany.EU.net).  Complete, 
  62. X  accurate and grammatically correct answers are appreciated to reduce 
  63. X  the time I have to take to test or edit your answers.
  64. X  
  65. X
  66. XFrom: Preface
  67. XSubject: Table of Contents
  68. X
  69. XLegend: + new, - deleted, ! changed
  70. X
  71. XIntroductory
  72. X
  73. X 1.  Why should I use tin?
  74. X 2.  Where can I get tin?
  75. X 3.  What references exist for tin?
  76. X 4.  How should I report bugs?
  77. X 5.  How can I convert from rn to nn?
  78. X 6.  How can I make life simpler when starting nn for the first time?
  79. X 7.  Is there an X interface to tin?
  80. X
  81. XBuilding tin
  82. X
  83. X 10. What machines does tin run on?
  84. X
  85. XUsing tin
  86. X
  87. X 20. How do I save files that I can read later with MH, elm, Mail, ...?
  88. X 21. How come nn doesn't show the Lines count?
  89. X 22. How can I find all articles having to do with a certain topic?
  90. X 23. How can I set a different Organization name?
  91. X 24. Can all non-selected subjects be automatically placed in my kill file?
  92. X 25. Can I automatically kill articles based on the Newsgroups header?
  93. X 26. How can I select one article in a thread with auto-select-subject set?
  94. X 27. Is there a library of macros and other nn features?
  95. X 28. Can one search for patterns in the entire article from the menu?
  96. X 29. How can I remove old articles from folders?
  97. X 30. What's the best way to save multi-part articles?
  98. X 31. When saving in +a/b/c keeps you from saving in +a/b.
  99. X 32. Can I use my mailer to send mail?
  100. X 33. How can I see the original article with the current subject?
  101. X 34. Can I choose newsgroups as I do articles, ie. with a menu?
  102. X 35. How can I post prewritten articles with nn?
  103. X 36. How do I eliminate double signatures?
  104. X 37. How can I make mail replies go to a different machine?
  105. X 38. How come more articles get selected than I expect?  
  106. X 39. Any plans for trn-ish thread following?  
  107. X 40. Setting new-group-action to "ask before adding" doesn't work.
  108. X 41. Why does nn crash when a letter one past the highest letter is selected?
  109. X 42. Why do articles without a Lines header appear empty?
  110. X
  111. XFrom: Preface
  112. XSubject: Viewing This Article
  113. X  
  114. X  To skip to a particular question numbered xx, use "/^F.*xx" with most
  115. X  pagers.  In GNU Emacs type "M-C-s ^F.*xx", (or C-r to search backwards),
  116. X  followed by ESC to end the search.
  117. X  
  118. X  To skip to new or changed questions, use "/^F.*[!+]" with most pagers and
  119. X  "M-C-s ^F.*[!+]" in GNU Emacs.
  120. X  
  121. X  This article is in digest format.  Nn may have already broken this
  122. X  message into separate articles; if not, then type "G %".  In rn, use
  123. X  ^G to skip sections.
  124. X  
  125. X  To get an overview of just the questions in GNU Emacs, type "M-2 C-x $".
  126. X  Use "C-x $" to display the text again ("M-0 C-l C-x $" ensures that
  127. X  the current cursor location remains on the screen).
  128. X  
  129. X  Contributer's E-Mail addresses can be found at the bottom of this article.
  130. X  
  131. X  
  132. XFrom: Intro-1
  133. XSubject: Why should I use tin?
  134. X  
  135. X  tin is a menu based (point and shoot) netnews reader with a complete
  136. X  set of features especially suited to the novice user.  Since its first
  137. X  release in Aug 1991 it has started to replace rn and other well-known
  138. X  news readers at many sites.
  139. X  
  140. X  Some of the key features of tin are:
  141. X  
  142. X  * Automatic kill & selection of articles based on subject or author.
  143. X  
  144. X  *  Based more on Notes and tass than rn type newreaders.
  145. X  *  Full screen, easy to use with on-line help at all levels.
  146. X  *  Reads news locally (ie. /usr/spool/news) and/or via NNTP/INN.
  147. X  *  Threads on Subject: and/or Archive-name: mail headers.
  148. X  *  Four different operating levels:
  149. X     -  Group selection level
  150. X     -  Thread selection level
  151. X     -  Article selection level
  152. X     -  Article viewer
  153. X  *  Same interface to mail, pipe, print & save articles.
  154. X  *  Auto unpacking of multi-part shar & uuencoded articles.
  155. X  *  Auto kill & selection of articles based on subject or author.
  156. X  *  Batch mode to mail/save new news when user is on holiday.
  157. X  *  Builtin NNTP mini-inews & clientlib.c
  158. X  *  NNTP extensions XUSER & XINDEX allow central index files. 
  159. X  
  160. X  
  161. XFrom: Intro-2
  162. XSubject: Where can I get tin?
  163. X  
  164. X  The current version of tin is 1.1 PL3.
  165. X  
  166. X  via anonymous ftp:
  167. X    ftp.Germany.EU.net []
  168. X      pub/news/tin/tin.tar.Z            ~250k
  169. X  
  170. X  via mail:
  171. X    Send a note to ftpmail@decwrl.dec.com whose body contains "help"
  172. X    on a line by itself get information on getting ftp sources by
  173. X    mail.
  174. X  
  175. X  
  176. XFrom: Intro-3 !
  177. XSubject: What references exist for tin?
  178. X  
  179. X  Usenet:
  180. X    news.software.readers
  181. X    news.software.notes
  182. X  
  183. X  Mailing list:
  184. X    none
  185. X  
  186. X  
  187. XFrom: Intro-4
  188. XSubject: How should I report bugs?
  189. X  
  190. X  Either mail them to  iain%anl433.uucp@Germany.EU.net  and be sure
  191. X  to include the version number as well as what hardware and operating
  192. X  system you are using, or better yet, use the 'B' bug command within tin.
  193. X  
  194. X  
  195. XFrom: Intro-6
  196. XSubject: How can I make life simpler when starting tin for the first time?
  197. X  
  198. X  tin -c
  199. X  sysadmin can set interesting groups in LIBDIR/subscriptions
  200. X  Subscribe/unsubscribe from uninteresting groups with sSuU commands at
  201. X  group selection level.  
  202. X
  203. X
  204. XFrom: Intro-7 
  205. XSubject: Is there an X interface to tin?
  206. X  
  207. X  No.
  208. X  
  209. X  
  210. XFrom: Building nn-10
  211. XSubject: What machines does tin run on?
  212. X
  213. X  * 386/486 PC & Xenix 2.3.2/SCO SysVR3.2/ISC SysVR3.2/ATT SysVr4.0
  214. X    386 PC & Minix 386 
  215. X    Amdahl & SysVR3
  216. X  * Apollo DN4500 & DomainOS 10.3
  217. X    Apricot VX/FT & SCO 3.2.2
  218. X    Atari STe & Minix 1.5.10.3b
  219. X    Convex C220 & Convex Un*x
  220. X  * Dec 5000/Vax & Ultrix 4.1/4.2
  221. X    DIAB DS90 & D-NIX 5.3
  222. X  * DG Aviion 300 & DG-UX 4.30
  223. X    Harris HCX & CX/UX
  224. X    HP 720/845 & HP-UX 7.0
  225. X    IBM RS/6000 & AIX 3.1.5
  226. X    ICL DRS6000 & SysVR4.0 
  227. X    NCR Tower & SysV
  228. X    Powerbook 140 & MacMinix
  229. X    Sequent S81 & PTX 1.3 / Dynix
  230. X    SGI 4D/35 & IRIX 4.0.1
  231. X  * SNI MX300/MX500 & Sinix 5.22/5.23/5.24/5.4
  232. X  * Sony News & NewsOS 4.1
  233. X  * Sun 3/4/IPC/SS1/SS2 & SunOS 4.0.3/4.1/4.1.1 
  234. X  * Vax 11/785 & BSD 4.3
  235. X
  236. X  * donates that the author has compiled & used tin on that machine.
  237. X
  238. X  
  239. XFrom: Using nn-22
  240. XSubject: How can I find all articles having to do with a certain topic?
  241. X  
  242. X  nngrab invokes nn on all articles whose subject or keyword fields
  243. X  contain a desired keyword.  This shows one how important it is to
  244. X  use descriptive subjects and keywords when posting articles.  For
  245. X  more information, read the manual page.
  246. X  
  247. X  
  248. XFrom: Using nn-23 
  249. XSubject: How can I set a different Organization name?
  250. X  
  251. X  This header (along with the Reply-To:) are user-specified in the
  252. X  init file.  An init file may include the lines:
  253. X  
  254. X  set mail-header Reply-To: steven@Transact.COM;Organization: Transact Software
  255. X  set news-header Reply-To: steven@Transact.COM;Organization: Transact Software
  256. X  
  257. X  You can include any headers that you want in the headers, either in
  258. X  mail or news postings, and they may be different.  --Steven M. List
  259. X  
  260. X  A Reply-To header is useful when your system generates either an
  261. X  unwanted or blatantly wrong return address for you.  If this header
  262. X  is present, then mailers use it instead of the system generated From
  263. X  header.  --Bill Wohler
  264. X  
  265. X  
  266. XFrom: Using nn-28
  267. XSubject: Is the Xref: header used to mark crosposted articles read?
  268. X  
  269. X  No. On the TODO list.
  270. X  
  271. X  
  272. XFrom: Using nn-28
  273. XSubject: Can one search for patterns in the entire article from the menu?
  274. X  
  275. X  No.
  276. X  
  277. X  
  278. XFrom: Using nn-29
  279. XSubject: How can I remove old articles from folders?
  280. X  
  281. X  Just open the folder in the usual way and C(ancel) the articles you
  282. X  want to remove from the folder.  When you leave the folder, nn will
  283. X  rewrite the folder with the "cancel"ed articles removed.  --Kim Storm
  284. X  
  285. X  
  286. XFrom: Using nn-30
  287. XSubject: What's the best way to save multi-part articles?
  288. X  
  289. X  This is VERY easy - all you have to do is to save the articles from
  290. X  the menu, e.g.
  291. X  
  292. X    W(rite) +file.* a b c d... <space>
  293. X  
  294. X  where a b c d... are the articles on the menu you want to save.  You
  295. X  can also save the selected articles on the menu with * (only on
  296. X  current page) or + (on all menu pages).  --Kim Storm
  297. X  
  298. X  
  299. XFrom: Using nn-31 
  300. XSubject: When saving in +a/b/c keeps you from saving in +a/b.
  301. X  
  302. X  This happens when default-save-file is $F.  Try changing
  303. X  default-save-file to $F/$N (my favorite) to get, for example,
  304. X  +news/software/nn/1022, or $G to put everything in
  305. X  +news.software.nn.  Finally, if you really did want the behavior of
  306. X  +$F, a compromise would be to use +$F. (Andrew's favorite) instead
  307. X  (one can use anything other than '.'). --Bill Wohler & Andrew Swann
  308. X  
  309. X  Alternatively, use +$F/$L, to place articles for news.software.nn in
  310. X  the file +/news/software/nn/nn.  This has two advantages:
  311. X  1) You can later read through the folder "nn" and save some of the
  312. X    articles under new folder names having to do with the topic.  For
  313. X    example, you might save auto-select topics under +$F/auto-sel,
  314. X    that is, +/news/software/nn/auto-sel.
  315. X  2) If at a later date, a new newsgroup is added below nn, articles
  316. X    can still be saved under that subgroup since +/news/software/nn is
  317. X    already a directory, not a folder.  --Harry Herman
  318. X  
  319. X  
  320. XFrom: Using nn-33 
  321. XSubject: How can I see the original article with the current subject?
  322. X  
  323. X  While reading an article, use "G RET RET RET".  --Bill Wohler
  324. X  
  325. X  
  326. XFrom: Using nn-35
  327. XSubject: How can I post prewritten articles with nn?
  328. X  
  329. X  nnpost will construct the header for the posted article, so it
  330. X  requires several arguments to be specified before the article is
  331. X  posted, e.g. a newsgroup name and a subject.  If some arguments are
  332. X  missing, nnpost will prompt for the missing arguments.
  333. X  
  334. X  If your pre-written article includes a full header, then you should
  335. X  not use nnpost; instead you should feed the article to "inews -h"
  336. X  directly (which is what nnpost does after building the header from
  337. X  the arguments).  --Kim Storm
  338. X  
  339. X  
  340. XFrom: Using nn-36
  341. XSubject: How do I eliminate double signatures?
  342. X  
  343. X  Double signatures occur when both nn and inews append your .signature
  344. X  file. 
  345. X  
  346. X  If you want inews to append your .signature file, use:
  347. X  
  348. X    unset append-signature-post
  349. X  
  350. X  If you want nn to append your .signature file, you can copy nn's aux
  351. X  file (ie. /usr/local/lib/nn/aux) to your .nn directory and set the
  352. X  mail-script and news-script variables to ~/.nn/aux.  In your copy of
  353. X  the aux script, you can either specify a different place for your
  354. X  .signature file (like $HOME/.nn/signature) or you can get fancy: you
  355. X  can use specific .signatures for certain groups, or use the output of
  356. X  a program.
  357. X  
  358. X  
  359. XFrom: Using nn-37 
  360. XSubject: How can I make mail replies go to a different machine?
  361. X  
  362. X  See "How can I set a different Organization name?"
  363. X  
  364. X  
  365. XFrom: Using nn-39 
  366. XSubject: Any plans for trn-ish thread following?  
  367. X  
  368. X  At the moment, no.
  369. X  
  370. X  
  371. XFrom: Using nn-42 +  
  372. XSubject: Why do articles without a Lines header appear empty?
  373. X  
  374. X  I discovered that this problem only shows up if you have
  375. X  header-lines set to a string that includes "L".  I suspect having
  376. X  the line count patch sets something that makes nn think there is a
  377. X  Lines header and then the header-string is telling it to display the
  378. X  Lines header but there isn't one and things get messed up.  --Gary
  379. X  Morris
  380. X  
  381. X  
  382. XFrom: Appendix
  383. XSubject: Glossary
  384. X  
  385. X  NNTP        Network News Transport Protocol (see RFC 977)
  386. X  
  387. X  
  388. XFrom: Appendix
  389. XSubject: Acknowledgements
  390. X
  391. XI'd like to thank the following people for providing ideas on the
  392. Xlayout of this article:
  393. X
  394. XJoe Wells <jbw@bigbird.bu.edu>          Richard M. Stallman <rms@gnu.ai.mit.edu>
  395. XDavid Elliott <dce@smsc.sony.com>     Tom Christiansen <tchrist@convex.com>
  396. XEugene N. Miya <eugene@nas.nasa.gov>
  397. X
  398. X
  399. XWe are also grateful to the following individuals that have provided
  400. Xanswers or other information to make this a better document.  The
  401. Xactual list is undoubtedly larger.
  402. X
  403. XF.F. Jacot Guillarmod <ccfj@hippo.ru.ac.za>  Mr. Kim F. Storm <storm@texas.dk>
  404. XSteven M. List <itkin@mrspoc.transact.com>   Steven Grady <grady@fx.com>
  405. XRichard M. Mathews <richard@locus.com>         Ian Taylor <ian@airs.com>
  406. XDave Shaver <shaver@convex.com>             Paul Eggert <eggert@twinsun.com>
  407. XMichael Rawdon <rawdon@rex.cs.tulane.edu>    Joerg Napp <napp@uni-paderborn.de>
  408. XDave Hayes <dave@elxr.jpl.nasa.gov>         Gary Morris <garym@telesoft.com>
  409. XAndrew Swann <swann@imada.ou.dk>         Alexis Rosen <alexis@panix.com>
  410. XDavid B. Thomas <dt@yenta.alb.nm.us>         Jeffery Small <jeff@cjsa.wa.com>
  411. XRichard Reiner <rreiner@nexus.yorku.ca>         Max Heffler <max@compaq.com>
  412. XHarry Herman <herman@corpane.uucp>         Luc Rooijakkers <lwj@cs.kun.nl>
  413. XPaul Bickerstaff <pbickers@tamaluit.phys.uidaho.edu>
  414. X
  415. X
  416. XFrom: Appendix
  417. XSubject: Warranty
  418. X
  419. X[The following statement epitomizes the ridiculous state of 
  420. Xaffairs in America and can be ignored outside of America...]
  421. X
  422. XNo Warranty: Because this article is provided free of charge as a
  423. Xservice to news.software.readers readers, we provide absolutely no
  424. Xwarranty, to the extent permitted by applicable state law.  This
  425. Xarticle is provided "as is" without warranty of any kind, either
  426. Xexpressed or implied, including, but not limited to, the implied
  427. Xwarranties of merchantability and fitness for a particular purpose.
  428. XShould the information prove defective, you assume the cost of all
  429. Xnecessary servicing, repair or correction.
  430. END_OF_FILE
  431.   if test 14588 -ne `wc -c <'FAQ'`; then
  432.     echo shar: \"'FAQ'\" unpacked with wrong size!
  433.   fi
  434.   # end of 'FAQ'
  435. fi
  436. if test -f 'INSTALL' -a "${1}" != "-c" ; then 
  437.   echo shar: Will not clobber existing file \"'INSTALL'\"
  438. else
  439.   echo shar: Extracting \"'INSTALL'\" \(9003 characters\)
  440.   sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
  441. XCompilation and installation notes for tin - 23-06-92 
  442. X-----------------------------------------------------
  443. X
  444. XTin has been compiled on a wide range of Un*x machines with cc and gcc.
  445. XA list of these machines can be found at the end of this file.
  446. X
  447. XThis file is long (so was the yellow brick road) but please read it all
  448. Xas it could save you problems later and we don't want an unhappy ending
  449. Xdo we? :-)  
  450. X
  451. XTin can be compiled to read news in any of the following ways:
  452. X
  453. X  o  locally from your machines news spool dir (default /usr/spool/news).
  454. X
  455. X  o  locally and remotely (rtin or tin -r option) (-DNNTP_ABLE).
  456. X
  457. X  o  remotely from another machine via NNTP but creating tin index files
  458. X     on local machine for each user in $HOME/.tin/.index (-DNNTP_ONLY).
  459. X
  460. X  o  remotely from another machine via NNTP and also retreiving tin index
  461. X     files from remote machine via NNTP (-DNNTP_ONLY). This
  462. X     option requires that MY NNTP XUSER & XINDEX patches be applied to
  463. X     your NNTP server nntpd. On the NNTP server the index daemon of tin
  464. X     'tind' needs to be run from cron to update the index files at 
  465. X     regular inetervals.
  466. X
  467. X  o  locally from you machines news spool dir (defult /usr/spool/news)
  468. X     and via CD-ROM using pseudo NNTP library with XSPOOLDIR command.
  469. X     (-DCDROM_ABLE) must be defined and tin must be linked with the
  470. X     pseudo NNTP CD-ROM library libcllib.a.
  471. X  o  via CD-ROM only using pseudo NNTP library with XSPOOLDIR command.
  472. X     (-DCDROM_ONLY) must be defined and tin must be linked with the
  473. X     pseudo NNTP CD-ROM library libcllib.a.
  474. XThe -DNNTP_ABLE or -DNNTP_ONLY define must be added to CFLAGS in 
  475. XMakefile and the correct libraries need to be linked to produce
  476. Xan NNTP aware tin.
  477. X
  478. XIf -DCDROM_ABLE is defined tin will not work with normal NNTP. This
  479. Xmay change as the CD-ROM library is further developed.
  480. X
  481. XBuilding Tin (Normal & Daemon versions) 
  482. X---------------------------------------
  483. X
  484. XNormal version
  485. X1)  Type 'make' and a few system types will be displayed.
  486. X2)  Edit Makefile if you want to add/change -D<defines>.
  487. X3)  Type 'make <system type>' to compile for your system.
  488. X4)  Type 'make install' / 'make install_setuid' to install.
  489. X
  490. XNote1: If you want to retreive tin index files from your NNTP server
  491. X      you will have to compile the tind index file daemon so do the
  492. X      following steps:
  493. X
  494. X  1)  Build 'Normal version' of tin as specified by the above 4 points.
  495. X  2)  The tind index daemon needs to be installed on your NNTP server.
  496. X  3)  Apply my NNTP XUSER & XINDEX patches to your nntpd server or this
  497. X      will not work!!!. (If you want tind locally read Note3).  
  498. X  4)  Edit the Makefile and add -DINDEX_DAEMON to your CFLAGS entry and
  499. X      remove any -DNNTP_* defines. Also remove any -lcurses screen type
  500. X      libs as tind does not need to be linked with curses and it will
  501. X      save a good 30-50K on the size of tind.
  502. X  5)  Type 'make <system type>' to compile tind daemon for your NNTP server.
  503. X  6)  Type 'make install_daemon' to install tind daemon on your NNTP server.
  504. X  7)  Add the following line to your system cron to run tind every 30 mins:
  505. X        00,30 * * * * su news -c '/usr/lib/news/tind'
  506. X        
  507. X  Note2: tind must be run as user 'news' and the normal tin must have 
  508. X         the correct permissions to read the central index files!
  509. X  Note3: tind can also be used to update a copy of all index files
  510. X         centrally so each user does not have duplicate files.
  511. X    
  512. XCompiler flags (-D<name> define directives)
  513. X-------------------------------------------
  514. XNews directory structure
  515. X------------------------
  516. X
  517. XLIBDIR
  518. XDefine if news software is not in /usr/lib/news.
  519. X
  520. XINEWSDIR
  521. XDefine if bnews/cnews program 'inews' is not in LIBDIR.
  522. X
  523. XSPOOLDIR
  524. XDefine if news articles are not in /usr/spool/news.
  525. X
  526. X
  527. XReading/posting news via NNTP
  528. X----------------------------- 
  529. X
  530. XNNTP_ABLE
  531. XDefine if you wish to read news locally and remotely via an NNTP server.
  532. X
  533. XNNTP_ONLY
  534. XDefine if you [want to | can] ONLY read news remotely via an NNTP server.
  535. X
  536. XNNTP_INEWS
  537. XDefine if you want to use my builtin NNTP POST routine so that you no
  538. Xlonger have to rely on the mini-inews from NNTP to be installed on each
  539. Xclient machine. Also check that NNTP_INEWS_GATEWAY & NNTP_INEWS_DOMAIN 
  540. Xare correctly set to produce correct From: headers for your site.
  541. X
  542. XNO_NNTP_EXTS
  543. XDefine if you have a *virgin* NNTP server with no extensions. This is just
  544. Xa nicety that will stop tin asking the server if it supports my NNTP server
  545. Xextensions XUSER & XINDEX.
  546. X
  547. XNNTP_INEWS_GATEWAY
  548. XDefines the name of your news gateway machine. Useful if you don't want 
  549. Xyour internal network visable to the outside world.
  550. XExample: I use this define to make all my net postings appear from our news
  551. Xgateway machine 'anl433' even though I post from my own workstation 'sony01'
  552. Xie. -DNNTP_INEWS_GATEWAY=\"anl433\"
  553. XIf the first letter of the string is '/' the gateway name will be read from 
  554. Xthe specified file.
  555. X
  556. XNNTP_INEWS_DOMAIN
  557. XDefines the name of your network domain. 
  558. XExample: I use this define to add our uucp domain '.uucp' to our news 
  559. Xgateways machine address 'anl433.uucp'.
  560. Xie. -DNNTP_INEWS_DOMAIN=\".uucp\"
  561. XIf the first letter of the string is '/' the domain name will be read from 
  562. Xthe specified file.
  563. X
  564. XNNTP_SERVER_FILE
  565. XOnly define if your nntpserver file is other than /etc/nntpserver.
  566. X
  567. XNETLIBS
  568. XContains the networking libraries needed to link with clientlib.o file.
  569. X
  570. X
  571. XReading news via CD-ROM
  572. X-----------------------
  573. X
  574. XCDROM_ABLE
  575. XDefine if you wish to read news locally and from CD-ROM.
  576. X
  577. XCDROM_ONLY
  578. XDefine if you [want to | can] ONLY read news from CD-ROM.
  579. X
  580. X
  581. XDaemon options
  582. X--------------
  583. X
  584. XINDEX_DAEMON
  585. XDefine to make an index file updating daemon version of tin. Note that
  586. Xno -lcurses or screen libraries need to be linked with tin when this
  587. X#define is specified. If defined this will automatically undefine all
  588. XNNTP_* defines as the daemon has to be installed on the NNTP server.
  589. X
  590. X
  591. XMiscellaneous options
  592. X---------------------
  593. X
  594. XSIGTYPE=[void | int]
  595. XDefine only if incorrect pointer type warnings occur during compilition.
  596. XSIGTYPE is already defined in tin.h for most compilers signal() call.
  597. XBy defining this you will override the default action in tin.h.
  598. XPOSIX_JOB_CONTROL
  599. XDefine if your machine uses Posix style sigaction() signal handling.
  600. X
  601. XUSE_MKDIR
  602. XDefine if your machine does not have the mkdir() system call.
  603. X
  604. XUSE_LONG_FILENAMES
  605. XDefine if your machines filesystem supports filenames longer than 14
  606. Xchars (default for BSD type systems).
  607. X
  608. XUSE_INVERSE_HACK
  609. XDefine if you want inverse video and highlighted bar disabled. (default
  610. Xfor SCO Unix & SysVR4).  Can be toggled in tin by the 'I' command and
  611. Xhighlight bar by 'M' command.
  612. X
  613. XUSE_CLEARSCREEN
  614. XDefine if the you wish screen to use ClearScreen() and not MoveCursor()
  615. Xand CleartoEOLN(). This is perhaps faster on slow terminals but I have
  616. Xnot really run any speed tests recently.
  617. X
  618. XUSE_SETREUID
  619. XDefine if problems occur when runnung tin as setuid news. Only define if
  620. Xyour system supports the setreuid() system call.
  621. X
  622. XSLOW_SCREEN_UPDATE
  623. XDefine if running over a low speed connection (ie. 2400baud). It stops
  624. Xthe percentage info being shown at bottom of select and group menus and
  625. Xstops the groupname being displayed at the bottom of the screen as it is
  626. Xsubscribed/unsubscribed.
  627. X
  628. XSMALL_MEMORY_MACHINE
  629. XDefine if you are running a machine with little memory (<4MB). Tin will
  630. Xrun slightly slower but be more efficent in how memory is allocated and
  631. Xreclaimed.
  632. XNO_REGEX
  633. XDefine if you do not want to use regular expression pattern matching.
  634. X
  635. XNO_SHELL_ESCAPE
  636. XDo not allow shell escapes.
  637. X
  638. XNO_POSTING
  639. XDo not allow posting/followup of articles.
  640. X
  641. XNO_RESYNC_ACTIVE_FILE
  642. XDo not reread active every RESYNC_ACTIVE_SECS.
  643. X
  644. XLOG_USER
  645. XLog username & info to /tmp/.tin_log for usage statistics. If reading via
  646. XNNTP the NNTP XUSER extended command will log user info to NNTP server.
  647. XIf -DNNTP_XUSER is defined it will define LOG_USER automatically.
  648. X
  649. XDEBUG
  650. XDefine if you want tin to log debug info. to files in /tmp. Activated
  651. Xby tin -Dn where n is 1 for NNTP only debug logging and n is 2 for 
  652. Xlogging all debug info. Debug files written to /tmp are ARTS, ACTIVE,
  653. XBASE and NNTP.
  654. X
  655. X
  656. XCompiled & installed on the following machines
  657. X----------------------------------------------
  658. X
  659. X1) * 386 PC & Xenix 2.3.2/SCO SysVR3.2/ISC SysVR3.2/ATT SysVr4.0
  660. X2) * Sony News & NewsOS 4.1
  661. X3) * SNI MX300/MX500 & Sinix 5.22/5.23/5.24/5.4
  662. X4) * Sun 3/4/IPC/SS1/SS2 & SunOS 4.0.3/4.1/4.1.1 
  663. X5) * Dec 5000/Vax & Ultrix 4.1/4.2
  664. X6) * Vax 11/785 & BSD 4.3
  665. X7) * DG Aviion 300 & DG-UX 4.30
  666. X8) * Apollo DN4500 & DomainOS 10.3
  667. X9)   ICL DRS6000 & SysVR4.0 
  668. X10)  Apricot VX/FT & SCO 3.2.2
  669. X11)  DIAB DS90 & D-NIX 5.3
  670. X12)  Amdahl & SysVR3
  671. X13)  HP 720/845 & HP-UX 7.0
  672. X14)  IBM RS/6000 & AIX 3.1.5
  673. X15)  NCR Tower & SysV
  674. X16)  Atari STe & Minix 1.5.10.3b
  675. X17)  Powerbook 140 & MacMinix
  676. X18)  386 PC & Minix 386
  677. X19)  Sequent S81 & PTX 1.3 / Dynix
  678. X20)  Convex C220 & Convex Un*x
  679. X21)  Harris HCX & CX/UX
  680. X22)  SGI 4D/35 & IRIX 4.0.1
  681. X23)  Pyramid 9810 & OSx96N
  682. X
  683. X* = compiled, installed and used by author 
  684. END_OF_FILE
  685.   if test 9003 -ne `wc -c <'INSTALL'`; then
  686.     echo shar: \"'INSTALL'\" unpacked with wrong size!
  687.   fi
  688.   # end of 'INSTALL'
  689. fi
  690. if test -f 'kill.c' -a "${1}" != "-c" ; then 
  691.   echo shar: Will not clobber existing file \"'kill.c'\"
  692. else
  693.   echo shar: Extracting \"'kill.c'\" \(13051 characters\)
  694.   sed "s/^X//" >'kill.c' <<'END_OF_FILE'
  695. X/*
  696. X *  Project   : tin - a threaded Netnews reader
  697. X *  Module    : kill.c
  698. X *  Author    : I.Lea & J.Robinson
  699. X *  Created   : 01-04-91
  700. X *  Updated   : 20-06-92
  701. X *  Notes     : kill & auto select (hot) articles
  702. X *  Copyright : (c) Copyright 1991-92 by Iain Lea & Jim Robinson
  703. X *              You may  freely  copy or  redistribute  this software,
  704. X *              so  long as there is no profit made from its use, sale
  705. X *              trade or  reproduction.  You may not change this copy-
  706. X *              right notice, and it must be included in any copy made
  707. X */
  708. X
  709. X#include    "tin.h"
  710. X
  711. X#ifdef NO_REGEX 
  712. Xchar *stars = "";
  713. X#else        
  714. Xchar *stars = "*";
  715. X#endif
  716. X
  717. X#define SET_KILLED(i)        (arts[i].unread = ART_READ, arts[i].killed = 1, num_of_killed_arts++)
  718. X#define SET_HOT(i)        (arts[i].hot = 1)
  719. X#define IS_READ(i)        (arts[i].unread == ART_READ)
  720. X#define IS_KILLED(i)        (arts[i].killed == 1)
  721. X
  722. X#define KILL_CHAR    'K'
  723. X#define HOT_CHAR    'H'
  724. X
  725. X#define K_KILL        0
  726. X#define K_HOT        1
  727. X
  728. Xint kill_level = 1;
  729. Xint kill_num = 0;
  730. Xint max_kill;
  731. Xstruct kill_t *killf;
  732. X
  733. X/*
  734. X *  read_kill_file - read ~/.tin/kill file contents into kill array
  735. X */
  736. X
  737. Xint read_kill_file ()
  738. X{
  739. X    char buf[LEN];
  740. X    FILE *fp;
  741. X    int n;
  742. X    char c;
  743. X    unsigned int type;
  744. X
  745. X    free_kill_array ();
  746. X    
  747. X    if ((fp = fopen (killfile, "r")) == NULL) {
  748. X        return FALSE;
  749. X    }
  750. X
  751. X    kill_num=0;
  752. X    while (fgets (buf, sizeof buf, fp) != NULL) {
  753. X        if (buf[0] == '#') {
  754. X            continue;
  755. X        }    
  756. X        if (kill_num == max_kill-1) {
  757. X            expand_kill ();
  758. X        }
  759. X        n = sscanf(buf, "%d %c", &type, &c);
  760. X        if (n == 0) {
  761. X            goto corrupt_killfile;
  762. X        }    
  763. X        if (n > 1 && c == HOT_CHAR) {    /* hot */
  764. X             killf[kill_num].kill_how = K_HOT;
  765. X        } else {
  766. X             killf[kill_num].kill_how = K_KILL;
  767. X        }     
  768. X        killf[kill_num].kill_type = type;
  769. X
  770. X        if (fgets (buf, sizeof buf, fp) == NULL)  {
  771. X            goto corrupt_killfile;
  772. X        }
  773. X        
  774. X        killf[kill_num].kill_group = (long) atol (buf);
  775. X
  776. X        switch (killf[kill_num].kill_type) {
  777. X        case KILL_SUBJ:
  778. X            if (fgets (buf, sizeof buf, fp) != NULL) {
  779. X                buf[strlen (buf)-1] = '\0';
  780. X                killf[kill_num].kill_subj = str_dup (buf);
  781. X            }
  782. X            break;
  783. X        case KILL_FROM:
  784. X            if (fgets (buf, sizeof buf, fp) != NULL) {
  785. X                buf[strlen (buf)-1] = '\0';
  786. X                killf[kill_num].kill_from = str_dup (buf);
  787. X            }
  788. X            break;
  789. X        case KILL_BOTH:
  790. X            if (fgets (buf, sizeof buf, fp) != NULL) {
  791. X                buf[strlen (buf)-1] = '\0';
  792. X                killf[kill_num].kill_subj = str_dup (buf);
  793. X            }
  794. X            if (fgets (buf, sizeof buf, fp) != NULL) {
  795. X                buf[strlen (buf)-1] = '\0';
  796. X                killf[kill_num].kill_from = str_dup (buf);
  797. X            }
  798. X            break;
  799. X        default:
  800. X            goto corrupt_killfile;
  801. X        }
  802. X        kill_num++;
  803. X    }
  804. X
  805. X    fclose (fp);
  806. X    return (kill_num);
  807. X
  808. Xcorrupt_killfile:
  809. X    fclose (fp);
  810. X    killf[kill_num].kill_type = 0;
  811. X    error_message (txt_corrupt_kill_file, killfile);
  812. X    return FALSE;
  813. X}
  814. X
  815. X/*
  816. X *  write_kill_file - write kill strings to ~/.tin/kill
  817. X */
  818. X
  819. Xvoid write_kill_file ()
  820. X{
  821. X    FILE *fp;
  822. X    int i;
  823. X    
  824. X    if (kill_num == 0 || (fp = fopen (killfile, "w")) == NULL) {
  825. X        return;
  826. X    }
  827. X
  828. X    wait_message (txt_saving);
  829. X    fprintf (fp, "# 1st line  1=(Subject: only)  2=(From: only)  3=(Subject: & From:)\n");
  830. X    fprintf (fp, "#           %c=(kill) %c=(auto-selection)\n", KILL_CHAR, HOT_CHAR);
  831. X    fprintf (fp, "# 2nd line  0=(kill on all newsgroups)  >0=(kill on specific newsgroup)\n");
  832. X    for (i=0 ; i < kill_num ; i++) {
  833. X        if (killf[i].kill_type == 0 || (killf[i].kill_subj == 0 
  834. X            &&  killf[i].kill_from == 0)) 
  835. X            continue;
  836. X
  837. X        if (killf[i].kill_how == K_KILL) {
  838. X            fprintf (fp, "#\n# %03d KILL\n", i+1);
  839. X            fprintf (fp, "%d\t%c\n", killf[i].kill_type, KILL_CHAR);
  840. X        } else {
  841. X            fprintf (fp, "#\n# %03d HOT\n", i+1);
  842. X            fprintf (fp, "%d\t%c\n", killf[i].kill_type, HOT_CHAR);
  843. X        }    
  844. X        fprintf (fp, "%ld\n", killf[i].kill_group);
  845. X
  846. X        switch (killf[i].kill_type) {
  847. X            case KILL_SUBJ:
  848. X                fprintf (fp, "%s\n", killf[i].kill_subj);
  849. X                break;
  850. X            case KILL_FROM:
  851. X                fprintf (fp, "%s\n", killf[i].kill_from);
  852. X                break;
  853. X            case KILL_BOTH:
  854. X                fprintf (fp, "%s\n", killf[i].kill_subj);
  855. X                fprintf (fp, "%s\n", killf[i].kill_from);
  856. X                break;
  857. X        }
  858. X    }
  859. X
  860. X    fclose (fp);
  861. X    chmod (killfile, 0600);
  862. X
  863. X    set_tin_uid_gid ();
  864. X}
  865. X
  866. Xstatic int get_choice (x, help, prompt, opt1, opt2, opt3, opt4)
  867. X    int x;
  868. X    char *help, *prompt, *opt1, *opt2, *opt3, *opt4;
  869. X{
  870. X    int ch, n = 0, i = 0;
  871. X    char *argv[4];
  872. X    
  873. X    if (opt1)
  874. X        argv[n++] = opt1;
  875. X    if (opt2)
  876. X        argv[n++] = opt2;
  877. X    if (opt3)
  878. X        argv[n++] = opt3;
  879. X    if (opt4)
  880. X        argv[n++] = opt4;
  881. X    assert(n > 0);
  882. X
  883. X    if (help)
  884. X        show_menu_help (help);
  885. X        
  886. X    do {
  887. X        MoveCursor(x, (int) strlen (prompt));
  888. X        fputs (argv[i], stdout);
  889. X        fflush (stdout);
  890. X        CleartoEOLN (); 
  891. X        if ((ch = ReadCh ()) != ' ')
  892. X            continue;
  893. X        if (++i == n)
  894. X            i = 0;
  895. X    } while (ch != CR && ch != ESC);
  896. X
  897. X    if (ch == ESC)
  898. X        return (-1);
  899. X    return (i);
  900. X}
  901. X
  902. X/*
  903. X *  options menu so that the user can dynamically change parameters
  904. X */
  905. Xint kill_art_menu (group_name, index)
  906. X    char *group_name;
  907. X    int index;
  908. X{
  909. X    char buf[LEN];
  910. X    char text[LEN];
  911. X    char kill_from[LEN];
  912. X    char kill_subj[LEN];
  913. X    char kill_group[LEN];
  914. X    char ch_default = 's';
  915. X    int ch;
  916. X    int counter = 0;
  917. X    int killed = TRUE;
  918. X    int kill_from_ok = FALSE;
  919. X    int kill_subj_ok = FALSE;
  920. X    int kill_every_group = FALSE;
  921. X    int i;
  922. X    int kill_how;
  923. X
  924. X#ifdef SIGTSTP
  925. X    sigtype_t (*susp)();
  926. X    
  927. X    susp = (sigtype_t *) 0;
  928. X
  929. X    if (do_sigtstp) {
  930. X        susp = sigdisp (SIGTSTP, SIG_DFL);
  931. X        sigdisp (SIGTSTP, SIG_IGN);
  932. X    }
  933. X#endif
  934. X    
  935. X    sprintf (kill_group, "%s only", group_name);
  936. X    sprintf (kill_subj, txt_kill_subject, COLS-35, COLS-35, arts[index].subject);
  937. X    if (arts[index].name != (char *) 0) {
  938. X        sprintf (text, "%s (%s)", arts[index].from, arts[index].name);
  939. X    } else {
  940. X        strcpy (text, arts[index].from);
  941. X    }
  942. X    sprintf (kill_from, txt_kill_from, COLS-35, COLS-35, text);
  943. X    text[0] = '\0';
  944. X    
  945. X    ClearScreen ();
  946. X
  947. X    center_line (0, TRUE, txt_kill_menu);
  948. X    
  949. X    MoveCursor (INDEX_TOP, 0);
  950. X    printf ("%s\r\n\r\n\r\n", txt_kill_how);
  951. X    printf ("%s\r\n\r\n", txt_kill_text);
  952. X    printf ("%s\r\n\r\n\r\n", txt_kill_text_type);
  953. X    printf ("%s\r\n\r\n", kill_subj);
  954. X    printf ("%s\r\n\r\n\r\n", kill_from);
  955. X    printf ("%s%s", txt_kill_group, kill_group);
  956. X    fflush (stdout);
  957. X
  958. X    i = get_choice (INDEX_TOP, txt_help_kill_how, txt_kill_how, 
  959. X               "Kill       ", "Auto Select", NULL, NULL);
  960. X    if (i == -1) {
  961. X        return FALSE;
  962. X    }    
  963. X    kill_how = (i == 0 ? K_KILL : K_HOT);
  964. X
  965. X    show_menu_help (txt_help_kill_text);
  966. X    
  967. X    if (! prompt_menu_string (INDEX_TOP+3, (int) strlen (txt_kill_text), text)) {
  968. X        return FALSE;
  969. X    }
  970. X
  971. X    if (text[0]) {
  972. X        i = get_choice(INDEX_TOP+5, txt_help_kill_text_type, 
  973. X                   txt_kill_text_type, "Subject: line only    ", 
  974. X                   "From: line only       ", "Subject: & From: lines", 
  975. X                   NULL);
  976. X        if (i == -1) {
  977. X            return FALSE;
  978. X        }    
  979. X        counter = ((i == 0 ? KILL_SUBJ : (i == 1 ? KILL_FROM : KILL_BOTH)));
  980. X    }
  981. X
  982. X    if (! text[0]) {
  983. X        i = get_choice (INDEX_TOP+8, txt_help_kill_subject, 
  984. X                    kill_subj, "Yes", "No ", NULL, NULL);
  985. X        if (i == -1) {
  986. X            return FALSE;
  987. X        } else {
  988. X            kill_subj_ok = (i ? FALSE : TRUE);
  989. X        }
  990. X        i = get_choice (INDEX_TOP+10, txt_help_kill_from, 
  991. X                    kill_from, "No ", "Yes", NULL, NULL);
  992. X        if (i == -1) {
  993. X            return FALSE;
  994. X        } else {
  995. X            kill_from_ok = (i ? TRUE : FALSE);
  996. X        }
  997. X    }
  998. X
  999. X    if (text[0] || kill_subj_ok || kill_from_ok) {
  1000. X        i = get_choice (INDEX_TOP+13, txt_help_kill_group, 
  1001. X                   txt_kill_group, kill_group, "All groups", 
  1002. X                   NULL, NULL);
  1003. X        if (i == -1) {
  1004. X            return FALSE;
  1005. X        }    
  1006. X        kill_every_group = (i == 0 ? FALSE : TRUE);
  1007. X    }
  1008. X
  1009. X    while (1) {
  1010. X        do {
  1011. X            sprintf (msg, "%s%c", txt_quit_edit_save_killfile, ch_default);
  1012. X            wait_message (msg);
  1013. X            MoveCursor (LINES, (int) strlen (txt_quit_edit_save_killfile));
  1014. X            if ((ch = ReadCh ()) == CR)
  1015. X                ch = ch_default;
  1016. X        } while (ch != ESC && ch != 'q' && ch != 'e' && ch != 's');
  1017. X        switch (ch) {
  1018. X        case 'e':
  1019. X            start_line_offset = 2;
  1020. X            invoke_editor (killfile);
  1021. X            unkill_all_articles ();
  1022. X            killed_articles = read_kill_file ();
  1023. X            killed = TRUE;
  1024. X            goto kill_done;
  1025. X
  1026. X        case 'a':
  1027. X        case ESC:
  1028. X            killed = FALSE;
  1029. X            goto kill_done;
  1030. X            
  1031. X        case 's':
  1032. X            if (kill_num > max_kill-1) {
  1033. X                expand_kill ();
  1034. X            }
  1035. X
  1036. X            killf[kill_num].kill_how = kill_how;
  1037. X
  1038. X            if (text[0]) {
  1039. X                sprintf (buf, "%s%s%s", stars, text, stars);
  1040. X                switch (counter) {
  1041. X                case KILL_SUBJ:
  1042. X                    killf[kill_num].kill_subj = str_dup (buf);
  1043. X                    break;
  1044. X                case KILL_FROM:
  1045. X                    killf[kill_num].kill_from = str_dup (buf);
  1046. X                    break;
  1047. X                case KILL_BOTH:
  1048. X                    killf[kill_num].kill_subj = str_dup (buf);
  1049. X                    killf[kill_num].kill_from = killf[kill_num].kill_subj; 
  1050. X                    break;
  1051. X                }
  1052. X                killf[kill_num].kill_type = counter;
  1053. X                if (kill_every_group) {
  1054. X                    killf[kill_num].kill_group = 0L;
  1055. X                } else {
  1056. X                    killf[kill_num].kill_group = hash_s (group_name);
  1057. X                }
  1058. X                kill_num++;
  1059. X            } else {
  1060. X                if (kill_subj_ok) {
  1061. X                    killf[kill_num].kill_type = KILL_SUBJ;
  1062. X                    sprintf (buf, "%s%s%s", 
  1063. X                        stars, arts[index].subject, stars);
  1064. X                    killf[kill_num].kill_subj = str_dup (buf);
  1065. X                }
  1066. X                if (kill_from_ok) {
  1067. X                    killf[kill_num].kill_type |= KILL_FROM;
  1068. X                    if (arts[index].name != (char *) 0) {
  1069. X                        sprintf (buf, "%s%s (%s)%s", 
  1070. X                            stars, arts[index].from, arts[index].name, stars);
  1071. X                    } else {
  1072. X                        sprintf (buf, "%s%s%s", 
  1073. X                            stars, arts[index].from, stars);
  1074. X                    }
  1075. X                    killf[kill_num].kill_from = str_dup (buf);
  1076. X                }
  1077. X                if (killf[kill_num].kill_type) {        
  1078. X                    if (kill_every_group) {
  1079. X                        killf[kill_num].kill_group= 0L;
  1080. X                    } else {
  1081. X                        killf[kill_num].kill_group= hash_s (group_name);
  1082. X                    }
  1083. X                    kill_num++;
  1084. X                }
  1085. X            }
  1086. X            write_kill_file ();
  1087. X            
  1088. X        kill_done:
  1089. X            
  1090. X#ifdef SIGTSTP
  1091. X            if (do_sigtstp) {
  1092. X                sigdisp (SIGTSTP, susp);
  1093. X            }
  1094. X#endif
  1095. X            return (killed);
  1096. X        }    
  1097. X    }
  1098. X    /* NOTREACHED */
  1099. X}
  1100. X
  1101. X
  1102. X/*
  1103. X * We assume that any articles which are tagged as killed are also
  1104. X * tagged as being read BECAUSE they were killed. So, we retag
  1105. X * them as being unread.
  1106. X */
  1107. Xint unkill_all_articles ()
  1108. X{
  1109. X    int unkilled = FALSE;
  1110. X    register int i;
  1111. X
  1112. X    for (i=0 ; i < top ; i++) {
  1113. X        if (arts[i].killed) {
  1114. X            arts[i].killed = FALSE;
  1115. X            arts[i].unread = ART_UNREAD;
  1116. X            unkilled = TRUE;
  1117. X        }
  1118. X    }
  1119. X    num_of_killed_arts = 0;
  1120. X
  1121. X    return (unkilled);
  1122. X}
  1123. X
  1124. X
  1125. Xint kill_any_articles (group)
  1126. X    char *group;
  1127. X{
  1128. X    char buf[LEN];
  1129. X    int killed = FALSE;
  1130. X    int run_ok = FALSE;
  1131. X    int is_hot;
  1132. X    long newsgroup_hash;
  1133. X    register int i, j;
  1134. X
  1135. X    if (! kill_num) {
  1136. X        return (killed);
  1137. X    }
  1138. X
  1139. X    num_of_killed_arts = 0;
  1140. X    num_of_hot_arts = 0;
  1141. X
  1142. X    newsgroup_hash = hash_s (group);
  1143. X
  1144. X    for (i=0 ; i < kill_num ; i++) {
  1145. X        if (killf[i].kill_group == 0L ||
  1146. X            killf[i].kill_group == newsgroup_hash) {
  1147. X            run_ok = TRUE;    
  1148. X        }
  1149. X    }
  1150. X    if (! run_ok) {
  1151. X        return (killed);
  1152. X    }
  1153. X    if (debug && ! update) {
  1154. X        wait_message (txt_killing_arts);
  1155. X    }
  1156. X    for (i=0 ; i < top ; i++) {
  1157. X        if (IS_READ(i) && kill_level == 0) {
  1158. X            continue;
  1159. X        }    
  1160. X        for (j=0 ; j < kill_num ; j++) {
  1161. X            if (killf[j].kill_group != 0L &&
  1162. X                killf[j].kill_group != newsgroup_hash)
  1163. X                continue;
  1164. X
  1165. X            is_hot = (killf[j].kill_how == K_HOT ? TRUE : FALSE);
  1166. X            switch (killf[j].kill_type) {
  1167. X            case KILL_SUBJ:
  1168. X                if (STR_MATCH (arts[i].subject, killf[j].kill_subj)) {
  1169. X                    if (! is_hot) {
  1170. X                        SET_KILLED(i);
  1171. X                    } else {
  1172. X                        SET_HOT(i);
  1173. X                        if (show_only_unread) {
  1174. X                            if (arts[i].unread == ART_UNREAD) {
  1175. X                                num_of_hot_arts++;
  1176. X                            }
  1177. X                        } else {
  1178. X                            num_of_hot_arts++;
  1179. X                        }
  1180. X                    }    
  1181. X                }
  1182. X                break;
  1183. X            case KILL_FROM:
  1184. X                if (arts[i].name != (char *) 0) {
  1185. X                    sprintf (buf, "%s (%s)", arts[i].from, arts[i].name);
  1186. X                } else {
  1187. X                    strcpy (buf, arts[i].from);
  1188. X                }
  1189. X                if (STR_MATCH (buf, killf[j].kill_from)) {
  1190. X                    if (! is_hot) {
  1191. X                        SET_KILLED(i);
  1192. X                    } else {
  1193. X                        SET_HOT(i);
  1194. X                        if (show_only_unread) {
  1195. X                            if (arts[i].unread == ART_UNREAD) {
  1196. X                                num_of_hot_arts++;
  1197. X                            }
  1198. X                        } else {
  1199. X                            num_of_hot_arts++;
  1200. X                        }
  1201. X                    }    
  1202. X                }
  1203. X                break;
  1204. X            case KILL_BOTH:
  1205. X                if (STR_MATCH (arts[i].subject, killf[j].kill_subj)) {
  1206. X                    if (! is_hot) {
  1207. X                        SET_KILLED(i);
  1208. X                    } else {
  1209. X                        SET_HOT(i);
  1210. X                        if (show_only_unread) {
  1211. X                            if (arts[i].unread == ART_UNREAD) {
  1212. X                                num_of_hot_arts++;
  1213. X                            }
  1214. X                        } else {
  1215. X                            num_of_hot_arts++;
  1216. X                        }
  1217. X                    }    
  1218. X                    break;
  1219. X                }
  1220. X                if (arts[i].name != (char *) 0) {
  1221. X                    sprintf (buf, "%s (%s)", arts[i].from, arts[i].name);
  1222. X                } else {
  1223. X                    strcpy (buf, arts[i].from);
  1224. X                }
  1225. X
  1226. X                if (STR_MATCH (buf, killf[j].kill_from)) {
  1227. X                    if (! is_hot) {
  1228. X                        SET_KILLED(i);
  1229. X                    } else {
  1230. X                        SET_HOT(i);
  1231. X                        if (show_only_unread) {
  1232. X                            if (arts[i].unread == ART_UNREAD) {
  1233. X                                num_of_hot_arts++;
  1234. X                            }
  1235. X                        } else {
  1236. X                            num_of_hot_arts++;
  1237. X                        }
  1238. X                    }    
  1239. X                }
  1240. X                break;
  1241. X            }
  1242. X            if (IS_KILLED(i) || ! killed)
  1243. X                killed = TRUE;
  1244. X        }
  1245. X    }
  1246. X    return (killed);
  1247. X}
  1248. X
  1249. X/*
  1250. X * Auto select articles.
  1251. X * WARNING - this routinely is presently a kludge. It calls
  1252. X * kill_any_articles() which also kills articles. It also always returns
  1253. X * true in order to fake out the display code (cause it doesn't know
  1254. X * if any articles were actually selected)
  1255. X * The correct way to do this is to modify kill_any_articles() to take
  1256. X * another arg to specify whether killing, auto-selecting, or both is to be 
  1257. X * done, rename it to something else, and then have a new kill_any_articles()
  1258. X * and auto_select_articles() call this new routine with the appropriate 
  1259. X * arguments.
  1260. X */
  1261. X
  1262. Xint auto_select_articles (group)
  1263. X    char *group;
  1264. X{
  1265. X    kill_any_articles (group);
  1266. X    return (TRUE);
  1267. X}
  1268. END_OF_FILE
  1269.   if test 13051 -ne `wc -c <'kill.c'`; then
  1270.     echo shar: \"'kill.c'\" unpacked with wrong size!
  1271.   fi
  1272.   # end of 'kill.c'
  1273. fi
  1274. if test -f 'tin.h' -a "${1}" != "-c" ; then 
  1275.   echo shar: Will not clobber existing file \"'tin.h'\"
  1276. else
  1277.   echo shar: Extracting \"'tin.h'\" \(14455 characters\)
  1278.   sed "s/^X//" >'tin.h' <<'END_OF_FILE'
  1279. X/*
  1280. X *  Project   : tin - a threaded Netnews reader
  1281. X *  Module    : tin.h
  1282. X *  Author    : I.Lea & R.Skrenta
  1283. X *  Created   : 01-04-91
  1284. X *  Updated   : 22-06-92
  1285. X *  Notes     : #include files, #defines & struct's
  1286. X *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1287. X *              You may  freely  copy or  redistribute  this software,
  1288. X *              so  long as there is no profit made from its use, sale
  1289. X *              trade or  reproduction.  You may not change this copy-
  1290. X *              right notice, and it must be included in any copy made
  1291. X */
  1292. X
  1293. X#include    <stdio.h>
  1294. X#include    <signal.h>
  1295. X#include    <errno.h>
  1296. X#ifdef apollo
  1297. X#    include </bsd4.3/usr/include/sys/types.h>
  1298. X#else
  1299. X#    include <sys/types.h>
  1300. X#endif
  1301. X#include    <sys/stat.h>
  1302. X#include    <pwd.h>
  1303. X#include    <ctype.h>
  1304. X#include    <time.h>
  1305. X#if !defined(apollo) && !defined(__NeXT__)
  1306. X#    include    <unistd.h>
  1307. X#endif
  1308. X
  1309. X#ifdef BSD
  1310. X#    include    <strings.h>
  1311. X#    include    <fcntl.h>
  1312. X#else
  1313. X#    ifndef apollo
  1314. X#        include    <stdlib.h>
  1315. X#    endif
  1316. X#    include    <string.h>
  1317. X#endif
  1318. X
  1319. X#ifndef MINIX
  1320. X#    include <sys/ioctl.h>
  1321. X#endif
  1322. X
  1323. X#ifdef M_XENIX
  1324. X#    include    <prototypes.h>
  1325. X#endif
  1326. X
  1327. X#ifdef SVR4
  1328. X#    include <locale.h>
  1329. X#endif
  1330. X
  1331. X#if !defined(BSD) && !defined(sinix) && !defined(RS6000)
  1332. X#    include    <sys/utsname.h>
  1333. X#endif
  1334. X
  1335. X/*
  1336. X * Needed for catching child processes
  1337. X */
  1338. X
  1339. X#ifdef SIGCHLD
  1340. X#    include    <sys/wait.h>
  1341. X#endif
  1342. X
  1343. X/*
  1344. X * Needed for resizing under an xterm
  1345. X */
  1346. X
  1347. X#if defined(SIGWINCH)
  1348. X#    ifndef SCO_UNIX
  1349. X#        include <termios.h>
  1350. X#    endif
  1351. X#    if !defined(TIOCGWINSZ) && !defined(TIOCGSIZE)
  1352. X#        if !defined(sinix) && !defined(nsc)
  1353. X#            include <sys/stream.h>
  1354. X#            ifdef PTX
  1355. X#                include <termio.h>
  1356. X#            else
  1357. X#                ifndef apollo
  1358. X#                    include <sys/ptem.h>
  1359. X#                    include <sys/tty.h>
  1360. X#                endif
  1361. X#                if !defined(SCO_UNIX) && !defined(SVR4) && !defined(apollo)
  1362. X#                    ifndef _h_BSDTYPES
  1363. X#                        include <sys/bsdtypes.h>
  1364. X#                    endif
  1365. X#                    include <sys/pty.h>
  1366. X#                endif
  1367. X#            endif
  1368. X#        endif
  1369. X#    endif
  1370. X#endif
  1371. X
  1372. X/*
  1373. X * Setup support for reading from CD-ROM
  1374. X */
  1375. X
  1376. X#ifdef CDROM_ONLY
  1377. X#    define CDROM_ABLE
  1378. X#endif
  1379. X#ifdef CDROM_ABLE
  1380. X#    define XSPOOLDIR
  1381. X#    define NNTP_ABLE
  1382. X#    undef NNTP_ONLY
  1383. X#    undef NNTP_INEWS
  1384. X#endif
  1385. X
  1386. X/*
  1387. X * Setup support for reading from NNTP
  1388. X */
  1389. X#if defined(NNTP_ABLE) || defined(NNTP_ONLY)
  1390. X#    ifndef NNTP_ABLE
  1391. X#        define    NNTP_ABLE
  1392. X#    endif
  1393. X#    ifndef NNTP_INEWS
  1394. X#        define    NNTP_INEWS
  1395. X#    endif
  1396. X#endif
  1397. X
  1398. X/*
  1399. X * Index file daemon version of tin. Will create/update index files from cron
  1400. X * on NNTP server machine so clients can retreive index file with NNTP XINDEX
  1401. X * command from server. Also can be used on machines that just want one copy
  1402. X * of all the index files in one place. In this case the normal tin must have
  1403. X * access to the index directory (-I dir option) or be setuid news.
  1404. X */
  1405. X#ifdef INDEX_DAEMON
  1406. X#    define    LOCK_FILE "/tmp/tind.LCK"
  1407. X#    undef    NNTP_ABLE
  1408. X#    undef    NNTP_ONLY
  1409. X#    undef    NNTP_INEWS
  1410. X#endif
  1411. X
  1412. X/*
  1413. X * Determine signal return type
  1414. X */
  1415. X#if defined(__GNUC__) || defined(POSIX_JOB_CONTROL)
  1416. Xtypedef void sigtype_t;
  1417. X#else    
  1418. X#    if defined(sony)
  1419. Xtypedef int sigtype_t;
  1420. X#    else
  1421. X#        if __STDC__ || defined(SVR4) || defined(sinix) || defined(sun) || \
  1422. X           defined(ultrix) || defined(atthcx) || defined(PTX) || defined(sgi)
  1423. Xtypedef void sigtype_t;
  1424. X#        else
  1425. Xtypedef int sigtype_t;
  1426. X#        endif
  1427. X#    endif
  1428. X#endif
  1429. X
  1430. X/*
  1431. X * Specify News spool & control directories
  1432. X */
  1433. X#ifndef SPOOLDIR
  1434. X#    define        SPOOLDIR    "/usr/spool/news"
  1435. X#endif
  1436. X#ifndef LIBDIR
  1437. X#    define        LIBDIR        "/usr/lib/news"
  1438. X#endif
  1439. X#ifndef INEWSDIR
  1440. X#    define        INEWSDIR    LIBDIR
  1441. X#endif
  1442. X
  1443. X/*
  1444. X * Determine machine configuration for external programs & directories
  1445. X */
  1446. X
  1447. X#ifdef BSD
  1448. X#    if defined(_SEQUENT_) || defined(pyr)
  1449. X#        define        memcmp(s1, s2, n)    bcmp(s2, s1, n)
  1450. X#    endif
  1451. X#    define        strchr(str, ch)    index(str, ch)
  1452. X#    define        DEFAULT_SHELL    "/bin/csh"
  1453. X#    define        DEFAULT_EDITOR    "/usr/ucb/vi"
  1454. X#    define        DEFAULT_PRINTER    "/usr/ucb/lpr"
  1455. X#    define        DEFAULT_SUM    "sum"
  1456. X#    ifdef DGUX
  1457. X#        define        DEFAULT_MAILER    "/bin/mail"
  1458. X#        define        DEFAULT_MAILBOX    "/usr/mail"
  1459. X#        define        POSIX_JOB_CONTROL
  1460. X#        define        USE_INVERSE_HACK
  1461. X#    endif
  1462. X#    ifdef pyr
  1463. X#        define        DEFAULT_MAILER    "/usr/.attbin/mailx"
  1464. X#    endif
  1465. X#    ifndef DEFAULT_MAILER
  1466. X#        define        DEFAULT_MAILER    "/usr/ucb/Mail"
  1467. X#    endif
  1468. X#    ifndef DEFAULT_MAILBOX
  1469. X#        define        DEFAULT_MAILBOX    "/usr/spool/mail"
  1470. X#    endif
  1471. X#    ifndef USE_LONG_FILENAMES
  1472. X#        define USE_LONG_FILENAMES
  1473. X#    endif
  1474. X#else
  1475. X#    ifdef M_XENIX
  1476. X#        define        DEFAULT_EDITOR    "/bin/vi"
  1477. X#        define        DEFAULT_MAILER    "/usr/bin/mail"
  1478. X#        define        DEFAULT_MAILBOX    "/usr/spool/mail"
  1479. X#    endif
  1480. X#    if defined(NCR) || defined(atthcx) || defined(HPUX)
  1481. X#        define        DEFAULT_MAILER    "/usr/bin/mailx"
  1482. X#    endif
  1483. X#    ifdef PTX
  1484. X#        define        DEFAULT_MAILER    "/usr/bin/mailx"
  1485. X#        ifndef USE_LONG_FILENAMES
  1486. X#            define    USE_LONG_FILENAMES
  1487. X#        endif
  1488. X#    endif
  1489. X#    ifdef RS6000
  1490. X#        define        DEFAULT_MAILER    "/usr/bin/mail"
  1491. X#        define        DEFAULT_PRINTER    "/bin/lp"
  1492. X#    endif
  1493. X#    ifdef sinix
  1494. X#        define        DEFAULT_MAILER    "/bin/rmail"
  1495. X#        define        DEFAULT_PRINTER    "/bin/lpr"
  1496. X#        ifndef USE_LONG_FILENAMES
  1497. X#            define USE_LONG_FILENAMES
  1498. X#        endif
  1499. X#    endif
  1500. X#    ifdef SVR4
  1501. X#        define        POSIX_JOB_CONTROL
  1502. X#        ifndef USE_LONG_FILENAMES
  1503. X#            define    USE_LONG_FILENAMES
  1504. X#        endif
  1505. X#    endif
  1506. X#    ifdef UNIXPC
  1507. X#        define        DEFAULT_MAILER    "/bin/rmail"
  1508. X#    endif
  1509. X#    ifndef DEFAULT_SHELL
  1510. X#        define        DEFAULT_SHELL    "/bin/sh"
  1511. X#    endif
  1512. X#    ifndef DEFAULT_EDITOR
  1513. X#        define        DEFAULT_EDITOR    "/usr/bin/vi"
  1514. X#    endif
  1515. X#    ifndef DEFAULT_MAILBOX
  1516. X#        define        DEFAULT_MAILBOX    "/usr/mail"
  1517. X#    endif
  1518. X#    ifndef DEFAULT_MAILER
  1519. X#        define        DEFAULT_MAILER    "/bin/mail"
  1520. X#    endif
  1521. X#    ifndef DEFAULT_PRINTER
  1522. X#        define        DEFAULT_PRINTER    "/usr/bin/lp"
  1523. X#    endif
  1524. X#    define        DEFAULT_SUM        "sum -r"
  1525. X#endif
  1526. X
  1527. X#ifdef USE_LONG_FILENAMES
  1528. X#    define        LONG_PATH_PART    "part"
  1529. X#    define        LONG_PATH_PATCH    "patch"
  1530. X#else
  1531. X#    define        LONG_PATH_PART    ""
  1532. X#    define        LONG_PATH_PATCH    "p"
  1533. X#endif
  1534. X
  1535. X/*
  1536. X * Useful for logging user usage
  1537. X */
  1538. X#ifdef LOG_USER
  1539. X#    define        LOG_USER_FILE    "/tmp/.tin_log" 
  1540. X#endif
  1541. X
  1542. X/*
  1543. X * Should active file be rereaf for new news & if so how often
  1544. X */
  1545. X#ifndef NO_RESYNC_ACTIVE_FILE
  1546. X#    ifndef RESYNC_ACTIVE_SECS
  1547. X#        define    RESYNC_ACTIVE_SECS    300    /* reread active every n secs */
  1548. X#    endif
  1549. X#endif
  1550. X
  1551. X/*
  1552. X * Initial sizes of internal arrays for small (<4MB) & large memory machines
  1553. X */
  1554. X#ifdef SMALL_MEMORY_MACHINE
  1555. X#    define        DEFAULT_ACTIVE_NUM    1800    
  1556. X#    define        DEFAULT_ARTICLE_NUM    400    
  1557. X#    define        DEFAULT_KILL_NUM    10    
  1558. X#    define        DEFAULT_SAVE_NUM    10    
  1559. X#else
  1560. X#    define        DEFAULT_ACTIVE_NUM    1800    
  1561. X#    define        DEFAULT_ARTICLE_NUM    1200    
  1562. X#    define        DEFAULT_KILL_NUM    30    
  1563. X#    define        DEFAULT_SAVE_NUM    30    
  1564. X#endif
  1565. X
  1566. X#define        RCDIR            ".tin"
  1567. X#define        RCFILE            "tinrc"
  1568. X#define        INDEXDIR        ".index"
  1569. X#define        KILLFILE        "kill"
  1570. X#define        POSTFILE        "posted"
  1571. X#define        UNTHREADFILE    "unthread"
  1572. X#define        DEFAULT_MAILDIR    "Mail"
  1573. X
  1574. X#define BUG_REPORT_ADDRESS    "iain%anl433.uucp@Germany.EU.net"
  1575. X
  1576. X#ifdef TRUE
  1577. X#    undef TRUE
  1578. X#endif
  1579. X#define        TRUE        1
  1580. X
  1581. X#ifdef FALSE
  1582. X#    undef FALSE
  1583. X#endif
  1584. X#define        FALSE        0
  1585. X
  1586. X#define        LEN                1024
  1587. X#define        PATH_LEN            256
  1588. X#define        HEADER_LEN            1024
  1589. X#define        MODULO_COUNT_NUM        5
  1590. X#define        TABLE_SIZE            1409
  1591. X#define        MAX_PAGES            1000
  1592. X#define        ctrl(c)                ((c) & 0x1F)
  1593. X
  1594. X#ifndef DEFAULT_COMMENT
  1595. X#    define        DEFAULT_COMMENT    ": "    /* used when by follow-ups & replys */
  1596. X#endif
  1597. X#ifndef UNREAD_ART_MARK
  1598. X#    define        UNREAD_ART_MARK    '+'    /* used to show that an art is unread */
  1599. X#endif
  1600. X#ifndef RETURN_ART_MARK
  1601. X#    define        RETURN_ART_MARK    '-'    /* used to show that an art will return */
  1602. X#endif
  1603. X#ifndef HOT_ART_MARK
  1604. X#    define        HOT_ART_MARK    '*'    /* used to show that an art was auto selected */
  1605. X#endif
  1606. X#ifndef READ_ART_MARK
  1607. X#    define        READ_ART_MARK    ' '    /* used to show that an art was not read or seen  */
  1608. X#endif
  1609. X
  1610. X#ifdef USE_INVERSE_HACK
  1611. X#    define        SELECT_MISC_COLS    21
  1612. X#    define        BLANK_GROUP_COLS    2
  1613. X#    define        BLANK_PAGE_COLS        2
  1614. X#else
  1615. X#    define        SELECT_MISC_COLS    21
  1616. X#    define        BLANK_GROUP_COLS    0
  1617. X#    define        BLANK_PAGE_COLS        0
  1618. X#endif
  1619. X
  1620. X#define        SCREEN_READ_UNREAD        6        /* position for "  +" / "   " */
  1621. X#define        INDEX_TOP                2
  1622. X
  1623. X#ifdef NO_REGEX 
  1624. X#    define STR_MATCH(s1,s2)    (str_str (s1, s2, strlen (s2)) != 0)
  1625. X#else        
  1626. X#    define STR_MATCH(s1,pat)    (wildmat (s1, pat))
  1627. X#endif
  1628. X
  1629. X#define IGNORE_ART(i)    ((arts[i].thread == ART_EXPIRED) || \
  1630. X             (arts[i].killed && kill_level > 0))
  1631. X
  1632. X/*
  1633. X *  used by get_arrow_key()
  1634. X */
  1635. X
  1636. X#define        KEYMAP_UNKNOWN            0
  1637. X#define        KEYMAP_UP                1
  1638. X#define        KEYMAP_DOWN                2
  1639. X#define        KEYMAP_PAGE_UP            3
  1640. X#define        KEYMAP_PAGE_DOWN        4
  1641. X#define        KEYMAP_HOME                5
  1642. X#define        KEYMAP_END                6
  1643. X
  1644. X/*
  1645. X *  used by feed.c - feed_articles()
  1646. X */
  1647. X#define        SELECT_LEVEL                1
  1648. X#define        GROUP_LEVEL                2
  1649. X#define        PAGE_LEVEL                3
  1650. X
  1651. X#define        FEED_MAIL                1
  1652. X#define        FEED_PIPE                2
  1653. X#define        FEED_PRINT                3
  1654. X#define        FEED_SAVE                4
  1655. X#define        FEED_XPOST                5
  1656. X
  1657. X/*
  1658. X *  used in art.c & rcfile.c
  1659. X */
  1660. X#define        SORT_BY_NOTHING            0        /* sort types on arts[] array */
  1661. X#define        SORT_BY_SUBJ_DESCEND    1
  1662. X#define        SORT_BY_SUBJ_ASCEND        2
  1663. X#define        SORT_BY_FROM_DESCEND    3
  1664. X#define        SORT_BY_FROM_ASCEND        4
  1665. X#define        SORT_BY_DATE_DESCEND    5
  1666. X#define        SORT_BY_DATE_ASCEND        6
  1667. X
  1668. X#define        SHOW_FROM_NONE            0
  1669. X#define        SHOW_FROM_ADDR            1
  1670. X#define        SHOW_FROM_NAME            2
  1671. X#define        SHOW_FROM_BOTH            3
  1672. X
  1673. X/*
  1674. X *  used in help.c
  1675. X */
  1676. X
  1677. X#define        HELP_INFO                0
  1678. X#define        POST_INFO                1
  1679. X
  1680. X/*
  1681. X *  used in save.c
  1682. X */
  1683. X
  1684. X#define        CHECK_ANY_NEWS            0
  1685. X#define        START_ANY_NEWS            1
  1686. X#define        MAIL_ANY_NEWS            2
  1687. X#define        SAVE_ANY_NEWS            3
  1688. X
  1689. X/*
  1690. X *  used in help.c
  1691. X */
  1692. X
  1693. X#define        HEADER_TO                0
  1694. X#define        HEADER_SUBJECT            1
  1695. X
  1696. X/*
  1697. X *  used in page.c & post.c
  1698. X */
  1699. X
  1700. X#define        POSTED_NONE                0
  1701. X#define        POSTED_REDRAW            1
  1702. X#define        POSTED_OK                2
  1703. X
  1704. X/*
  1705. X *  Assertion verifier
  1706. X */
  1707. X
  1708. X#if __STDC__ && !defined(apollo)
  1709. X#    define    assert(p)    if(! (p)) asfail(__FILE__, __LINE__, #p); else
  1710. X#else
  1711. X#    define    assert(p)    if(! (p)) asfail(__FILE__, __LINE__, "p"); else
  1712. X#endif
  1713. X
  1714. X#define        ESC        27
  1715. X#if defined(BSD) || defined(MINIX) || defined(apollo)
  1716. X#    define        CR        '\r'
  1717. X#else
  1718. X#    define        CR        10
  1719. X#endif
  1720. X
  1721. X/*
  1722. X * return codes for change_rcfile ()
  1723. X */
  1724. X
  1725. X#define        NO_KILLING        0
  1726. X#define        KILLING            1
  1727. X
  1728. X/*
  1729. X *  art.thread
  1730. X */
  1731. X
  1732. X#define        ART_NORMAL        -1
  1733. X#define        ART_EXPIRED        -2
  1734. X
  1735. X/*
  1736. X *  art.unread
  1737. X */
  1738. X
  1739. X#define        ART_READ        0
  1740. X#define        ART_UNREAD        1
  1741. X#define        ART_WILL_RETURN    2
  1742. X
  1743. X/*
  1744. X * used by group_t & my_group[]
  1745. X */
  1746. X#define        UNSUBSCRIBED    0x01    /* haven't put in my_group[] yet */
  1747. X#define        SUBSCRIBED        0x02    /* subscribed to */
  1748. X
  1749. X/*
  1750. X * kill_type used in struct kill_t
  1751. X */
  1752. X#define KILL_SUBJ    1
  1753. X#define KILL_FROM    2
  1754. X#define KILL_BOTH    3
  1755. X
  1756. X/*
  1757. X * usedin group.c & page.c
  1758. X */
  1759. X#define    ART_UNAVAILABLE    -1
  1760. X
  1761. X
  1762. X/*
  1763. X * used in feed.c & save.c
  1764. X */
  1765. X#define POST_PROC_NONE            0
  1766. X#define POST_PROC_SHAR            1
  1767. X#define POST_PROC_UUDECODE        2
  1768. X#define POST_PROC_UUD_LST_ZOO    3
  1769. X#define POST_PROC_UUD_EXT_ZOO    4
  1770. X
  1771. X/*
  1772. X *  struct article_t - article header
  1773. X *
  1774. X *  article.artnum:
  1775. X *    article number in spool directory for group
  1776. X *
  1777. X *  article.thread:
  1778. X *    -1 initial default
  1779. X *    -2 means article has expired (wasn't found in file search
  1780. X *    of spool directory for the group)
  1781. X *    >=0 points to another arts[] (struct article_t)
  1782. X *
  1783. X *  article.inthread:
  1784. X *    FALSE for the first article in a thread, TRUE for all
  1785. X *    following articles in thread
  1786. X *
  1787. X *  article.unread:
  1788. X *    boolean, has this article been read or not
  1789. X *
  1790. X *  article.killed:
  1791. X *    boolean, has this article been killed
  1792. X *
  1793. X *  article.hot:
  1794. X *    boolean, has this article been auto-selected
  1795. X *
  1796. X *  article.tagged:
  1797. X *    count, has this article been tagged for saving (>0) or not (=0)
  1798. X *
  1799. X *  article.date
  1800. X *    date: line used for sorting articles by date order
  1801. X *
  1802. X *  article.archive:
  1803. X *    archive name used in *source* groups
  1804. X *
  1805. X *  article.part:
  1806. X *    part no. of archive
  1807. X *
  1808. X *  article.patch:
  1809. X *    patch no. of archive
  1810. X *
  1811. X */
  1812. X
  1813. Xstruct article_t {
  1814. X    long artnum;
  1815. X    char *subject;        /* Subject: line from mail header */
  1816. X    char *from;        /* From: line from mail header (address) */
  1817. X    char *name;        /* From: line from mail header (full name) */
  1818. X    int thread;
  1819. X    unsigned int inthread:1;/* 0 = thread head, 1 = thread follower */
  1820. X    unsigned int unread:2;    /* 0 = read, 1 = unread, 2 = will return */
  1821. X    unsigned int killed:1;    /* 0 = not killed, 1 = killed */
  1822. X    unsigned int hot:1;    /* 0 = not hot, 1 = hot */
  1823. X    unsigned int zombie:1;    /* 1 = was alive (unread) before 'X' command */
  1824. X    unsigned int o_unread:2;/* original value of unread - used in xref */
  1825. X    int tagged;        /* 0 = not tagged, >0 = tagged */
  1826. X    char date[16];        /* Date: line from mail header */
  1827. X    char *archive;        /* Archive-name: line from mail header */
  1828. X    char *part;        /* part no. of archive */
  1829. X    char *patch;        /* patch no. of archive */
  1830. X    char *xref;        /* cross reference line */
  1831. X};
  1832. X
  1833. X/*
  1834. X *  struct attribute_t - configurable attributes on a per group basis
  1835. X */
  1836. X
  1837. Xstruct attribute_t {
  1838. X    char *server;            /* read group locally/via nntp server */
  1839. X    char *maildir;            /* mail dir if other than ~/Mail */
  1840. X    char *savedir;            /* save dir if other than ~/News */
  1841. X    char *sigfile;            /* sig file if other than ~/.Sig */
  1842. X    unsigned int read:1;        /* marked TRUE if group was entered during session */
  1843. X    unsigned int showall:1;        /* 0 = only unread, 1 = all */
  1844. X    unsigned int thread:1;        /* 0 = unthread, 1 = thread */
  1845. X    unsigned int sortby:4;        /* 0 = none, 1 = , 2 = , 3 = , 4 = , */
  1846. X    unsigned int author:4;        /* 0 = none, 1 = name, 2 = addr, 3 = both */
  1847. X    unsigned int autosave:1;    /* 0 = none, 1 = save */
  1848. X    unsigned int process:4;        /* 0 = none, 1 = shar, 2 = uudecode, 
  1849. X                         3 = uud & list zoo, 4 = uud & ext zoo*/
  1850. X};
  1851. X
  1852. X/*
  1853. X *  struct group_t - newsgroup info from active file
  1854. X */
  1855. X
  1856. Xstruct group_t {
  1857. X    char *name;
  1858. X    char *description;        /* text from LIBDIR/newsgroups file */
  1859. X    long max;
  1860. X    long min;
  1861. X    char moderated;
  1862. X    int next;            /* next active entry in hash chain */
  1863. X    int flag;
  1864. X    struct attribute_t attribute;    /* per group attributes */ 
  1865. X};
  1866. X
  1867. X/*
  1868. X *  used in hashstr.c
  1869. X */
  1870. Xstruct hashnode {
  1871. X    char *s;                        /* the string we're saving */
  1872. X    struct hashnode *next;            /* chain for spillover */
  1873. X};
  1874. X
  1875. X/*
  1876. X *  used in kill.c
  1877. X */
  1878. Xstruct kill_t {
  1879. X    unsigned int kill_type:8;
  1880. X    unsigned int kill_how:8;    /* kill/auto select */
  1881. X    long kill_group;
  1882. X    char *kill_subj;
  1883. X    char *kill_from;
  1884. X};
  1885. X
  1886. Xstruct save_t {
  1887. X    char *subject;
  1888. X    char *dir;
  1889. X    char *file;
  1890. X    char *archive;
  1891. X    char *part;
  1892. X    char *patch;
  1893. X    int index;    
  1894. X    int saved;    
  1895. X    int is_mailbox;    
  1896. X};
  1897. X
  1898. Xstruct screen_t {
  1899. X    char *col;
  1900. X};
  1901. X
  1902. Xstruct posted_t {
  1903. X    char date[10];
  1904. X    char group[80];
  1905. X    char action;
  1906. X    char subj[120];
  1907. X};
  1908. X
  1909. Xstruct art_stat_t {
  1910. X    int total;    /* total article count */
  1911. X    int unread;    /* number of unread articles (does not include seen) arts */
  1912. X    int seen;    /* number of seen articles (ART_WILL_RETURN) */
  1913. X    int hot_total;    /* total hot count */
  1914. X    int hot_unread; /* hot and unread */
  1915. X    int hot_seen;    /* hot and seen */
  1916. X    char art_mark;    /* mark to use for this thread - not used for groups */
  1917. X};
  1918. X
  1919. Xstruct spooldir_t {
  1920. X    int state;
  1921. X    char *name;
  1922. X    char *comment;
  1923. X};
  1924. X
  1925. X/*
  1926. X *  function prototypes    & extern definitions    
  1927. X */ 
  1928. X
  1929. X#include    "patchlev.h"
  1930. X#include    "extern.h"
  1931. X#include    "nntplib.h"
  1932. X#include    "proto.h"
  1933. END_OF_FILE
  1934.   if test 14455 -ne `wc -c <'tin.h'`; then
  1935.     echo shar: \"'tin.h'\" unpacked with wrong size!
  1936.   fi
  1937.   # end of 'tin.h'
  1938. fi
  1939. echo shar: End of archive 12 \(of 15\).
  1940. cp /dev/null ark12isdone
  1941. MISSING=""
  1942. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  1943.     if test ! -f ark${I}isdone ; then
  1944.     MISSING="${MISSING} ${I}"
  1945.     fi
  1946. done
  1947. if test "${MISSING}" = "" ; then
  1948.     echo You have unpacked all 15 archives.
  1949.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1950. else
  1951.     echo You still must unpack the following archives:
  1952.     echo "        " ${MISSING}
  1953. fi
  1954. exit 0
  1955. exit 0 # Just in case...
  1956.