Maximus Squish base date fixer, v0.3
Copyright (c) 2000 William McBrine
Distributed under the GNU General Public License

This program corrects the ASCII date field in Squish message bases, acting
only on those areas whose echotags are listed in the file passed to it on
the command line, and only on those messages which originated locally. It
rewrites the ASCII date based on the binary date_written field.


Purpose
=======

I wrote this to compensate for bugs in the Blue Wave offline mail door,
which 1) stamps a year of "100" into this field when posting replies,
preventing Squish from exporting the message; and 2) when downloading,
puts "100" into the date field in BW packets if the message's ASCII date
field is blank, as normally occurs with messages posted through Maxmius
online or via the built-in QWK. This program solves both problems (though
#1 better than #2). It should be run immediately after a Blue Wave upload.

Note that if you're experiencing crashes or lockups within the Blue Wave
door itself, this program probably won't help you.


Usage
=====

Two precompiled executables are included:

 echofixd.exe   16-bit MS-DOS version
 echofix2.exe   32-bit OS/2 version -- requires EMX DLLs

Or you can compile your own (see below). You would run this as:

 echofix echotoss.log

in the directory where your MAREA.DAT file is; where "echofix" is whatever
name you give the program (it doesn't matter), and "echotoss.log" is the
text file -- possibly with that name, but it could be anything -- that
lists the echotags of the areas to be processed, one per line.

Example: Bob Juge wraps the Blue Wave door with this batch file:

 @echo off
 c:
 cd \max\bwave
 bwmail2 %1 %2 %3 %4 %5 %6 %7 %8 %9
 cd \max
 echofix echotoss.log


Deficiences
===========

- No file locking is done. See "Compiling" below for more on this.

- Only Squish conferences are processed; *.MSG areas are ignored.
  Hopefully I'll change that in the future. :-)


Compiling
=========

This is (I hope) pure ANSI C, and not dependent on any non-standard
external libraries. The supplied executables were compiled with the
following compilers and command lines:

 echofixd.exe:  Turbo C 2.0     tcc echofix.c
 echofix2.exe:  EMX 0.9d        gcc echofix.c -Zcrtdll -lwrap

A note on file locking is in order here. When running, Maximus evidently
keeps some conference files open, though not actually locked, at all
times. In a multinode system, this can present problems for programs which
try to gain exclusive access to the files. In the source code of this
program, I have made no attempt to deal with locking and sharing issues,
relying only on standard ANSI file handling; but it behaves differently
depending on the compiler. Bob Juge compiled it with the IBM C++ compiler
for OS/2, and that version refuses to open a file that's open in another
process. The EMX version supplied here doesn't have that problem. The
included DOS executable, when run in the same OS/2 environment, has a more
severe problem: it not only refuses to open the file, but also causes a
dialog box to pop up.

I originally wrote this to use the strftime() function, but I added a
non-strftime() version of the code in order to get it to compile with my
antiquated copy of Turbo C. It shouldn't make much difference which you
use (there are tradeoffs, but they're minor).


History
=======

I first wrote a program that just fixed a single .SQD file that was passed
to it on the command line, and posted that to the BLUEWAVE echo. Call that
version 0.0. :-)

Version 0.1, sent only to Bob Juge and created at his urging, added
parsing of ECHOTOSS.LOG and MAREA.DAT, so that only the areas with new
messages had to be processes. The slight downside is that this made the
program Maximus-specific, instead of just Squish-base-specific.

Version 0.2 adds a counter of the messages updated, and documentation, :-)
and reduces the number of disk writes by comparing the new date string
against the old (suggested by Tulipant Gergely). This is the first actual
release.

Version 0.3 fixes a very stupid bug in 0.2 that prevented it from working
at all. :-( It came about when I added the string comparison. Sorry!


Where to reach me
=================

 Internet: wmcbrine@clark.net
 US Mail:  William McBrine
           8128 Fenwick Ct.
           Laurel, MD 20707-5615

New versions, if any, will be available at:

 ftp://ftp.clark.net/pub/wmcbrine/bbs/maximus/
