14 Apr 94

- Created directories h, lib, libunix, and libmac.  h holds header
files, lib holds the general and reader libraries libtcgen.a and
libtcread.a, libunix holds UNIX-specific stuff in libtcunix.a.  libmac
holds source used only by Macintosh versions of the translators (which
don't exist yet).  Some stuff is shared by both troffcvt and the
postprocessors, so that goes in libtcgen.a.

- Abolished TCRStrToNum().  Instead use one of the functions in lib/math.c.

15 Apr 94

- Renamed tcr.h -> tcread.h

- New global variable (long tcrLineNum) for the reader stuff, to indicate input
line number.  *** NOTE that it's not incremented properly yet ***

- TCRInit() should now be called by postprocessors once per input file,
to reset tcrLineNum properly.

- HAVEGETPID configuration parameter is gone now.  The GetPid() function now
exists in different forms in the libunix and libmac libraries.

[[ ... long gap in active development ... ]]

15 Dec 96

- Use portlib string-to-number routines instead of the ones in lib/math.c.

16 Dec 96

- Enable recognition of long request names, and long string and register
references like \*[xxx] and \n[xxx].  This helps with translation of input
intended for groff.

- Add -C option to troffcvt to turn on compatibility mode (disables
recognition of long names).  It's like groff's -C option.

- Add .C register, which is 1 if compatibility mode is on, off otherwise.

20 Dec 96

- Instantiated new type XChar (extended type), which is typedef'ed as an
unsigned long.  It's an unsigned type wide enough to encode information
about any input character (plain, escaped, or special char) in a single
scalar value.  This way I can avoid encoding non-standard characters
in a sequence of bytes.

- Low-level input functions now return type XChar rather than int.

- Renamed Bug() macro to Debug().

21 Dec 96

- There is no longer a limit of 255 special characters.

23 Dec 96

- Making full conversion from using UChar (unsigned char) to XChar
(unsigned long) for internal character type.  This is such a pervasive
change, and has so many implications, that I'm also switching to using
prototyped functions.  This means troffcvt won't compile under non-ANSI
compilers anymore.  That may break it on some systems, I guess, but I
really need to have the compiler tell me when I'm passing the wrong
argument type or the conversion will drive me nuts.

26 Dec 96

- Renamed TCSetOpenLibFileProc() and TCOpenLibFile() to TCRSetOpenLibFileProc()
and TCROpenLibFile().

- ToEsc() has always had a panic triggered to go off it it's called with
a special character code as an argument.  I've now put a similar panic into
FromEsc(); I don't see anywhere that it should be called with a special
character code, but I want to be sure.

- Added FileInfo() function that returns a string consisting of the current
input filename and line number.  Useful for making error messages more
informative.

28 Dec 96

- Added support for building troffcvt distribution on FreeBSD and MkLinux.

- Parameterized how troffcvt constructs system macro filenames for handling
command-line arguments like -me and -ms.  Usually these files have names
like tmac.e and tmac.s, but under Solaris they seem to be named just e and s.

- Modified the way troffcvt interprets command line arguments.
Formerly, it read setup files (action or macro files) named by -a or -m
options as soon as the option was pulled from the command line.  Also,
the -r option, if one was given, had to be given before any -a or -m
options.  This is no longer necessary, because instead of reading setup
files as they're found, troffcvt keeps a list of pointers to them.
After all the option arguments have been examined, it reads the
setup files.  After the setup files have been read it proceeds to read
any other input files named on the command line.

- Eliminated troffcvt -troff and -nroff options.  Now they should be
specified as -t troff or -t nroff (t = formatter type).  Also, the
option -t groff is now recognized (see next item below).  I changed
the option structure to avoid using up more initial option letters
each time a new formatter type is added.  This way only -t is used.

- Added -t groff option to troffcvt.  This defines the .g read-only
register, which keeps troffcvt from aborting on gtbl output or when
using groff macro packages.  (gtbl output and the groff macro
packages test for the .g register and abort if it's not set.)  -t
groff is also intended to make troffcvt act like groff in other
ways, but I haven't implemented other ways yet...check the list below
for future groff-related entries.

- Added ASetCompatibility() function and "req cp" line in actions file to
implement the groff .cp request for setting compatibility mode on the fly.
This is needed to keep troffcvt from dying while reading the groff tmac.e
file.  But the "req cp" line in the actions file should probably really
be interpreted only if the -t groff flag was specified...???

- Add -A option to troffcvt to suppress reading default action file.

30 Dec 96

- Changed tl action to have "title $1 $2 $3" in the post-parsing part.

- The troffcvt output format for three-part titles is different,
too.  It's now incompatible with earlier format.  However, this
should present little problem to postprocessors; three-part title
output was never implemented before, so postprocessors are unlikely
to have tried to do anything with them.

02 Jan 97

- Allow special character references of the form \[xxx].  That is, allow
special characters with long names.  These are disallowed in compatibility
mode.

03 Jan 97

- Modified handling of the .bd request; previously ".bd S F N" was
parsed correctly, but ".bd S N" was not.  The "parse-s" action has been
replaced by the "parse-embolden" action, and the AParseS() function has
been replaced by AParseEmbolden(), which parses all of the .bd request
arguments, not just the "S".  This change is probably of minimal impact;
very little is done with this request by postprocessors.

- Began work on tc2html, a postprocessor for producing HTML.

06 Jan 97

- Added \pass (pass-through) control to troffcvt reader.  Action files can
use this as:
	output-control "pass anything"
to cause:
	\pass anything
to appear in troffcvt output.  Postprocessors can do what they like with
"anything" (which is parsed into rargv[] as a single argument, but normally
it should be dumped unchanged to the output.

- Added \other control to troffcvt reader.  Action files can use this as
	output-control "other arg1 arg2 ..."
to cause
	\other arg1 arg2 ...
to appear in troffcvt output.  Postprocessors can do what they like with
the arguments, but typically \other indicates the presence of unrecognized
requests.

- Added ADumpBadRequests() action function, which can be used to turn
dumping of unrecognized requests on or off with "dump-bad-requests 1" or
"dump-bad-requests 0".  An input line beginning with an unrecognized request
will then appear in the output as:
	\comment bad-req: original-line-here

08 Jan 97

- Added ADumpInputStack() action function, which writes information about
the input stack to stderr.  It can be accessed using "dump-input-stack" in
an action file, which can be useful for debugging.  For example, if you use
the following line in an action file, you can dump the input stack with
.dump_stack requests:
	req dump_stack eol dump-input-stack

- Changed how the push-string action works.  Formerly this just pushed a
string onto the input stack.  The problem with this is that the string didn't
actually get processed until after the action list was finished.  Suppose you
had an action list like this:
	break push-string "this is a line\n" break
The break would be executed, then "abc" should be shoved on the input stack,
another break would be executed, and the action would be over.  Then the
string on the input stack would finally be processed.  Furthermore, if you
had an action list like this:
	push-string "line 1\n" push-string "line 2\n"
the output that would result would be "line 2 line 1" because the strings
would be processed in first-in last-out order.

Now any string put on the stack is processed immediately.  This means you
can put it anywhere in an action list and expect it to be processed where
it occurs.

09 Jan 97

- Began changing "non-parsing" terminology to "post-parsing" in doc/actions.ms
(and will change anywhere else it occurs).  "post" is more descriptive of the
fact that these actions are executed after request arguments are parsed.

14 Jan 97

- Fixed bug of erroneously pushing back newline after processing conditional
if newline was not the last char read (could be endOfInput, e.g., if the
conditional was provided by a push-string of a string that didn't end in
newline).  Now push back newline or endOfInput, whichever was the last char
read.

- tc2html produces "okay" output now.  That is, it can HTML-ize all the
documents in the doc directory pretty well.  Not sure how well it does in
the general case yet.  The biggest difficulty is that to use tc2html with
input intended for a given macro package, you need to write a troffcvt
action file that redefines the structure-related macros to produce produce
\html output lines that tc2html can recognize.  Once this is done, though,
it should be able to do pretty well for most documents formatted using
that macro package.

- Added "flush" action to troffcvt.  It's like "break" but doesn't write
any \break, i.e., it just flushes any pending output if there is any.
This allows you to guarantee that the next stuff written will be on a new
line (e.g., if you write a \pass xxx action to write xxx to the output
literally).

16 Jan 97

- Fixed crashing bug if macro argument \$0 occurred.  Arguments are
supposed to be \$1 .. \$9, but I had an off-by-one error on the bounds
check, which was triggered by some groff macros which use \$0 to mean
the macro name.  Boom.  Probably should at some point just implement
\$0 to do with groff does.

- troff input files can refer to \$* and \$* in a macro to refer to all
the macro arguments concatenated and space-separated.  \$@ additionally
puts double quotes around each argument.

- Actions can now refer to $* and $@, which produce a string consisting
of all request arguments concatenated and space-separated.  $@ additionally
puts double quotes around each argument.

- Fixed following bug:
   When a request is processed, the arguments are parsed and put
   in an array.  If the request's post-parsing action list includes
   a push-string action and the string pushed contains a request,
   processing the request replaces the argument array with the
   new arguments.  Any further argument references in actions
   for the original request then refer to the most recently seen
   arguments!
The fix is to save the current argument information before processing
a request, and restore it afterward.  See parse.c/ProcessRequest().

18 Jan 97

- Allow \$0 inside macros to refer to the macro name, a la groff.

- Implement the groff .mso request.  This is done using the new troffcvt
action push-macro-file, which is like push-file, except that troffcvt
looks for the filename in the same places it looks for a macro file.  Note
that this will not be *quite* the same as in groff, because if a file
of the desired name is found in the troffcvt library directory before
it's found elsewhere, it will be used.

- doc/actions.ms says that the argument array passed to action procedures
has a NULL pointer at the end.  In fact, no NULL pointer has ever been
added.  Fixed now.

- troffcvt/parse.c no longer keeps a separate buffer for the request name.
Instead it just parses the name into the rargv[] array like all the other
arguments.

- troffcvt now allows 99 macro arguments rather than just 9.  Along with
this, you can refer to macro arguments using \$(nn or \$[nnn], not just \$n.

20 Jan 97

- I just discovered that both troff and groff do the following.  If you
define a macro xx, and then refer to it like a string using \*(xx, the
macro gets executed.  I guess this is because macros and strings share
the same namespace.  Still, it seems weird to me.  Nevertheless, both
troff and groff seem to do this.  So troffcvt does it now, too.  This makes
troffcvt handle the groff -man package a lot better because groff's tmac.an
deliberately uses this trick.  [see also 16 Mar 97 entry]

- Implement groff ".shift" request for troffcvt.  New action shift-args
is used for this.

- Implement groff ".do" request for troffcvt.  New action process-do is used
for this.

- Fixed bug where a macro's arguments weren't accessible unless the macro
was the current input source.  For instance, if a file was .so'ed from within
the macro and the file referenced \$1, the macro's first argument wasn't being
seen.

23 Jan 97

- Started working on implementing aliases such as groff has (for the .aln
and .als requests).  This will involve some changes to the data structures
used for requests, macros, strings, and registers.  In particular, the
underlying structure for macros and registers has a pointer back to the
structure holding the name.  This won't work because with aliases, multiple
names will be able to point to the same underlying structure.  (And that
structure can't point back to them all.)  The reason for these backpointers
is so that the name associated with a structure can be obtained, so the
code has to be reworked to allow the name to be gotten differently.

- Fixed memory leak related to deferred removal of macros that got redefined
while they were executing.  (Had the code in there to handle this case, but
it didn't work!)

24 Jan 97

- Eliminated the -tgroff command line option; the groff extensions are now
the default.

- Fixed memory leak with .rn xx yy -- if yy already existed, it wasn't being
removed before renaming xx to yy.  This also had the problem that if you
then removed the new yy, the old yy was still in the namelist and could
reappear!

- Finished implementing the .aln and .als requests, using the alias-register
and alias-macro actions (the latter also applies to request and string
names).

28 Jan 97

- Turns out I hadn't implemented aliases correctly.  In groff, if you
redefine a macro (string, etc.), any aliases are *also* redefined.  Fixed
this.

- Wrote a script "runtest" (built in the troffcvt directory, run in the
troffcvt/tests directory) that'll run troffcvt with a given input file
and compare it to the expected result.  The input and results file must
both be in the tests directory, named xxx and xxx.result, for some xxx.
This is useful for regression testing when I change code that affects
something I know used to work and makes it easier to find bugs.

30 Jan 97

- Added table-of-contents stuff to tc2html, so that you can have a
clickable TOC at the top of the document which links to all the
sections in the document.

04 Feb 97

- Fixed crashing bug which could occur if a request was removed by
its own action list.  To prevent this from occurring, I now increment
the use count on the request object while the action lists are
being executed, and release the use afterward.  (Similar to the
mechanism that prevents crashes of a macro that happens to remove
or redefine itself as it executes.)

05 Feb 97

- Started working on tblcvt, a tbl preprocessor that has much the same
goal as troffcvt: to convert one form of input to output that's easier
to parse.

- Simplified the implementation of strings and macros by not maintaining
a separate "String" type.  Now a string is just a macro without arguments.
(Internally, both strings and macros were simply a source of input.
Furthermore, troff allows .am to a string name and .as to a macro name,
which implies it's treating them similarly internally.)  Anyway, not
having a separate string type eliminates a certain amount of code.

07 Feb 97

- Junked the parse-removelist parsing action (used for .rm and .rr).  I
never liked that this not only parsed the actions, but did something
with them (doing something with them should be handled by the
post-parsing actions.  Replaced parse-removelist with a new action
parse-names (like parse-name, but gets multiple names), and call a
new action remove-names in the port-parsing actions.  (I use parse-names
rather than parse-macro-args because parse-macro-args strips quotes.)

09 Feb 97

- The noescape action was defined in troffcvt/action.c as taking one
argument when it really takes none.  Fixed.

12 Feb 97

- Implement named environments (a la groff) by considering *all*
environments to be named rather than numbers.  Compatibility with
number-only environments is achieved by creating an initial default set
of environments named "0", "1", and "2".

13 Feb 97

- Implement another quoting mode such that a quote in a macro
argument doesn't get subjected to further quote stripping if the
macro passes the argument to another macro.  This is done by turning
these quotes into a special quote character not used anywhere else.
The regular quote-stripping mechanism is still used in compatibility
mode.  [see also 14 Mar 97 entry]

- Transliterations have been limited to transliterating an ASCII character
to another ASCII character.  Eased this limitation slightly so that the
destination character can be anything.  Probably should allow the source
character to be anything as well, but then it's harder to use a simple
array lookup to do the transliteration.

17 Feb 97

- Added -l command line option to troffcvt.  This causes it to print
controls to the output that look like:
	\line file number
to give an indication of the current input file and number.  This helps
for debugging, to figure out what output is resulting from which input
line.

01 Mar 97

- tblcvt works reasonably well now.  Now need to add table-specific controls
to troffcvt and get the postprocessors to do something with them.

- Changed symbols like begin-setup, end-setup, BeginSetup, EndSetup to
setup-begin, setup-end, SetupBegin, SetupEnd.  This change has no functional
significance, it just makes names group better in lists that are organized
alphabetically.

06 Mar 97

- Fixed subtle bug in parse.c where skipping a failed multi-line condition
wouldn't properly detect the closing \} if the line was the last in the
input but didn't end with a newline.  Sheesh.

07 Mar 97

- Modified troffcvt's name lookup mechanism.  Instead of a single list with
all the names on it, have an array of lists, and index into the array using
the name's hash value to select one of the lists.

11 Mar 97

- Corrected failure of troffcvt reader code to recognize \noconstant-width.

13 Mar 97

- Started working on support for the -mdoc macro package.  The
first test (formatting the mdoc manual page itself, using the macros
themselves with no redefinitions) turned out pretty awful -- lots of
\A tests were being written literally to the output.  That's because
I never implemented \A.  After adding code to handle \A, the man page
turned out fairly well.  It could still use some work, much of which I
hope can be done with a tc.mdoc redefinition file.

14 Mar 97

- Oops!  Now I tried formatting the mdoc.samples manual page and it
breaks big time.  Lots of the \A'xx' tests occur in macros and test an
argument using \A'\\$n', where \$n has a quote in it (like "that's").
This causes the delimiter scan to terminated early, spilling text to
the output that should be part of the test.  Okay, to fix this, the
parsing routines need to pay attention to the input level, such that
routines that looks for closing delimiters don't quit parsing until
encounting a delimiter at the same input level as the opening
delimiter.  This is similar to what groff does.  To preserve
compatibility with standard troff, the input level is ignored in
compatibility mode.  This change affects such stuff as \A'xx', \w'xx',
.if 'x'y', and .tl 'left'center'right.  Turns out the same mechanism
can also be used with opening and closing quotes in macro argument
parsing, so the ugly special quote character hack (see 13 Feb 97) can
be junked.

- Modify input character pushback mechanism to record the input level
of pushed back characters, to prevent them from being returned into
the wrong input level should a level change occur after a character is
pushed back but before the next character is read.

16 Mar 97

- Implemented groff's property that when a macro interpolates another
macro as a string (\*x, \*(xx, \*[xxx]), the outer macro's arguments
are not hidden from the inner macro.  This required splitting out
argument information from the MacSrc structure into a separate structure
and maintaining a use count on the argument structure.

- Wrote manual page for unroff.

17 Mar 97

- Changed options for tc2null, tc2text, tc2rtf.  This helps make most
options for troffcvt lowercase and options for postprocessors uppercase,
which helps when writing front ends that execute both troffcvt and a
postprocessor, by reducing option space overlap.

tc2null changes:
	echo input tokens:
	old	-e
	new	-E

tc2rtf changes:
	debugging output:
	old	-d
	new	-D
	echo input tokens:
	old	-e
	new	-E
	character set:
	old	-cs charset
	new	-S charset

tc2text changes:
	echo input tokens:
	old	-e
	new	-E
	join output lines:
	old	-join
	new	-J
	split output lines:
	old	-split nnn
	new	-S nnn

28 Mar 97

- Renamed config/mklinuxppc.p-cf to config/linux-pmac.p-cf per similar
naming change in WRPRC 2.10 config file distribution.

09 Apr 97

- Added support for groff's ".if d", ".if r", and ".if c" constructs.
The ".if c" construct is a little tricky: the input routines create
at a very low level any special char they see that doesn't exist.
This makes any special character always appear to exist if you test
whether it has a code.  But the value given to such characters is
empty, so the test is made based on an empty or non-empty value.

- tc2html now does the following with the <A HREF=xxx> construct:
instead of writing it to the output immediately, it hangs onto it
and "floats" it forward in the document until it encounters a
non-whitespace character.  Then it writes the anchor followed by
the character.  This avoids the problem where an anchor is started
on one line, but the text surrounded by the anchor beginning and
end is on the next line and is part of a display.  Since the text
is typically indented in a display, the leading space was part of
the link and was being underlined as well, which is ugly.  Now the
anchor beginning floats past the spaces.

18 Apr 97

- Moved the troffcvt-specific macros, variables, and rules for
formatting documents with troff2html, troff2rtf, and unroff into the
WRPRC2 configuration files.  This means the distribution *requires*
at least WRPRC-2.10 of that distribution.

06 May 97

- tc2text actually pays a little attention to the indent and temp
indent now.

09 May 97

- Fixed ugly (subtle) bug in troffcvt with writing /indent and /temp-indent.
Normally, troffcvt tries to avoid writing out param settings if the value
hasn't really changed.  The indent was one of these params.  But it really
has to be written out each time.  Consider the following:
	.in .5i
	.ti 1i
	a
	.ti 1i
	.in .5i
	b
This was generating the following output:
	\indent 216
	\temp-indent 432
	a
	\break
	\temp-indent 432
	b
	\break
No \indent was written after the second \temp-indent, because the .in value
didn't change.  But this is wrong, because .in overrides a preceding .ti
and the \indent should be written, like this:
	\indent 216
	\temp-indent 432
	a
	\break
	\temp-indent 432
	\indent 216
	b
	\break
This was fixed by forcing out an \indent on every indent change.  The
output gets a bit more verbose, but it's correct.

- Fixed a temp indent bug where the \temp-indent argument was being
allowed to go negative rather than being clipped to zero.

- Began making tc2text a bit smarter:
  - Pays attention to line length
  - Uses a buffer to assemble the output line.  (Before it was just
    writing characters as soon as it saw them.)  This allows better
    line wrapping (breaking a line before the word that crosses the
    output line length rather than after).  It also allows centering
    to be done (since the entire line is assembled before writing it
    out, it's known how long it is and therefore how much indenting
    is needed.
  - Tabs are expanded.  (Treats all tabs as left-justified, though.)
  - Handles tables a little bit, though badly (especially for cells
    with multiple-line contents).

11 May 97

- Removed -S option from tc2text (and unroff) since tc2text now pays
attention to line length.

13 May 97

- Improved tc2rtf's handling of tables.  The table output isn't great
but at least it no longer instantly crashes Word. :-)

16 May 97

- Changed internal names of some special characters (names written by
troffcvt using @name).  I decided to use PostScript names whenever
possible (PostScript is a preexisting standard that includes most names
I need, so by using it I don't need to make up as many names myself).
This means names like @em-dash become @emdash, etc.  Changes-1.04 lists
the changes.

- Changed oslash sequence from o/ to /o, which matches groff.

- Added special-character sequences to the troffcvt actions file for
those characters recognized by groff that weren't already in the file.
This will help provide the basis for ISO Latin-1 (ISO 8859-1) support,
since lots of Latin-1 characters are specified using special-character
sequences of the form \(xx.

18 May 97

- Removed the restriction on 8-bit input characters.  This was done by
starting special-character codes at 512 rather than 256, and by using
an escape-code range of 256-511 rather than 128-255, which frees up
the range from 128-255 for another purpose - that purpose being to
allow 8-bit characters.  This shouldn't yet be considered as real
"support" for 8-bit input, since all it means is that troffcvt doesn't
filter them out.  Postprocessors don't do anything special with such
characters.

21 May 97

- Removed the UC (university-crest) special character.  That's the kind
of thing that should be locally added on a per-site basis.

- Improved handling of tables by tc2text a little.

- Added -8 option to tc2text and unroff for specifying that 8-bit
characters should be allowed in the output.  -8 turns on reading of
text-8-specials after reading text-specials.  The text-8-specials file
lists the translations for 8-bit Latin-1 character names.

- Wrote list-specials and chk-specials scripts (in misc directory)
for generating a troffable list of all special characters and
for checking which special characters are listed and unlisted in
postprocessor special-character translations tables.

22 May 97

- Removed the @leader-pad special character.  There is no such thing.

- I had @emdash listed as a builtin special character in some places.
It's not.

23 May 97

- The distribution builds under NetBSD 1.2.1 (mac68k) now.
