Restore previously discarded (and incomplete) OS9 backend files.

This commit is contained in:
Joachim Nilsson 2010-08-03 00:14:48 +02:00
parent 3fedfd4444
commit 80ca9e1811
3 changed files with 75 additions and 0 deletions

19
Make.os9 Normal file
View File

@ -0,0 +1,19 @@
## $Revision: 1.2 $
##
## OS-9 makefile for editline library.
##
.SUFFIXES:
RFILES = editline.r complete.r sysos9.r
%.r: %.c
cc68 -r -Dstrchr=index -Dstrrchr=rindex -DNEED_STRDUP -DSYS_OS9 $*.c
testit: testit.r editline.lib
cc68 -f=testit testit.r -l=editline.lib
$(RFILES): $(RFILES:%.r=%.c)
editline.lib: $(RFILES)
cat $(RFILES) >$@

10
src/os9.h Normal file
View File

@ -0,0 +1,10 @@
/* $Revision: 1.1 $
**
** Editline system header file for OS-9 (on 68k).
*/
#define CRLF "\r\l"
#define FORWARD extern
#include <dir.h>
typedef struct direct DIRENTRY;

46
src/sysos9.c Normal file
View File

@ -0,0 +1,46 @@
/* $Revision: 1.1 $
**
** OS-9 system-dependant routines for editline library.
*/
#include "editline.h"
#include <sgstat.h>
#include <modes.h>
void
rl_ttyset(Reset)
int Reset;
{
static struct sgbuf old;
struct sgbuf new;
if (Reset == 0) {
_gs_opt(0, &old);
_gs_opt(0, &new);
new.sg_backsp = 0; new.sg_delete = 0; new.sg_echo = 0;
new.sg_alf = 0; new.sg_nulls = 0; new.sg_pause = 0;
new.sg_page = 0; new.sg_bspch = 0; new.sg_dlnch = 0;
new.sg_eorch = 0; new.sg_eofch = 0; new.sg_rlnch = 0;
new.sg_dulnch = 0; new.sg_psch = 0; new.sg_kbich = 0;
new.sg_kbach = 0; new.sg_bsech = 0; new.sg_bellch = 0;
new.sg_xon = 0; new.sg_xoff = 0; new.sg_tabcr = 0;
new.sg_tabsiz = 0;
_ss_opt(0, &new);
rl_erase = old.sg_bspch;
rl_kill = old.sg_dlnch;
rl_eof = old.sg_eofch;
rl_intr = old.sg_kbich;
rl_quit = -1;
}
else
_ss_opt(0, &old);
}
void
rl_add_slash(path, p)
char *path;
char *p;
{
(void)strcat(p, access(path, S_IREAD | S_IFDIR) ? " " : "/");
}