home *** CD-ROM | disk | FTP | other *** search
-
- tde, the Thomson-Davis Editor
- Version 1.2
- 10-5-91
- Frank Davis
-
-
- Author:
-
- program name: tde, the Thomson-Davis Editor
- version 1.2
-
- author: Frank Davis
- fmd@tifton.bitnet
-
- home address: 102 Starr Street
- Tifton, Georgia 31794
- USA
-
- work address: U.S Dept. of Agriculture
- P.O. Box 946
- Tifton, Georgia 31793
- USA
-
-
- Based on an editor by: Douglas Thomson
- c/- Computing
- M.U.C.G.
- Switchback Road
- Churchill
- Victoria 3842
- AUSTRALIA
- doug@giaea.oz
-
- Contributions by:
-
- Tom Waters, twaters@nswc-wo.navy.mil
-
-
-
- File descriptions:
-
- TDE.EXE tde executable for IBM PC or compatible
- TDE.DOC tde user's manual
-
- TDECFG.EXE utility to customize color and keys in tde.exe
- TDECFG.DOC tdecfg user's manual
- SAMPLE.HLP sample file for redefining help screen
-
- READ_ME.TDE this file (you're reading it now)
- CHANGES.TDE log of changes, inconvenience adjustments, additions
-
-
- All source for tde editor, not needed unless you want to modify tde.
-
- SIMUL101.ASM utility to simulate 101 scan codes on 83/84 key keyboards
- BLOCK.C line and box block functions
- ED.C basic editor functions
- FINDREP.C Boyer-Moore search routines
- HWIND.C initialization and display routines
- MAIN.C main function and hardware routines
- TDEASM.C pointer/string/display assembly routines
- UTILS.C misc editor functions
- WINDOW.C window routines
- COMMON.H external global variable declarations
- DEFAULT.H default function key assignments
- DEFINE.H editor function defs
- GLOBAL.H initial global variable declarations
- HELP.H intro and help screen
- TDEFUNC.H prototypes of all functions
- TDESTR.H defs for all structures and defines
- VERSION.H tde version number
- TDE.NMK MSC 6.0a make (nmake) file
- TDE.QMK QuickC 2.5 make (nmake) file
-
-
- All source for configuration utility, not needed unless you want to modify.
-
- TDECFG.C main programs for configuration
- TDECOLOR.C color utility routines
- TDEHELP.C redefine the help screen
- TDEKEYS.C key redefinition routines
- TDECFG.H global structures and prototypes for tdecfg
- TDECOLOR.H defines for color utility
- TDEHELP.H defines for rewriting help screen
- TDEKEYS.H structures for all available keys and functions
- TDECFG.NMK MSC 6.0a make (nmake) file
- TDECFG.QMK QuickC 2.5 make (nmake) file
-
-
- Disclaimer:
-
- This program is provided "as is" without warranty of any kind, either expressed
- or implied, including, but not limited to the fitness for a particular purpose.
- You assume all risk for the use, inability to use, misuse, or abuse of this
- program. In any event, you (and not Frank Davis) assume the entire cost of loss
- of use; loss of information; loss of savings; loss of business profits, business
- interruption; mental anguish, mental distress; all direct, consequential, or
- incidental damages or losses; all necessary servicing, repair, or correction;
- and all physical and mental health problems, acute or chronic, caused by direct
- or indirect use of this program by you or any of your relatives, friends,
- acquaintances, co-workers, or otherwise fellow man either known or unknown
- by you.
-
- Your use of this software constitutes agreement with and notice of
- acknowledgement of the above heretofore stated warranty and limitations. In
- addition with your agreement, you henceforth and forever relinquish, waive, and
- forfeit all claims, rights, rulings, or judgements against the forementioned
- author of said software; however, you retain the right to keep your first born.
- If you decide that it is in your best interest to waive your right to your
- first born child, the author is in no way obligated to accept or support the
- offspring, regardless of age, marital or employment status of said offspring.
-
-
- Claimer:
-
- I use this program all-day-every-day on all of my FORTRAN, C, and assembly
- source code at home and at work, Frank Davis.
-
-
- Licensing:
-
- This program is released into the public domain. You may use and distribute it
- freely. There is no copyright, no fee for use, no licensing, no registration,
- no legal bull, no nothing. This editor is not user supported, corporate
- sponsored, or government subsidized - it is sustained and maintained solely
- by Frank Davis. This editor was written for use not only as a simple text
- editor but also as a learning tool. Examine the code and discover the basics
- of editor construction. Experiment a little and add your favorite functions or
- modify the existing functions to suit your needs/requirements/tastes/etc. If
- anyone includes tde with their own software, please use common courtesy and
- give Douglas Thomson and Frank Davis credit for their work (that's the only
- payment I ask). If you release any changes or additions to the tde editor,
- please observe the original spirit of Douglas Thomson's dte 5.1 and release
- the changes as public domain software.
-
-
- Distribution Sites:
-
- You will always be able to find the latest version of tde in the Simtel 20
- archives in the PD1:<MSDOS.EDITOR> directory or in Library 16 of the Utilforum
- in PC MagNet on CompuServe. I do not upload tde to any other file archive.
-
- Standard SIMTEL20 download Info
-
- "If you are unable to access SIMTEL20 or mirror site wuarchive.wustl.edu
- via FTP or through one of the BITNET/EARN file servers, most SIMTEL20
- MSDOS files, including the PC-Blue collection, are available for
- downloading on the Detroit Download Central network at 313-885-3956.
- DDC has multiple lines which support 300/1200/2400/9600/14400 bps
- (103/212/V22bis/HST/V32bis/V42bis/MNP). This is a subscription system
- with an average hourly cost of 17 cents. It is also accessible on
- Telenet via PC Pursuit and on Tymnet via StarLink outdial. New files
- uploaded to SIMTEL20 are usually available on DDC within 24 hours."
-
-
- Background:
-
- At work, I have written several editors that may only be used for a certain
- type of file (almost an expert system). I have always wanted to write a
- general purpose public domain text editor. It seems none of the existing
- public domain or shareware editors have all of the features I like. My wish
- list of features are:
-
- Blocks:
- Line and box blocks.
- Move, delete, copy, kopy, overlay, and fill block options.
- Block actions within or between files.
-
- Files:
- Multiple files limited only by memory.
-
- Windows:
- Multiple windows limited only by memory.
- Split screen horizontally (don't use vertical screens very often).
- Changes to text in one window are updated in all windows of same file.
- Interactively resize windows.
- Two windows of same size so two files can be easily compared.
-
- Search/Replace:
- Ignore or Match case of pattern.
- Prompt or no prompt replace.
- Boyer-Moore pattern matching algorithm.
-
- Other:
- Split/join line.
- Lines as long a 255 characters.
- Paren balance.
- Support for functions keys.
- Mode/information line.
-
-
- Douglas Thomson's editor, dte 5.1:
-
- Well, I found a public domain editor that had most of the features on my wish
- list. The original code was extremely well documented. That editor was
- dte 5.1, written by Douglas Thomson, Gippsland, Victoria, Australia. So
- instead of writing an editor from scratch, I based my editor around Doug's
- well designed and documented program. My editor was written using dte 5.1
- as an outline. Doug, thanks a lot for releasing the source code for your
- editor.
-
- dte 5.1 is pretty much machine independent. It runs on PC's, HP 3000's, and
- generic Unix system V release 2 systems. It was designed to work well over
- slow communication lines, eg 1200 baud. Screen updates are kept to a minimum
- which saves time and money when using dial-up phone lines. dte 5.1 uses the
- WordStar/Turbo x style key definitions. If you need an editor for use over
- slow communication terminals, check out Doug's editor.
-
-
- tde, the Thomson-Davis Editor:
-
- My dream editor was to be written specifically for PC's. At work, we have
- an IBM mainframe. The only reason I use the mainframe is for e-mail and for
- backup of my PC files (I have exaggerated a little). I use my PC editors to
- compose my mail then upload to the mainframe to send it. So, I really don't
- need or desire a machine independent editor. Although I have IBM OS/2 1.3 on
- my machine at work, I don't use OS/2 enough to justify writing a bound version.
- (To make a program run under both IBM/MS DOS and OS/2, you have to bind it and
- refrain from doing neat BIOS and hardware tricks.)
-
- Another of my design considerations was the machine-compiler-memory model
- factor. At work I use a 16 Mhz 386 machine with Microsoft C 6.0a and at
- home I use a 8 Mhz 286 machine with Microsoft QuickC 2.51 w/ QuickAssembler.
- I wanted the editor to work fast on the slow machine, so I wrote some of the
- often used string functions in assembly. To edit files larger than 64k, you
- just about have to use the huge memory model; however, QuickC cannot debug
- programs compiled with the huge option. Additionally, programs compiled using
- the huge model run a lot slower because of all the compiler generated pointer
- arithmetic. I wrote some functions in assembly that allow my editor to be
- compiled with either the small, compact, or large memory model. Now, I can run
- and debug the program at work or at home. All of those assembly routines that
- support huge pointer arithmetic are original. If you're into assembly, check
- out the tdeasm.c module for some good assembly tips on manually manipulating
- far pointers.
-
- I also wanted the ability to edit the files produced by our water quality model.
- Null characters, or '\0', are allowed as part of the normal text in those files.
- Since DOS uses ^Z to mark the end of files (in text mode), I decided to use ^Z
- to mark the end of strings. Any character, except ^Z, is allowed in the text
- file. Consequently, the standard C string library functions will not work when
- doing operations on text in the file (can't rely on library functions to handle
- '\0' properly). The assembly language routines in tdeasm.c take care of the ^Z
- terminated strings.
-
- I modified almost all of the algorithms in the original dte 5.1 editor and added
- several more. The block and find/replace algorithms are completely rewritten.
- Block operations use either line or box blocks instead of stream blocks.
- Available block operations include move, delete, copy, kopy, fill, overlay,
- block expand tabs, block print, block write to file (some of these functions
- were available for stream blocks in the original dte 5.1). Block operations are
- allowed within or between files. The "brute force" text find algorithm was
- replaced by the Boyer-Moore string matching algorithm, a very fast text search
- algorithm. The text display algorithms were rewritten. Window operations were
- rewritten, enhanced, and streamlined. Support for lines as long as 255 charact-
- ers was added. Horizontal scrolling/paging are allowed. A mode/information
- lite bar was added to display the various modes at the bottom of the screen.
- Displayed in the lite bar are: number of open files and total number of
- windows, available memory for editing the current file or additional files, and
- the editor mode flags. Displayed with the file name are: the total number of
- lines in the file (size) and the current line number and column number of the
- cursor. The join line, split line, and dup line functions were added. Any
- ASCII or Extended ASCII character, except control z, can be entered into the
- text file by using the ALT-xxx method. Several often used string routines were
- rewritten in assembly and optimized for 16 bit processors, which makes cursor
- movement very fast through any size file. One function that I sorely missed,
- a simple undo function, was added. A configuration utility was written to
- allow the user to customize all colors and the 184 recognized function keys.
- And last, an instant help screen with key definitions was added.
-
-
- Programming Notes:
-
- This program makes extensive use of multi-segment pointers. The assembly
- routines in tdeasm.c were written to avoid a LOT of pointer arithmetic
- generated by the compiler. If you do decide to modify tde, keep in mind that
- you are responsible for pointer integrity. That is, functions that use
- pointers to access text forwards through the file need to check those pointers
- to make sure they don't "wrap" around a segment. Same goes for accessing text
- backwards through the file. The functions responsible for pointer integrity
- are cpf (check pointer forwards) and cpb (check pointer backwards). Also, you
- can't reliably add large numbers to pointers in the compact and large memory
- model. The small, compact, and large memory models were not designed for use
- with multisegment (huge) pointers (you may always explicitly declare and use
- huge pointers in those models, though). Use the function addltop (add long to
- pointer) to handle adding large numbers to pointers.
-
- The 101 key keyboard simulation utility requires an assembler to produce object
- code. If you don't have access to an assembler, you may comment out the calls
- to function simulate_enh_kbd( ) in main.c. tde will still take advantage of
- the 101 enhanced keyboard, but will not be able to use the simulated 101 keys
- on older 83/84 keyboard systems.
-
-
- Bug reports:
-
- There are no bugs in tde, only features that may inconvenience you. ;*)
- Please send inconvenience reports via e-mail, if at all possible, to
- fmd@tifton.bitnet. For y'all over there on Compuserve, my e-mail address is
- ">INTERNET:FMD%TIFTON.BITNET@CUNYVM.CUNY.EDU" (don't type the quotes, just
- everything between them). I'll try to respond as quickly as possible to reports
- received via e-mail.
-
-
- About the author of tde, Frank Davis:
-
- Frank "yank" Davis, who has an impressive collection of inflatable bed bunnies,
- received a BS in Information and Computer Science from Georgia Tech in 1983. He
- can be found drinking massive quantities of beer in his underwear (boxer shorts)
- on his couch while watching college football and Atlanta Braves baseball on his
- 19 inch color TV. Hobbies include: sex, drugs, and rock 'n' roll.
-
- This program is another quality product from Yank Software, "Software you just
- can't beat".