diff options
author | ache <ache@FreeBSD.org> | 1997-08-24 19:09:45 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-08-24 19:09:45 +0000 |
commit | d324cfc41c56e2e000bbdb6832237595a054ce5d (patch) | |
tree | 198d02925c034851bf9f0ab81ec3bd4d80389540 /lib | |
parent | e309caa011c72381f3760db60667bb985462994f (diff) | |
download | FreeBSD-src-d324cfc41c56e2e000bbdb6832237595a054ce5d.zip FreeBSD-src-d324cfc41c56e2e000bbdb6832237595a054ce5d.tar.gz |
Add winnstr family and fake resizeterm from ncurses 4.1 for compatibility
with recent applications.
Bump minor number.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libncurses/Makefile | 6 | ||||
-rw-r--r-- | lib/libncurses/curses.h | 7 | ||||
-rw-r--r-- | lib/libncurses/lib_instr.c | 54 | ||||
-rw-r--r-- | lib/libncurses/lib_kernel.c | 6 | ||||
-rw-r--r-- | lib/ncurses/ncurses/Makefile | 6 |
5 files changed, 73 insertions, 6 deletions
diff --git a/lib/libncurses/Makefile b/lib/libncurses/Makefile index c0e7b35..5cb0429 100644 --- a/lib/libncurses/Makefile +++ b/lib/libncurses/Makefile @@ -1,16 +1,16 @@ # Makefile for ncurses -# $Id$ +# $Id: Makefile,v 1.21 1997/02/22 15:07:38 peter Exp $ LIB= ncurses SHLIB_MAJOR= 3 -SHLIB_MINOR= 0 +SHLIB_MINOR= 1 SRCS= lib_kernel.c lib_pad.c lib_bkgd.c \ lib_unctrl.c lib_raw.c lib_vidattr.c lib_trace.c lib_beep.c \ lib_doupdate.c lib_refresh.c lib_initscr.c lib_newwin.c lib_addch.c \ lib_addstr.c lib_scroll.c lib_clreol.c lib_touch.c lib_mvcur.c lib_keyname.c\ lib_delwin.c lib_endwin.c lib_clrbot.c lib_move.c lib_printw.c \ lib_scanw.c lib_erase.c lib_getch.c lib_options.c lib_acs.c lib_slk.c\ - lib_box.c lib_clear.c lib_delch.c lib_insch.c \ + lib_box.c lib_clear.c lib_delch.c lib_insch.c lib_instr.c \ lib_getstr.c lib_mvwin.c lib_longname.c lib_tstp.c \ lib_newterm.c lib_set_term.c lib_overlay.c lib_scrreg.c lib_color.c \ lib_insstr.c lib_insdel.c lib_twait.c lib_window.c copyright.c diff --git a/lib/libncurses/curses.h b/lib/libncurses/curses.h index 247aab8..0800a8a 100644 --- a/lib/libncurses/curses.h +++ b/lib/libncurses/curses.h @@ -166,6 +166,8 @@ extern int LINES, COLS; extern "C" { #endif +extern int resizeterm (int, int); + #if 0 /* MYTINFO not have it */ extern char ttytype[]; /* needed for backward compatibility */ #endif @@ -278,6 +280,7 @@ extern int werase(WINDOW *); extern int wgetch(WINDOW *); extern int wgetnstr(WINDOW *,char *,int maxlen); extern int whline(WINDOW *,chtype,int); +extern int winnstr(WINDOW *, char *, int); extern int winsch(WINDOW *,chtype); extern int winsdelln(WINDOW *,int); extern int winsnstr(WINDOW *,char *,int); @@ -361,6 +364,7 @@ extern int slk_touch(void); #define vline(ch, n) wvline(stdscr, ch, n) #define winsstr(w, s) winsnstr(w, s, 0) +#define winstr(w, s) winnstr(w, s, -1) #define redrawwin(w) wredrawln(w, 0, w->_maxy+1) #define waddstr(win,str) waddnstr(win,str,-1) @@ -393,6 +397,7 @@ extern int slk_touch(void); #define deleteln() winsdelln(stdscr, -1) #define wdeleteln(w) winsdelln(w, -1) #define refresh() wrefresh(stdscr) +#define innstr(s,n) winnstr(stdscr,s,n) #define insch(c) winsch(stdscr,c) #define delch() wdelch(stdscr) #define setscrreg(t,b) wsetscrreg(stdscr,t,b) @@ -418,6 +423,7 @@ extern int slk_touch(void); #define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) #define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? ERR : winch(win)) #define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) +#define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) #define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) #define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) #define mvgetch(y,x) mvwgetch(stdscr,y,x) @@ -426,6 +432,7 @@ extern int slk_touch(void); #define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) #define mvinch(y,x) mvwinch(stdscr,y,x) #define mvdelch(y,x) mvwdelch(stdscr,y,x) +#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) #define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) #define mvwinsstr(w, y, x, s) (wmove(w,y,x) == ERR ? ERR : winsstr(w,s)) #define mvwinsnstr(w, y, x, s, n) (wmove(w,y,x) == ERR ? ERR : winsnstr(w,s,n)) diff --git a/lib/libncurses/lib_instr.c b/lib/libncurses/lib_instr.c new file mode 100644 index 0000000..6d850b3 --- /dev/null +++ b/lib/libncurses/lib_instr.c @@ -0,0 +1,54 @@ + +/*************************************************************************** +* COPYRIGHT NOTICE * +**************************************************************************** +* ncurses is copyright (C) 1992-1995 * +* Zeyd M. Ben-Halim * +* zmbenhal@netcom.com * +* Eric S. Raymond * +* esr@snark.thyrsus.com * +* * +* Permission is hereby granted to reproduce and distribute ncurses * +* by any means and for any fee, whether alone or as part of a * +* larger distribution, in source or in binary form, PROVIDED * +* this notice is included with any such distribution, and is not * +* removed from any of its header files. Mention of ncurses in any * +* applications linked with it is highly appreciated. * +* * +* ncurses comes AS IS with no warranty, implied or expressed. * +* * +***************************************************************************/ + + +/* +** lib_instr.c +** +** The routine winnstr(). +** +*/ + +#include "curses.priv.h" + +int winnstr(WINDOW *win, char *str, int n) +{ + int i, row, col; + + T(("winnstr(%p,%p,%d) called", win, str, n)); + + getyx(win, row, col); + + if (n < 0) + n = win->_maxx - win->_curx + 1; + + for (i = 0; i < n;) { + str[i++] = TextOf(win->_line[row][col]); + if (++col > win->_maxx) { + col = 0; + if (++row > win->_maxy) + break; + } + } + str[i] = '\0'; /* SVr4 does not seem to count the null */ + + return (i); +} diff --git a/lib/libncurses/lib_kernel.c b/lib/libncurses/lib_kernel.c index a96cbfc..a1d0a85 100644 --- a/lib/libncurses/lib_kernel.c +++ b/lib/libncurses/lib_kernel.c @@ -310,3 +310,9 @@ int resetty() return OK; } + +int +resizeterm(int ToLines, int ToCols) +{ + return OK; +} diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index c0e7b35..5cb0429 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -1,16 +1,16 @@ # Makefile for ncurses -# $Id$ +# $Id: Makefile,v 1.21 1997/02/22 15:07:38 peter Exp $ LIB= ncurses SHLIB_MAJOR= 3 -SHLIB_MINOR= 0 +SHLIB_MINOR= 1 SRCS= lib_kernel.c lib_pad.c lib_bkgd.c \ lib_unctrl.c lib_raw.c lib_vidattr.c lib_trace.c lib_beep.c \ lib_doupdate.c lib_refresh.c lib_initscr.c lib_newwin.c lib_addch.c \ lib_addstr.c lib_scroll.c lib_clreol.c lib_touch.c lib_mvcur.c lib_keyname.c\ lib_delwin.c lib_endwin.c lib_clrbot.c lib_move.c lib_printw.c \ lib_scanw.c lib_erase.c lib_getch.c lib_options.c lib_acs.c lib_slk.c\ - lib_box.c lib_clear.c lib_delch.c lib_insch.c \ + lib_box.c lib_clear.c lib_delch.c lib_insch.c lib_instr.c \ lib_getstr.c lib_mvwin.c lib_longname.c lib_tstp.c \ lib_newterm.c lib_set_term.c lib_overlay.c lib_scrreg.c lib_color.c \ lib_insstr.c lib_insdel.c lib_twait.c lib_window.c copyright.c |