UnInEvHk EVENT HOOK UNINSTALLER v.4.00
**************************************

I) Purpose

1) What's it?
This is an updated version of the UnInEvHk program included with many
event hook TSRs, such as my own: AutoClBr, Auto Alpha-Lock Off and XtraKeys.
This version will be included with future versions of those programs.

2) Purpose
This program uninstalls any installed event hook as long as it is compatible
with AutoClBr's event hook convention (see file "evhkconv.txt").

3) Use
a) If there are no event hooks installed:
UnInEvHk will just report an error message.
b) If the latest installed event hook is incompatible:
UnInEvHk will just report an error message. You won't be able to uninstall
event hooks installed before. Most incompatible event hooks (including
DoorsOS and TeOS) disable all previous event hooks without uninstalling them
correctly. UnInEvHk CANNOT locate them, so the memory leaks stay there.
SO: ALWAYS INSTALL INCOMPATIBLE EVENT HOOKS BEFORE COMPATIBLE ONES.
c) If the latest installed event hook is compatible:
UnInEvHk will give you the option to select which event hook to uninstall.
Note that if you have installed an incompatible event hook, only event hooks
installed AFTER the incompatible one can be uninstalled. You won't be able to
uninstall event hooks installed before. Most incompatible event hooks
(including DoorsOS and TeOS) disable all previous event hooks without
uninstalling them correctly. UnInEvHk CANNOT locate them, so the memory leaks
stay there.
SO: ALWAYS INSTALL INCOMPATIBLE EVENT HOOKS BEFORE COMPATIBLE ONES.
d) If the latest event hook is compatible, but there is not enough memory to
   display the menu or if there are more than 4094 event hooks installed
   (unrealistic situations):
UnInEvHk will just uninstall the latest event hook.

4) For developers:
See the section V, especially V.ii, for details about how to distribute this
uninstaller together with your programs.

II) History

Current version:
v.4.00: * Reverted additions to support version 2.00 of evhkconv.txt.
        * Added support for hardware version 3 (TI-89 Titanium).
        * Updated evhkconv.txt to document version 3.00 which reflects these
          changes.
        * Fixed a double-free bug in the memory-saving uninstallation method,
          which made it crash when the last installed hook was incompatible.

Previous versions:
v.3.00: * Fixed a serious bug in the memory-saving uninstallation method. (It
          was not working at all.)
        * Added support for version 2.00 of evhkconv.txt.
v.2.02: * This version fixes a small memory leak bug (42 bytes) which only
          occured when running UnInEvHk without any compatible event hooks
          installed. Thanks to Greg Dietsche for reporting that bug.
        * Updated evhkconv.txt to document version 1.01.
v.2.01: This version fixes an annoying memory leak bug.
        I'm sorry if it caused any problems. You will have to reset the
        calculator if you want to get those bytes of RAM back. Sorry!
v.2.00: This version was the first public release as a separate program.
        It adds the option to select an event hook to uninstall.
v.1.00: This version was the first public release, included with some
        programs.

III) How UnInEvHk works

First, you should understand my event hook conventions (see evhkconv.txt).

My program checks EV_hook. It checks if any event hook is installed and if it
is compatible. If it is, it adds it to the list of event hooks to uninstall
and repeats the process with the "old event hook" placeholder instead of
EV_hook.
Afterwards, a simple popup menu (using the popup menu ROM calls of the AMS)
is drawn.
When a program to uninstall is chosen, the same iterative process is done,
but the number of times it is repeated is a fixed one, in order to locate the
specific event handler. Afterwards, it is uninstalled according to my
convention: the "old event hook" placeholder of the previous event in the
chained list, or EV_hook if it is the first one, is set to the value of the
"old event hook" placeholder in the event hook to uninstall, then the handle
is erased.

IV) Bugs

There are currently NO known bugs.
If you have to report a bug to me, see section VII. PLEASE report any bugs
you find, or else I cannot correct them.

V) License

In addition to the following license:

(i)
-----------------------------------------------------------------------------

Kevin Kofler's TI-89 Program License
====================================

This license applies to all TI-89 programs by Kevin Kofler, unless otherwise
stated. Note that CHEMISLV is NOT an exception since the following is a
generalized copy of the CHEMISLV-License (readme point 8).

a.I CAN'T BE HELD RESPONSIBLE FOR ANYTHING! NO WARRANTY!
b.YOU CAN'T SELL MY PROGRAM OR CLAIM IT IS YOURS!
c.IF YOU TRANSMIT ONLY PARTS OF THIS PROGRAM, YOU MUST SAY THAT IT'S A PART
  OF THE (package name) PACKAGE AND ONLY A PART!
d.NORMAL RIGHT APPLIES TO THE THINGS I'VE FORGOTTEN!

-----------------------------------------------------------------------------

(ii) I am granting you permission to freely redistribute the UnInEvHk package
     as long as:

* the source and all 3 executables (TI-89, TI-92+ and Voyage 200) are kept
  together. Please also include this file (You should rename it to
  "uninevhk.txt".) or a link where to get the whole package:
  http://members.chello.at/gerhard.kofler/kevin/ti89prog/
* it is LEFT UNMODIFIED.
* applicable credit is given in the program's documentation.
* it is NOT distributed together with ILLEGAL programs.

Ask me for permission if you are not sure about one of these license
requirements.
Please DO NOT distribute modified versions of UnInEvHk without my permission.

VI) Credits

Thanks to:
* The TIGCC Team (http://tigcc.ticalc.org) for TIGCC. Especially:
  - Zeljko Juric for documenting some important operating system functions
  - Sebastian Reichelt for the TIGCC IDE (integrated developer environment),
    which was used for this program
* Rusty Wagner for the Virtual TI emulator
* Brian Anderson, Charlie Gibbs and David Ellsworth for the A68K assembler

VII) Contact me

Homepage: http://members.chello.at/gerhard.kofler/kevin/ or
          http://kevinkofler.cjb.net
E-Mail: kevin.kofler@chello.at or Kevin@tigcc.ticalc.org