diff options
author | Xin LI <delphij@FreeBSD.org> | 2014-02-28 19:18:07 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2014-02-28 19:18:07 +0000 |
commit | a0044ffc69cfe39a3b0b2d208e0952254555afc6 (patch) | |
tree | 7b2d708d03277cdd2560e9ce6572bdafc2e58bab /include | |
parent | 4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a (diff) | |
download | src-a0044ffc69cfe39a3b0b2d208e0952254555afc6.tar.gz src-a0044ffc69cfe39a3b0b2d208e0952254555afc6.zip |
Redo import of ncurses 5.9 (stripped).vendor/ncurses/5.9-20110404_stripped
Notes
Notes:
svn path=/vendor/ncurses/dist/; revision=262617
svn path=/vendor/ncurses/5.9-20110404_stripped/; revision=262631; tag=vendor/ncurses/5.9-20110404_stripped
Diffstat (limited to 'include')
-rw-r--r-- | include/Caps | 10 | ||||
-rw-r--r-- | include/Caps.aix4 | 10 | ||||
-rw-r--r-- | include/Caps.hpux11 | 10 | ||||
-rw-r--r-- | include/Caps.keys | 10 | ||||
-rw-r--r-- | include/Caps.osf1r5 | 10 | ||||
-rw-r--r-- | include/Caps.uwin | 10 | ||||
-rw-r--r-- | include/MKterm.h.awk.in | 56 | ||||
-rw-r--r-- | include/Makefile.in | 20 | ||||
-rw-r--r-- | include/capdefaults.c | 6 | ||||
-rw-r--r-- | include/curses.h.in | 270 | ||||
-rw-r--r-- | include/curses.tail | 32 | ||||
-rw-r--r-- | include/curses.wide | 68 | ||||
-rw-r--r-- | include/headers | 6 | ||||
-rw-r--r-- | include/nc_alloc.h | 18 | ||||
-rw-r--r-- | include/nc_mingw.h | 69 | ||||
-rw-r--r-- | include/nc_panel.h | 35 | ||||
-rw-r--r-- | include/nc_tparm.h | 12 | ||||
-rw-r--r-- | include/ncurses_defs | 11 | ||||
-rw-r--r-- | include/ncurses_dll.h.in (renamed from include/ncurses_dll.h) | 20 | ||||
-rw-r--r-- | include/ncurses_mingw.h | 164 | ||||
-rw-r--r-- | include/term_entry.h | 12 | ||||
-rw-r--r-- | include/tic.h | 28 | ||||
-rw-r--r-- | include/unctrl.h.in | 8 |
23 files changed, 712 insertions, 183 deletions
diff --git a/include/Caps b/include/Caps index 7c63c7f039a5..f9a8ebd32aac 100644 --- a/include/Caps +++ b/include/Caps @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-2006,2010 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"), # @@ -29,7 +29,7 @@ # Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 # and: Eric S. Raymond <esr@snark.thyrsus.com> # -# $Id: Caps,v 1.36 2006/05/27 15:33:04 tom Exp $ +# $Id: Caps,v 1.37 2010/12/04 18:47:13 tom Exp $ # # This is the master termcap/terminfo capability table. # @@ -1256,9 +1256,3 @@ infoalias ksel kslt IBM key_select # kcmd, kend, khlp, and kf11...kf63. # ############################################################################# -# -# The following sets edit modes for GNU EMACS -# Local Variables: -# case-fold-search:nil -# truncate-lines:t -# End: diff --git a/include/Caps.aix4 b/include/Caps.aix4 index 75913dc6e9a4..5864d7b7afe6 100644 --- a/include/Caps.aix4 +++ b/include/Caps.aix4 @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. # +# Copyright (c) 2001-2006,2010 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"), # @@ -28,7 +28,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.aix4,v 1.7 2006/05/27 15:33:04 tom Exp $ +# $Id: Caps.aix4,v 1.8 2010/12/04 18:47:13 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with AIX 4.x's terminfo. @@ -1247,9 +1247,3 @@ infoalias ksel kslt IBM key_select # kcmd, kend, khlp, and kf11...kf63. # ############################################################################# -# -# The following sets edit modes for GNU EMACS -# Local Variables: -# case-fold-search:nil -# truncate-lines:t -# End: diff --git a/include/Caps.hpux11 b/include/Caps.hpux11 index b74acdb44b70..8dbe656cd617 100644 --- a/include/Caps.hpux11 +++ b/include/Caps.hpux11 @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2002-2003,2006 Free Software Foundation, Inc. # +# Copyright (c) 2002-2006,2010 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"), # @@ -28,7 +28,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.hpux11,v 1.4 2006/05/27 15:33:04 tom Exp $ +# $Id: Caps.hpux11,v 1.5 2010/12/04 18:47:13 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with HPUX 11.x's terminfo. @@ -1270,9 +1270,3 @@ infoalias ksel kslt IBM key_select # kcmd, kend, khlp, and kf11...kf63. # ############################################################################# -# -# The following sets edit modes for GNU EMACS -# Local Variables: -# case-fold-search:nil -# truncate-lines:t -# End: diff --git a/include/Caps.keys b/include/Caps.keys index 6841ae5c1d5b..4d4fe30b8130 100644 --- a/include/Caps.keys +++ b/include/Caps.keys @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. # +# Copyright (c) 2001-2006,2010 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"), # @@ -29,7 +29,7 @@ # Author: Thomas Dickey # and: Ilya Zakharevich # -# $Id: Caps.keys,v 1.3 2006/05/27 15:33:04 tom Exp $ +# $Id: Caps.keys,v 1.4 2010/12/04 18:47:13 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is illustrates an experimental extension to describe alt-, shift- and @@ -1346,9 +1346,3 @@ infoalias ksel kslt IBM key_select # kcmd, kend, khlp, and kf11...kf63. # ############################################################################# -# -# The following sets edit modes for GNU EMACS -# Local Variables: -# case-fold-search:nil -# truncate-lines:t -# End: diff --git a/include/Caps.osf1r5 b/include/Caps.osf1r5 index d9ea5646ff5a..79dbf50fd3db 100644 --- a/include/Caps.osf1r5 +++ b/include/Caps.osf1r5 @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2002,2006 Free Software Foundation, Inc. # +# Copyright (c) 2002-2006,2010 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"), # @@ -28,7 +28,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.osf1r5,v 1.4 2006/05/27 15:33:04 tom Exp $ +# $Id: Caps.osf1r5,v 1.5 2010/12/04 18:47:13 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with OSF/1 version 5 (Tru64) terminfo. @@ -1266,9 +1266,3 @@ infoalias ksel kslt IBM key_select # kcmd, kend, khlp, and kf11...kf63. # ############################################################################# -# -# The following sets edit modes for GNU EMACS -# Local Variables: -# case-fold-search:nil -# truncate-lines:t -# End: diff --git a/include/Caps.uwin b/include/Caps.uwin index 450eaeb6ae58..31020cd0700a 100644 --- a/include/Caps.uwin +++ b/include/Caps.uwin @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. # +# Copyright (c) 2001-2006,2010 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"), # @@ -28,7 +28,7 @@ # # Author: Thomas Dickey # -# $Id: Caps.uwin,v 1.4 2006/05/27 15:33:04 tom Exp $ +# $Id: Caps.uwin,v 1.5 2010/12/04 18:49:20 tom Exp $ # # This is an adaptation of ncurses' termcap/terminfo capability table, which # is designed to align with U/Win's terminfo. @@ -1082,9 +1082,3 @@ infoalias ksel kslt IBM key_select # kcmd, kend, khlp, and kf11...kf63. # ############################################################################# -# -# The following sets edit modes for GNU EMACS -# Local Variables: -# case-fold-search:nil -# truncate-lines:t -# End: diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in index 5fc20529b11b..261c40d75619 100644 --- a/include/MKterm.h.awk.in +++ b/include/MKterm.h.awk.in @@ -1,7 +1,7 @@ # vile:awkmode BEGIN { print "/****************************************************************************" - print " * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *" + print " * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *" print " * *" print " * Permission is hereby granted, free of charge, to any person obtaining a *" print " * copy of this software and associated documentation files (the *" @@ -34,7 +34,7 @@ BEGIN { print "/* and: Thomas E. Dickey 1995-on */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.50 2008/05/24 23:13:59 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.58 2010/01/09 19:53:26 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -130,11 +130,15 @@ BEGIN { print "" print "#else /* !HAVE_TERMIO_H */" print "" + print "#if __MINGW32__" + print "# include <ncurses_mingw.h>" + print "# define TTY struct termios" + print "#else" print "#undef TERMIOS" print "#include <sgtty.h>" print "#include <sys/ioctl.h>" print "#define TTY struct sgttyb" - print "" + print "#endif /* MINGW32 */" print "#endif /* HAVE_TERMIO_H */" print "" print "#endif /* HAVE_TERMIOS_H */" @@ -228,8 +232,16 @@ END { print " char * _termname; /* used for termname() */" print "} TERMINAL;" print "" - print "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@" + print "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@" + print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" + print "#elif @cf_cv_enable_reentrant@" print "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);" + print "#define cur_term NCURSES_PUBLIC_VAR(cur_term())" + print "#else" + print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" + print "#endif" + print "" + print "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@" print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);" print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);" print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);" @@ -240,7 +252,6 @@ END { print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);" print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);" print "" - print "#define cur_term NCURSES_PUBLIC_VAR(cur_term())" print "#define boolnames NCURSES_PUBLIC_VAR(boolnames())" print "#define boolcodes NCURSES_PUBLIC_VAR(boolcodes())" print "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())" @@ -253,8 +264,6 @@ END { print "" print "#else" print "" - print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" - print "" print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];" print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];" print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];" @@ -300,6 +309,8 @@ END { print "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */" print "#endif" print "" + print "extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */" + print "" print "#endif /* __NCURSES_H */" print "" print "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */" @@ -312,6 +323,37 @@ END { print "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));" print "#endif /* NCURSES_TERMCAP_H_incl */" print "" + print "/*" + print " * Include curses.h before term.h to enable these extensions." + print " */" + print "#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)" + print "" + print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tigetstr) (SCREEN*, NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(putp) (SCREEN*, const char *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetflag) (SCREEN*, NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetnum) (SCREEN*, NCURSES_CONST char *);" + print "" + print "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */" + print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, ...); /* special */" + print "#else" + print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */" + print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm_varargs) (SCREEN*, NCURSES_CONST char *, ...); /* special */" + print "#endif" + print "" + print "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */" + print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgetstr) (SCREEN*, NCURSES_CONST char *, char **);" + print "extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetflag) (SCREEN*, NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetnum) (SCREEN*, NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);" + print "" + print "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);" + print "" + print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);" + print "#endif /* NCURSES_SP_FUNCS */" + print "" print "#ifdef __cplusplus" print "}" print "#endif" diff --git a/include/Makefile.in b/include/Makefile.in index 1a48a1700a86..e2a2f8a22866 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.35 2001/12/08 18:50:06 tom Exp $ +# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,2009,2010 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"), # @@ -40,6 +40,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile DESTDIR = @DESTDIR@ @@ -54,6 +55,9 @@ INSTALL_DATA = @INSTALL_DATA@ AWK = @AWK@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + VERSION = @cf_cv_rel_version@ # The "Caps" file specifies the terminfo database format, as well as the list @@ -64,6 +68,7 @@ TERMINFO_CAPS = $(srcdir)/@TERMINFO_CAPS@ CONFIG_SRC = \ MKterm.h.awk \ curses.head \ + ncurses_dll.h \ termcap.h \ unctrl.h @@ -73,6 +78,7 @@ AUTO_SRC = \ hashsize.h \ ncurses_def.h \ parametrized.h \ + config.h \ term.h ################################################################################ @@ -104,11 +110,15 @@ ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh parametrized.h: $(TERMINFO_CAPS) $(srcdir)/MKparametrized.sh AWK=$(AWK) sh $(srcdir)/MKparametrized.sh $(TERMINFO_CAPS) >$@ +# This is required by pthread.h on MinGW +config.h: + touch $@ + tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace @@ -117,7 +127,7 @@ clean :: mostlyclean -rm -f $(AUTO_SRC) distclean :: clean - -rm -f Makefile $(CONFIG_SRC) + -rm -f Makefile $(CONFIG_SRC) config.h realclean :: distclean diff --git a/include/capdefaults.c b/include/capdefaults.c index 33f2fe8f0299..da76cc1d7a57 100644 --- a/include/capdefaults.c +++ b/include/capdefaults.c @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: capdefaults.c,v 1.13 2008/08/04 12:33:42 tom Exp $ */ +/* $Id: capdefaults.c,v 1.14 2008/11/16 00:19:59 juergen Exp $ */ /* * Compute obsolete capabilities. The reason this is an include file is @@ -44,11 +44,11 @@ * postprocess_termcap(). */ { - char *sp; + char *strp; short capval; #define EXTRACT_DELAY(str) \ - (short) (sp = strchr(str, '*'), sp ? atoi(sp+1) : 0) + (short) (strp = strchr(str, '*'), strp ? atoi(strp+1) : 0) /* current (4.4BSD) capabilities marked obsolete */ if (VALID_STRING(carriage_return) diff --git a/include/curses.h.in b/include/curses.h.in index 53da9a564fe5..5774154e8538 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 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 * @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.187 2008/08/30 20:11:29 tom Exp $ */ +/* $Id: curses.h.in,v 1.220 2011/01/22 19:47:20 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -40,12 +40,6 @@ #define CURSES 1 #define CURSES_H 1 -/* This should be defined for the enhanced functionality to be visible. - * However, some of the wide-character (enhanced) functionality is missing. - * So we do not define it (yet). -#define _XOPEN_CURSES 1 - */ - /* These are defined only in curses.h, and are used for conditional compiles */ #define NCURSES_VERSION_MAJOR @NCURSES_MAJOR@ #define NCURSES_VERSION_MINOR @NCURSES_MINOR@ @@ -110,6 +104,19 @@ #endif /* + * The reentrant code relies on the opaque setting, but adds features. + */ +#ifndef NCURSES_REENTRANT +#define NCURSES_REENTRANT @cf_cv_enable_reentrant@ +#endif + +/* + * Control whether bindings for interop support are added. + */ +#undef NCURSES_INTEROP_FUNCS +#define NCURSES_INTEROP_FUNCS @NCURSES_INTEROP_FUNCS@ + +/* * The internal type used for window dimensions. */ #undef NCURSES_SIZE_T @@ -137,12 +144,24 @@ typedef unsigned @cf_cv_typeof_chtype@ chtype; typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t; #endif +/* + * We need FILE, etc. Include this before checking any feature symbols. + */ #include <stdio.h> -#include <unctrl.h> + +/* + * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or + * conflicting) when _XOPEN_SOURCE is 500 or greater. + */ +#undef NCURSES_WIDECHAR +#if defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5) +#define NCURSES_WIDECHAR +#endif + #include <stdarg.h> /* we need va_list */ -#ifdef _XOPEN_SOURCE_EXTENDED +#ifdef NCURSES_WIDECHAR #include <stddef.h> /* we want wchar_t */ -#endif /* _XOPEN_SOURCE_EXTENDED */ +#endif /* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also * implement it. If so, we must use the C++ compiler's type to avoid conflict @@ -224,9 +243,9 @@ extern "C" { /* line graphics */ -#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@ +#if @BROKEN_LINKER@ || NCURSES_REENTRANT NCURSES_WRAPPED_VAR(chtype*, acs_map); -#define acs_map (_nc_acs_map()) +#define acs_map NCURSES_PUBLIC_VAR(acs_map()) #else extern NCURSES_EXPORT_VAR(chtype) acs_map[]; #endif @@ -323,7 +342,7 @@ typedef struct _win_st WINDOW; typedef chtype attr_t; /* ...must be at least as wide as chtype */ -#ifdef _XOPEN_SOURCE_EXTENDED +#ifdef NCURSES_WIDECHAR #if @NCURSES_LIBUTF8@ #ifdef mblen /* libutf8.h defines it w/o undefining first */ @@ -344,7 +363,13 @@ typedef unsigned short wchar_t@NCURSES_OK_WCHAR_T@; typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@; #endif -#define CCHARW_MAX 5 +/* + * cchar_t stores an array of CCHARW_MAX wide characters. The first is + * normally a spacing character. The others are non-spacing. If those + * (spacing and nonspacing) do not fill the array, a null L'\0' follows. + * Otherwise, a null is assumed to follow when extracting via getcchar(). + */ +#define CCHARW_MAX @NCURSES_CCHARW_MAX@ typedef struct { attr_t attr; @@ -357,7 +382,7 @@ typedef struct } cchar_t; -#endif /* _XOPEN_SOURCE_EXTENDED */ +#endif /* NCURSES_WIDECHAR */ #if !NCURSES_OPAQUE struct ldat; @@ -409,7 +434,7 @@ struct _win_st NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ -#ifdef _XOPEN_SOURCE_EXTENDED +#ifdef NCURSES_WIDECHAR cchar_t _bkgrnd; /* current background char/attribute pair */ #if @NCURSES_EXT_COLORS@ int _color; /* current color-pair for non-space character */ @@ -461,8 +486,8 @@ typedef struct _nc_event *events[1]; } _nc_eventlist; -extern NCURSES_EXPORT(int) wgetch_events(WINDOW *, _nc_eventlist *); /* experimental */ -extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);/* experimental */ +extern NCURSES_EXPORT(int) wgetch_events (WINDOW *, _nc_eventlist *); /* experimental */ +extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *);/* experimental */ #endif /* NCURSES_WGETCH_EVENTS */ #endif /* NCURSES_EXT_FUNCS */ @@ -511,6 +536,12 @@ extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *); #endif /* + * Curses uses a helper function. Define our type for this to simplify + * extending it for the sp-funcs feature. + */ +typedef int (*NCURSES_OUTC)(int); + +/* * Function prototypes. This is the complete X/Open Curses list of required * functions. Those marked `generated' will have sources generated from the * macro definitions later in this file, in order to satisfy XPG4.2 @@ -646,7 +677,7 @@ extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* genera extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */ extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */ extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ +extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */ extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...) /* implemented */ GCC_PRINTFLIKE(4,5); @@ -654,9 +685,9 @@ extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) GCC_SCANFLIKE(4,5); extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */ extern NCURSES_EXPORT(int) napms (int); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */ extern NCURSES_EXPORT(int) nl (void); /* implemented */ extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */ extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */ @@ -710,7 +741,7 @@ extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */ extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */ extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */ extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ +extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ extern NCURSES_EXPORT(int) standout (void); /* generated */ extern NCURSES_EXPORT(int) standend (void); /* generated */ extern NCURSES_EXPORT(int) start_color (void); /* implemented */ @@ -727,7 +758,7 @@ extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ -extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* implemented */ +extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC); /* implemented */ extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list); /* implemented */ extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* generated */ @@ -805,6 +836,8 @@ extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,l extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */ #endif +extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */ + /* * These functions are not in X/Open, but we use them in macro definitions: */ @@ -821,7 +854,7 @@ extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */ /* * vid_attr() was implemented originally based on a draft of X/Open curses. */ -#ifndef _XOPEN_SOURCE_EXTENDED +#ifndef NCURSES_WIDECHAR #define vid_attr(a,pair,opts) vidattr(a) #endif @@ -838,6 +871,7 @@ extern NCURSES_EXPORT(char *) keybound (int, int); extern NCURSES_EXPORT(const char *) curses_version (void); extern NCURSES_EXPORT(int) assume_default_colors (int, int); extern NCURSES_EXPORT(int) define_key (const char *, int); +extern NCURSES_EXPORT(int) get_escdelay (void); extern NCURSES_EXPORT(int) key_defined (const char *); extern NCURSES_EXPORT(int) keyok (int, bool); extern NCURSES_EXPORT(int) resize_term (int, int); @@ -856,23 +890,135 @@ extern NCURSES_EXPORT(void) nofilter(void); * These extensions provide access to information stored in the WINDOW even * when NCURSES_OPAQUE is set: */ -extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */ +extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_pad (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* @GENERATED_EXT_FUNCS@ */ #else #define curses_version() NCURSES_VERSION #endif +/* + * Extra extension-functions, which pass a SCREEN pointer rather than using + * a global variable SP. + */ +#if @NCURSES_SP_FUNCS@ +#undef NCURSES_SP_FUNCS +#define NCURSES_SP_FUNCS @NCURSES_PATCH@ +#define NCURSES_SP_NAME(name) name##_sp + +/* Define the sp-funcs helper function */ +#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC) +typedef int (*NCURSES_SP_OUTC)(SCREEN*, int); + +extern NCURSES_EXPORT(SCREEN *) new_prescr (void); /* implemented:SP_FUNC */ + +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(doupdate) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented:SP_FUNC */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, short, short, short, short); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, short, short, short); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(char) NCURSES_SP_NAME(killchar) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, NCURSES_CONST char *, FILE *, FILE *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, short, short*, short*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int)); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, short, void*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, short); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (SCREEN*, int, const char *, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(termattrs) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */ +#if @NCURSES_EXT_FUNCS@ +extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined) (SCREEN*, const char *); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */ /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*); /* implemented:EXT_SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ +#endif +#else +#undef NCURSES_SP_FUNCS +#define NCURSES_SP_FUNCS 0 +#define NCURSES_SP_NAME(name) name +#define NCURSES_SP_OUTC NCURSES_OUTC +#endif + /* attributes */ #define NCURSES_ATTR_SHIFT 8 @@ -951,7 +1097,7 @@ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generat /* It seems older SYSV curses versions define these */ #if !NCURSES_OPAQUE -#define getattrs(win) ((win) ? (win)->_attrs : A_NORMAL) +#define getattrs(win) NCURSES_CAST(int, (win) ? (win)->_attrs : A_NORMAL) #define getcurx(win) ((win) ? (win)->_curx : ERR) #define getcury(win) ((win) ? (win)->_cury : ERR) #define getbegx(win) ((win) ? (win)->_begx : ERR) @@ -969,11 +1115,17 @@ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generat #define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL) #if !NCURSES_OPAQUE -#if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@ -#define wattrset(win,at) ((win)->_color = PAIR_NUMBER(at), \ - (win)->_attrs = (at)) +#if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@ +#define wattrset(win,at) ((win) \ + ? ((win)->_color = PAIR_NUMBER(at), \ + (win)->_attrs = NCURSES_CAST(attr_t, at), \ + OK) \ + : ERR) #else -#define wattrset(win,at) ((win)->_attrs = (at)) +#define wattrset(win,at) ((win) \ + ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \ + OK) \ + : ERR) #endif #endif /* NCURSES_OPAQUE */ @@ -1003,7 +1155,7 @@ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generat * These apply to the first 256 color pairs. */ #define COLOR_PAIR(n) NCURSES_BITS(n, 0) -#define PAIR_NUMBER(a) (NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) +#define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) /* * pseudo functions for standard screen @@ -1111,17 +1263,17 @@ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generat #define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) #if !NCURSES_OPAQUE -#if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@ +#if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@ #define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \ (win)->_color = (p), \ OK) #define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ - (void)((p) != (void *)0 && (*(p) = (win)->_color)), \ + (void)((p) != (void *)0 && (*(p) = (short)(win)->_color)), \ OK) #else -#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK) +#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p)), OK) #define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ - (void)((p) != (void *)0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \ + (void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs))), \ OK) #endif #endif /* NCURSES_OPAQUE */ @@ -1148,16 +1300,18 @@ NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); */ #if @NCURSES_EXT_FUNCS@ #if !NCURSES_OPAQUE -#define is_cleared(win) ((win)->_clear) -#define is_idcok(win) ((win)->_idcok) -#define is_idlok(win) ((win)->_idlok) -#define is_immedok(win) ((win)->_immed) -#define is_keypad(win) ((win)->_use_keypad) -#define is_leaveok(win) ((win)->_leaveok) -#define is_nodelay(win) ((win)->_delay == 0) -#define is_notimeout(win) ((win)->_notimeout) -#define is_scrollok(win) ((win)->_scroll) -#define is_syncok(win) ((win)->_sync) +#define is_cleared(win) ((win) ? (win)->_clear : FALSE) +#define is_idcok(win) ((win) ? (win)->_idcok : FALSE) +#define is_idlok(win) ((win) ? (win)->_idlok : FALSE) +#define is_immedok(win) ((win) ? (win)->_immed : FALSE) +#define is_keypad(win) ((win) ? (win)->_use_keypad : FALSE) +#define is_leaveok(win) ((win) ? (win)->_leaveok : FALSE) +#define is_nodelay(win) ((win) ? ((win)->_delay == 0) : FALSE) +#define is_notimeout(win) ((win) ? (win)->_notimeout : FALSE) +#define is_pad(win) ((win) ? ((win)->_flags & _ISPAD) != 0 : FALSE) +#define is_scrollok(win) ((win) ? (win)->_scroll : FALSE) +#define is_subwin(win) ((win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE) +#define is_syncok(win) ((win) ? (win)->_sync : FALSE) #define wgetparent(win) ((win) ? (win)->_parent : 0) #define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) #endif @@ -1173,7 +1327,7 @@ NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); * It gives the ESC expire time in milliseconds. * b. ttytype is needed for backward compatibility */ -#if @cf_cv_enable_reentrant@ +#if NCURSES_REENTRANT NCURSES_WRAPPED_VAR(WINDOW *, curscr); NCURSES_WRAPPED_VAR(WINDOW *, newscr); diff --git a/include/curses.tail b/include/curses.tail index aef7c378d5d5..098c898ed571 100644 --- a/include/curses.tail +++ b/include/curses.tail @@ -1,4 +1,4 @@ -/* $Id: curses.tail,v 1.16 2008/07/05 20:20:38 tom Exp $ */ +/* $Id: curses.tail,v 1.20 2010/03/28 19:10:55 tom Exp $ */ /* * vile:cmode: * This file is part of ncurses, designed to be appended after curses.h.in @@ -94,13 +94,22 @@ typedef struct } MEVENT; -extern NCURSES_EXPORT(int) getmouse (MEVENT *); -extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); +extern NCURSES_EXPORT(bool) has_mouse(void); +extern NCURSES_EXPORT(int) getmouse (MEVENT *); +extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); -extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); -extern NCURSES_EXPORT(int) mouseinterval (int); -extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); -extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ +extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); +extern NCURSES_EXPORT(int) mouseinterval (int); +extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); +extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ + +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_mouse) (SCREEN*); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetmouse) (SCREEN*,MEVENT *); +extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mouseinterval) (SCREEN*, int); +#endif #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) @@ -109,6 +118,11 @@ extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* gene extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int); /* do we have given key? */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int); /* direct data to printer */ +#endif + /* Debugging : use with libncurses_g.a */ extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); @@ -119,7 +133,7 @@ extern NCURSES_EXPORT(char *) _nc_tracebits (void); extern NCURSES_EXPORT(char *) _tracechar (int); extern NCURSES_EXPORT(char *) _tracechtype (chtype); extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); -#ifdef _XOPEN_SOURCE_EXTENDED +#ifdef NCURSES_WIDECHAR #define _tracech_t _tracecchar_t extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); #define _tracech_t2 _tracecchar_t2 @@ -160,6 +174,8 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); #define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ #endif +#include <unctrl.h> + #ifdef __cplusplus #ifndef NCURSES_NOMACROS diff --git a/include/curses.wide b/include/curses.wide index 0c799e4f395c..44135eecb9d2 100644 --- a/include/curses.wide +++ b/include/curses.wide @@ -1,10 +1,12 @@ -/* $Id: curses.wide,v 1.34 2007/03/10 17:52:23 tom Exp $ */ +/* $Id: curses.wide,v 1.42 2010/03/30 00:39:41 tom Exp $ */ /* * vile:cmode: * This file is part of ncurses, designed to be appended after curses.h.in * (see that file for the relevant copyright). */ -#ifdef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_CURSES 1 + +#ifdef NCURSES_WIDECHAR extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; @@ -60,6 +62,56 @@ extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; #define WACS_NEQUAL NCURSES_WACS('|') /* not equal */ #define WACS_STERLING NCURSES_WACS('}') /* UK pound sign */ + /* double lines */ +#define WACS_BDDB NCURSES_WACS('C') +#define WACS_DDBB NCURSES_WACS('D') +#define WACS_BBDD NCURSES_WACS('B') +#define WACS_DBBD NCURSES_WACS('A') +#define WACS_DBDD NCURSES_WACS('G') +#define WACS_DDDB NCURSES_WACS('F') +#define WACS_DDBD NCURSES_WACS('H') +#define WACS_BDDD NCURSES_WACS('I') +#define WACS_BDBD NCURSES_WACS('R') +#define WACS_DBDB NCURSES_WACS('Y') +#define WACS_DDDD NCURSES_WACS('E') + +#define WACS_D_ULCORNER WACS_BDDB +#define WACS_D_LLCORNER WACS_DDBB +#define WACS_D_URCORNER WACS_BBDD +#define WACS_D_LRCORNER WACS_DBBD +#define WACS_D_RTEE WACS_DBDD +#define WACS_D_LTEE WACS_DDDB +#define WACS_D_BTEE WACS_DDBD +#define WACS_D_TTEE WACS_BDDD +#define WACS_D_HLINE WACS_BDBD +#define WACS_D_VLINE WACS_DBDB +#define WACS_D_PLUS WACS_DDDD + + /* thick lines */ +#define WACS_BTTB NCURSES_WACS('L') +#define WACS_TTBB NCURSES_WACS('M') +#define WACS_BBTT NCURSES_WACS('K') +#define WACS_TBBT NCURSES_WACS('J') +#define WACS_TBTT NCURSES_WACS('U') +#define WACS_TTTB NCURSES_WACS('T') +#define WACS_TTBT NCURSES_WACS('V') +#define WACS_BTTT NCURSES_WACS('W') +#define WACS_BTBT NCURSES_WACS('Q') +#define WACS_TBTB NCURSES_WACS('X') +#define WACS_TTTT NCURSES_WACS('N') + +#define WACS_T_ULCORNER WACS_BTTB +#define WACS_T_LLCORNER WACS_TTBB +#define WACS_T_URCORNER WACS_BBTT +#define WACS_T_LRCORNER WACS_TBBT +#define WACS_T_RTEE WACS_TBTT +#define WACS_T_LTEE WACS_TTTB +#define WACS_T_BTEE WACS_TTBT +#define WACS_T_TTEE WACS_BTTT +#define WACS_T_HLINE WACS_BTBT +#define WACS_T_VLINE WACS_TBTB +#define WACS_T_PLUS WACS_TTTT + /* * Function prototypes for wide-character operations. * @@ -138,7 +190,7 @@ extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* implemented extern NCURSES_EXPORT(attr_t) term_attrs (void); /* implemented */ extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* implemented */ extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* implemented */ -extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented */ +extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, NCURSES_OUTC); /* implemented */ extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int); /* generated:WIDEC */ extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *); /* implemented */ extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int); /* implemented */ @@ -165,6 +217,14 @@ extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* implemented */ extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *); /* implemented */ extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* implemented */ +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(term_attrs) (SCREEN*); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(unget_wch) (SCREEN*, const wchar_t); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, short, void *); /* implemented:SP_FUNC */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC); /* implemented:SP_FUNC */ +#endif + #ifndef NCURSES_NOMACROS /* @@ -249,4 +309,4 @@ extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *); #endif -#endif /* _XOPEN_SOURCE_EXTENDED */ +#endif /* NCURSES_WIDECHAR */ diff --git a/include/headers b/include/headers index a24bd90923ff..6c367950c9f4 100644 --- a/include/headers +++ b/include/headers @@ -1,6 +1,6 @@ -# $Id: headers,v 1.9 2007/01/20 19:57:04 Miroslav.Lichvar Exp $ +# $Id: headers,v 1.10 2009/09/05 17:46:30 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2007,2009 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"), # @@ -33,7 +33,7 @@ term.h curses.h unctrl.h termcap.h -$(srcdir)/ncurses_dll.h +ncurses_dll.h @ ticlib $(srcdir)/tic.h $(srcdir)/term_entry.h diff --git a/include/nc_alloc.h b/include/nc_alloc.h index f521bffe9f0a..da70906f552f 100644 --- a/include/nc_alloc.h +++ b/include/nc_alloc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 * @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: nc_alloc.h,v 1.16 2008/09/27 22:30:33 tom Exp $ */ +/* $Id: nc_alloc.h,v 1.18 2010/11/20 22:59:49 tom Exp $ */ #ifndef NC_ALLOC_included #define NC_ALLOC_included 1 @@ -38,7 +38,7 @@ extern "C" { #endif -#if HAVE_LIBDMALLOC +#if defined(HAVE_LIBDMALLOC) && HAVE_LIBDMALLOC #include <string.h> #undef strndup /* workaround for #define in GLIBC 2.7 */ #include <dmalloc.h> /* Gray Watson's library */ @@ -47,14 +47,14 @@ extern "C" { #define HAVE_LIBDMALLOC 0 #endif -#if HAVE_LIBDBMALLOC +#if defined(HAVE_LIBDBMALLOC) && HAVE_LIBDBMALLOC #include <dbmalloc.h> /* Conor Cahill's library */ #else #undef HAVE_LIBDBMALLOC #define HAVE_LIBDBMALLOC 0 #endif -#if HAVE_LIBMPATROL +#if defined(HAVE_LIBMPATROL) && HAVE_LIBMPATROL #include <mpatrol.h> /* Memory-Patrol library */ #else #undef HAVE_LIBMPATROL @@ -74,9 +74,15 @@ extern NCURSES_EXPORT(void) _nc_free_tic(int) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_free_tparm(void); extern NCURSES_EXPORT(void) _nc_leaks_dump_entry(void); extern NCURSES_EXPORT(void) _nc_leaks_tic(void); -#define ExitProgram(code) _nc_free_and_exit(code) + +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC_NORETURN; #endif +#define ExitProgram(code) _nc_free_and_exit(code) + +#endif /* NO_LEAKS, etc */ + #ifndef HAVE_NC_FREEALL #define HAVE_NC_FREEALL 0 #endif diff --git a/include/nc_mingw.h b/include/nc_mingw.h new file mode 100644 index 000000000000..32470034df34 --- /dev/null +++ b/include/nc_mingw.h @@ -0,0 +1,69 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,2010 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 Dickey, 2008-on * + * * + ****************************************************************************/ + +/* $Id: nc_mingw.h,v 1.3 2010/09/25 22:16:12 juergen Exp $ */ + +#ifndef NC_MINGW_H +#define NC_MINGW_H 1 + +#ifdef WINVER +# if WINVER < 0x0501 +# error WINVER must at least be 0x0501 +# endif +#else +# define WINVER 0x0501 +#endif +#include <windows.h> + +#undef sleep +#define sleep(n) Sleep((n) * 1000) + +#undef gettimeofday +#define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) + +#include <sys/time.h> /* for struct timeval */ + +extern int _nc_gettimeofday(struct timeval *, void *); + +#undef HAVE_GETTIMEOFDAY +#define HAVE_GETTIMEOFDAY 1 + +#define SIGHUP 1 +#define SIGKILL 9 +#define getlogin() "username" + +#undef wcwidth +#define wcwidth(ucs) _nc_wcwidth(ucs) +extern int _nc_wcwidth(wchar_t); + +#endif /* NC_MINGW_H */ diff --git a/include/nc_panel.h b/include/nc_panel.h index 6578577ee988..6a9ffea39687 100644 --- a/include/nc_panel.h +++ b/include/nc_panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -31,9 +31,8 @@ * and: Thomas E. Dickey * ****************************************************************************/ - /* - * $Id: nc_panel.h,v 1.5 2008/08/04 18:26:46 tom Exp $ + * $Id: nc_panel.h,v 1.7 2009/07/04 18:20:02 tom Exp $ * * nc_panel.h * @@ -45,25 +44,33 @@ #define NC_PANEL_H 1 #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -struct panel; /* Forward Declaration */ + struct panel; /* Forward Declaration */ -struct panelhook { - struct panel* top_panel; - struct panel* bottom_panel; - struct panel* stdscr_pseudo_panel; + struct panelhook + { + struct panel *top_panel; + struct panel *bottom_panel; + struct panel *stdscr_pseudo_panel; #if NO_LEAKS - int (*destroy)(struct panel *); + int (*destroy) (struct panel *); #endif -}; + }; -/* Retrieve the panelhook of the current screen */ -extern NCURSES_EXPORT(struct panelhook*) _nc_panelhook (void); + struct screen; /* Forward declaration */ +/* Retrieve the panelhook of the specified screen */ + extern NCURSES_EXPORT(struct panelhook *) + _nc_panelhook (void); +#if NCURSES_SP_FUNCS + extern NCURSES_EXPORT(struct panelhook *) + NCURSES_SP_NAME(_nc_panelhook) (SCREEN *); +#endif #ifdef __cplusplus } #endif -#endif /* NC_PANEL_H */ +#endif /* NC_PANEL_H */ diff --git a/include/nc_tparm.h b/include/nc_tparm.h index d1d769be9a27..a8dbcacb1e31 100644 --- a/include/nc_tparm.h +++ b/include/nc_tparm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006 Free Software Foundation, Inc. * + * Copyright (c) 2006,2010 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 * @@ -30,13 +30,19 @@ * Author: Thomas E. Dickey 2006 * ****************************************************************************/ -/* $Id: nc_tparm.h,v 1.4 2006/11/26 00:49:25 tom Exp $ */ +/* $Id: nc_tparm.h,v 1.5 2010/12/25 20:27:22 tom Exp $ */ + +#ifndef NC_TPARM_included +#define NC_TPARM_included 1 /* * Cast parameters past the formatting-string for tparm() to match the * assumption of the varargs code. */ +#ifndef TPARM_ARG #define TPARM_ARG long +#endif + #define TPARM_N(n) (TPARM_ARG)(n) #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j)) @@ -63,3 +69,5 @@ #define TPARM_1(a,b) TPARM_2(a,b,0) #define TPARM_0(a) TPARM_1(a,0) #endif + +#endif /* NC_TPARM_included */ diff --git a/include/ncurses_defs b/include/ncurses_defs index 97a377dc5270..42d5908457cc 100644 --- a/include/ncurses_defs +++ b/include/ncurses_defs @@ -1,6 +1,6 @@ -# $Id: ncurses_defs,v 1.40 2008/09/06 15:57:41 tom Exp $ +# $Id: ncurses_defs,v 1.46 2011/03/22 09:17:59 tom Exp $ ############################################################################## -# Copyright (c) 2000-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 2000-2010,2011 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"), # @@ -85,6 +85,7 @@ HAVE_LIMITS_H HAVE_LINK HAVE_LOCALE_H HAVE_LONG_FILE_NAMES +HAVE_MATH_H HAVE_MBLEN HAVE_MBRLEN HAVE_MBRTOWC @@ -110,11 +111,13 @@ HAVE_REMOVE HAVE_RESIZETERM HAVE_RESIZE_TERM HAVE_RIPOFFLINE 1 +HAVE_SCR_DUMP 1 HAVE_SELECT HAVE_SETBUF HAVE_SETBUFFER HAVE_SETUPTERM 1 HAVE_SETVBUF +HAVE_SGTTY_H HAVE_SIGACTION HAVE_SIGVEC HAVE_SIZECHANGE @@ -139,6 +142,7 @@ HAVE_TERMATTRS 1 HAVE_TERMIOS_H HAVE_TERMIO_H HAVE_TERMNAME 1 +HAVE_TERM_ENTRY_H 1 HAVE_TERM_H 1 HAVE_TGETENT 1 HAVE_TIGETNUM 1 @@ -163,6 +167,7 @@ HAVE_WCTYPE_H HAVE_WINSSTR 1 HAVE_WORKING_POLL HAVE_WRESIZE +HAVE_WSYNCDOWN 1 HAVE__DOSCAN MIXEDCASE_FILENAMES NCURSES_CHAR_EQ @@ -171,7 +176,6 @@ NCURSES_EXT_COLORS NCURSES_EXT_FUNCS NCURSES_NO_PADDING NCURSES_PATHSEP ':' -NDEBUG NEED_PTEM_H NO_LEAKS PURE_TERMINFO @@ -195,6 +199,7 @@ USE_HOME_TERMINFO USE_LINKS USE_MY_MEMMOVE USE_OK_BCOPY +USE_PTHREADS_EINTR USE_RCS_IDS USE_REENTRANT USE_SAFE_SPRINTF diff --git a/include/ncurses_dll.h b/include/ncurses_dll.h.in index e24feee2051d..82c9b85ca542 100644 --- a/include/ncurses_dll.h +++ b/include/ncurses_dll.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2009 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 * @@ -25,11 +25,18 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ -/* $Id: ncurses_dll.h,v 1.6 2007/03/10 19:21:49 tom Exp $ */ +/* $Id: ncurses_dll.h.in,v 1.8 2009/04/04 22:26:27 tom Exp $ */ #ifndef NCURSES_DLL_H_incl #define NCURSES_DLL_H_incl 1 +/* + * For reentrant code, we map the various global variables into SCREEN by + * using functions to access them. + */ +#define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name +#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) + /* no longer needed on cygwin or mingw, thanks to auto-import */ /* but this structure may be useful at some point for an MSVC build */ /* so, for now unconditionally define the important flags */ @@ -37,7 +44,7 @@ #undef NCURSES_DLL #define NCURSES_STATIC -#if defined(__CYGWIN__) +#if defined(__CYGWIN__) || defined(__MINGW32__) # if defined(NCURSES_DLL) # if defined(NCURSES_STATIC) # undef NCURSES_STATIC @@ -76,11 +83,4 @@ # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type #endif -/* - * For reentrant code, we map the various global variables into SCREEN by - * using functions to access them. - */ -#define NCURSES_PUBLIC_VAR(name) _nc_##name -#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - #endif /* NCURSES_DLL_H_incl */ diff --git a/include/ncurses_mingw.h b/include/ncurses_mingw.h new file mode 100644 index 000000000000..4ea1dad53737 --- /dev/null +++ b/include/ncurses_mingw.h @@ -0,0 +1,164 @@ +/**************************************************************************** + * Copyright (c) 1998-2007,2008 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: Juergen Pfeifer, 2008-on * + * * + ****************************************************************************/ + +/* $Id: ncurses_mingw.h,v 1.1 2008/12/14 19:22:16 juergen Exp $ */ + +/* + * This is a placholder up to now and describes what needs to be implemented + * to support I/O to external terminals with ncurses on the Windows OS. + */ + +#if __MINGW32__ +#ifndef _NC_MINGWH +#define _NC_MINGWH + +#define USE_CONSOLE_DRIVER 1 + +#undef TERMIOS +#define TERMIOS 1 + +#define InvalidHandle ((TERM_HANDLE)-1) +#define InvalidConsoleHandle(s) ((s)==InvalidHandle) + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 32 +struct termios +{ + tcflag_t c_iflag; /* input mode */ + tcflag_t c_oflag; /* output mode */ + tcflag_t c_cflag; /* control mode */ + tcflag_t c_lflag; /* local mode */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* c_ospeed */ +}; + +/* c_cc chars */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VTIME 5 +#define VMIN 6 + +/* c_iflag bits */ +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define BRKINT 0000002 +#define PARMRK 0000010 +#define IXON 0002000 +#define IGNBRK 0000001 +#define IGNPAR 0000004 +#define INPCK 0000020 +#define IXOFF 0010000 + +/* c_oflag bits */ +#define OPOST 0000001 + +/* c_cflag bit meaning */ +#define CBAUD 0010017 +#define CSIZE 0000060 +#define CS8 0000060 +#define B0 0000000 +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define CLOCAL 0004000 +#define CREAD 0000200 +#define CSTOPB 0000100 +#define HUPCL 0002000 +#define PARENB 0000400 +#define PARODD 0001000 + +/* c_lflag bits */ +#define ECHO 0000010 +#define ECHONL 0000100 +#define ISIG 0000001 +#define IEXTEN 0100000 +#define ICANON 0000002 +#define NOFLSH 0000200 +#define ECHOE 0000020 +#define ECHOK 0000040 + +/* tcflush() */ +#define TCIFLUSH 0 + +/* tcsetattr uses these */ +#define TCSADRAIN 1 + +/* ioctls */ +#define TCGETA 0x5405 +#define TCFLSH 0x540B +#define TIOCGWINSZ 0x5413 + +extern int _nc_mingw_ioctl(int fd, long int request, struct termios* arg); +extern void _nc_set_term_driver(void* term); + +#ifndef cfgetospeed +#define cfgetospeed(t) ((t)->c_cflag & CBAUD) +#endif + +#ifndef tcsetattr +#define tcsetattr(fd, cmd, arg) _nc_mingw_ioctl(fd, cmd, arg) +#endif + +#ifndef tcgetattr +#define tcgetattr(fd, arg) _nc_mingw_ioctl(fd, TCGETA, arg) +#endif + +#ifndef tcflush +#define tcflush(fd, arg) _nc_mingw_ioctl(fd, TCFLSH, arg) +#endif + +#undef ttyname +#define ttyname(fd) NULL + +#endif +#endif diff --git a/include/term_entry.h b/include/term_entry.h index fb875407276f..4770f8659c48 100644 --- a/include/term_entry.h +++ b/include/term_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1998-on * ****************************************************************************/ -/* $Id: term_entry.h,v 1.35 2008/08/16 16:16:03 tom Exp $ */ +/* $Id: term_entry.h,v 1.37 2009/07/11 16:52:29 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code @@ -81,12 +81,18 @@ ENTRY; #define EXT_NAMES(tp,i,limit,index,table) table[i] #endif -#define NUM_EXT_NAMES(tp) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings) +#define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings) #define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++) #define for_each_number(n,tp) for(n = 0; n < NUM_NUMBERS(tp); n++) #define for_each_string(n,tp) for(n = 0; n < NUM_STRINGS(tp); n++) +#if NCURSES_XNAMES +#define for_each_ext_boolean(n,tp) for(n = BOOLCOUNT; n < NUM_BOOLEANS(tp); n++) +#define for_each_ext_number(n,tp) for(n = NUMCOUNT; n < NUM_NUMBERS(tp); n++) +#define for_each_ext_string(n,tp) for(n = STRCOUNT; n < NUM_STRINGS(tp); n++) +#endif + #define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names) #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names) #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names) diff --git a/include/tic.h b/include/tic.h index 4e10399356c1..4f3a21c22b3f 100644 --- a/include/tic.h +++ b/include/tic.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2009 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 * @@ -33,7 +33,7 @@ ****************************************************************************/ /* - * $Id: tic.h,v 1.62 2007/08/11 16:12:43 tom Exp $ + * $Id: tic.h,v 1.65 2009/08/08 17:52:46 tom Exp $ * tic.h - Global variables and structures for the terminfo * compiler. */ @@ -183,6 +183,8 @@ extern NCURSES_EXPORT_VAR(const struct tinfo_fkeys) _nc_tinfo_fkeys[]; #endif +typedef short HashValue; + /* * The file comp_captab.c contains an array of these structures, one * per possible capability. These are indexed by a hash table array of @@ -193,10 +195,21 @@ struct name_table_entry { const char *nte_name; /* name to hash on */ int nte_type; /* BOOLEAN, NUMBER or STRING */ - short nte_index; /* index of associated variable in its array */ - short nte_link; /* index in table of next hash, or -1 */ + HashValue nte_index; /* index of associated variable in its array */ + HashValue nte_link; /* index in table of next hash, or -1 */ }; + /* + * Use this structure to hide differences between terminfo and termcap + * tables. + */ +typedef struct { + unsigned table_size; + const HashValue *table_data; + HashValue (*hash_of)(const char *); + int (*compare_names)(const char *, const char *); +} HashData; + struct alias { const char *from; @@ -205,7 +218,8 @@ struct alias }; extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool); -extern NCURSES_EXPORT(const short *) _nc_get_hash_table (bool); +extern NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool); +extern NCURSES_EXPORT(const HashValue *) _nc_get_hash_table (bool); extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool); #define NOTFOUND ((struct name_table_entry *) 0) @@ -244,9 +258,9 @@ extern NCURSES_EXPORT(char *) _nc_rootname (char *); /* comp_hash.c: name lookup */ extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry - (const char *, const short *); + (const char *, const HashValue *); extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry - (const char *, int, const struct name_table_entry *); + (const char *, int, bool); /* comp_scan.c: lexical analysis */ extern NCURSES_EXPORT(int) _nc_get_token (bool); diff --git a/include/unctrl.h.in b/include/unctrl.h.in index 70d74b7714b1..e08bc813881d 100644 --- a/include/unctrl.h.in +++ b/include/unctrl.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -39,7 +39,7 @@ * as ^?. Printable characters are displayed as is. */ -/* $Id: unctrl.h.in,v 1.10 2001/03/24 21:53:25 tom Exp $ */ +/* $Id: unctrl.h.in,v 1.11 2009/04/18 21:00:52 tom Exp $ */ #ifndef NCURSES_UNCTRL_H_incl #define NCURSES_UNCTRL_H_incl 1 @@ -56,6 +56,10 @@ extern "C" { #undef unctrl NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); +#if @NCURSES_SP_FUNCS@ +NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype); +#endif + #ifdef __cplusplus } #endif |