new version from arnold
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 2 May 1985 08:44:35 +0000 (00:44 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 2 May 1985 08:44:35 +0000 (00:44 -0800)
SCCS-vsn: lib/libcurses/curses.h 1.15
SCCS-vsn: lib/libcurses/Makefile 1.18

usr/src/lib/libcurses/Makefile
usr/src/lib/libcurses/curses.h

index 0081b5b..2c77cda 100644 (file)
@@ -1,24 +1,26 @@
-#      Makefile        1.17    83/07/02
+#      @(#)Makefile    1.18 (Berkeley) %G%
 #
 # curses package
 #
 #
 # curses package
 #
-CFILES=        box.c clear.c initscr.c endwin.c mvprintw.c mvscanw.c mvwin.c \
-       newwin.c overlay.c overwrite.c printw.c scanw.c refresh.c \
-       touchwin.c erase.c clrtobot.c clrtoeol.c cr_put.c cr_tty.c \
-       longname.c delwin.c insertln.c deleteln.c scroll.c getstr.c \
-       getch.c addstr.c addch.c move.c curses.c unctrl.c standout.c \
-       tstp.c insch.c delch.c
+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 \
+       fullname.c getch.c getstr.c idlok.c id_subwins.c initscr.c insch.c \
+       insertln.c longname.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
 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 \
 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 initscr.o insch.o insertln.o longname.o move.o \
-       mvprintw.o mvscanw.o mvwin.o newwin.o overlay.o overwrite.o \
-       printw.o refresh.o scanw.o scroll.o standout.o touchwin.o tstp.o \
-       unctrl.o
+       fullname.o getch.o getstr.o idlok.o id_subwins.o initscr.o insch.o \
+       insertln.o longname.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
+
 CTAGS= ctags
 CTAGS= ctags
-CFLAGS=        -O
+DEFS=
+CFLAGS=        -O $(DEFS)
 
 .c.o:
 
 .c.o:
-       ${CC} -c -p ${CFLAGS} $*.c
+       ${CC} -c -pg ${CFLAGS} $*.c
        ld -x -r $*.o
        mv a.out profiled/$*.o
        ${CC} -c ${CFLAGS} $*.c
        ld -x -r $*.o
        mv a.out profiled/$*.o
        ${CC} -c ${CFLAGS} $*.c
@@ -27,9 +29,11 @@ CFLAGS=      -O
 
 libcurses libcurses_p: ${OBJS}
        @echo building profiled libcurses
 
 libcurses libcurses_p: ${OBJS}
        @echo building profiled libcurses
-       @cd profiled; ar cr ../libcurses_p ${OBJS}
+       @cd profiled; ar cu ../libcurses_p ${OBJS}
+       ranlib libcurses_p
        @echo building normal libcurses
        @echo building normal libcurses
-       @ar cr libcurses ${OBJS}
+       @ar cu libcurses ${OBJS}
+       ranlib libcurses
 
 install: libcurses libcurses_p
        install -m 644 libcurses ${DESTDIR}/usr/lib/libcurses.a
 
 install: libcurses libcurses_p
        install -m 644 libcurses ${DESTDIR}/usr/lib/libcurses.a
@@ -47,7 +51,10 @@ lint:
        lint -hxb ${CFILES} -lcurses > lint.out
 
 test:  libcurses test.o
        lint -hxb ${CFILES} -lcurses > lint.out
 
 test:  libcurses test.o
-       ${CC} ${LDFLAGS} ${CFLAGS} -o test test.o crlib -ltermlib
+       ${CC} ${LDFLAGS} ${CFLAGS} -o test test.o libcurses -ltermlib
+
+test.o:        test.c
+       ${CC} ${CFLAGS} -c test.c
 
 
-cat.o: curses.h
-       ${CC} -c ${CFLAGS} cat.c
+ar:
+       ar crv curses.ar ${CFILES} curses.h curses.ext Makefile
index 7daa6c7..d76f94e 100644 (file)
@@ -1,4 +1,4 @@
-/* @(#)curses.h        1.14 (Berkeley) %G% */
+/* %G% (Berkeley) @(#)curses.h 1.15 */
 # ifndef WINDOW
 
 # include      <stdio.h>
 # ifndef WINDOW
 
 # include      <stdio.h>
 # define       _FULLWIN        002
 # define       _SCROLLWIN      004
 # define       _FLUSH          010
 # define       _FULLWIN        002
 # define       _SCROLLWIN      004
 # define       _FLUSH          010
+# define       _FULLLINE       020
+# define       _IDLINE         040
 # define       _STANDOUT       0200
 # define       _NOCHANGE       -1
 
 # define       _STANDOUT       0200
 # define       _NOCHANGE       -1
 
-# define       _puts(s)        tputs(s, 0, _putchar);
+# define       _puts(s)        tputs(s, 0, _putchar)
 
 typedef        struct sgttyb   SGTTY;
 
 
 typedef        struct sgttyb   SGTTY;
 
@@ -28,24 +30,29 @@ typedef     struct sgttyb   SGTTY;
  * Capabilities from termcap
  */
 
  * Capabilities from termcap
  */
 
-extern bool     AM, BS, CA, DA, DB, EO, GT, HZ, IN, MI, MS, NC, OS, UL,
-               XN;
-extern char     *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *DC, *DL, *DM,
-               *DO, *ED, *EI, *HO, *IC, *IM, *IP, *LL, *MA, *ND, *NL,
-               *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US,
-               *VB, *VE, *VS, PC;
+extern bool     AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL,
+               XB, XN, XT, XX;
+extern 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;
+extern char    PC;
 
 /*
  * From the tty modes...
  */
 
 
 /*
  * From the tty modes...
  */
 
-extern bool    NONL, UPPERCASE, normtty, _pfast;
+extern bool    GT, NONL, UPPERCASE, normtty, _pfast;
 
 struct _win_st {
        short           _cury, _curx;
        short           _maxy, _maxx;
        short           _begy, _begx;
        short           _flags;
 
 struct _win_st {
        short           _cury, _curx;
        short           _maxy, _maxx;
        short           _begy, _begx;
        short           _flags;
+       short           _ch_off;
        bool            _clear;
        bool            _leave;
        bool            _scroll;
        bool            _clear;
        bool            _leave;
        bool            _scroll;
@@ -130,14 +137,20 @@ int       __void__;
 
 #define raw()   (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, stty(_tty_ch,&_tty))
 #define noraw()         (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),stty(_tty_ch,&_tty))
 
 #define raw()   (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, stty(_tty_ch,&_tty))
 #define noraw()         (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),stty(_tty_ch,&_tty))
-#define crmode() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, stty(_tty_ch,&_tty))
-#define nocrmode() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,stty(_tty_ch,&_tty))
+#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, stty(_tty_ch,&_tty))
+#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,stty(_tty_ch,&_tty))
+#define crmode() cbreak()      /* backwards compatability */
+#define nocrmode() nocbreak()  /* backwards compatability */
 #define echo()  (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty))
 #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty))
 #define nl()    (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
 #define nonl()  (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
 #define echo()  (_tty.sg_flags |= ECHO, _echoit = TRUE, stty(_tty_ch, &_tty))
 #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, stty(_tty_ch, &_tty))
 #define nl()    (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
 #define nonl()  (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
-#define        savetty() (gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags)
-#define        resetty() (_tty.sg_flags = _res_flg, stty(_tty_ch, &_tty))
+#define        savetty() ((void) gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags)
+#define        resetty() (_tty.sg_flags = _res_flg, (void) stty(_tty_ch, &_tty))
+
+#define        erasechar()     (_tty.sg_erase)
+#define        killchar()      (_tty.sg_kill)
+#define baudrate()     (_tty.sg_ospeed)
 
 WINDOW *initscr(), *newwin(), *subwin();
 char   *longname(), *getcap();
 
 WINDOW *initscr(), *newwin(), *subwin();
 char   *longname(), *getcap();