diff --git a/WEGA/contrib/lcc/contrib/README b/WEGA/contrib/lcc/contrib/README new file mode 100644 index 0000000..6fc4935 --- /dev/null +++ b/WEGA/contrib/lcc/contrib/README @@ -0,0 +1,2 @@ +libcurses taken from 4.3BSD and modified to compile on WEGA with LCC +libtermlib taken from 4.3BSD diff --git a/WEGA/contrib/lcc/contrib/libcurses/Makefile b/WEGA/contrib/lcc/contrib/libcurses/Makefile new file mode 100644 index 0000000..0eaafc6 --- /dev/null +++ b/WEGA/contrib/lcc/contrib/libcurses/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.1 (Berkeley) 6/7/85 +# +# curses package +# + +LIB= Llibcurses.a +PREFIX= /z/LCC +CC= lcc + +#LIB= libcurses.a +#PREFIX= /usr +#CC= cc + +#LIB= slibcurses.a +#PREFIX= /usr +#CC= scc + +CFLAGS= -O + +AR= -ar +ARFLAGS= rvu + +CHMOG= chmog +CP= cp +RANLIB= ranlib +LIBMODE= 644 +LIBOWNER= wega +LIBGROUP= system + +CFILES= addch.c addstr.c box.c clear.c clrtobot.c clrtoeol.c cr_put.c \ + cr_tty.c curses.c delch.c deleteln.c delwin.c endwin.c erase.c \ + getch.c getstr.c idlok.c id_subwins.c initscr.c insch.c \ + insertln.c move.c mvprintw.c mvscanw.c mvwin.c newwin.c \ + overlay.c overwrite.c printw.c putchar.c refresh.c scanw.c scroll.c \ + toucholap.c standout.c touchwin.c tstp.c unctrl.c +#CFILES+=fullname.c longname.c + +OBJS= addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \ + cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \ + getch.o getstr.o idlok.o id_subwins.o initscr.o insch.o \ + insertln.o move.o mvprintw.o mvscanw.o mvwin.o newwin.o \ + overlay.o overwrite.o printw.o putchar.o refresh.o scanw.o scroll.o \ + toucholap.o standout.o touchwin.o tstp.o unctrl.o +#OBJS+= fullname.o longname.o + +all: $(LIB) + +$(LIB): $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +install: all + $(CP) $(LIB) $(PREFIX)/lib + $(CHMOG) $(LIBMODE) $(LIBOWNER) $(LIBGROUP) $(PREFIX)/lib/$(LIB) + $(RANLIB) $(PREFIX)/lib/$(LIB) + +clean: + -rm -f *.o $(LIB) + +test: $(LIB) test.o + ${CC} ${LDFLAGS} ${CFLAGS} -o test test.o $(LIB) -ltermlib + +test.o: test.c + ${CC} ${CFLAGS} -c test.c diff --git a/WEGA/contrib/lcc/contrib/libcurses/curses.c b/WEGA/contrib/lcc/contrib/libcurses/curses.c new file mode 100644 index 0000000..730ba08 --- /dev/null +++ b/WEGA/contrib/lcc/contrib/libcurses/curses.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)curses.c 5.2 (Berkeley) 11/8/85"; +#endif not lint + +/* + * Define global variables + * + */ +# include "curses.h" + +bool _echoit = TRUE, /* set if stty indicates ECHO */ + _rawmode = FALSE, /* set if stty indicates RAW mode */ + My_term = FALSE, /* set if user specifies terminal type */ + _endwin = FALSE; /* set if endwin has been called */ + +char ttytype[50], /* long name of tty */ + *Def_term = "unknown"; /* default terminal type */ + +int _tty_ch = 1, /* file channel which is a tty */ + LINES, /* number of lines allowed on screen */ + COLS, /* number of columns allowed on screen */ + _res_flg; /* sgtty flags for reseting later */ + +WINDOW *stdscr = NULL, + *curscr = NULL; + +# ifdef DEBUG +FILE *outf; /* debug output file */ +# endif + +SGTTY _tty; /* tty modes */ + +bool AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL, XB, XN, + XT, XS, XX; +char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL, *DM, + *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6, *K7, *K8, + *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL, *KR, *KS, *KU, + *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF, *SO, *SR, *TA, *TE, + *TI, *UC, *UE, *UP, *US, *VB, *VS, *VE, *AL_PARM, *DL_PARM, + *UP_PARM, *DOWN_PARM, *LEFT_PARM, *RIGHT_PARM; +char PC; + +/* + * From the tty modes... + */ + +bool GT, NONL, UPPERCASE, normtty, _pfast; diff --git a/WEGA/contrib/lcc/contrib/libcurses/curses.ext b/WEGA/contrib/lcc/contrib/libcurses/curses.ext new file mode 100644 index 0000000..e98ed1b --- /dev/null +++ b/WEGA/contrib/lcc/contrib/libcurses/curses.ext @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)curses.ext 5.2 (Berkeley) 6/19/85 + */ + +/* + * External variables for the curses library + */ + +/* LINTLIBRARY */ + +# include "curses.h" + +extern bool _echoit, _rawmode, My_term, _endwin; + +extern char ttytype[50], *_unctrl[]; + +extern int _tty_ch, LINES, COLS; + +extern SGTTY _tty; + +char _putchar(); + +#ifdef DEBUG +# define outf _outf + +FILE *outf; +#endif + +#ifdef _IOLBF +#ifndef _IOSTRG +#define _IOSTRG _IOLBF +#endif +#endif diff --git a/WEGA/contrib/lcc/contrib/libcurses/printw.c b/WEGA/contrib/lcc/contrib/libcurses/printw.c new file mode 100644 index 0000000..51819ac --- /dev/null +++ b/WEGA/contrib/lcc/contrib/libcurses/printw.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)printw.c 5.1 (Berkeley) 6/7/85"; +#endif not lint + +/* + * printw and friends + * + */ + +# include "curses.ext" + +/* + * This routine implements a printf on the standard screen. + */ +printw(fmt, args) +char *fmt; +int args; { + + return _sprintw(stdscr, fmt, &args); +} + +/* + * This routine implements a printf on the given window. + */ +wprintw(win, fmt, args) +WINDOW *win; +char *fmt; +int args; { + + return _sprintw(win, fmt, &args); +} +/* + * This routine actually executes the printf and adds it to the window + * + * This is really a modified version of "sprintf". As such, + * it assumes that sprintf interfaces with the other printf functions + * in a certain way. If this is not how your system works, you + * will have to modify this routine to use the interface that your + * "sprintf" uses. + */ +_sprintw(win, fmt, args) +WINDOW *win; +char *fmt; +int *args; { + + FILE junk; + char buf[512]; + + junk._flag = _IOWRT + _IOSTRG; + junk._ptr = (unsigned char*)buf; + junk._cnt = 32767; + _doprnt(fmt, args, &junk); + putc('\0', &junk); + return waddstr(win, buf); +} diff --git a/WEGA/contrib/lcc/contrib/libcurses/scanw.c b/WEGA/contrib/lcc/contrib/libcurses/scanw.c new file mode 100644 index 0000000..a243fbc --- /dev/null +++ b/WEGA/contrib/lcc/contrib/libcurses/scanw.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)scanw.c 5.1 (Berkeley) 6/7/85"; +#endif not lint + +/* + * scanw and friends + * + */ + +# include "curses.ext" + +/* + * This routine implements a scanf on the standard screen. + */ +scanw(fmt, args) +char *fmt; +int args; { + + return _sscans(stdscr, fmt, &args); +} +/* + * This routine implements a scanf on the given window. + */ +wscanw(win, fmt, args) +WINDOW *win; +char *fmt; +int args; { + + return _sscans(win, fmt, &args); +} +/* + * This routine actually executes the scanf from the window. + * + * This is really a modified version of "sscanf". As such, + * it assumes that sscanf interfaces with the other scanf functions + * in a certain way. If this is not how your system works, you + * will have to modify this routine to use the interface that your + * "sscanf" uses. + */ +_sscans(win, fmt, args) +WINDOW *win; +char *fmt; +int *args; { + + char buf[100]; + FILE junk; + + junk._flag = _IOREAD|_IOSTRG; + junk._base = junk._ptr = (unsigned char *)buf; + if (wgetstr(win, buf) == ERR) + return ERR; + junk._cnt = strlen(buf); + return _doscan(&junk, fmt, args); +}