//
//
// mods.h John Washington 1995-2000
// USERS READ THIS:
// This file serves instead of a formal document, to indicate
// the facilities available in the modified Snews, and details
// of how to configure it. Although some of the material here
// is only of interest to developers, you will certainly wish
// to browse this file. It is not used by snews.exe, and if
// you have received only this file together with snews.exe,
// my purpose in sending it to you is simply so that you can
// read it.
// Yes, ideally there would be a proper 'history' document and
// some nice friendly documentation for the changes I've made.
// But given the very limited time that I devote to tinkering
// with Snews, writing such docs would greatly slow the
// development. Such feedback as I've received seems to
// indicate that users are happier with the present compromise.
// This file is roughly in chronological order, though I do
// sometimes go back and revise earlier bits when necessary.
// DEVELOPERS READ THIS:
// Allows different versions to be built, the standard Snews,
// and various modified ones.
// Copyright (c) 1996-2000 John Washington
#define JW_MODIFIED
// This #define must be present, if any of the options
// below are to have any effect on the code.
// Hence, a convenient test (that nothing untoward has
// been introduced) is to comment out the above #define
// and recompile, then check that the resulting .exe
// files are identical to the originals.
// (Or nearly original, thanks to the damn build date
// occurring in the .exe three times).
#ifdef JW_MODIFIED
/* Here is a summary of typical additions to a .rc file:
#
# Show interesting headers
show_hdr=1
#
# Quote initials
quote_initials=0
#
# Show expiry info
expiry_display=0
#
# Show deleted threads
del_display=1
#
# Show article numbers
artnum=0
#
# Use topper file (similar to .sig)
# topper=
#
# Display alternative cursor
# cursor_mod=X
#
# Start up with search all (including headers)
# search_all=1
Of course, your choices may be different. That's the whole
point of having such things in a configuration file!
*/
#define JW_COMMENT // Extra comments, no functional change.
#define JW_NICE_FILENAMES // addgroup.c (and new nicename.c, .h);
// Meaningful filenames in newsbase
#define JW_RNAME_GARBAGE // article.c; bug fix attempt (partial)
#define JW_RNAME_STRIP_LEADING_SPACES // article.c; bug fix attempt (partial)
// JW_WRKFILE // mail.c; generating 'wrk' file, respecting
// 'From:'.
// I would call JW_WRKFILE a bug fix, but it might
// be considered an enhancement or even an
// undesirable feature. I like it though!
// Makes first part of 2nd line of .wrk correspond to 'From:'
// line.
// Not configurable, but it doesn't affect you if you don't
// change your From: line.
// 981015: #ifdef's removed from code to simplify.
// The new way is now the only way.
// JW_ALIAS // mail.c; Handling alias better.
// 981016: #ifdef's removed from code to simplify.
// The new way is now the only way.
// JW_DEL // snews.c; 'D' in threads display
// marks thread as read as well.
// JW_PAGING_OVERLAP_1LINE // article.c; single line overlap, not double
// Not configurable.
/*
Another undoc'd feature-ette is F4. Press it
before entering a newsgroup. Turns off threading,
just chronological. Handy if you use fake n/grps
for mail, as I do. Following option controls code
for this:
*/
// JW_NOTHREAD // snews.c; allow toggle of threading algorithm (F4)
/*
F4 has become a 3-way toggle. Press it once, it works as before.
Press it twice, it gives reverse chrono display. Press it
a third time and it goes back to normal threading.
As before, F4 only has an effect when you're in the 'outermost'
display, i.e. the newsgroups. And the effect only applies to
the next newsgroup that you load; after that it reverts to
normal threading (until you again use F4, of course).
Feature released in SNews 1.30+mods(jlw980619).
*/
#define JW_DUPDIAG // unbatch.c; more informative duplicate msg
// reporting
// JW_SHOW_INTERESTING_HEADER_PARTS // article.c, active.c; very
// personal taste!
// Put show_hdr=1 in .rc file to show from the first 'interesting'
// line in the header.
// JW_QUOTE_INITIALS // active.c, (and new mail2.c, .h);
// Personal taste.
// Quoting initials config'able with "quote_initials=1" in .rc file.
// JW_ARTICLE_NUMBER_DISPLAY // snews.c, defs.h, active.c;
// diagnostic, personal.
// Article numbers are displayed, for diagnostic purposes,
// if artnum=1 is in .rc file, to turn on 'artnum_disp'.
//#define JW_SMARTCMP // snews.c; possibly of more general interest
// if extended.
// Modifies threading.
// Not configurable, but probably few users
// will see any difference.
#define JW_LESS_OVERHEAD_FOR_ME // snews.c; I doubt if this would be popular
// Reduces frequency of progress display while threading.
#define JW_EATGUNK // snews.c; a change to the eat_gunk() function,
// concerned with subject threading.
// Probably no change visible to most users.
// JW_HQO // snews.c, mail2.c; Header quoting once allowed
// (use F3 to see this possibility).
// Saves having to remember to turn it off again after
// making occasional use of header quoting.
// JW_TOP // post.c, mail.c, active.c, defs.h
// Looks for a .top file, same place as .sig
// (needs topper= in .rc to permit, similar to
// signature= in .rc)
// Also see JW_MULTI_SIGS, works with .top files
// same way.
// Useful for standard announcements, like
// "Sorry my PC has been dead for 3 weeks.."
// at the start of every message.
// JW_UUENC // mail.c, active.c, defs.h; uuencode of outgoing msg
// Additional option, selectable when 'r'eplying.
// Needs something like the following in .rc file:
// uuenc=c:\UUDVD\UUENVIEW -o %s
// uuext=001
// Obsolete, superseded by JW_MIME
// JW_ZIP // mail.c, active.c, defs.h; zip before uuencode
// Additional option, selectable when 'r'eplying
// See JW_UUENC for info about the uuencode part.
// Uses pkzip, assumed to be on the path.
// Messes up screen, but otherwise works ok if
// zipping and encoding files in the current
// directory. Still at the "proof of concept"
// stage really, but I already find it very useful.
//> Doesn't cope with other directories. Shell out
//> and cd to relevant directory until this is fixed.
// Obsolete, superseded by JW_MIME, though that still
// requires the user to zip up manually.
#define JW_DK // 'D' on thread to do 'K' as well
// JW_PEA_UPPER_OK // post.c; Upper case ok on P/E/A
// JW_FROM_MAILGROUPNAME // bugrep.c mail.c; Changes "From:" if
// in 'ampersand'-mail.*
// Mainly of interest to Mail2snz users.
#define JW_S_NOWAIT // snews.c; No wait after 'S'/'s'
// Not configurable. I don't see any point in waiting,
// do you?
// JW_PRINT_THREAD_BUG // snews.c; print_thread() bug, discussed
// in d.i.s.pc 9512.
// JW_REPLYTO // mail.c; Generate empty Reply-To: line if none
// specified in .rc file.
// JW_FU // post.c; Follow-up questions coded differently
// (not completely successful)
// (later JW_FU2 did a rather better job)
// JW_MULTI_SIGS // snews.c, mail.c; Different .sig files for
// each group.
// The user creates such .sig files in the
// 'newsbase' directory, each having a
// similar name to that of the corresponding newsgroup file.
// For groups that don't have a .sig file in the 'newsbase'
// directory, the original .sig file is used.
// JW_UNBATCH_PATH_BUG // unbatch.c; Correction of bug
// when long path recvd,
// and better use of memory.
#define JW_EXPIRY_DISPLAY // snews.c, active.c, defs.h; Display n/grp
// expiry info.
// To invoke, put expiry_display=1 in .rc file.
// JW_RETAIN_SEARCH_TEXT // snews.c; Don't blank out search text,
// i.e. return to 1.29 way of doing it.
// JW_CURSOR // snews.c, active.c; cursor, useful for speech
// synth for blind users, alters n/grp and threads
// displays.
// cursor_mod=X in .rc to invoke, where X is
// 1 for hardware cursor on line
// 2 for 2 big blobs instead of "->"
// 3 for 2 big blobs and h/w cursor
// 4, 5 same as 0, 1
// 6 for 1 big blob instead of "->"
// 7 for 1 big blob and h/w cursor
// JW_DEL_DISPLAY // snews.c, active.c, defs.h, snews.h
// Shows which threads are deleted (D) or partially so (d).
// del_display=1 in .rc to invoke.
// JW_DEL_DISPLAY2 // snews.c article.c
// Displays 'd' near top of screen when a deleted article
// is being browsed.
// JW_UNDEL // snews.h, snews.c, article.c
// 'u'/'U' to undelete thread or article.
// JW_AGOLD_HILITE_BUGETTE // article.c
// Anthony Gold pointed out bugette with
// hilighted search text not being hilit
// when scrolling with up/dn arrow.
#define JW_GEK_RE_FIX // snews.c
// Fix by Graham E Kinns to improve threading
#define JW_CTRL_S // article.c
// Suggestion by Shakib, ^S to do similar thing
// to S, but for this article and the rest of the
// thread. Also marks each of those articles as read.
#define JW_GEK_PATH // unbatch.c
// Fix by Graham K for problem when Path: line has
// whitespace.
// See d.i.d 17 July 96
// JW_SEARCH_HEADER_ALSO // snews.c, active.c, defs.h
// Allows including header in search.
// Use F3 to see toggle possibility, using 'S'.
// To turn on at start-up, put search_all=1 in .rc file.
// JW_HEADER // defs.h active.c mail.c
// .hdr file to be appended to header, much as
// .sig file is appended to message body.
#define JW_MIME
// Adds M to send/abort/edit to add MIME stuff.
// Cursor moves to start of line, ought to be
// repositioned, but rest of it seems working ok.
// JW_YYYY // 4-digit year in "Date:".
// Avoids possible Year 2000 problems in other
// systems.
#define JW_CTRL_D // article.c
// ctrl-D deletes rest of thread.
// ctrl-U undeletes rest of thread.
// Overrides old effect of ctrl-D (which was
// same as space or ctrl-F.
// Overrides old effect of ctrl-U (which was
// same as 'b' or ctrl-B.
// JW_IS_DIRECT_POST
/*
Extension developed and made available by Ian Smith.
This option enables the building of the direct post format file for
NNTP direct posting using POST.
This file consists of a text file holding the complete article to be
posted. It obviously lacks the mail2news line. Also needed are three
new snews.rc file entries - direct_post, direct_post_queue, and
direct_post_extn:
--- start snippet of snews.rc ---
#
# direct_post
# Controls the news post format and destination:
# direct_post 0 = indirect posting via mail to mail2news (default)
# direct_post 1 = direct posting to news server
#
direct_post 1
#
# direct_post_queue
# The full path of the ka9q outbound news direct post directory.
# This is only used if direct_post = 1
#
direct_post_queue d:\demon\spool\nqueue
#
# direct_post_extn
# The file extension used for direct post news article files.
# For YAN 2.0+ use txt
# This is only used if direct_post = 1
#
direct_post_extn txt
#
--- end snippet of snews.rc ---
*/
// JW_MAILHOST // Use smart mail host if necessary
// e.g. mailhost=post.demon.co.uk
// Implemented around 980808
// JW_ALIAS2 // mail.c
// Expand multiple aliases
// They can be separated by either commas or spaces.
#define JW_CC_FOLLOWUP_MAIL
// Chris Croughton's mod to allow follow-up to mail addr
// #define JW_CC_MSGID
// CC's change to message id.
// It would be better to make this fully user config'able.
// E.g. msgid_fmt = .Snews..
#define JW_CC_UNBATCH_ARTICLE_LENGTH_BUG
// Chris Croughton's bug fix for missing article length
// JW_IGNORE_KEYWORD_UNDERSCORES
// Underscores in .rc keywords to have no significance.
// JW_FU2 // post.c; Follow-up questions coded differently
// See also JW_FU
// JW_IS_NEWSGROUPS_SINGLE_LINE
#define JW_MESSAGE_DEFENCE
// More defensive against messages wider than the screen.
#define JW_SHOW_USER // snews.c; Show current user on screen.
#define JW_IS_DECODE
// Thanks to Ian Smith for supplying this code.
// This code is very much under development at present.
// Eventually I hope to recommend suitable decoders.
// Note that none of the new code kicks in until you
// try to 's'ave the message. I'm wondering whether it
// would be better to tell the user there's an encoded
// msg at an earlier stage.
/*
JW_IS_DECODE enables decoding MIME, UU and Binhex'd files when they
are saved, using external decoders.
--- start snippet of snews.rc ---
# (x)decoder
# The program(s) to be used for decoding MIME, UU or Binhex files
# when they are saved. They need to be able to handle the *whole* file.
# mdecoder - MIME
# udecoder - UU
# bdecoder - Binhex
#
mdecoder d:\demon\olim\bd.com %s > NUL
udecoder d:\demon\olim\uudecode.com %s > NUL
bdecoder c:\archive\uu\udec.exe %s > NUL
#
--- end snippet of snews.rc ---
*/
// 9810:
/*
Implemented by Ian Smith. Reworked 981206 by jlw.
Enables display of coloured headers, sigs and quoted text.
snews.rc will use the following additions:
colour textt - article top/header text colour
colour textq - article quoted text colour
colour texts - article sig/footer text colour
E.g.
colour textt red
colour textq yellow
colour texts cyan+
Actually I'd find those rather repulsive, but quotes in cyan
look much nicer than I'd expected. Worth a try. Thanks Ian.
*/
#define JW_NOPRESS
// Get rid of those pesky "press any key" messages.
// (May have overdone it on this first attempt).
#define JW_NOSPLASH // No splash screen
// JW_NOBUGREP // No bug report to Demon
// JW_NOSPLASH & JW_NOBUGREP together save about 6K.
#define DJS_MODS
// DJS changes and additions.
#ifdef DJS_MODS
#ifndef JW_MODIFIED
#error DJS_MODS requires JW_MODIFIED to be defined also
#endif
#endif
#ifdef DJS_MODS
/* "bug" fixes */
// #define DJS_LONGINTS // removed
#define DJS_NOFLOATS // unbatch.c
/* Remove the one occurrence of floating point code
avoiding the need to link floating point library. */
// #define DJS_DISCARDEXTKEY // removed
// #define DJS_SUPPRESSUNKEYS // removed
#define DJS_PREFIX_FROM // article.c snews.c
/* Check for lines beginning with the separator string "From "
when writing mailbox output (the 's'/'S' commands).
Prefix as usual with a '>' escape-char */
/* new stuff */
#define DJS_TAB // defs.h snews.c active.c
/* Less aggressive tabbing option on thread selection.
If enabled (tab_thread=1 in .rc file) tab first moves to
next unread thread, but requires 2nd tab to actually enter it.
Now works at group level also.
--- start snippet of snews.rc ---
#
# tab threading
# If not present, or set to 0, tab key pressed on thread selection
# screen will jump to the next thread with unread articles, and
# display the first such article of that thread. If set to 1,
# the first press of will move to the thread, but requires
# a second in order to enter the thread and display the
# next unread article.
#
# tab_thread 1
#
--- start snippet of snews.rc --- */
#endif // DJS_MODS
// 981007
// #define JW_GEK_VIDEO_MODE
// Looks like something in progress.
// Gives undefineds at link time.
/*
# videomode defaults to none set
# videomode mode_number [edit_mode (0 = entry mode) [don't reset mode on exit]]
videomode 5b -1 0
*/
#define JW_GEK_ATTRIBUTION
// Allows news_quote and mail_quote in .rc file.
// Under development, likely to change.
// Examples:
//
// mailquote On %D you wrote:
// newsquote I was fascinated to read article %M, in which %N wrote:
//
// If you're desperate for further info, study
// the source or mail me.
#define JW_GEK_GP
// Fix for buffer sizes.
// #define JW_GEK_DIGEST // article.c
// Can't use this yet, it clashes with a DJS mod. (DJS_GET)
// Needs more thought. Are both functions popular?
// Which should get priority for ^G keybinding?
#define JW_INVERT_FOOTER // snews.c
// GeK has pointed out that footer_quote has inverted logic.
// It's too late to change the effect of all those .rc files
// out in the real world, but at least the status can be
// displayed correctly.
#define JW_GEK_LOCALTIME // mail.c
/* GeK - Date: to meet RFC1123 + son-of-1036 - local time, full year,
* numeric offset from UTC as +hhmm, timezone name in brackets
* Assumes:
* long timezone value in seconds added to local time to get UTC
* (doesn't change during DST)
* char* tzname[2] ptrs to TZ names
* The +1 hour ahead during DST is fixed by BC++ libraries.
*/
// JW_GEK_LOCAL_POST_REDUCE_JUNK // post.c (later moved to mail.c)
// Local posting not to put more than one copy in junk newsgroup.
//> But who uses local posting anyway? Local posting
//> could be candidate for removing to cut memory?
//> 9911: At least one user (Ian Smith)!
//> 0011: And paul@pcserv.
// 9810:
// Abandoned policy of marking all changes from 1.30 in the code.
//
// Up to this point I marked (with #ifdef) every change that I
// hoped to see Demon introduce in 1.31, thinking that it would
// increase the chances of acceptance. My guess now is that
// Demon will either not make another release or else do something
// so insipid that marked changes are irrelevant.
//
// In particular, some of the options, such as JW_OPTIM, JW_SPRINTF,
// JW_CONST, JW_STATIC, JW_LOADSTUFF, JW_LOADSTUFF2,
// JW_LOADSTUFF_DIAGNOSTICS, JW_INCL_SIG, JW_BETTER, JW_WRKFILE,
// JW_WRK2, JW_NULL_PTR_USAGE, JW_UNBATCH_PATH_BUG, JW_FU, JW_FU2,
// JW_DELART, JW_SEARCH_HEADER_ALSO, JW_PAGING_OVERLAP_1LINE,
// JW_AGOLD_HILITE_BUGETTE, JW_NOTHREAD, JW_FROM_MAILGROUPNAME,
// JW_REPLYTO, JW_MULTI_SIGS, JW_ALIAS2, JW_PEA_UPPER_OK, JW_TOP,
// JW_HEADER, JW_DEL, JW_PRINT_THREAD_BUG, JW_RETAIN_SEARCH_TEXT,
// JW_YYYY, JW_SHOW_INTERESTING_HEADER_PARTS, JW_DEL_DISPLAY,
// JW_ARTICLE_NUMBER_DISPLAY, JW_CURSOR, DJS_BIOS_SCROLL,
// JW_IGNORE_KEYWORD_UNDERSCORES, JW_GEK_LOCAL_POST_REDUCE_JUNK
// have been removed, leaving only the new code. This makes
// the code easier to read and maintain. Although the above
// list was started 9810, it is extended as further options
// are removed, rather than document the removals piecemeal.
//
// Also marking of some functional changes that I think are
// non-contentious have been removed. These include JW_ALIAS,
// major parts of JW_GROOVY_QUOTE (which is now changed to
// JW_QUOTE_INITIALS), JW_CRAP_7CHAR_ID, JW_UNDEL, ...
// I particularly wanted to do this where the changes involved
// large amounts of code movement, so that preserving the ifdef's
// was a hindrance for development.
//
// Some options that have proved useless have been removed
// instead of being just commented out. These include
// JW_DELUPDN
//
// Many other 'silent' changes have been made at this time,
// but none should affect the user directly. A few changes
// may give better diagnostics. Many are faster and/or smaller
// code. Some are more elegant code. This is an open competition,
// but remember: Editor's decision final!
// 981017:
// Added time of last command to display in status line.
// 981019:
// #define JW_POST_GROUPS
// JW_POST_GROUPS introduced because it seems that in practice
// Demon users don't use an 'ng' file. By not defining this,
// a useful saving of about 500 bytes can be made.
// 981025
// JW_NEWSFROM
// Replaces JW_POST_DOLLAR, now removed.
// Permits a different user name to be specified
// in From: in newsgroup postings. Add to the .rc file
// 'newsfrom=...'.
// E.g. my own .rc file has
// news_from=john$
// 981104
// Correction of crash if follow-up to long references line
// without spaces for 256+ chars.
// 981110
// 'delete_skip' added.
// delete_skip=0 in the .rc file will prevent the skipping to
// the next unread article, which has proved distasteful for
// some users.
// 981111-12
// Fixed char arrays within some structures made dynamic.
// May slightly increase code size, marginally slow execution,
// but should use memory more efficiently.
// 981112
// Added GeK code to rmgroup to implement -f switch to force
// removal of a group even if suspended.
// 981117
// JW_SBJ
// Reorganising post() and its callers, making 'subject' an
// in-only param. Believed to be no change in functionality
// for users. Simplifies code and makes it safer.
// Preparatory for further reorg when confirmed ok.
// 981127: looks ok, going with it.
// 981120
// JW_FU3
// Fixed bug concerning follow-up, notified by A Gold.
// 981122
// Reorg of get_his_stuff, no effect for user
// Updated 'd' near top of screen when article (un)deleted
// 981124
// maillog=userid in .rc file will cause outgoing mail to be
// routed to a .txt file derived from the &mail.. newsgroup
// name. E.g. a reply to a message in &mail.uuuu will be
// stored in uuuu.txt.
// 981125
// No effect likely to be seen by user.
// Further mods to reading and generation of 'References:' lines.
// 981126
// 981206
#define PDL_MIME
#define PDL_AUTOMIME
// Temp test using F10 in article display. Ask pete@pdlmail.demon
// if you're curious about display of MIME articles (e.g. those
// funny msgs with equal signs in them).
// 981207
// Reorganization of load_article nearing completion.
// 981212
// Alias expansion works recursively.
// 981216
// .sig/.top/.hdr files now terminate at line with lone '.'
// if present. Allows comments etc to be stored afterwards.
// #define DBG_MALLOC
// Use testmall.c for debugging heap usage. This should not
// be defined in any public release, it slows down operation
// too much and reduces available memory.
// #define JW_MAGIC
// For diagnosis. Not usually in released versions.
// Adds an extra field at the start of various structs,
// which can be set to a magic value and checked for later,
// to detect possible corruption of the struct or rogue pointers.
// #define JW_TRACE
// Internal trace. Not usually in released versions.
// If present it's turned on by a line trace=1 in the .rc file.
// See 001130 for change to trace=filename
// 981229
// F9 turns =xx into single characters.
// F10 cycles thru fonts in snews.fnt file. This file should
// be in your 'news' directory, the same directory where your
// .rc file is located.
// 990101
#define JW_CTRL_F
// 'Fetch' rest of thread. Combines ctrl+D and ctrl+S.
// 990106
// If newsfrom= (added 981025) was omitted, postings were
// generated with an invalid From: header. This is now
// corrected.
// Experimenting with F7 supersedes, F8 cancel
// 990106-14
// Integrating work by DJS (see below)
#if 1
// updated DJS990808
#define DJS_INIFILE // snews.c snewsini.c addgroup.c rmgroup.c
// unbatch.c reindex.c expire.c mail2snz.c
/* Sets, or overrides environment variables, including SNEWS. Means
Snews and utilities can be run directly from command line - no
setting is required in either autoexec or any other batch files.
Has no effect unless snews.ini found in either current directory
or the .EXE's location */
// DJS_SCROLL // defs.h, snews.c, active.c
/* pointer moves full height of screen on groups & threads displays,
with 1 line overlap. (now scroll_style = 1 in .rc)
Plus! Now with centred mode option... (now scroll_style = 2 in .rc)
(990114: centre_thread withdrawn, replaced by scroll_style = 2)
--- start snippet of snews.rc ---
#
# scroll style
# 0 = 'classic' style (PgUP/DN moves 1/2 a screenful)
# 1 = 'standard' paging (UP/DN arrows scroll 1 line at a time)
# 2 = 'gunsight' mode (current item always displayed centred)
#
--- end snippet of snews.rc --- */
#define DJS_SKIPKILLED // snews.c, article.c
/* skip header-only/killed msgs (those without bodies), using
the '\' or '|' keys. Both are similar to TAB - at the article
display level they page down through the current article, before
skipping to :-
\ the next unread and un-killed article
| the next un-killed article
They also work at the thread selection level, and obey the new
tab-thread configuration setting. */
#define DJS_GET // snews.c, article.c, finetune.c
/* Get and Kill file interface.
g=get current message (or thread)
i.e msg-id to get file
G=get rest of thread, i.e. current & following articles
^G=same as G, but also marks thread for subsequent retrieval
i.e. "!Subject: Re: " to killfile
^K=kill rest of thread and mark thread for subsequent ignoring
i.e. "Subject: Re: " to killfile
This fits (fairly well) with existing keys :-
k kill (i.e. mark as read) current message and move on
K kill entire thread
^K at group level will killfile the selected group, marking it
for header-only downloads.
i.e. "Newsgroups: **" to killfile
^A=kill/keep current author's articles
i.e. "From: " or "!From: " to killfile
Killed articles now display the indicated line count (i.e. the
value of the Lines: header) instead of the usual "Line x/y" - a
quick indication as to whether an article was killed due to it's
size, and/or whether it's too big to bother requesting.
In non-expert mode there is a "yes/no/undo" style prompt - the
latter allowing the removal of previous get/kill requests. The
kill file option also allows for the "expiry" of rules, and
allows the interval for this to be changed. The default for
this may be defined in the .rc file...
--- start snippet of snews.rc ---
#
# killfile_duration
# The number of days that entries to the killfile will be retained
# for, before being "expired". If not specified this defaults to 7
# days. Note this is the initial value only, and may always be
# changed from within Snews itself. Also note that the external
# utility snzTune is required to process such rules.
# killfile_duration -1 = non-expiring killfile rules
# killfile_duration 30 = active for 30 days before being removed
#
killfile_duration 14
#
--- end snippet of snews.rc --- */
/* Further info from Dave, Feb 2002:
Ctrl-A (Author Status)
----------------------
Article level only. This controls the downloading of articles based on
the author 'From' header, though in fact it can use other headers also.
Using this brings up the following prompt :-
(K)ill or (G)et for -1 (D)ays, (E)dit-header, (U)ndo or (A)bort [e] ?
'K' indicates a kill rule. Articles matching this rule will be ignored
on subsequent downloads.
'G' indicates a keep, or anti-kill rule. Articles matching this rule
will always be downloaded - this is useful for example in groups which
have been set to header only downloads, where you wish to read articles
from certain authors only.
'D' sets the number of days for which the rule is active, after which it
will be deleted. By default the setting of '-1' indicates the rule is
permanent and will not expire.
'E' allows the rule to be edited prior to use. E.g. you might change a
rule such as 'From: I_morph@my_address (An Annoying Poster)' to simply
'From: *An Annoying Poster*', in order to defeat attempts to avoid the
killfile. Alternatively by using the up and down arrows you can actually
select other headers to based the kill/keep rule upon, e.g. the
'Organization' or 'X-Trace' ones, which might be more constant.
'U' removes the rule (if found) from the killfile, though you can also
do that manually of course.
'A' aborts the command without making any changes, or alternatively you
can press ESCape.
Ctrl-K (Killfile) and Ctrl-G (Getfile)
--------------------------------------
Article and Thread levels. These are similar to Ctrl-A, but specifically
kill or keep based on the 'Subject' header, i.e. the thread title.
'^K' marks the thread with a killfile rule to prevent further articles
being downloaded, and in addition marks the existing thread as read.
'^G' marks the thread with a keep rule, causing further articles to be
downloaded in an otherwise header only download group, and in addition
fetches the full bodies of any articles currently in the thread as
headers only.
Navigating around header only articles
--------------------------------------
Article and Thread levels. The following keys are very similar to the
TAB key in that they page down through each article, moving on
automatically to the next when the end is reached. However in addition
they "skip over" header only articles, i.e. those rejected by rules in
the killfile but which still occupy a place in the thread as an article
without a body.
'\' : finds the next unread article which has a body.
'|' : finds the next article, unread or not, which has a body.
---------snip ----------------------------------------------------------
One BIG point however - in order to use the above you'll need a copy of
my snzTune utility. Follow the link from :-
http://www.roborat.demon.co.uk/programs/snews.htm
Simply arrange to run that utility after each Snews session, and the
above commands are processed and used to update the kill and get files.
There are other commands available - see the snztune.txt file for full
details.
*/
#define DJS_SHOW_EOF // article.c
/* Displays a marker at the end of each message.
--- start snippet of snews.rc ---
#
# show_eof
# Show end of message marker.
# show_eof + single character repeated across width of screen
# show_eof displays given string
#
show_eof
#
--- end snippet of snews.rc --- */
#endif // if 0 or 1
// 990114
// New .rc param: scroll_style = 0/1/2
// 0 Classic
// 1 Full page
// 2 Fixed arrow, centred
// This is likely to change further, as part of the ongoing
// effort to make scrolling/paging more user-friendly and
// configurable. This parameter may be withdrawn and replaced
// by others. Watch this space!
// 990121
// Failed to use correct colour for displaying '>' quotes. Fixed.
// 990114-23
// (Not in released binary) Major reorganisation of scrolling.
// 990129
// Multiple .rc files permitted. snews.rc is still loaded at
// start-up. On entry to each newsgroup a check is made for
// an .rc file specific for that newsgroup. I believe this to
// be particularly likely to be of interest to users reading
// mail in fake newsgroups (as created by mail2snz), though it
// can be used for any newsgroup.
// To use this feature, go to your 'news' directory (where files
// 'snews.rc', 'active', 'nntp.dat', etc are located). Create
// a subdirector 'rc'. In this new directory, place .rc files
// with names corresponding the newsbase files. To find how
// those files pair with newsgroups, look in the 'active' file.
// 990131
// Trying new makefile with different optimisation.
// 990206
// Change to experimental ^F code.
// 990311: Added following DJS990206 mods
// DJS990206
#define DJS_KBHIT // screen.c
/* modifies kbhit() behaviour to prevent special keys (^S, ^C) being acted
upon inappropriately */
// Correction to ^S bug due to Borland library using DOS for
// kbd checking (^S in DOS holds output scrolling).
// DJS990206
// DJS_RECALL // lnrecall.c and many files calling it.
/* replacement for gets() call - provides command/string recall, with
list of previous strings held on disk in various recall (*.rcl) files.
To control the amount of history held in each such file, use
max_recalls = n
in your .rc file. The default value is 50. Don't make this value
ridiculously large, else you may have trouble with running out of
memory. But a few hundred should be reasonable.
*/
// DJS990206
// DJS_EOL_WRAP // screen.c
/* make direct screen mode behave same as bios... wraps down to next line
in cputs() and putch() fn's */
// 990315
// Defaults for textt, textq, texts tidied up.
// Introduction of popup screen for history recall. (PgUp)
// Keys for history recall:
/*
Apart from the usual keys which work as you would expect (Left &
Right arrows, Home, End, Backspace, Delete and Enter), the following
keys also have an effect :-
ESCAPE erase the current line, or, if it's already blank, abort.
^DEL erase from cursor to end of line.
^Backspace erase from start of line to cursor.
Insert toggle between the insert (default) and alternative
overwrite mode.
Up arrow recall from list of previous entries.
Down arrow recall more recent entries.
^Page Down recall most recent entry. Note that a down-arrow from
this point gives a blank line.
^Page Up recall oldest entry. Note that an up-arrow beyond this
point gives a blank line.
TAB recall previous entries which match the current line,
from the start of the line to the current cursor position.
Page Up show popup window (scroll up/dn, pgup/dn, Enter, Esc,
Tab, Delete).
*/
// 990331
// PgUp enters popup window at most recent entry.
// 990403
// Printer =
// added to .rc file. Intent is to allow Printer=LPT2 etc.
// DJS990403 (-ish) // DJS990808 removed pre-remap code
// #define DJS_REMAP // remapkey.c snews.c article.c
/* allows remapping of command keys at all 3 levels - Group, Thread
and Article. */
// 990403-29
// Minor bug fixes and optimizations.
// DJS990606> began porting to DJGPP
// DJS990808
#define DJS_MSGEND // snews.c article.c finetune.c expire.c reindex.c
/* !bug-fix! inconsistent use of end of message terminator.
strncmp(buf, "@@@@END\n", 7) misses the \n - i.e. will match the
given terminator string followed by any other text (should be on
an otherwise blank line by itself). Additionally some tests in the
snz utilities do a case insensitive match - again will match more
than it should. Have also modified unbatch to actually escape the
string in the first place. */
// DJS990808
// DJS_FROMLINE // article.c
/* !bug-fix! fn. show_from() failed due to signed/unsigned comparison
problem. Replacement fn. also slightly better - uses full width of
3rd line down to display From: and Organisation: data */
// DJS990808
#define DJS_LATIN1 // article.c cputs_wh.c
/* alternative to PDL_MIME - alters cputs_with_highlight() in order
to display ISO 8859-1 (Latin1) charset chars
--- start snippet of snews.rc ---
# Latin1
# Attempts to show ISO-8859-1 or Windows-1252 encoded text using
# replacements from the standard us-ascii character set
# 0 for manual selection only (press Shift-F10 to toggle)
# 1 auto switch to 8859-1 or Win-1252 as indicated by headers
# 2 auto switch to Win-1252 on detection of either of these headers
latin1=2
--- end snippet of snews.rc ----- */
// DJS990808
#define DJS_HELP // help.c
/* Use 'snews.hlp' rather than embedded text for help system.
Saves memory, and allows the help pages to be kept in sync with any
keyboard remapping (DJS_REMAP) changes (should the user wish/care) */
// DJS990818> !bug-fix! article.c ^D/^F Delete/Fetch rest of thread
/* Removed message()/wait_kbhit(), as the uneaten keypress causes conflict
when also setting exit_code - apparently acting incorectly and at the
wrong level */
// DJS990818> re-built under new DJGPP/GCC 2.95 compiler
// DJS990828> Corrected path header to use 'newsfrom' setting when available
// DJS990828> Horiz. centred message() and help title lines on screen
// DJS990829> Suppress org. display is none given - i.e. don't say 'at (none)'
// DJS990829
// DJS_PARSEAUTHOR // mail.c mail2.c
/* !bug-fix! get_his_stuff() replacement parse_author() -
differentiates between From: and Reply-To:, and uses unfolded headers,
thereby not missing cont. lines */
// 991113:
// Correction to code for local posting.
// 991203:
// Direct posting toggle added in F3 screen.
//
// news_replyto option added, analagous to news_from option.
// Note that, unlike the news_from option, this needs a fully
// qualified name, just as the reply_to option does.
// 991204:
// Ignore video char sets if not 16 rows per character (e.g. 50-line display).
// Relates to snews.fnt and F10 toggle.
/*
F10 alters the hardware video font.
Shift-F10 uses a translation table to substitute different chars on
screen - ones that bear some resemblance at least to the intended
8859-1 set. e.g. for code 163 (an accented u under us-ascii) it
instead shows the ISO required pound sign (ascii code 156).
Each key has it's own cycle. Use F10 if you're running full-screen
in dos or a Windows dos box. Use shift+F10 if you're running
in a Windows dos box that isn't full screen.
But basically don't use the two together.
*/
// 991212:
// Bcc with continuation lines fixed.
// 991216:
// Follow-ups: Breaking long references lines that have no spaces.
// 991219:
// 'news_from' and 'news_replyto' may be fully qualified, i.e. they
// can include a '@' character.
// 991228:
// 9-digit -> 10-digit changes from RNC
// Display if chrono/rev-chrono in newsgroup and threads screens.
// 000105:
// Recent versions tried to treat any 2 or 3 char sequence before
// a colon as equivalent to Re:. This was requested by users
// experiencing (IMHO) brain-damaged mailers that try to be
// international and use local equivalents for Re: instead of
// sticking to RFC conventions. However, it's caused a problem
// with subjects that have things like FS:, WTB:, etc. Old
// behaviour restored.
// 000117:
// Unbatch: added -o option to unbatch crossposted articles into
// only one group.
// DJS000125:
// Use existing values as starting point when user answers 'N' to
// "Reply to who?" and "post there?" newsgroup prompts.
// Zero length copy check on strncpy0().
// Removed small piece of inline assembly from kbhit()
// DJS000127:
// reduce flicker/flash due to difference between header/body colours
#define DJS_NOFLASH
// 000131:
// news_from/news_replyto buffers widened to 80 chars, and other
// small tweaks to this. (Still problems in this area).
// 000206:
// Change to unbatch, -o option. Stops incorrect update to the
// history.snw file. [incorrect, see 000222]
// 000220:
// Merging of DJS/JW development strands.
// Minor change to news_replyto code concerning Path: header
// 000222:
// Change to unbatch, -o option. Stops incorrect update to the
// history.snw file. Maybe. I hope. This time.
// 000226:
// Experimenting with not accepting as a synonym for 'A' in
// prompts. It has bitten me too many times, resulting in lost
// messages.
// 000626:
// Internal changes by DJS to reduce recompilation when version
// string is changed. No effect on users.
// 000702:
#define JW_SHELL
// Experimenting with ctrl+F1.
// Put something like "shell1 = myprog article.tmp" in your .rc
// file. Read an article, press ctrl+F1. This creates a file
// 'article.tmp' in the current directory and runs 'myprog'.
// 000707:
// shell1 to shell12 for ctrl+F1 to ctrl+F12
// 000710:
// Modified tzset.c from DJS.
// DJS000716:
// Upgrade to DJGPP 2.03, binutils 2.10
// Work on JW_SHELL - 'article.tmp' becomes mktemp (SN??????) in the
// temp. directory defined in .rc setting.
// Allow for %f = output filename (full path)
// unbatch.c: Percentage complete option
// DJS000728:
// Large re-org of save_... functions. Moved them and printing stuff
// from snews/article.c into new module output.c
// JW_SHELL: restore use of 'article.tmp'
// added %h - output headers only
// %b - output body text only
// to complement existing %f - full article
// Function xrealloc() created.
// DJS000806:
// Finetune.c: improved ^A command, with sub-option (E) for
// edit-headers - up-arrow allows selection from full list of
// current article's headers.
// Also made a few keys different on the sub-menu for ease of typing:
// It's now ^K-K rather than ^K-Y(es), and likewise ^G-G.
// mail.c: DJS_PREFIX_FROM Fixed broken "From " in the outgoing mail
// log file.
// remapkey.inc: new option MarkThreadRead_NP (also snews/article.c)
// This is bound to NO KEY by default. Bind it at article or thread
// level, to avoid the "are you sure" prompt in non-expert mode when
// requesting a thread be marked as read.
// DJS000812:
// Internal changes:
// mail.c: removed unnecessary static. Changed logic which sometimes
// meant 'newsgroups' was being set NULL.
// If post/f-up to a group whose first character is not alpha-numeric,
// prompt user that this is a pseudo group - ask whether to proceed or not.
// New fn. 'posting_allowed' - replaces 4 occurences in snews+article.c
// where user is asked whether to post to suspended group or not.
// DJS000817:
// finetune.c: prefix regular expression chars in killfile rules with a '\'
// DJS000823:
// message.c: new 'wmessage', combines message+wait_kbhit/wait_for_any_key
// depending on JW_NOPRESS. Always swallows ESCAPE, allowing this to just
// clear the msg, rather than being acted on, sometimes inappropriately.
// Used particularly in mail.c, also snews.c, article.c, finetune.c, output.c.
// DJS000903
// mail.c: when forwarding mail, don't quote end-of-message string.
// DJS000906
// mail.c: mail_of_some_kind, who_to increased from 256 to GPBUFSIZ
// to allow bigger aliases (obsolete as of 000930).
// DJS000909
// system.c: some re-org, set white on black text before shell. (removed)
// system("") now prints "type EXIT to return" msg, simplifies
// shell-out in snews/article.c
#define DJS_ALIAS
// DJS000930
// mail.c: rfc822 style addresses, including real name parts/comments.
// DJS001028
// mail.c: new version of parse_author. "route-addr" part, enclosed in
// now taken as is. Nested (bracketed comments) allowed
// for, and "quoted" bits not assumed to necessarily be part of real name.
// DJS001030
// lnrecall.c: New ^left/^right arrow, allows movement a word at a time.
#define DJS_ENV_FROM
// mail.c: form envelope-from (2nd line of .wrk file) from the From:
// header in the message itself, in case user has edited this.
// DJS001117
#define DJS_NRC_UPDATE
// active.c, article.c, snews.c:
// keep running list of read articles in .nrc file
// --- start snippet of snews.rc ---
// # NRC_update
// #
// # determines when article read file (.nrc) is updated
// # 0 for update at end of Snews session only
// # 1 for update as each article is marked read
// #NRC_update=1
// --- end snippet of snews.rc ----- */
// JW 001130
// For diagnosis of difficult problems there is a feature
// that isn't usually in released versions. Compilation has
// to be done with JW_TRACE defined (see 981216) and the user
// turns on the feature with trace=... in the .rc file. This
// causes copious logging to a file. It used to be turned on
// with trace=1, but this version changes this to trace=filename,
// where filename specifies the name of log file to be written.
//
// An absolute, not relative, filename is recommended. E.g.
// don't use trace=snz.log, instead use trace=c:\snz.log or
// trace=d:\mylogs\snz\test.log or some such. If you use a
// relative filename you may get fragmented logs as Snews changes
// the current directory. By the Law of Maximum Cussidness this
// is guaranteed to happen around the time that you most wanted a
// detailed and accurate log!
// Minor fix in mail.c concerning null ptr.
// Changes to boundary generation for attachments, so as to allow
// multiple attachments to be created correctly.
// JW 001201
#define JW_WARN_EMAIL
// Usenet mail by mistake preventer.
// Put warn_email=1 in .rc file to activate.
// 001202..
// Internal changes to 'artarr' because of fault found when
// cross posting with local posting on.
// Changes to make cross posting defensive against corrupt
// 'active'/'history.snw' files.
// 001207
// rmgroup: added removal of .del file. Reorg to simplify.
// 001216
#define JW_MSGIDFMT
// Configurable msg-id.
// Under development, subject to change.
// Default is same as having msgidfmt = %d.%t.%nsnz@%s.%D
// in the .rc file.
// %d date (ccyymmdd)
// %t time (hhmm)
// %n message sequence number
// %s site name ('nodename=' in .rc file, e.g. wash)
// %D domain name ('domain=' in .rc file, e.g. demon.co.uk)
// 001227
// Internal changes to Unbatch, slight memory improvements
// and easier to make further changes.
// Various clean-ups and more resilience against low memory.
#define JW_ELIMINATE_HORRIBLE_USE_OF_STRTOK
// Speaks for itself really. See history.c, history2.c, for
// use of find_msg_id2 and caller's reliance on strtok(NULL..)
// having been set up with static buffer.
#define JW_HIST
// Release old history.snw records from memory in favour
// of later ones.
// 010316
// Cope with \r\n in newsbase (normally lines in the newsbase
// are held according to Unix convention, ending in only \n).
// Previously a blank \r\n line wasn't seen as separating header
// and body.
// 010521
//#define JW_PAGING
// Experimental
// JW_PAGING is experimental. Trying to rationalize all the different
// ways of displaying, into a nice parameterizable form.
// Started early 99? Still not ready for prime time at end 99. :-(
// Summer 2001, getting better, but still not fully there, so
// turned off again 010820 before release.
// DEVELOPERS ARE ASKED TO TEST COMPILE WITH *AND* WITHOUT THIS <<<<<<<<
// OPTION, TO ENSURE NOTHING GETS BROKEN AGAIN. <<<<<<<<
// 010604
#define JW_SUSPEND
// Option to suppress display of suspended groups.
// F5 key in group display toggles it. Key can be
// redefined, keyword "SuspendToggle".
// 010605 (djs)
// Change to chargen.c to bypass multiple character set code if
// no snews.fnt file found. This change is to reduce problem of
// flashing video on certain machines.
// 010627
// Despamming of reply address enhanced to use Demon's
// X-Mail2News-Path header.
// 010820
#define JW_USERISMG
// defs.h, active.c, help.c
// user_is_mg=on gives same behaviour as before
// in the mail pseudo-groups, generating the From: header
// according to the group name.
// user_is_mg=off (default) gives the original Demon Snews
// behaviour, i.e. the 'userid' setting is used.
// '*' in F2 help shows when user_is_mg is turned on.
// 010821
// getch.c
// Multitasker yield added when waiting for keystroke.
// unbatch.c
// Fixed spurious '\' in temp filename, though it seemed to
// do no harm.
// 010822
// mail.c, help.c
// Minor reorgs of code. No functional change.
// 010828
// Small changes from djs, other small changes.
// DJS010914
#define DJS_BIGGRP
// snews.c expire.c reindex.c
// Allow for newsbase file offsets greater than 8 digits in
// length, by avoiding hardcoded offsets within index files.
// This adds support for newsgroups over 100Mb.
// 011222
// Minor improvements to logging in unbatch.
// 011229
// Handle cc/bcc in direct posted news articles.
// 020111
// Changes concerning international substitutes for Re:.
// 020226
#ifdef __DJGPP__
#define JW_32BIT_ART_NUMS
// Experimental.
// Uses 32-bit article numbers, allowing more than
// 65,535 articles per newsgroup.
// Only available in DPMI version (built with djgpp).
#endif // def __DJGPP__
// 020319
// Corrections encouraged by trying latest djgpp, which
// is stricter.
// 020331
// Tidying up code and comments, particularly in .rc loading.
// 020504
// Made JW_32BIT_ART_NUMS conditional on __DJGPP__.
// When upgrading from old or Demon Snews, manually
// scan the .nrc file for -ve numbers. If any are
// found, the 16-bit version of Snews/jlw should be
// run, until these -ve numbers go away (and if that
// doesn't happen quickly, contact me).
// After that, it should be safe to move to the 32-bit
// version.
// If this is a real problem, rather than just theoretical,
// there should perhaps be code added that warns of the
// negative article numbers.
//>> 020623: need to add code to trim out refs if
//>> the total is too long. Recommended is the
//>> 1st plus the last 3 plus as many others as
//>> fit.
// ----------------------------------------------------------------
// If you are a user, not a developer, there is nothing of interest
// to you beyond this point.
// ----------------------------------------------------------------
// Option compatibility checking follows. Only of interest when recompiling.
//DJS> remove this? It's prob. just the tip of an iceberg
#ifdef DJS_SKIPKILLED
#ifndef DJS_TAB
#error DJS_SKIPKILLED requires DJS_TAB
#endif
#endif
#endif // def JW_MODIFIED
//
//