diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-09-13 19:16:32 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-09-13 19:16:32 +0000 |
commit | 53218c15edcfe41c06028f1a17a68693bb6bc556 (patch) | |
tree | 1d0df32b127f247ba83c0a8cc104156535f70408 /lib | |
parent | 777adf5023503ad1519db23336d1e411ba8fa089 (diff) |
ncurses-4.2-980905
Diffstat (limited to 'lib')
66 files changed, 360 insertions, 288 deletions
diff --git a/lib/libcurses/Makefile b/lib/libcurses/Makefile index 9079fc69387..6cb9c099cea 100644 --- a/lib/libcurses/Makefile +++ b/lib/libcurses/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.27 1998/08/31 17:46:06 mickey Exp $ +# $OpenBSD: Makefile,v 1.28 1998/09/13 19:16:14 millert Exp $ # Uncomment this to enable tracing in libcurses #CURSESTRACE=-DTRACE @@ -12,8 +12,8 @@ AWK?= /usr/bin/awk LIB= curses SRCS= access.c alloc_entry.c captoinfo.c codes.c comp_captab.c comp_error.c \ comp_expand.c comp_hash.c comp_parse.c comp_scan.c define_key.c \ - expanded.c fallback.c hardscroll.c hashmap.c keyok.c lib_acs.c \ - lib_adabind.c lib_addch.c lib_addstr.c lib_baudrate.c \ + doalloc.c expanded.c fallback.c hardscroll.c hashmap.c keyok.c \ + lib_acs.c lib_adabind.c lib_addch.c lib_addstr.c lib_baudrate.c \ lib_beep.c lib_bkgd.c lib_box.c lib_chgat.c lib_clear.c \ lib_clearok.c lib_clrbot.c lib_clreol.c lib_color.c \ lib_colorset.c lib_cur_term.c lib_data.c lib_delch.c \ diff --git a/lib/libcurses/access.c b/lib/libcurses/access.c index 1060467caf9..20ae2ed4773 100644 --- a/lib/libcurses/access.c +++ b/lib/libcurses/access.c @@ -33,7 +33,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: access.c,v 1.1 1998/07/27 03:37:27 millert Exp $") +MODULE_ID("$From: access.c,v 1.1 1998/07/25 20:17:09 tom Exp $") int _nc_access(const char *path, int mode) { diff --git a/lib/libcurses/comp_expand.c b/lib/libcurses/comp_expand.c index 089162f149d..1543ebe8fc8 100644 --- a/lib/libcurses/comp_expand.c +++ b/lib/libcurses/comp_expand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_expand.c,v 1.3 1998/08/15 18:44:43 millert Exp $ */ +/* $OpenBSD: comp_expand.c,v 1.4 1998/09/13 19:16:15 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -37,7 +37,7 @@ #include <ctype.h> #include <tic.h> -MODULE_ID("$From: comp_expand.c,v 1.7 1998/05/30 23:32:45 Todd.Miller Exp $") +MODULE_ID("$From: comp_expand.c,v 1.8 1998/08/15 23:01:54 tom Exp $") static int trailing_spaces(const char *src) { @@ -58,20 +58,13 @@ static size_t length; int bufp; const char *ptr, *str = VALID_STRING(srcp) ? srcp : ""; -char *nbuffer; bool islong = (strlen(str) > 3); size_t need = (2 + strlen(str)) * 4; int ch; if (buffer == 0 || need > length) { - length = need; - nbuffer = buffer ? realloc(buffer, length) : malloc(length); - if (nbuffer == 0) { - if (buffer != 0) - free(buffer); - return(NULL); - } - buffer = nbuffer; + if ((buffer = (char *)_nc_doalloc(buffer, length = need)) == 0) + return 0; } bufp = 0; diff --git a/lib/libcurses/comp_hash.c b/lib/libcurses/comp_hash.c index 399324c596c..74133bb0944 100644 --- a/lib/libcurses/comp_hash.c +++ b/lib/libcurses/comp_hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_hash.c,v 1.1 1998/07/23 21:17:25 millert Exp $ */ +/* $OpenBSD: comp_hash.c,v 1.2 1998/09/13 19:16:15 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -51,7 +51,7 @@ #define DEBUG(level, params) /*nothing*/ #endif -MODULE_ID("$From: comp_hash.c,v 1.17 1998/05/30 23:55:42 Todd.Miller Exp $") +MODULE_ID("$From: comp_hash.c,v 1.18 1998/08/22 18:01:18 tom Exp $") static int hash_function(const char *); @@ -312,9 +312,9 @@ int main(int argc, char **argv) printf("{\n"); for (n = 0; n < HASHTABSIZE; n++) { if (hash_table[n] != 0) { - sprintf(buffer, "_nc_%s_table + %3d", + sprintf(buffer, "_nc_%s_table + %3ld", root_name, - hash_table[n] - name_table); + (long) (hash_table[n] - name_table)); } else { strcpy(buffer, "0"); } diff --git a/lib/libcurses/curs_addch.3tbl b/lib/libcurses/curs_addch.3tbl index 8854518d92f..6dd600b47fd 100644 --- a/lib/libcurses/curs_addch.3tbl +++ b/lib/libcurses/curs_addch.3tbl @@ -1,3 +1,6 @@ +'\" t +.\" $OpenBSD: curs_addch.3tbl,v 1.6 1998/09/13 19:16:16 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,9 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -'\" t -.\" $OpenBSD: curs_addch.3tbl,v 1.5 1998/07/23 21:17:26 millert Exp $ -.\" $From: curs_addch.3x,v 1.12 1998/06/13 21:44:11 Alexander.V.Lukyanov Exp $ +.\" $From: curs_addch.3x,v 1.14 1998/08/27 21:21:04 Rick.Ohnemus Exp $ .TH curs_addch 3 "" .SH NAME \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, @@ -93,38 +94,38 @@ l l l _ _ _ l l l. \fIName\fR \fIDefault\fR \fIDescription\fR -ACS_ULCORNER + upper left-hand corner -ACS_LLCORNER + lower left-hand corner -ACS_URCORNER + upper right-hand corner -ACS_LRCORNER + lower right-hand corner -ACS_RTEE + right tee -ACS_LTEE + left tee +ACS_BLOCK # solid square block +ACS_BOARD # board of squares ACS_BTEE + bottom tee -ACS_TTEE + top tee -ACS_HLINE - horizontal line -ACS_VLINE | vertical line -ACS_PLUS + plus -ACS_S1 - scan line 1 -ACS_S9 \&_ scan line 9 -ACS_DIAMOND + diamond +ACS_BULLET o bullet ACS_CKBOARD : checker board (stipple) +ACS_DARROW v arrow pointing down ACS_DEGREE ' degree symbol -ACS_PLMINUS # plus/minus -ACS_BULLET o bullet +ACS_DIAMOND + diamond +ACS_GEQUAL > greater-than-or-equal-to +ACS_HLINE - horizontal line +ACS_LANTERN # lantern symbol ACS_LARROW < arrow pointing left +ACS_LEQUAL < less-than-or-equal-to +ACS_LLCORNER + lower left-hand corner +ACS_LRCORNER + lower right-hand corner +ACS_LTEE + left tee +ACS_NEQUAL ! not-equal +ACS_PI * greek pi +ACS_PLMINUS # plus/minus +ACS_PLUS + plus ACS_RARROW > arrow pointing right -ACS_DARROW v arrow pointing down -ACS_UARROW ^ arrow pointing up -ACS_BOARD # board of squares -ACS_LANTERN # lantern symbol -ACS_BLOCK # solid square block +ACS_RTEE + right tee +ACS_S1 - scan line 1 ACS_S3 - scan line 3 ACS_S7 - scan line 7 -ACS_LEQUAL < less-than-or-equal-to -ACS_GEQUAL > greater-than-or-equal-to -ACS_PI * greek pi -ACS_NEQUAL ! not-equal +ACS_S9 \&_ scan line 9 ACS_STERLING f pound-sterling symbol +ACS_TTEE + top tee +ACS_UARROW ^ arrow pointing up +ACS_ULCORNER + upper left-hand corner +ACS_URCORNER + upper right-hand corner +ACS_VLINE | vertical line .TE .SH RETURN VALUE @@ -144,7 +145,7 @@ The attribute A_ALTCHARSET actually forces literal display of PC ROM characters including the high-half graphics. Your console driver may still capture or translate a few (such as ESC) but this feature should give you access to the card-suit characters, up and down-arrow, and most others in the range 0-32. -(In a terminfo entry designed for use with \fBcurses\fR, the high-half +(In a terminfo entry designed for use with \fBncurses\fR, the high-half characters are obtained using this attribute with an \fBacsc\fR string in which the second of each pair is a high-half character.) @@ -162,7 +163,7 @@ The seven ACS symbols starting with \fBACS_S3\fR were not documented in any publicly released System V. However, many publicly available terminfos include \fBacsc\fR strings in which their key characters (pryz{|}) are embedded, and a second-hand list of their character descriptions has come -to light. The ACS-prefixed names for them were invented for \fBcurses\fR(3). +to light. The ACS-prefixed names for them were invented for \fBncurses\fR(3). .SH SEE ALSO \fBcurses\fR(3), \fBcurs_attr\fR(3), \fBcurs_clear\fR(3), \fBcurs_inch\fR(3), \fBcurs_outopts\fR(3), \fBcurs_refresh\fR(3), diff --git a/lib/libcurses/curs_addchstr.3 b/lib/libcurses/curs_addchstr.3 index b8889dfd0da..c1dd24ba849 100644 --- a/lib/libcurses/curs_addchstr.3 +++ b/lib/libcurses/curs_addchstr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_addchstr.3,v 1.6 1998/09/13 19:16:16 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,7 +28,6 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $OpenBSD: curs_addchstr.3,v 1.5 1998/09/07 16:44:35 aaron Exp $ .\" $From: curs_addchstr.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ .TH curs_addchstr 3 "" .SH NAME @@ -64,7 +65,7 @@ The window cursor is \fInot\fR advanced, and these routines work faster than (such as for the newline, backspace, or carriage return characters), they don't advance the current cursor position, they don't expand other control characters to ^-escapes, and they truncate the string if it crosses the right margin, -rather than wrapping it around to the new line. +rather then wrapping it around to the new line. .SH RETURN VALUES All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success diff --git a/lib/libcurses/curs_addstr.3 b/lib/libcurses/curs_addstr.3 index ca0ad515d7a..092725f3485 100644 --- a/lib/libcurses/curs_addstr.3 +++ b/lib/libcurses/curs_addstr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_addstr.3,v 1.5 1998/09/13 19:16:16 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_addstr.3x,v 1.8 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_addstr.3,v 1.4 1998/07/23 21:17:28 millert Exp $ .TH curs_addstr 3 "" .SH NAME \fBaddstr\fR, \fBaddnstr\fR, \fBwaddstr\fR, \fBwaddnstr\fR, diff --git a/lib/libcurses/curs_attr.3tbl b/lib/libcurses/curs_attr.3tbl index 5398551c49c..4aa58a5a558 100644 --- a/lib/libcurses/curs_attr.3tbl +++ b/lib/libcurses/curs_attr.3tbl @@ -1,3 +1,6 @@ +'\" t +.\" $OpenBSD: curs_attr.3tbl,v 1.6 1998/09/13 19:16:16 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,9 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -'\" t -.\" $From: curs_attr.3x,v 1.16 1998/06/13 22:59:17 tom Exp $ -.\" $OpenBSD: curs_attr.3tbl,v 1.5 1998/07/23 21:17:29 millert Exp $ +.\" $From: curs_attr.3x,v 1.17 1998/08/27 21:21:04 Rick.Ohnemus Exp $ .TH curs_attr 3 "" .SH NAME \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, diff --git a/lib/libcurses/curs_beep.3 b/lib/libcurses/curs_beep.3 index 142496243d6..44582db4f6f 100644 --- a/lib/libcurses/curs_beep.3 +++ b/lib/libcurses/curs_beep.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_beep.3,v 1.5 1998/09/13 19:16:17 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_beep.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_beep.3,v 1.4 1998/07/23 21:17:30 millert Exp $ .TH curs_beep 3 "" .SH NAME \fBbeep\fR, \fBflash\fR - \fBcurses\fR bell and screen flash routines diff --git a/lib/libcurses/curs_bkgd.3 b/lib/libcurses/curs_bkgd.3 index 1fc0d90c9cd..f73f634070a 100644 --- a/lib/libcurses/curs_bkgd.3 +++ b/lib/libcurses/curs_bkgd.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_bkgd.3,v 1.6 1998/09/13 19:16:17 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_bkgd.3x,v 1.12 1998/03/14 23:43:31 tom Exp $ -.\" $OpenBSD: curs_bkgd.3,v 1.5 1998/07/23 21:17:31 millert Exp $ .TH curs_bkgd 3 "" .SH NAME \fBbkgdset\fR, \fBwbkgdset\fR, \fBbkgd\fR, diff --git a/lib/libcurses/curs_border.3 b/lib/libcurses/curs_border.3 index 66b1cae6228..88427015b58 100644 --- a/lib/libcurses/curs_border.3 +++ b/lib/libcurses/curs_border.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_border.3,v 1.6 1998/09/13 19:16:17 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_border.3x,v 1.9 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_border.3,v 1.5 1998/07/23 21:17:32 millert Exp $ .TH curs_border 3 "" .SH NAME \fBborder\fR, \fBwborder\fR, \fBbox\fR, diff --git a/lib/libcurses/curs_clear.3 b/lib/libcurses/curs_clear.3 index d46c151dade..063e709e717 100644 --- a/lib/libcurses/curs_clear.3 +++ b/lib/libcurses/curs_clear.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_clear.3,v 1.6 1998/09/13 19:16:17 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_clear.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_clear.3,v 1.5 1998/07/23 21:17:34 millert Exp $ .TH curs_clear 3 "" .SH NAME \fBerase\fR, \fBwerase\fR, \fBclear\fR, @@ -84,7 +85,7 @@ error conditions. Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of \fBclearok(..., 1)\fR by saying \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. This will not work under -this version of curses. +ncurses. .SH SEE ALSO \fBcurses\fR(3), \fBcurs_outopts\fR(3), \fBcurs_refresh\fR(3) .\"# diff --git a/lib/libcurses/curs_color.3 b/lib/libcurses/curs_color.3 index adc9c0eb663..fe2ba593282 100644 --- a/lib/libcurses/curs_color.3 +++ b/lib/libcurses/curs_color.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_color.3,v 1.7 1998/09/13 19:16:17 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_color.3x,v 1.10 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_color.3,v 1.6 1998/07/23 21:17:35 millert Exp $ .TH curs_color 3 "" .SH NAME \fBstart_color\fR, \fBinit_pair\fR, @@ -149,7 +150,7 @@ All other routines return the integer \fBERR\fR upon failure and an \fBOK\fR (SVr4 specifies only "an integer value other than \fBERR\fR") upon successful completion. .SH NOTES -In this \fIcurses\fR implementation, there is a separate color activation flag, +In the \fIncurses\fR implementation, there is a separate color activation flag, color palette, color pairs table, and associated COLORS and COLOR_PAIRS counts for each screen; the \fBstart_color\fR function only affects the current screen. The SVr4/XSI interface is not really designed with this in mind, and diff --git a/lib/libcurses/curs_delch.3 b/lib/libcurses/curs_delch.3 index 0ed9a1c2e51..b0ceb604b56 100644 --- a/lib/libcurses/curs_delch.3 +++ b/lib/libcurses/curs_delch.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_delch.3,v 1.5 1998/09/13 19:16:18 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_delch.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_delch.3,v 1.4 1998/07/23 21:17:36 millert Exp $ .TH curs_delch 3 "" .SH NAME \fBdelch\fR, \fBwdelch\fR, \fBmvdelch\fR, \fBmvwdelch\fR - diff --git a/lib/libcurses/curs_deleteln.3 b/lib/libcurses/curs_deleteln.3 index bd8bb11d035..526e1238595 100644 --- a/lib/libcurses/curs_deleteln.3 +++ b/lib/libcurses/curs_deleteln.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_deleteln.3,v 1.5 1998/09/13 19:16:18 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_deleteln.3x,v 1.4 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_deleteln.3,v 1.4 1998/07/23 21:17:37 millert Exp $ .TH curs_deleteln 3 "" .SH NAME \fBdeleteln\fR, \fBwdeleteln\fR, \fBinsdelln\fR, diff --git a/lib/libcurses/curs_getch.3tbl b/lib/libcurses/curs_getch.3tbl index 8a5090fc7f3..e24cbcc02ff 100644 --- a/lib/libcurses/curs_getch.3tbl +++ b/lib/libcurses/curs_getch.3tbl @@ -1,3 +1,6 @@ +'\" t +.\" $OpenBSD: curs_getch.3tbl,v 1.6 1998/09/13 19:16:18 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,9 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -'\" t -.\" $From: curs_getch.3x,v 1.13 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_getch.3tbl,v 1.5 1998/07/23 21:17:38 millert Exp $ +.\" $From: curs_getch.3x,v 1.14 1998/08/27 21:21:04 Rick.Ohnemus Exp $ .TH curs_getch 3 "" .SH NAME \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, @@ -255,12 +256,11 @@ input timeout or non-blocking mode hsd been set. Programmers concerned about portability should be prepared for either of two cases: (a) signal receipt does not interrupt \fBgetch\fR; (b) signal receipt interrupts \fBgetch\fR and causes it to return ERR with \fBerrno\fR set to -\fBEINTR\fR. Under this \fBcurses\fR implementation, handled signals never +\fBEINTR\fR. Under the \fBncurses\fR implementation, handled signals never interrupt \fBgetch\fR. -The \fBhas_key\fR function is unique to this version of \fBcurses\fR. We -recommend that any code using it be conditionalized on the -\fBNCURSES_VERSION\fR feature macro. +The \fBhas_key\fR function is unique to \fBncurses\fR. We recommend that +any code using it be conditionalized on the \fBNCURSES_VERSION\fR feature macro. .SH SEE ALSO \fBcurses\fR(3), \fBcurs_inopts\fR(3), diff --git a/lib/libcurses/curs_getstr.3 b/lib/libcurses/curs_getstr.3 index 22010aaff50..f347ed5af74 100644 --- a/lib/libcurses/curs_getstr.3 +++ b/lib/libcurses/curs_getstr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_getstr.3,v 1.6 1998/09/13 19:16:18 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_getstr.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_getstr.3,v 1.5 1998/07/23 21:17:39 millert Exp $ .TH curs_getstr 3 "" .SH NAME \fBgetstr\fR, \fBwgetstr\fR, \fBmvgetstr\fR, diff --git a/lib/libcurses/curs_getyx.3 b/lib/libcurses/curs_getyx.3 index aa90db1ff44..41c6f5eb2ca 100644 --- a/lib/libcurses/curs_getyx.3 +++ b/lib/libcurses/curs_getyx.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_getyx.3,v 1.5 1998/09/13 19:16:19 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_getyx.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_getyx.3,v 1.4 1998/07/23 21:17:41 millert Exp $ .TH curs_getyx 3 "" .SH NAME \fBgetyx\fR, \fBgetparyx\fR, \fBgetbegyx\fR, diff --git a/lib/libcurses/curs_inch.3tbl b/lib/libcurses/curs_inch.3tbl index fc1aa5ec426..5dd3525250b 100644 --- a/lib/libcurses/curs_inch.3tbl +++ b/lib/libcurses/curs_inch.3tbl @@ -1,3 +1,6 @@ +'\" t +.\" $OpenBSD: curs_inch.3tbl,v 1.6 1998/09/13 19:16:19 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,9 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -'\" t -.\" $From: curs_inch.3x,v 1.9 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_inch.3tbl,v 1.5 1998/07/23 21:17:42 millert Exp $ +.\" $From: curs_inch.3x,v 1.10 1998/08/27 21:21:04 Rick.Ohnemus Exp $ .TH curs_inch 3 "" .SH NAME \fBinch\fR, \fBwinch\fR, \fBmvinch\fR, \fBmvwinch\fR diff --git a/lib/libcurses/curs_inchstr.3 b/lib/libcurses/curs_inchstr.3 index 72d586b8e95..9a305c8fc19 100644 --- a/lib/libcurses/curs_inchstr.3 +++ b/lib/libcurses/curs_inchstr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_inchstr.3,v 1.6 1998/09/13 19:16:19 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_inchstr.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_inchstr.3,v 1.5 1998/07/23 21:17:43 millert Exp $ .TH curs_inchstr 3 "" .SH NAME \fBinchstr\fR, \fBinchnstr\fR, \fBwinchstr\fR, diff --git a/lib/libcurses/curs_initscr.3 b/lib/libcurses/curs_initscr.3 index da7fd23489d..37467d40830 100644 --- a/lib/libcurses/curs_initscr.3 +++ b/lib/libcurses/curs_initscr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_initscr.3,v 1.5 1998/09/13 19:16:19 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_initscr.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_initscr.3,v 1.4 1998/07/23 21:17:44 millert Exp $ .TH curs_initscr 3 "" .SH NAME \fBinitscr\fR, \fBnewterm\fR, \fBendwin\fR, diff --git a/lib/libcurses/curs_inopts.3 b/lib/libcurses/curs_inopts.3 index dcf71510e53..1f7c303c5e5 100644 --- a/lib/libcurses/curs_inopts.3 +++ b/lib/libcurses/curs_inopts.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_inopts.3,v 1.6 1998/09/13 19:16:19 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_inopts.3x,v 1.8 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_inopts.3,v 1.5 1998/07/23 21:17:45 millert Exp $ .TH curs_inopts 3 "" .SH NAME \fBcbreak\fR, \fBnocbreak\fR, \fBecho\fR, @@ -190,7 +191,7 @@ completion, unless otherwise noted in the preceding routine descriptions. .SH PORTABILITY These functions are described in the XSI Curses standard, Issue 4. -This curses library obeys the XPG4 standard and the historical practice of the +The ncurses library obeys the XPG4 standard and the historical practice of the AT&T curses implementations, in that the echo bit is cleared when curses initializes the terminal state. BSD curses differed from this slightly; it left the echo bit on at initialization, but the BSD \fBraw\fR call turned it diff --git a/lib/libcurses/curs_insch.3 b/lib/libcurses/curs_insch.3 index 23df2c8534b..aef3fbb8bfc 100644 --- a/lib/libcurses/curs_insch.3 +++ b/lib/libcurses/curs_insch.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_insch.3,v 1.5 1998/09/13 19:16:20 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_insch.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_insch.3,v 1.4 1998/07/23 21:17:46 millert Exp $ .TH curs_insch 3 "" .SH NAME \fBinsch\fR, \fBwinsch\fR, \fBmvinsch\fR, \fBmvwinsch\fR - diff --git a/lib/libcurses/curs_insstr.3 b/lib/libcurses/curs_insstr.3 index b479c5cc468..88eb4aef2f3 100644 --- a/lib/libcurses/curs_insstr.3 +++ b/lib/libcurses/curs_insstr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_insstr.3,v 1.8 1998/09/13 19:16:20 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_insstr.3x,v 1.10 1998/07/25 20:32:57 Todd.Miller Exp $ -.\" $OpenBSD: curs_insstr.3,v 1.7 1998/07/27 03:37:27 millert Exp $ .TH curs_insstr 3 "" .SH NAME \fBinsstr\fR, \fBinsnstr\fR, \fBwinsstr\fR, \fBwinsnstr\fR, diff --git a/lib/libcurses/curs_instr.3 b/lib/libcurses/curs_instr.3 index e8c98285f72..c954d4beeb5 100644 --- a/lib/libcurses/curs_instr.3 +++ b/lib/libcurses/curs_instr.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_instr.3,v 1.6 1998/09/13 19:16:20 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_instr.3x,v 1.8 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_instr.3,v 1.5 1998/07/23 21:17:49 millert Exp $ .TH curs_instr 3 "" .SH NAME \fBinstr\fR, \fBinnstr\fR, \fBwinstr\fR, \fBwinnstr\fR, @@ -71,7 +72,7 @@ yet support XPG4 multi-byte characters). SVr4 does not document whether a length limit includes or excludes the trailing NUL. .PP -This curses library extends the XSI description by allowing a negative +The ncurses library extends the XSI description by allowing a negative value for \fIn\fR. In this case, the functions return the string ending at the right margin. .SH SEE ALSO diff --git a/lib/libcurses/curs_kernel.3 b/lib/libcurses/curs_kernel.3 index 05858e4215a..9e748741aab 100644 --- a/lib/libcurses/curs_kernel.3 +++ b/lib/libcurses/curs_kernel.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_kernel.3,v 1.7 1998/09/13 19:16:20 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_kernel.3x,v 1.11 1998/06/27 21:56:38 tom Exp $ -.\" $OpenBSD: curs_kernel.3,v 1.6 1998/07/23 21:17:50 millert Exp $ .TH curs_kernel 3 "" .SH NAME \fBdef_prog_mode\fR, \fBdef_shell_mode\fR, diff --git a/lib/libcurses/curs_mouse.3tbl b/lib/libcurses/curs_mouse.3tbl index e1cc95b7937..9ab5ab6a03c 100644 --- a/lib/libcurses/curs_mouse.3tbl +++ b/lib/libcurses/curs_mouse.3tbl @@ -1,3 +1,6 @@ +'\" t +.\" $OpenBSD: curs_mouse.3tbl,v 1.6 1998/09/13 19:16:20 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,9 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -'\" t -.'" $From: curs_mouse.3x,v 1.8 1998/03/11 21:12:53 juergen Exp $ -.'" $OpenBSD: curs_mouse.3tbl,v 1.5 1998/07/23 21:17:51 millert Exp $ +.'" $From: curs_mouse.3x,v 1.9 1998/08/27 21:21:04 Rick.Ohnemus Exp $ .TH curs_mouse 3 "" .SH NAME \fBgetmouse\fR, \fBungetmouse\fR, @@ -142,7 +143,7 @@ termination. All routines return the integer \fBERR\fR upon failure or \fBOK\fR upon successful completion. .SH PORTABILITY -These calls were designed for \fBcurses\fR(3), and are not found in SVr4 +These calls were designed for \fBncurses\fR, and are not found in SVr4 curses, 4.4BSD curses, or any other previous version of curses. The feature macro \fBNCURSES_MOUSE_VERSION\fR is provided so the preprocessor @@ -154,7 +155,7 @@ incremented. The order of the \fBMEVENT\fR structure members is not guaranteed. Additional fields may be added to the structure in the future. -Under \fBcurses\fR(3), these calls are implemented using either +Under \fBncurses\fR, these calls are implemented using either xterm's built-in mouse-tracking API or Alessandro Rubini's gpm server. If you are using something other than xterm there is no gpm daemon running on your machine, mouse events will not be visible to diff --git a/lib/libcurses/curs_move.3 b/lib/libcurses/curs_move.3 index f5803339e0a..271c1f7a7a1 100644 --- a/lib/libcurses/curs_move.3 +++ b/lib/libcurses/curs_move.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_move.3,v 1.5 1998/09/13 19:16:20 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_move.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_move.3,v 1.4 1998/07/23 21:17:52 millert Exp $ .TH curs_move 3 "" .SH NAME \fBmove\fR, \fBwmove\fR - move \fBcurses\fR window cursor diff --git a/lib/libcurses/curs_outopts.3 b/lib/libcurses/curs_outopts.3 index 84fe7fa978d..00306deba86 100644 --- a/lib/libcurses/curs_outopts.3 +++ b/lib/libcurses/curs_outopts.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_outopts.3,v 1.6 1998/09/13 19:16:21 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_outopts.3x,v 1.12 1998/03/21 22:56:02 jtc Exp $ -.\" $OpenBSD: curs_outopts.3,v 1.5 1998/07/23 21:17:53 millert Exp $ .TH curs_outopts 3 "" .SH NAME \fBclearok\fR, \fBidlok\fR, \fBidcok immedok\fR, @@ -141,11 +142,11 @@ system does not mess with. Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of \fBclearok(..., 1)\fR by saying \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. This will not work under -this curses. +ncurses. Earlier System V curses implementations specified that with \fBscrollok\fR enabled, any window modification triggering a scroll also forced a physical -refresh. XSI Curses does not require this, and \fBcurses\fR avoids doing +refresh. XSI Curses does not require this, and \fBncurses\fR avoids doing it in order to perform better vertical-motion optimization at \fBwrefresh\fR time. diff --git a/lib/libcurses/curs_overlay.3 b/lib/libcurses/curs_overlay.3 index 78b1a6e4f3d..5c43788942e 100644 --- a/lib/libcurses/curs_overlay.3 +++ b/lib/libcurses/curs_overlay.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_overlay.3,v 1.5 1998/09/13 19:16:21 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_overlay.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_overlay.3,v 1.4 1998/07/23 21:17:54 millert Exp $ .TH curs_overlay 3 "" .SH NAME \fBoverlay\fR, \fBoverwrite\fR, \fBcopywin\fR - overlay and diff --git a/lib/libcurses/curs_pad.3 b/lib/libcurses/curs_pad.3 index ace0d77c3bf..1a43e5ffd60 100644 --- a/lib/libcurses/curs_pad.3 +++ b/lib/libcurses/curs_pad.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_pad.3,v 1.5 1998/09/13 19:16:21 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_pad.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_pad.3,v 1.4 1998/07/23 21:17:56 millert Exp $ .TH curs_pad 3 "" .SH NAME \fBnewpad\fR, \fBsubpad\fR, \fBprefresh\fR, diff --git a/lib/libcurses/curs_print.3 b/lib/libcurses/curs_print.3 index 031c022f7d3..c70a72c5946 100644 --- a/lib/libcurses/curs_print.3 +++ b/lib/libcurses/curs_print.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_print.3,v 1.7 1998/09/13 19:16:21 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .'" $From: curs_print.3x,v 1.3 1998/03/11 21:12:53 juergen Exp $ -.'" $OpenBSD: curs_print.3,v 1.6 1998/07/23 21:17:57 millert Exp $ .TH curs_print 3 "" .SH NAME \fBmcprint\fR - ship binary data to printer diff --git a/lib/libcurses/curs_printw.3 b/lib/libcurses/curs_printw.3 index 335bd8e5173..58577df8181 100644 --- a/lib/libcurses/curs_printw.3 +++ b/lib/libcurses/curs_printw.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_printw.3,v 1.7 1998/09/13 19:16:22 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_printw.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_printw.3,v 1.6 1998/07/23 21:17:58 millert Exp $ .TH curs_printw 3 "" .SH NAME \fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR, diff --git a/lib/libcurses/curs_refresh.3 b/lib/libcurses/curs_refresh.3 index 1e3609a76d8..abcf9385ca6 100644 --- a/lib/libcurses/curs_refresh.3 +++ b/lib/libcurses/curs_refresh.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_refresh.3,v 1.5 1998/09/13 19:16:22 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_refresh.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_refresh.3,v 1.4 1998/07/23 21:17:59 millert Exp $ .TH curs_refresh 3 "" .SH NAME \fBrefresh\fR, \fBwrefresh\fR, \fBwnoutrefresh\fR, diff --git a/lib/libcurses/curs_scanw.3 b/lib/libcurses/curs_scanw.3 index 1cfe04291f3..09792b77f89 100644 --- a/lib/libcurses/curs_scanw.3 +++ b/lib/libcurses/curs_scanw.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_scanw.3,v 1.6 1998/09/13 19:16:22 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_scanw.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_scanw.3,v 1.5 1998/07/23 21:18:00 millert Exp $ .TH curs_scanw 3 "" .SH NAME \fBscanw\fR, \fBwscanw\fR, \fBmvscanw\fR, diff --git a/lib/libcurses/curs_scr_dmp.3 b/lib/libcurses/curs_scr_dmp.3 index 2fd642846b8..027173307ff 100644 --- a/lib/libcurses/curs_scr_dmp.3 +++ b/lib/libcurses/curs_scr_dmp.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_scr_dmp.3,v 1.6 1998/09/13 19:16:22 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_scr_dmp.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_scr_dmp.3,v 1.5 1998/07/23 21:18:01 millert Exp $ .TH curs_scr_dump 3 "" .SH NAME \fBscr_dump\fR, \fBscr_restore\fR, diff --git a/lib/libcurses/curs_scroll.3 b/lib/libcurses/curs_scroll.3 index a4cc15370e2..cd2e7affb32 100644 --- a/lib/libcurses/curs_scroll.3 +++ b/lib/libcurses/curs_scroll.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_scroll.3,v 1.5 1998/09/13 19:16:22 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_scroll.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_scroll.3,v 1.4 1998/07/23 21:18:02 millert Exp $ .TH curs_scroll 3 "" .SH NAME \fBscroll\fR, \fBsrcl\fR, \fBwscrl\fR - scroll a \fBcurses\fR window diff --git a/lib/libcurses/curs_slk.3 b/lib/libcurses/curs_slk.3 index bfb4ab6f40e..1f76ad60933 100644 --- a/lib/libcurses/curs_slk.3 +++ b/lib/libcurses/curs_slk.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_slk.3,v 1.6 1998/09/13 19:16:23 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_slk.3x,v 1.9 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_slk.3,v 1.5 1998/07/23 21:18:04 millert Exp $ .TH curs_slk 3 "" .SH NAME \fBslk_init\fR, \fBslk_set\fR, \fBslk_refresh\fR, @@ -68,10 +69,10 @@ The slk* functions manipulate the set of soft function-key labels that exist on many terminals. For those terminals that do not have soft labels, \fBcurses\fR takes over the bottom line of \fBstdscr\fR, reducing the size of \fBstdscr\fR and the variable \fBLINES\fR. \fBcurses\fR standardizes on eight -labels of up to eight characters each. In addition to this, this curses +labels of up to eight characters each. In addition to this, the ncurses implementation supports a mode where it simulates 12 labels of up to five characters each. This is most common for todays PC like enduser devices. -Please note that curses simulates this mode by taking over up to two lines at +Please note that ncurses simulates this mode by taking over up to two lines at the bottom of the screen, it doesn't try to use any hardware support for this mode. diff --git a/lib/libcurses/curs_termattrs.3 b/lib/libcurses/curs_termattrs.3 index f4d5f4eb4db..e5920d901b7 100644 --- a/lib/libcurses/curs_termattrs.3 +++ b/lib/libcurses/curs_termattrs.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_termattrs.3,v 1.6 1998/09/13 19:16:23 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_termattrs.3x,v 1.4 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_termattrs.3,v 1.5 1998/07/23 21:18:05 millert Exp $ .TH curs_termattrs 3 "" .SH NAME \fBbaudrate\fR, \fBerasechar\fR, \fBhas_ic\fR, diff --git a/lib/libcurses/curs_touch.3 b/lib/libcurses/curs_touch.3 index 3c53c8f2c02..6c39ab5072b 100644 --- a/lib/libcurses/curs_touch.3 +++ b/lib/libcurses/curs_touch.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_touch.3,v 1.5 1998/09/13 19:16:23 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_touch.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_touch.3,v 1.4 1998/07/23 21:18:06 millert Exp $ .TH curs_touch 3 "" .SH NAME \fBtouchwin\fR, \fBtouchline\fR, \fBuntouchwin\fR, @@ -81,7 +82,7 @@ The XSI Curses standard, Issue 4 describes these functions. Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of \fBclearok(..., 1)\fR by saying \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. This will not work under -\fBcurses\fR(3). +ncurses. .SH NOTES Note that all routines except \fBwtouchln\fR may be macros. .SH SEE ALSO diff --git a/lib/libcurses/curs_util.3 b/lib/libcurses/curs_util.3 index 7295671c3de..d0eb4bf34b4 100644 --- a/lib/libcurses/curs_util.3 +++ b/lib/libcurses/curs_util.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_util.3,v 1.5 1998/09/13 19:16:23 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_util.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_util.3,v 1.4 1998/07/23 21:18:07 millert Exp $ .TH curs_util 3 "" .SH NAME \fBunctrl\fR, \fBkeyname\fR, \fBfilter\fR, diff --git a/lib/libcurses/curs_window.3 b/lib/libcurses/curs_window.3 index cae77ad91ea..4ce91b57dc7 100644 --- a/lib/libcurses/curs_window.3 +++ b/lib/libcurses/curs_window.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: curs_window.3,v 1.5 1998/09/13 19:16:23 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_window.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curs_window.3,v 1.4 1998/07/23 21:18:08 millert Exp $ .TH curs_window 3 "" .SH NAME \fBnewwin\fR, \fBdelwin\fR, \fBmvwin\fR, diff --git a/lib/libcurses/curses.3tbl b/lib/libcurses/curses.3tbl index 13c7d6b71a1..c8f0907f003 100644 --- a/lib/libcurses/curses.3tbl +++ b/lib/libcurses/curses.3tbl @@ -1,3 +1,6 @@ +'\" t +.\" $OpenBSD: curses.3tbl,v 1.8 1998/09/13 19:16:24 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,10 +29,8 @@ .\" authorization. * .\"*************************************************************************** .\" -'\" t -.\" $From: ncurses.3x,v 1.24 1998/03/11 21:12:53 juergen Exp $ -.\" $OpenBSD: curses.3tbl,v 1.7 1998/07/25 22:04:02 millert Exp $ -.TH curses 3 "" +.\" $From: ncurses.3x,v 1.25 1998/08/27 21:21:04 Rick.Ohnemus Exp $ +.TH ncurses 3 "" .ds n 5 .ds d /usr/share/terminfo .SH NAME diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index 0d5662dfead..9f2b76c3c97 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.h,v 1.10 1998/08/03 17:02:43 millert Exp $ */ +/* $OpenBSD: curses.h,v 1.11 1998/09/13 19:16:24 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $From: curses.h.in,v 1.67 1998/07/11 20:17:07 dnelson Exp $ */ +/* $From: curses.h.in,v 1.68 1998/09/05 22:03:59 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -50,7 +50,7 @@ /* These are defined only in curses.h, and are used for conditional compiles */ #define NCURSES_VERSION_MAJOR 4 #define NCURSES_VERSION_MINOR 2 -#define NCURSES_VERSION_PATCH 980801 +#define NCURSES_VERSION_PATCH 980905 /* This is defined in more than one ncurses header, for identification */ #undef NCURSES_VERSION @@ -714,6 +714,7 @@ extern int tigetflag(NCURSES_CONST char *); /* implemented */ extern int tigetnum(NCURSES_CONST char *); /* implemented */ extern char *tigetstr(NCURSES_CONST char *); /* implemented */ extern void timeout(int); /* generated */ +extern char *tparm(NCURSES_CONST char *, ...); /* implemented */ extern int typeahead(int); /* implemented */ extern int ungetch(int); /* implemented */ #ifdef _XOPEN_SOURCE_EXTENDED diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h index a0762f9ba03..1868afcf667 100644 --- a/lib/libcurses/curses.priv.h +++ b/lib/libcurses/curses.priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.priv.h,v 1.7 1998/07/27 03:37:30 millert Exp $ */ +/* $OpenBSD: curses.priv.h,v 1.8 1998/09/13 19:16:25 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ /* - * $From: curses.priv.h,v 1.106 1998/07/25 20:07:29 tom Exp $ + * $From: curses.priv.h,v 1.109 1998/09/05 22:10:02 tom Exp $ * * curses.priv.h * @@ -487,7 +487,6 @@ extern void _nc_fifo_dump(void); #define returnWin(code) return code #endif -extern const char *_nc_visbuf(const char *); extern const char *_nc_visbuf2(int, const char *); #define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch)) @@ -593,6 +592,9 @@ extern void _nc_expanded(void); #endif +/* doalloc.c */ +extern void *_nc_doalloc(void *, size_t); + /* doupdate.c */ #if USE_XMC_SUPPORT extern void _nc_do_xmc_glitch(attr_t); @@ -603,11 +605,6 @@ extern void _nc_do_xmc_glitch(attr_t); extern void _nc_linedump(void); #endif -/* hardscroll.c */ -#if defined(TRACE) || defined(SCROLLDEBUG) -extern void _nc_linedump(void); -#endif - /* lib_acs.c */ extern void init_acs(void); /* no prefix, this name is traditional */ extern int _nc_msec_cost(const char *const, int); /* used by 'tack' program */ @@ -652,7 +649,6 @@ extern int _nc_setupscreen(short, short const, FILE *); extern int _nc_timed_wait(int, int, int *); extern int _nc_waddch_nosync(WINDOW *, const chtype); extern void _nc_do_color(int, bool, int (*)(int)); -extern void _nc_free_and_exit(int); extern void _nc_freeall(void); extern void _nc_freewin(WINDOW *win); extern void _nc_hash_map(void); diff --git a/lib/libcurses/define_key.3 b/lib/libcurses/define_key.3 index 3f314b89dec..292f8d0ec37 100644 --- a/lib/libcurses/define_key.3 +++ b/lib/libcurses/define_key.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: define_key.3,v 1.3 1998/09/13 19:16:25 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -29,7 +31,6 @@ .\" Author: Thomas E. Dickey <dickey@clark.net> 1997 .\" .\" $From: define_key.3x,v 1.5 1998/03/14 23:43:22 tom Exp $ -.\" $OpenBSD: define_key.3,v 1.2 1998/07/23 21:18:13 millert Exp $ .TH define_key 3 "" .SH NAME \fBdefine_key\fP \- define a keycode diff --git a/lib/libcurses/dft_fgbg.3 b/lib/libcurses/dft_fgbg.3 index c2d7783da4c..6332c04cea8 100644 --- a/lib/libcurses/dft_fgbg.3 +++ b/lib/libcurses/dft_fgbg.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: dft_fgbg.3,v 1.3 1998/09/13 19:16:25 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -29,7 +31,6 @@ .\" Author: Thomas E. Dickey <dickey@clark.net> 1997 .\" .\" $From: dft_fgbg.3x,v 1.6 1998/03/14 23:43:15 tom Exp $ -.\" $OpenBSD: dft_fgbg.3,v 1.2 1998/07/23 21:18:15 millert Exp $ .TH use_default_colors 3 "" .SH NAME \fBdft_fgbg\fR \- use terminal's default colors diff --git a/lib/libcurses/doalloc.c b/lib/libcurses/doalloc.c new file mode 100644 index 00000000000..d973c47da44 --- /dev/null +++ b/lib/libcurses/doalloc.c @@ -0,0 +1,60 @@ +/* $OpenBSD: doalloc.c,v 1.1 1998/09/13 19:16:25 millert Exp $ */ + +/**************************************************************************** + * Copyright (c) 1998 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey <dickey@clark.net> 1998 * + ****************************************************************************/ + + +/* + * Wrapper for malloc/realloc. Standard implementations allow realloc with + * a null pointer, but older libraries may not (e.g., SunOS). + * + * Also if realloc fails, we discard the old memory to avoid leaks. + */ + +#include <curses.priv.h> + +MODULE_ID("$From: doalloc.c,v 1.2 1998/08/18 22:52:39 Hans-Joachim.Widmaier Exp $") + +void *_nc_doalloc(void *oldp, size_t amount) +{ + void *newp; + + if (oldp != 0) { + if ((newp = realloc(oldp, amount)) == 0) { + free(oldp); + errno = ENOMEM; /* just in case 'free' reset */ + } + } else { + newp = malloc(amount); + } + return newp; +} diff --git a/lib/libcurses/keyok.3 b/lib/libcurses/keyok.3 index 59b3384fe9c..9d44325a6dd 100644 --- a/lib/libcurses/keyok.3 +++ b/lib/libcurses/keyok.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: keyok.3,v 1.3 1998/09/13 19:16:27 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -29,7 +31,6 @@ .\" Author: Thomas E. Dickey <dickey@clark.net> 1997 .\" .\" $From: keyok.3x,v 1.5 1998/03/14 23:43:07 tom Exp $ -.\" $OpenBSD: keyok.3,v 1.2 1998/07/23 21:18:20 millert Exp $ .TH keyok 3 "" .SH NAME \fBkeyok\fP \- enable or disable a keycode diff --git a/lib/libcurses/lib_doupdate.c b/lib/libcurses/lib_doupdate.c index f9913cd0dee..1c1ee616eb2 100644 --- a/lib/libcurses/lib_doupdate.c +++ b/lib/libcurses/lib_doupdate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_doupdate.c,v 1.8 1998/08/15 18:44:44 millert Exp $ */ +/* $OpenBSD: lib_doupdate.c,v 1.9 1998/09/13 19:16:27 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -77,7 +77,7 @@ #include <term.h> -MODULE_ID("$From: lib_doupdate.c,v 1.102 1998/05/30 23:37:01 Todd.Miller Exp $") +MODULE_ID("$From: lib_doupdate.c,v 1.103 1998/08/15 23:34:47 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -927,23 +927,17 @@ static size_t lenLine; int row, col; int top = total; int last = min(screen_columns, newscr->_maxx+1); -int error = 0; size_t length = sizeof(chtype) * last; chtype blank = newscr->_line[total-1].text[last-1]; /* lower right char */ -void *p; if (!clr_eos || !can_clear_with(blank)) return total; if (tstLine == 0 || length > lenLine) { - p = tstLine ? realloc(tstLine, length) : malloc(length); - if (p != 0) - tstLine = (chtype *)p; - else - error = 1; + tstLine = (chtype *)_nc_doalloc(tstLine, length); } - if (!error) { + if (tstLine != 0) { lenLine = length; for (col = 0; col < last; col++) tstLine[col] = blank; diff --git a/lib/libcurses/lib_initscr.c b/lib/libcurses/lib_initscr.c index d3e8774592e..2e09588b491 100644 --- a/lib/libcurses/lib_initscr.c +++ b/lib/libcurses/lib_initscr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_initscr.c,v 1.4 1998/07/23 21:18:51 millert Exp $ */ +/* $OpenBSD: lib_initscr.c,v 1.5 1998/09/13 19:16:27 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -47,7 +47,7 @@ #include <sys/termio.h> /* needed for ISC */ #endif -MODULE_ID("$From: lib_initscr.c,v 1.22 1998/04/18 21:51:33 tom Exp $") +MODULE_ID("$From: lib_initscr.c,v 1.23 1998/08/09 00:18:48 tom Exp $") WINDOW *initscr(void) { diff --git a/lib/libcurses/lib_mouse.c b/lib/libcurses/lib_mouse.c index 112fa4cdcac..90cf5673239 100644 --- a/lib/libcurses/lib_mouse.c +++ b/lib/libcurses/lib_mouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mouse.c,v 1.5 1998/07/23 21:19:01 millert Exp $ */ +/* $OpenBSD: lib_mouse.c,v 1.6 1998/09/13 19:16:27 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -75,7 +75,7 @@ #endif #endif -MODULE_ID("$From: lib_mouse.c,v 1.35 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$From: lib_mouse.c,v 1.36 1998/08/22 18:09:52 tom Exp $") #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT @@ -119,7 +119,9 @@ static void _trace_slot(const char *tag) _tracef(tag); for (ep = events; ep < events + EV_MAX; ep++) - _tracef("mouse event queue slot %d = %s", ep-events, _tracemouse(ep)); + _tracef("mouse event queue slot %ld = %s", + (long) (ep - events), + _tracemouse(ep)); } #endif @@ -322,7 +324,9 @@ static bool _nc_mouse_inline(SCREEN *sp) eventp->x = (kbuf[1] - ' ') - 1; eventp->y = (kbuf[2] - ' ') - 1; - TR(MY_TRACE, ("_nc_mouse_inline: primitive mouse-event %s has slot %d", _tracemouse(eventp), eventp - events)); + TR(MY_TRACE, ("_nc_mouse_inline: primitive mouse-event %s has slot %ld", + _tracemouse(eventp), + (long) (eventp - events))); /* bump the next-free pointer into the circular list */ eventp = NEXT(eventp); @@ -417,8 +421,9 @@ static bool _nc_mouse_parse(int runcount) */ if (runcount == 1) { - TR(MY_TRACE, ("_nc_mouse_parse: returning simple mouse event %s at slot %d", - _tracemouse(prev), prev-events)); + TR(MY_TRACE, ("_nc_mouse_parse: returning simple mouse event %s at slot %ld", + _tracemouse(prev), + (long) (prev - events))); return (prev->id >= 0) ? ((prev->bstate & eventmask) ? TRUE : FALSE) : FALSE; @@ -434,8 +439,10 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("before mouse press/release merge:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } #endif /* TRACE */ @@ -486,8 +493,10 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("before mouse click merge:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } #endif /* TRACE */ @@ -591,8 +600,10 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("before mouse event queue compaction:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } #endif /* TRACE */ @@ -609,13 +620,16 @@ static bool _nc_mouse_parse(int runcount) if (_nc_tracing & TRACE_IEVENT) { _trace_slot("after mouse event queue compaction:"); - _tracef("_nc_mouse_parse: run starts at %d, ends at %d, count %d", - runp-events, ((eventp - events) + (EV_MAX-1)) % EV_MAX, runcount); + _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d", + (long) (runp - events), + (long) ((eventp - events) + (EV_MAX-1)) % EV_MAX, + runcount); } for (ep = runp; ep != eventp; ep = NEXT(ep)) if (ep->id != INVALID_EVENT) - TR(MY_TRACE, ("_nc_mouse_parse: returning composite mouse event %s at slot %d", - _tracemouse(ep), ep-events)); + TR(MY_TRACE, ("_nc_mouse_parse: returning composite mouse event %s at slot %ld", + _tracemouse(ep), + (long) (ep - events))); #endif /* TRACE */ /* after all this, do we have a valid event? */ @@ -671,8 +685,9 @@ int getmouse(MEVENT *aevent) /* copy the event we find there */ *aevent = *prev; - TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %d", - _tracemouse(prev), prev-events)); + TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld", + _tracemouse(prev), + (long) (prev - events))); prev->id = INVALID_EVENT; /* so the queue slot becomes free */ returnCode(OK); diff --git a/lib/libcurses/lib_setup.c b/lib/libcurses/lib_setup.c index 6510f5e9fcd..71cec9dd200 100644 --- a/lib/libcurses/lib_setup.c +++ b/lib/libcurses/lib_setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_setup.c,v 1.2 1998/08/14 23:02:31 millert Exp $ */ +/* $OpenBSD: lib_setup.c,v 1.3 1998/09/13 19:16:28 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ #include <term.h> /* lines, columns, cur_term */ -MODULE_ID("$From: lib_setup.c,v 1.38 1998/04/04 19:08:22 juergen Exp $") +MODULE_ID("$From: lib_setup.c,v 1.42 1998/09/05 22:15:14 tom Exp $") /**************************************************************************** * @@ -92,8 +92,6 @@ MODULE_ID("$From: lib_setup.c,v 1.38 1998/04/04 19:08:22 juergen Exp $") # endif #endif -extern TERMINAL *cur_term; - static int _use_env = TRUE; static void do_prototype(void); @@ -136,6 +134,16 @@ long l; } T(("screen size: environment LINES = %d COLUMNS = %d",*linep,*colp)); +#ifdef __EMX__ + if (*linep <= 0 || *colp <= 0) + { + int screendata[2]; + _scrsize(screendata); + *colp = screendata[0]; + *linep = screendata[1]; + T(("EMX screen size: environment LINES = %d COLUMNS = %d",*linep,*colp)); + } +#endif #if HAVE_SIZECHANGE /* if that didn't work, maybe we can try asking the OS */ if (*linep <= 0 || *colp <= 0) @@ -152,8 +160,14 @@ long l; } while (errno == EINTR); - *linep = WINSIZE_ROWS(size); - *colp = WINSIZE_COLS(size); + /* + * Solaris lets users override either dimension with an + * environment variable. + */ + if (*linep <= 0) + *linep = WINSIZE_ROWS(size); + if (*colp <= 0) + *colp = WINSIZE_COLS(size); } /* FALLTHRU */ failure:; diff --git a/lib/libcurses/lib_tparm.c b/lib/libcurses/lib_tparm.c index beedb78d748..4e7386c2c69 100644 --- a/lib/libcurses/lib_tparm.c +++ b/lib/libcurses/lib_tparm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tparm.c,v 1.3 1998/08/15 19:06:36 millert Exp $ */ +/* $OpenBSD: lib_tparm.c,v 1.4 1998/09/13 19:16:28 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -45,7 +45,7 @@ #include <term.h> #include <tic.h> -MODULE_ID("$From: lib_tparm.c,v 1.31 1998/06/21 00:55:35 tom Exp $") +MODULE_ID("$From: lib_tparm.c,v 1.32 1998/08/15 23:37:16 tom Exp $") /* * char * @@ -143,10 +143,7 @@ static void save_text(size_t limit, char *s) if (need > out_size) { out_size = need * 2; - if (out_buff == 0) - out_buff = malloc(out_size); - else - out_buff = realloc(out_buff, out_size); + out_buff = (char *)_nc_doalloc(out_buff, out_size); } if (out_buff == 0) _nc_err_abort("Out of memory"); @@ -185,7 +182,8 @@ static inline int npop(void) static inline char *spop(void) { - return (stack_ptr > 0 ? stack[--stack_ptr].str : ""); + static char dummy[] = ""; /* avoid const-cast */ + return (stack_ptr > 0 ? stack[--stack_ptr].str : dummy); } static inline const char *parse_format(const char *s, char *format, int *len) @@ -302,16 +300,9 @@ static int static_vars[NUM_VARS]; } } if ((size_t)(cp - string) > len_fmt) { - char *nformat; - len_fmt = (cp - string) + len_fmt + 2; - nformat = format ? realloc(format, len_fmt) : malloc(len_fmt); - if (nformat == 0) { - if (format != 0) - free(format); + if ((format = _nc_doalloc(format, len_fmt)) == 0) return 0; - } - format = nformat; } if (number > 9) number = 9; diff --git a/lib/libcurses/read_entry.c b/lib/libcurses/read_entry.c index f4457941f37..ed44929ceae 100644 --- a/lib/libcurses/read_entry.c +++ b/lib/libcurses/read_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read_entry.c,v 1.2 1998/07/27 03:37:34 millert Exp $ */ +/* $OpenBSD: read_entry.c,v 1.3 1998/09/13 19:16:28 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -49,7 +49,7 @@ #include <term.h> #include <tic.h> -MODULE_ID("$From: read_entry.c,v 1.40 1998/07/25 20:11:11 tom Exp $") +MODULE_ID("$From: read_entry.c,v 1.42 1998/08/09 11:59:36 tom Exp $") #ifndef O_BINARY #define O_BINARY 0 @@ -100,8 +100,10 @@ int _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) char buf[MAX_ENTRY_SIZE]; if (_nc_access(filename, R_OK) < 0 - || (fd = open(filename, O_RDONLY|O_BINARY)) < 0) + || (fd = open(filename, O_RDONLY|O_BINARY)) < 0) { + T(("cannot open terminfo %s (errno=%d)", filename, errno)); return(0); + } T(("read terminfo %s", filename)); @@ -136,8 +138,8 @@ int _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) if (ptr->term_names == NULL) { if (str_size) free(ptr->str_table); - close(fd); - return(0); + close(fd); + return(0); } (void) strcpy(ptr->term_names, buf); if (name_size > MAX_NAME_SIZE) diff --git a/lib/libcurses/read_termcap.c b/lib/libcurses/read_termcap.c index af23d89e3b3..64467f39dcc 100644 --- a/lib/libcurses/read_termcap.c +++ b/lib/libcurses/read_termcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read_termcap.c,v 1.3 1998/08/14 21:11:41 millert Exp $ */ +/* $OpenBSD: read_termcap.c,v 1.4 1998/09/13 19:16:29 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -63,7 +63,7 @@ #include <fcntl.h> #endif -MODULE_ID("$From: read_termcap.c,v 1.33 1998/07/25 20:22:11 tom Exp $") +MODULE_ID("$From: read_termcap.c,v 1.35 1998/08/18 01:37:53 tom Exp $") #ifndef PURE_TERMINFO @@ -262,6 +262,7 @@ _nc_cgetent(char **buf, int *oline, char **db_array, const char *name) * names interpolated, a name can't be found, or depth exceeds * MAX_RECURSION. */ +#define DOALLOC(size) (char *)_nc_doalloc(record, size) static int _nc_getent( char **cap, /* termcap-content */ @@ -276,7 +277,7 @@ _nc_getent( { register char *r_end, *rp; int myfd = FALSE; - char *record; + char *record = 0; int tc_not_resolved; int current; int lineno; @@ -292,7 +293,7 @@ _nc_getent( * Check if we have a top record from cgetset(). */ if (depth == 0 && toprec != 0 && _nc_cgetmatch(toprec, name) == 0) { - if ((record = malloc (topreclen + BFRAG)) == 0) { + if ((record = DOALLOC(topreclen + BFRAG)) == 0) { errno = ENOMEM; return (TC_SYS_ERR); } @@ -306,7 +307,7 @@ _nc_getent( /* * Allocate first chunk of memory. */ - if ((record = malloc(BFRAG)) == 0) { + if ((record = DOALLOC(BFRAG)) == 0) { errno = ENOMEM; return (TC_SYS_ERR); } @@ -324,8 +325,8 @@ _nc_getent( */ if (fd >= 0) { (void)lseek(fd, (off_t)0, SEEK_SET); - } else if (_nc_access(db_array[current], R_OK) < 0 - || (fd = open(db_array[current], O_RDONLY, 0) < 0)) { + } else if ((_nc_access(db_array[current], R_OK) < 0) + || (fd = open(db_array[current], O_RDONLY, 0)) < 0) { /* No error on unfound file. */ if (errno == ENOENT) continue; @@ -398,20 +399,16 @@ _nc_getent( if (rp >= r_end) { unsigned int pos; size_t newsize; - char *nrecord; pos = rp - record; newsize = r_end - record + BFRAG; - nrecord = realloc(record, newsize); - if (nrecord == 0) { - if (record != 0) - free(nrecord); + record = DOALLOC(newsize); + if (record == 0) { if (myfd) (void)close(fd); errno = ENOMEM; return (TC_SYS_ERR); } - record = nrecord; r_end = record + newsize; rp = record + pos; } @@ -535,23 +532,19 @@ _nc_getent( if (diff >= r_end - rp) { unsigned int pos, tcpos, tcposend; size_t newsize; - char *nrecord; pos = rp - record; newsize = r_end - record + diff + BFRAG; tcpos = tcstart - record; tcposend = tcend - record; - nrecord = realloc(record, newsize); + record = DOALLOC(newsize); if (record == 0) { - if (record != 0) - free(record); if (myfd) (void)close(fd); free(icap); errno = ENOMEM; return (TC_SYS_ERR); } - record = nrecord; r_end = record + newsize; rp = record + pos; tcstart = record + tcpos; @@ -583,14 +576,10 @@ _nc_getent( (void)close(fd); *len = rp - record - 1; /* don't count NUL */ if (r_end > rp) { - char *nrecord; - if ((nrecord = realloc(record, (size_t)(rp - record))) == 0) { - if (record != 0) - free(record); + if ((record = DOALLOC((size_t)(rp - record))) == 0) { errno = ENOMEM; return (TC_SYS_ERR); } - record = nrecord; } *cap = record; diff --git a/lib/libcurses/resizeterm.3 b/lib/libcurses/resizeterm.3 index db6e8c3a52b..8b222d01e23 100644 --- a/lib/libcurses/resizeterm.3 +++ b/lib/libcurses/resizeterm.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: resizeterm.3,v 1.3 1998/09/13 19:16:29 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -29,7 +31,6 @@ .\" Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 .\" .\" $From: resizeterm.3x,v 1.7 1998/03/14 23:42:52 tom Exp $ -.\" $OpenBSD: resizeterm.3,v 1.2 1998/07/23 21:19:59 millert Exp $ .TH resizeterm 3 "" .SH NAME \fBresizeterm\fR - change the curses terminal size diff --git a/lib/libcurses/safe_sprintf.c b/lib/libcurses/safe_sprintf.c index 397ede9c605..dab3c69221d 100644 --- a/lib/libcurses/safe_sprintf.c +++ b/lib/libcurses/safe_sprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe_sprintf.c,v 1.4 1998/08/15 19:06:38 millert Exp $ */ +/* $OpenBSD: safe_sprintf.c,v 1.5 1998/09/13 19:16:30 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ #include <curses.priv.h> #include <ctype.h> -MODULE_ID("$From: safe_sprintf.c,v 1.8 1998/07/11 20:31:37 Bernhard.Rosenkraenzer Exp $") +MODULE_ID("$From: safe_sprintf.c,v 1.9 1998/08/15 23:58:49 tom Exp $") #if USE_SAFE_SPRINTF @@ -68,8 +68,9 @@ _nc_printf_length(const char *fmt, va_list ap) while (*fmt != '\0') { if (*fmt == '%') { + static char dummy[] = ""; PRINTF state = Flags; - char *pval = ""; + char *pval = dummy; /* avoid const-cast */ double fval = 0.0; int done = FALSE; int ival = 0; @@ -150,17 +151,12 @@ _nc_printf_length(const char *fmt, va_list ap) if (prec < 0) prec = strlen(pval); if (prec > (int)length) { - char *nbuffer; - length = length + prec; - nbuffer = realloc(buffer, length); - if (nbuffer == 0) { - if (buffer != 0) - free(buffer); + buffer = (char *)_nc_doalloc(buffer, length); + if (buffer == 0) { free(format); return -1; } - buffer = nbuffer; } used = 'p'; break; @@ -218,27 +214,23 @@ _nc_printf_string(const char *fmt, va_list ap) int len = _nc_printf_length(fmt, ap); if (len > 0) { - if ((buf = malloc(len+1)) == NULL) - return(NULL); + if ((buf = malloc(len+1)) == 0) + return(0); vsprintf(buf, fmt, ap); } #else static int rows, cols; static char *buf; static size_t len; - char *nbuf; if (screen_lines > rows || screen_columns > cols) { if (screen_lines > rows) rows = screen_lines; if (screen_columns > cols) cols = screen_columns; len = (rows * (cols + 1)) + 1; - nbuf = buf ? realloc(buf, len) : malloc(len); - if (nbuf == NULL) { - if (buf != NULL) - free(buf); - return(NULL); + buf = (char *)_nc_doalloc(buf, len); + if (buf == 0) { + return(0); } - buf = nbuf; } if (buf != 0) { diff --git a/lib/libcurses/term.h b/lib/libcurses/term.h index 182975ef70a..afa07a43e7e 100644 --- a/lib/libcurses/term.h +++ b/lib/libcurses/term.h @@ -1,4 +1,4 @@ -/* $OpenBSD: term.h,v 1.2 1998/08/14 23:02:34 millert Exp $ */ +/* $OpenBSD: term.h,v 1.3 1998/09/13 19:16:30 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ /* and: Eric S. Raymond <esr@snark.thyrsus.com> */ /****************************************************************************/ -/* $From: MKterm.h.awk.in,v 1.24 1998/04/11 22:46:44 tom Exp $ */ +/* $From: MKterm.h.awk.in,v 1.25 1998/09/05 22:19:41 tom Exp $ */ /* ** term.h -- Definition of struct term @@ -135,7 +135,6 @@ extern "C" { #define SET_TTY(fd, buf) stty(fd, buf) #endif -extern char ttytype[]; #define NAMESIZE 256 #define CUR cur_term->type. @@ -724,23 +723,26 @@ extern TERMINAL *set_curterm(TERMINAL *); extern int del_curterm(TERMINAL *); /* miscellaneous entry points */ -extern int putp(const char *); extern int restartterm(const char *, int, int *); extern int setupterm(const char *,int,int *); extern int tputs(const char *, int, int (*)(int)); -/* terminfo entry points */ -extern int tigetflag(NCURSES_CONST char *); -extern int tigetnum(NCURSES_CONST char *); +/* terminfo entry points, also declared in curses.h */ +#if !defined(__NCURSES_H) && !defined(_TERMCAP_H) +extern char ttytype[]; extern char *tigetstr(NCURSES_CONST char *); extern char *tparm(NCURSES_CONST char *, ...); +extern int putp(const char *); +extern int tigetflag(NCURSES_CONST char *); +extern int tigetnum(NCURSES_CONST char *); +#endif /* __NCURSES_H */ /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */ +extern char *tgetstr(const char *, char **); +extern char *tgoto(const char *, int, int); extern int tgetent(char *, const char *); extern int tgetflag(const char *); extern int tgetnum(const char *); -extern char *tgetstr(const char *, char **); -extern char *tgoto(const char *, int, int); #ifdef __cplusplus } diff --git a/lib/libcurses/termcap.3 b/lib/libcurses/termcap.3 index 66ee22cb8d5..10e0ff4a0ab 100644 --- a/lib/libcurses/termcap.3 +++ b/lib/libcurses/termcap.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: termcap.3,v 1.3 1998/09/13 19:16:30 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -26,7 +28,6 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $OpenBSD: termcap.3,v 1.2 1998/07/25 22:03:17 millert Exp $ .\" $From: curs_termcap.3x,v 1.11 1998/07/18 02:45:56 tom Exp $ .TH termcap 3 "" .ds n 5 diff --git a/lib/libcurses/termcap.h b/lib/libcurses/termcap.h index 844519ac7e5..9a0f5a642be 100644 --- a/lib/libcurses/termcap.h +++ b/lib/libcurses/termcap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: termcap.h,v 1.1 1998/07/23 21:20:05 millert Exp $ */ +/* $OpenBSD: termcap.h,v 1.2 1998/09/13 19:16:30 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $From: termcap.h.in,v 1.6 1998/03/21 23:08:27 Adam.Richter Exp $ */ +/* $From: termcap.h.in,v 1.7 1998/09/05 22:20:45 tom Exp $ */ #ifndef _TERMCAP_H #define _TERMCAP_H 1 @@ -54,14 +54,14 @@ extern char *UP; extern char *BC; extern speed_t ospeed; +#if !defined(__NCURSES_H) && !defined(_TERM_H) +extern char *tgetstr(const char *, char **); +extern char *tgoto(const char *, int, int); extern int tgetent(char *, const char *); extern int tgetflag(const char *); extern int tgetnum(const char *); -extern char *tgetstr(const char *, char **); - extern int tputs(const char *, int, int (*)(int)); - -extern char *tgoto(const char *, int, int); +#endif #ifdef __cplusplus } diff --git a/lib/libcurses/terminfo.3 b/lib/libcurses/terminfo.3 index 1786e754a4a..6dd09ba3764 100644 --- a/lib/libcurses/terminfo.3 +++ b/lib/libcurses/terminfo.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: terminfo.3,v 1.3 1998/09/13 19:16:31 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -27,7 +29,6 @@ .\"*************************************************************************** .\" .\" $From: curs_terminfo.3x,v 1.9 1998/07/18 02:49:20 tom Exp $ -.\" $OpenBSD: terminfo.3,v 1.2 1998/07/25 23:48:42 millert Exp $ .TH terminfo 3 "" .ds n 5 .SH NAME diff --git a/lib/libcurses/trace_buf.c b/lib/libcurses/trace_buf.c index a096fc7a9f8..0fad3c81040 100644 --- a/lib/libcurses/trace_buf.c +++ b/lib/libcurses/trace_buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trace_buf.c,v 1.4 1998/08/15 18:44:46 millert Exp $ */ +/* $OpenBSD: trace_buf.c,v 1.5 1998/09/13 19:16:31 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -37,14 +37,16 @@ #include <curses.priv.h> -MODULE_ID("$From: trace_buf.c,v 1.5 1998/05/30 23:30:09 Todd.Miller Exp $") +MODULE_ID("$From: trace_buf.c,v 1.6 1998/08/15 23:37:25 tom Exp $") + +typedef struct { + char *text; + size_t size; +} LIST; char * _nc_trace_buf(int bufnum, size_t want) { - static struct { - char *text; - size_t size; - } *list, *nlist; + static LIST *list; static size_t have; #if NO_LEAKS @@ -62,33 +64,19 @@ char * _nc_trace_buf(int bufnum, size_t want) if ((size_t)(bufnum+1) > have) { size_t need = (bufnum + 1) * 2; size_t used = sizeof(*list) * need; - nlist = (list == 0) ? malloc(used) : realloc(list, used); - if (nlist == 0) { - if (list != 0) - free(list); - return(NULL); - } - list = nlist; + if ((list = (LIST *)_nc_doalloc(list, used)) == 0) + return(0); while (need > have) list[have++].text = 0; } - if (list[bufnum].text == 0) + if (list[bufnum].text == 0 + || want > list[bufnum].size) { - list[bufnum].text = malloc(want); + if ((list[bufnum].text = (char *)_nc_doalloc(list[bufnum].text, want)) != 0) + list[bufnum].size = want; } - else if (want > list[bufnum].size) - { - void *p = realloc(list[bufnum].text, want); - if (p != 0) { - list[bufnum].text = p; - } else { - free(list[bufnum].text); - list[bufnum].text = 0; - } - } - list[bufnum].size = want; if (list[bufnum].text != 0) *(list[bufnum].text) = '\0'; return list[bufnum].text; diff --git a/lib/libcurses/wresize.3 b/lib/libcurses/wresize.3 index ac53172f4bc..5d718031ee7 100644 --- a/lib/libcurses/wresize.3 +++ b/lib/libcurses/wresize.3 @@ -1,3 +1,5 @@ +.\" $OpenBSD: wresize.3,v 1.6 1998/09/13 19:16:31 millert Exp $ +.\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * .\" * @@ -29,7 +31,6 @@ .\" Author: Thomas E. Dickey <dickey@clark.net> 1996 .\" .\" $From: wresize.3x,v 1.5 1998/03/14 23:42:44 tom Exp $ -.\" $OpenBSD: wresize.3,v 1.5 1998/07/23 21:20:09 millert Exp $ .TH wresize 3 "" .SH NAME \fBwresize\fR - resize a curses window @@ -40,7 +41,7 @@ \fBint wresize(WINDOW *win, int lines, int columns);\fR .. .SH DESCRIPTION -The \fBwresize\fR function reallocates storage for an \fBcurses\fR +The \fBwresize\fR function reallocates storage for a \fBcurses\fR window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window's data is filled with blanks that have the current background rendition diff --git a/lib/libcurses/wresize.c b/lib/libcurses/wresize.c index f51d29e60e1..d904dcca229 100644 --- a/lib/libcurses/wresize.c +++ b/lib/libcurses/wresize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wresize.c,v 1.6 1998/08/15 18:44:47 millert Exp $ */ +/* $OpenBSD: wresize.c,v 1.7 1998/09/13 19:16:31 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ #include <curses.priv.h> #include <term.h> -MODULE_ID("$From: wresize.c,v 1.9 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$From: wresize.c,v 1.10 1998/08/15 22:59:39 tom Exp $") /* * Reallocate a curses WINDOW struct to either shrink or grow to the specified @@ -43,17 +43,7 @@ MODULE_ID("$From: wresize.c,v 1.9 1998/02/11 12:13:54 tom Exp $") * blanks. The application is responsible for repainting the blank area. */ -static void *doalloc(void *p, size_t n) -{ - void *np; - - np = p ? realloc(p, n) : malloc(n); - if (np == 0 && p != 0) - free(p); - return np; -} - -#define DOALLOC(p,t,n) (t *)doalloc(p, sizeof(t)*(n)) +#define DOALLOC(p,t,n) (t *)_nc_doalloc(p, sizeof(t)*(n)) #define ld_ALLOC(p,n) DOALLOC(p,struct ldat,n) #define c_ALLOC(p,n) DOALLOC(p,chtype,n) diff --git a/lib/libcurses/write_entry.c b/lib/libcurses/write_entry.c index d7b3402b4d0..4ecda83d004 100644 --- a/lib/libcurses/write_entry.c +++ b/lib/libcurses/write_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: write_entry.c,v 1.3 1998/08/03 17:02:47 millert Exp $ */ +/* $OpenBSD: write_entry.c,v 1.4 1998/09/13 19:16:31 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -51,7 +51,7 @@ #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) #endif -MODULE_ID("$From: write_entry.c,v 1.30 1998/08/01 23:46:32 tom Exp $") +MODULE_ID("$From: write_entry.c,v 1.31 1998/08/22 18:02:09 tom Exp $") static int total_written; @@ -215,7 +215,6 @@ char symlinkname[PATH_MAX]; #endif /* USE_SYMLINKS */ static int call_count; static time_t start_time; /* time at start of writes */ -int code; if (call_count++ == 0) { start_time = 0; @@ -309,6 +308,7 @@ int code; else if (_nc_access(linkname, W_OK) == 0) #if HAVE_LINK { + int code; #if USE_SYMLINKS strcpy(symlinkname, "../"); strncat(symlinkname, filename, sizeof(symlinkname) - 4); |