From: Thomas E. Dickey Date: Sun, 14 Jul 2013 01:08:41 +0000 (+0000) Subject: ncurses 5.9 - patch 20130713 X-Git-Tag: v6.0~97 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=ba78eb501a2ed01647123dbe7279ca0f38782e04 ncurses 5.9 - patch 20130713 + improve manpages for initscr and setupterm. + minor compiler-warning fixes --- diff --git a/NEWS b/NEWS index cf1da26a..6154a3ca 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2078 2013/07/06 20:51:48 tom Exp $ +-- $Id: NEWS,v 1.2079 2013/07/13 23:21:51 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,10 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20130713 + + improve manpages for initscr and setupterm. + + minor compiler-warning fixes + 20130706 + add fallback defs for and (cf: 20120225). + add check for size of wchar_t, use that to suppress a chunk of diff --git a/dist.mk b/dist.mk index 55d1f8a4..05b88c7c 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.935 2013/07/06 15:25:26 tom Exp $ +# $Id: dist.mk,v 1.936 2013/07/13 17:11:30 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 9 -NCURSES_PATCH = 20130706 +NCURSES_PATCH = 20130713 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/man/curs_initscr.3x b/man/curs_initscr.3x index 83a01eaf..97334580 100644 --- a/man/curs_initscr.3x +++ b/man/curs_initscr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2010,2012 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 * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_initscr.3x,v 1.17 2010/12/04 18:36:58 tom Exp $ +.\" $Id: curs_initscr.3x,v 1.18 2013/07/13 22:45:52 tom Exp $ .TH curs_initscr 3X "" .na .hy 0 @@ -121,10 +121,19 @@ Old versions of curses, e.g., BSD 4.4, may have returned a null pointer from \fBinitscr\fR when an error is detected, rather than exiting. It is safe but redundant to check the return value of \fBinitscr\fR in XSI Curses. +.PP +If the TERM variable is missing or empty, \fBinitscr\fP uses the +value ``unknown'', +which normally corresponds to a terminal entry with the \fIgeneric\fP +(\fIgn\fP) capability. +Generic entries are detected by \fBsetupterm\fP(3X) and cannot be +used for full-screen operation. +Other implementations may handle a missing/empty TERM variable differently. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_kernel\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_slk\fR(3X), +\fBcurs_terminfo\fR(3X), \fBcurs_util\fR(3X), \fBcurs_variables\fR(3X). diff --git a/man/curs_terminfo.3x b/man/curs_terminfo.3x index a9c6231b..12d4b0fe 100644 --- a/man/curs_terminfo.3x +++ b/man/curs_terminfo.3x @@ -26,8 +26,11 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_terminfo.3x,v 1.37 2013/01/12 18:11:40 tom Exp $ +.\" $Id: curs_terminfo.3x,v 1.38 2013/07/13 23:12:13 tom Exp $ .TH curs_terminfo 3X "" +.de bP +.IP \(bu 4 +.. .ds n 5 .na .hy 0 @@ -150,11 +153,17 @@ If \fBERR\fR is returned, examine \fIerrret\fR: .TP 5 .B 1 means that the terminal is hardcopy, cannot be used for curses applications. +.IP +\fBsetupterm\fP determines if the entry is a hardcopy type by +checking the \fIhc\fP (\fIhardcopy\fP) capability. .TP 5 .B 0 means that the terminal could not be found, or that it is a generic type, having too little information for curses applications to run. +.IP +\fBsetupterm\fP determines if the entry is a generic type by +checking the \fIgn\fP (\fIgeneric\fP) capability. .TP 5 .B \-1 means that the \fBterminfo\fR database could not be found. @@ -275,7 +284,7 @@ Routines that return pointers always return \fBNULL\fR on error. .PP X/Open defines no error conditions. In this implementation -.RS +.RS 5 .TP 5 \fBdel_curterm\fP returns an error @@ -313,6 +322,31 @@ be considered non-portable. All other functions are as described by X/Open. \fBsetupterm\fP copies the terminal name to the array \fBttytype\fP. This is not part of X/Open Curses, but is assumed by some applications. .PP +If configured to use the terminal-driver, +e.g., for the MinGW port, +.bP +\fBsetupterm\fP interprets a missing/empty TERM variable as the +special value ``unknown''. +.bP +\fBsetupterm\fP allows explicit use of the +the windows console driver by checking if $TERM is set to +``#win32con'' or an abbreviation of that string. +.PP +Older versions of \fBncurses\fP assumed that the file descriptor passed to +\fBsetupterm\fP from \fBinitscr\fP or \fBnewterm\fP uses buffered I/O, +and would write to the corresponding stream. +In addition to the limitation that the terminal was left in block-buffered +mode on exit (like SystemV curses), +it was problematic because \fBncurses\fP +did not allow a reliable way to cleanup on receiving SIGTSTP. +The current version uses output buffers managed directly by \fBncurses\fP. +Some of the low-level functions described in this manual page write +to the standard output. +They are not signal-safe. +The high-level functions in \fBncurses\fP use +alternate versions of these functions +using the more reliable buffering scheme. +.PP In System V Release 4, \fBset_curterm\fR has an \fBint\fR return type and returns \fBOK\fR or \fBERR\fR. We have chosen to implement the X/Open Curses semantics. @@ -337,7 +371,7 @@ X/Open Curses Issue 7 proposed the \fBtiparam\fP function in mid-2009. X/Open notes that after calling \fBmvcur\fR, the curses state may not match the actual terminal state, and that an application should touch and refresh the window before resuming normal curses calls. -Both ncurses and System V Release 4 curses implement \fBmvcur\fR using +Both \fBncurses\fP and System V Release 4 curses implement \fBmvcur\fR using the SCREEN data allocated in either \fBinitscr\fR or \fBnewterm\fR. So though it is documented as a terminfo function, \fBmvcur\fR is really a curses function which is not well specified. diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 653a3741..814d1116 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.88 2013/06/03 11:05:54 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.89 2013/07/13 21:55:32 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -162,18 +162,15 @@ name_ending(char *name) static bool remove_collision(char *n1, char *n2) { - char *p1 = n1; char *p2 = n2; char *pstart, *qstart, *pend, *qend; bool removed = FALSE; #if NCURSES_USE_TERMCAP && NCURSES_XNAMES if ((_nc_syntax == SYN_TERMCAP) && _nc_user_definable) { - p1 = n1 = skip_index(n1); + n1 = skip_index(n1); p2 = n2 = skip_index(n2); } -#else - (void) p1; #endif for (pstart = n1; (pend = name_ending(pstart)); pstart = next_name(pend)) { diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index e67ced48..4d1cb116 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.123 2013/05/25 20:17:49 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.124 2013/07/13 20:06:43 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -107,7 +107,7 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) return (int) want; } -#define Read(buf, count) fake_read(buffer, &offset, limit, buf, (unsigned) count) +#define Read(buf, count) fake_read(buffer, &offset, limit, (char *) buf, (unsigned) count) #define read_shorts(buf, count) \ (Read(buf, (count)*2) == (int) (count)*2) diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index 021fc7d1..05e57df2 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 * @@ -56,7 +56,7 @@ #include #include -MODULE_ID("$Id: read_termcap.c,v 1.87 2012/05/05 19:40:50 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.88 2013/07/13 22:11:06 tom Exp $") #if !PURE_TERMINFO @@ -791,13 +791,11 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) int i; char pathbuf[PBUFSIZ]; /* holds raw path of filenames */ CGETENT_CONST char *pathvec[PVECSIZ]; /* point to names in pathbuf */ - CGETENT_CONST char **pvec; /* holds usable tail of path vector */ NCURSES_CONST char *termpath; string_desc desc; *lineno = 1; fname = pathvec; - pvec = pathvec; p = pathbuf; cp = use_terminfo_vars()? getenv("TERMCAP") : NULL; diff --git a/package/debian/changelog b/package/debian/changelog index a8569b89..97214c42 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20130706) unstable; urgency=low +ncurses6 (5.9-20130713) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 06 Jul 2013 11:25:23 -0400 + -- Thomas E. Dickey Sat, 13 Jul 2013 14:01:04 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/ncurses.spec b/package/ncurses.spec index 04c54100..62037f9b 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Release: 5.9 -Version: 20130706 +Version: 20130713 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz