home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
editor
/
stevie
/
porting.doc
< prev
next >
Wrap
Text File
|
1994-01-31
|
2KB
|
69 lines
Release Notes for STEVIE - Version 3.68
Atari ST Editor for VI Enthusiasts
Porting
Tony Andrews
8/6/88
Porting the editor is a relatively simple task. Most of the
code is pretty machine-independent. For each environment, there is
a file of routines that perform various low-level operations that
tend to vary a lot from one machine to another. Another file contains
the escape sequences to be used for each machine.
The machine-dependent files currently used are:
tos.c: Atari ST running TOS
unix.c: UNIX System V or BSD
os2.c: Microsoft OS/2
dos.c: MS DOS 3.3
minix.c: Minix on the Atari ST
Each of these files are around 250 lines long and deal with
low-level issues like character I/O to the terminal, terminal
initialization, signal handling (if supported), cursor addressing, and
so on. There are different tradeoffs to be made depending on the
environment. For example, the UNIX and Minix versions buffer terminal
output because of the relatively high overhead of system calls. A quick
look at the files will make it clear what needs to be done in a new
environment.
The file "env.h" contains macro definitions to customize the
editor for your particular environment. The macros there select the
machine/os, enable various optional features, etc.
One of the options in env.h is whether to use the termcap
routines or hard-wired escape sequences. The hard-wired sequences,
if used, are defined in term.h. The file term.c contains code to access
the termcap database, if enabled. Termcap is only supported by some of
the system-dependent files (unix.c and minix.c) but can be added easily
to others, if needed.
The basic process for doing a new port is:
1. Come up with a macro name to use when ifdef'ing your system-
specific changes. Add a line to 'env.h' to define the macro
name you've chosen.
2. Look at the system-dependent files and copy the one that comes
closest to working on your system. Then modify your new file
as needed.
3. Look at term.h and edit the file appropriately adding a new
set of escape sequence definitions for your system.
4. Compile and debug the editor.
In most cases it should really be that simple. Other ports have
been done for which I don't have the code, including the Amiga, and a
Data General machine of some kind (in Australia).