OpenBSD ed(1) for DOS
=====================

* Introduction
* File key
* Documentation
* Hints
* Compile on DOS with BCC
* Compile on DOS with DJGPP
* Compile on DOS with Watcom
* Cross-compile on Slackware with BCC
* Cross-compile on Slackware with DJGPP
* Cross-compile on Slackware with Watcom

Introduction
============

This is portable OpenBSD ed(1) version 7.4 compiled for DOS.
It is compiled using the tiny-regex-c regular expression library.

<https://github.com/ibara/oed>
<https://github.com/gyrovorbis/tiny-regex-c>

File key
========

OED.EXE            - OpenBSD ed(1) compiled with Watcom & tiny-re
OED32.EXE          - OpenBSD ed(1) compiled with DJGPP & tiny-re
BSDED.EXE          - OpenBSD ed(1) compiled with DJGPP
SRC\BUF.C          - buf.c changed for DOS compilers & tiny-re
SRC\BUF.OLD        - Original buf.c
SRC\ED.H           - ed.h changed for DOS compilers & tiny-re
SRC\ED.OLD         - Original ed.h
SRC\GLBL.C         - glbl.c changed for BCC, Watcom & tiny-re
SRC\GLBL.OLD       - Original glbl.c
SRC\IO.C           - io.c changed for DOS compilers & tiny-re
SRC\IO.OLD         - Original io.c
SRC\MAIN.C         - main.c changed for DOS compilers & tiny-re
SRC\MAIN.OLD       - Original main.c
SRC\MAKEFILE.BCC   - Cross-compile on Slackware with BCC & tiny-re
SRC\MAKEFILE.WAT   - Cross-compile on Slackware with Watcom & tiny-re
SRC\MAKEFILE.DJ    - Cross-compile on Slackware with DJGPP
SRC\MAKEFILE.TIN   - Cross-compile on Slackware with DJGPP & tiny-re
SRC\MAN2TXT.AWK    - Convert man page to plain text
SRC\MKBCC.BAT      - Compile on DOS with BCC
SRC\MKDJGPP.BAT    - Compile on DOS with DJGPP
SRC\MKCLEAN.BAT    - Clean up after build
SRC\MKTINY.BAT     - Compile on DOS with DJGPP & tiny-re
SRC\MKWATCOM.BAT   - Compile on DOS with Watcom
SRC\RE.C           - re.c changed for BCC & tiny-re
SRC\RE.OLD         - Original re.c
SRC\REALLOCA.C     - reallocarray.c changed for BCC
SRC\REALLOCA.OLD   - Original reallocarray.c
SRC\STRTOL.OLD     - Original strtol.c from ELKS libc
SRC\STRTOL.C       - strtol.c changed for BCC DOS target
SRC\SUB.C          - sub.c changed for tiny-re
SRC\SUB.OLD        - Original sub.c
SRC\TINY-RE\RE.OLD - Original tiny-re\re.c
SRC\TINY-RE\RE.C   - tiny-re\re.c changed for BCC
SRC\UNDO.OLD       - Original undo.c
SRC\UNDO.C         - undo.c changed for tiny-re
SRC\UTILS.OLD      - Original utils.h
SRC\UTILS.H        - utils.h changed for DOS compilers

Documentation
=============

* doc/oed.txt
* doc/tinyre.txt
* <gopher://katolaz.net/0/ed_tutorial.txt>

Hints
=====

* tiny-regex-c requires + to be escaped in the following regex.

OLD: s/^+/-/
NEW: s/^\+/-/

* oed requires an address after the 't' command.
  Specify the current line with '.'
 
OLD: /tea/t
NEW: /tea/t.

* DOS doesn't really do pipes

OLD: printf ",p\n" | ed TODO.txt
NEW: echo ,p>input.txt
NEW: oed TODO.txt <input.txt

OLD: r ! ls -l
NEW: !dir /lfn >tmp.txt
NEW: r tmp.txt

Compile on DOS with BCC
=======================

    Run mkbcc.bat

mkbcc.bat uses bcc, groff, and mawk

bcc
<gopher://tilde.pink/1/~bencollver/files/dos/devel/bcc/>

groff
<ftp://ftp.mirrorservice.org/sites/
ftp.delorie.com/pub/djgpp/current/v2gnu/gro1223b.zip>

mawk
<gopher://tilde.pink/1/~bencollver/files/dos386/devel/mawk/>

Compile on DOS with DJGPP
=========================

    Run mkdjgpp.bat

Compile on DOS with Watcom
==========================

    Run mkwatcom.bat

Cross-compile on Slackware with BCC
===================================

    $ make -f Makefile.bcc

Cross-compile on Slackware with DJGPP
=====================================

    $ make -f Makefile.dj

Compile on DOS with Watcom
==========================

    $ wmake -f Makefile.wat
