-------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
#! /bin/sh
-# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $
+# $Id: MKncurses_def.sh,v 1.3 2003/10/25 16:19:46 tom Exp $
##############################################################################
-# Copyright (c) 2000 Free Software Foundation, Inc. #
+# Copyright (c) 2000,2003 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"), #
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
--- $Revision: 1.6 $
+-- $Revision: 1.7 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.12 $
+-- $Revision: 1.13 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo.Attributes is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo.Mouse is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Form_Demo is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.11 $
+-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Menu_Demo is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Text_IO_Demo is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample is
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
--- $Revision: 1.7 $
+-- $Revision: 1.8 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet <pautet@gnat.com> --
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet <pautet@gnat.com> --
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample; use Sample;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.9 $
+-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure Tour;
------------------------------------------------------------------------------
--- Copyright (c) 2010-2011,2014 Free Software Foundation, Inc. --
+-- Copyright (c) 2010-2014,2016 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 --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
--- $Id: library.gpr,v 1.10 2016/09/18 00:25:54 tom Exp $
+-- $Id: library.gpr,v 1.11 2016/09/18 00:25:54 tom Exp $
-- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html
-- http://www.adaworld.com/debian/debian-ada-policy.html
project AdaCurses is
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- Copyright (c) 1998,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.10 $
+-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc. --
+-- Copyright (c) 2000,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.3 $
+-- $Revision: 1.4 $
-- Binding Version 01.00
with Ada.Streams.Stream_IO.C_Streams;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc. --
+-- Copyright (c) 2000,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.3 $
+-- $Revision: 1.4 $
-- Binding Version 01.00
with Ada.Streams.Stream_IO;
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc. --
+-- Copyright (c) 2000,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.3 $
+-- $Revision: 1.4 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc. --
+-- Copyright (c) 2000,2003 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 --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.3 $
+-- $Revision: 1.4 $
-- Binding Version 01.00
------------------------------------------------------------------------------
./test/package/debian/watch
./test/package/mingw-ncurses-examples.spec
./test/package/ncurses-examples.spec
+./test/popup_msg.c
+./test/popup_msg.h
./test/programs
./test/railroad.c
./test/rain.c
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2799 2017/04/08 22:54:04 tom Exp $
+-- $Id: NEWS,v 1.2806 2017/04/15 18:00:38 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20170415
+ + modify several test programs to use new popup_msgs, adapted from
+ help-screen used in test/edit_field.c
+ + drop two symbols obsoleted in 2004: _nc_check_termtype, and
+ _nc_resolve_uses
+ + fix some old copyright dates (cf: 20031025).
+ + build-fixes for test/savescreen.c to work with AIX and HPUX.
+ + minor fix to configure script, adding a backslash/continuation.
+ + extend TERMINAL structure for ABI 6 to store numbers internally as
+ integers rather than short, by adding new data for this purpose.
+ + more fixes for minor memory-leaks in test-programs.
+
20170408
+ change logic in wins_nwstr() to avoid addressing data past the output
of mbstowcs().
-5:0:9 6.0 20170408
+5:0:9 6.0 20170415
#! /bin/sh
-# From configure.in Revision: 1.640 .
+# From configure.in Revision: 1.641 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by Autoconf 2.52.20150926.
#
fi
done
-if test "x$ac_cv_func_getopt" = xno &&
+if test "x$ac_cv_func_getopt" = xno && \
test "x$cf_with_progs$cf_with_tests" != xnono; then
{ { echo "$as_me:17384: error: getopt is required for building programs" >&5
echo "$as_me: error: getopt is required for building programs" >&2;}
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: configure.in,v 1.640 2017/04/01 21:10:59 tom Exp $
+dnl $Id: configure.in,v 1.641 2017/04/13 23:35:03 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20030208)
-AC_REVISION($Revision: 1.640 $)
+AC_REVISION($Revision: 1.641 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
vsnprintf \
)
-if test "x$ac_cv_func_getopt" = xno &&
+if test "x$ac_cv_func_getopt" = xno && \
test "x$cf_with_progs$cf_with_tests" != xnono; then
AC_MSG_ERROR(getopt is required for building programs)
fi
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1155 2017/04/02 10:36:57 tom Exp $
+# $Id: dist.mk,v 1.1156 2017/04/09 10:43:26 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 0
-NCURSES_PATCH = 20170408
+NCURSES_PATCH = 20170415
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
#! /bin/sh
-# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $
+# $Id: MKncurses_def.sh,v 1.3 2003/10/25 16:19:46 tom Exp $
##############################################################################
-# Copyright (c) 2000 Free Software Foundation, Inc. #
+# Copyright (c) 2000,2003 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"), #
# vile:awkmode
+function declare_termtype(number,suffix) {
+ printf "typedef struct termtype%s { /* in-core form of terminfo data */\n", suffix;
+ print " char *term_names; /* str_table offset of term names */"
+ print " char *str_table; /* pointer to string table */"
+ print " NCURSES_SBOOL *Booleans; /* array of boolean values */"
+ printf " %-5s *Numbers; /* array of integer values */\n", number;
+ print " char **Strings; /* array of string offsets */"
+ print ""
+ print "#if NCURSES_XNAMES"
+ print " char *ext_str_table; /* pointer to extended string table */"
+ print " char **ext_Names; /* corresponding names */"
+ print ""
+ print " unsigned short num_Booleans;/* count total Booleans */";
+ print " unsigned short num_Numbers; /* count total Numbers */";
+ print " unsigned short num_Strings; /* count total Strings */";
+ print ""
+ print " unsigned short ext_Booleans;/* count extensions to Booleans */";
+ print " unsigned short ext_Numbers; /* count extensions to Numbers */";
+ print " unsigned short ext_Strings; /* count extensions to Strings */";
+ print "#endif /* NCURSES_XNAMES */"
+ print ""
+ printf "} TERMTYPE%s;\n", suffix;
+}
BEGIN {
lcurl = "{";
rcurl = "}";
print "/* and: Thomas E. Dickey 1995-on */"
print "/****************************************************************************/"
print ""
- print "/* $Id: MKterm.h.awk.in,v 1.66 2017/04/03 08:16:54 tom Exp $ */"
+ print "/* $Id: MKterm.h.awk.in,v 1.67 2017/04/06 00:19:26 tom Exp $ */"
print ""
print "/*"
print "** term.h -- Definition of struct term"
print "/* used by code for comparing entries */"
print "#define acs_chars_index ", acsindex
print ""
- print "typedef struct termtype { /* in-core form of terminfo data */"
- print " char *term_names; /* str_table offset of term names */"
- print " char *str_table; /* pointer to string table */"
- print " NCURSES_SBOOL *Booleans; /* array of boolean values */"
- print " short *Numbers; /* array of integer values */"
- print " char **Strings; /* array of string offsets */"
- print ""
- print "#if NCURSES_XNAMES"
- print " char *ext_str_table; /* pointer to extended string table */"
- print " char **ext_Names; /* corresponding names */"
- print ""
- print " unsigned short num_Booleans;/* count total Booleans */"
- print " unsigned short num_Numbers; /* count total Numbers */"
- print " unsigned short num_Strings; /* count total Strings */"
- print ""
- print " unsigned short ext_Booleans;/* count extensions to Booleans */"
- print " unsigned short ext_Numbers; /* count extensions to Numbers */"
- print " unsigned short ext_Strings; /* count extensions to Strings */"
- print "#endif /* NCURSES_XNAMES */"
- print ""
- print "} TERMTYPE;"
+ declare_termtype("short","");
print ""
print "/*"
print " * The only reason these structures are visible is for read-only use."
print " * curses implementations."
print " */"
print "#ifdef NCURSES_INTERNALS"
+ print ""
+ if (@NCURSES_EXT_COLORS@) {
+ declare_termtype("int","2");
+ } else {
+ print "typedef TERMTYPE TERMTYPE2;"
+ }
+ print ""
print "typedef struct term { /* describe an actual terminal */"
print " TERMTYPE type; /* terminal type description */"
print " short Filedes; /* file description being written to */"
print " TTY Nttyb; /* current state of the terminal */"
print " int _baudrate; /* used to compute padding */"
print " char * _termname; /* used for termname() */"
+ if (@NCURSES_EXT_COLORS@) {
+ print " TERMTYPE2 type2; /* extended terminal type description */"
+ }
print "} TERMINAL;"
print "#else"
print "typedef struct term TERMINAL;"
print "#ifdef NCURSES_INTERNALS"
print ""
print "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);"
- print "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);"
- print "extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE *const);"
- print "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);"
+ print "extern NCURSES_EXPORT(int) _nc_read_entry2 (const char * const, char * const, TERMTYPE2 *const);"
+ print "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE2 *);"
+ print "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, char *, int);"
print "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);"
print "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);"
print ""
* and: Thomas E. Dickey 1998-on *
****************************************************************************/
-/* $Id: term_entry.h,v 1.54 2017/04/03 21:36:00 tom Exp $ */
+/* $Id: term_entry.h,v 1.55 2017/04/06 22:45:34 tom Exp $ */
/*
* term_entry.h -- interface to entry-manipulation code
} ENTRY_USES;
struct entry {
- TERMTYPE tterm;
- int *XNumbers; /* array of integer values */
+ TERMTYPE2 tterm;
unsigned nuses;
ENTRY_USES uses[MAX_USES];
int ncrosslinks;
/* alloc_entry.c: elementary allocation code */
extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp);
extern NCURSES_EXPORT(char *) _nc_save_str (const char *const);
-extern NCURSES_EXPORT(void) _nc_init_entry (TERMTYPE *const);
-extern NCURSES_EXPORT(void) _nc_merge_entry (TERMTYPE *const, TERMTYPE *const);
+extern NCURSES_EXPORT(void) _nc_init_entry (ENTRY *const);
+extern NCURSES_EXPORT(void) _nc_merge_entry (ENTRY *const, ENTRY *const);
extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool);
/* alloc_ttype.c: elementary allocation code */
-extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE *, TERMTYPE *);
+extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE2 *, TERMTYPE2 *);
+
+/* free_ttype.c: elementary allocation code */
+extern NCURSES_EXPORT(void) _nc_free_termtype2 (TERMTYPE2 *);
/* lib_termcap.c: trim sgr0 string for termcap users */
-extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE *);
+extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE2 *);
/* parse_entry.c: entry-parsing code */
#if NCURSES_XNAMES
/* write_entry.c: writing an entry to the file system */
extern NCURSES_EXPORT(void) _nc_set_writedir (const char *);
-extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const);
-extern NCURSES_EXPORT(int) _nc_write_object(TERMTYPE *, char *, unsigned *, unsigned);
+extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE2 *const);
+extern NCURSES_EXPORT(int) _nc_write_object (TERMTYPE2 *, char *, unsigned *, unsigned);
/* comp_parse.c: entry list handling */
extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*));
extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool);
extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *);
extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */
-extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE *, bool);
+extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE2 *, bool);
/* trace_xnames.c */
extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *);
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,2001 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 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
-/* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */
+/* $Id: termcap.h.in,v 1.17 2001/03/24 21:53:27 tom Exp $ */
#ifndef NCURSES_TERMCAP_H_incl
#define NCURSES_TERMCAP_H_incl 1
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: term_variables.3x,v 1.8 2017/01/07 19:25:15 tom Exp $
+.\" $Id: term_variables.3x,v 1.9 2017/04/14 08:33:25 tom Exp $
.TH term_variables 3X ""
.ds n 5
+.ie \n(.g .ds `` \(lq
+.el .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el .ds '' ''
.na
.hy 0
.SH NAME
\fBstrcodes\fP.
.\"
.SS Terminal Type
+A terminal description begins with one or more terminal names
+separated by \*(``|\*('' (vertical bars).
On initialization of the curses or terminfo interfaces,
-\fBsetupterm\fP(3X) copies the terminal name to the array \fBttytype\fP.
+\fBsetupterm\fP(3X) copies the terminal names to the array \fBttytype\fP.
.\"
.SS Terminfo Names
.PP
.PP
.nf
.ft CW
-#define CUR cur_term->type.
+#define CUR ((TERMTYPE *)(cur_term))->
.fi
.ft R
.PP
These symbols provide a faster method of accessing terminfo capabilities
than using \fBtigetstr\fR(3X), etc.
+.PP
+The actual definition of \fBCUR\fP depends upon the implementation,
+but each terminfo library provides these long names defined to point
+into the current terminal description loaded into memory.
.\"
.SH NOTES
The low-level terminfo interface is initialized using
#!/bin/sh
##############################################################################
-# Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2005,2007 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"), #
#
# Author: Thomas E. Dickey <dickey@clark.net> 1996
#
-# $Id: shlib,v 1.11 2007/01/13 17:09:52 tom Exp $
+# $Id: shlib,v 1.12 2007/01/13 17:09:52 tom Exp $
# Use this script as a wrapper when running executables linked to shared
# libraries on systems that use the $LD_LIBRARY_PATH variable and don't embed
# the soname's path within the linked executable (such as IRIX), e.g,
#!/bin/sh
##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc. #
+# Copyright (c) 1998,2000 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"), #
#
# Author: Thomas E. Dickey <dickey@clark.net> 1996
#
-# $Id: tdlint,v 1.5 2000/10/28 20:53:36 tom Exp $
+# $Id: tdlint,v 1.6 2000/10/28 20:53:36 tom Exp $
#
# Lint-script that allows user's own lint libraries, in addition to the ones
# installed in the system.
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,2005 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 *
****************************************************************************/
/*
- * $Id: SigAction.h,v 1.8 2005/08/06 20:05:32 tom Exp $
+ * $Id: SigAction.h,v 1.9 2005/08/06 20:05:32 tom Exp $
*
* This file exists to handle non-POSIX systems which don't have <unistd.h>,
* and usually no sigaction() nor <termios.h>
-# $Id: MKkeyname.awk,v 1.49 2016/05/28 23:11:26 tom Exp $
+# $Id: MKkeyname.awk,v 1.50 2017/04/11 01:18:08 tom Exp $
##############################################################################
-# Copyright (c) 1999-2013,2016 Free Software Foundation, Inc. #
+# Copyright (c) 1999-2016,2017 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"), #
print " } else if (result == 0 && HasTerminal(sp)) {"
print " int j, k;"
print " char * bound;"
- print " TERMTYPE *tp = &(TerminalOf(sp)->type);"
+ print " TERMTYPE2 *tp = &TerminalType(TerminalOf(sp));"
print " unsigned save_trace = _nc_tracing;"
print ""
print " _nc_tracing = 0; /* prevent recursion via keybound() */"
#include <curses.priv.h>
#include <tic.h>
-#ifndef CUR
+#undef CUR
#define CUR SP_TERMTYPE
-#endif
-MODULE_ID("$Id: lib_set_term.c,v 1.159 2017/04/02 14:26:18 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.162 2017/04/15 21:44:03 tom Exp $")
#ifdef USE_TERM_DRIVER
#define MaxColors InfoOf(sp).maxcolors
NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx sp->_term);
FreeIfNeeded(sp->out_buffer);
+ if (_nc_prescreen.allocated == sp)
+ _nc_prescreen.allocated = 0;
free(sp);
/*
if ((dst = tmp) == 0) {
dst = src;
} else if (value >= 0) {
- *result = value;
+ *result = (int) value;
}
while (*dst != 0 && *dst != ';')
dst++;
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.567 2017/04/01 17:10:55 tom Exp $
+ * $Id: curses.priv.h,v 1.570 2017/04/12 00:50:57 tom Exp $
*
* curses.priv.h
*
#include <nc_panel.h>
+#include <term.h>
+#include <nc_termios.h>
+
#define IsPreScreen(sp) (((sp) != 0) && sp->_prescreen)
#define HasTerminal(sp) (((sp) != 0) && (0 != ((sp)->_term)))
#define IsValidScreen(sp) (HasTerminal(sp) && !IsPreScreen(sp))
#define TerminalOf(sp) CurTerm
#endif
-#include <term.h>
-#include <nc_termios.h>
+/*
+ * The legacy layout for TERMTYPE uses "short" for all of the numbers. Moving
+ * past that, numeric capabilities can be "int" by using a TERMTYPE2 structure
+ * in TERMINAL, and doing most of the internal work using TERMTYPE2. There are
+ * a few places (mostly to expose the legacy layout) where the distinction
+ * needs attention.
+ */
+#if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR
+#define NCURSES_EXT_NUMBERS 1
+#define NCURSES_INT2 int
+#define TerminalType(tp) (tp)->type2
+#else
+#define NCURSES_EXT_NUMBERS 0
+#define NCURSES_INT2 short
+#define TerminalType(tp) (tp)->type
+#endif
/*
* Reduce dependency on cur_term global by using terminfo data from SCREEN's
/*
* Definitions for color pairs
*/
+
+#define MAX_OF_TYPE(t) (int)(((unsigned t)(~0))>>1)
+
#include <new_pair.h>
/*
* It may be modified before the next SCREEN is created.
*/
typedef struct {
+ struct screen * allocated;
bool use_env;
bool filter_mode;
attr_t previous_attr;
extern NCURSES_EXPORT(int) _nc_remove_string (TRIES **, const char *);
/* elsewhere ... */
-extern NCURSES_EXPORT(ENTRY *) _nc_delink_entry (ENTRY *, TERMTYPE *);
extern NCURSES_EXPORT(SCREEN *) _nc_screen_of (WINDOW *);
extern NCURSES_EXPORT(TERMINAL*) _nc_get_cur_term (void);
extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int);
extern NCURSES_EXPORT(int) _nc_putchar (int);
extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *);
extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *);
-extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const);
-extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *);
+extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE2 *const);
+extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE2 *);
extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int);
extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
+extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE2 *const);
extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC);
extern NCURSES_EXPORT(void) _nc_flush (void);
extern NCURSES_EXPORT(void) _nc_free_and_exit (int) GCC_NORETURN;
-extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *);
+extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE2 *);
extern NCURSES_EXPORT(void) _nc_freeall (void);
extern NCURSES_EXPORT(void) _nc_hash_map (void);
extern NCURSES_EXPORT(void) _nc_init_keytry (SCREEN *);
extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *);
extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *);
+#if NCURSES_EXT_NUMBERS
+extern NCURSES_EXPORT(const TERMTYPE2 *) _nc_fallback2 (const char *);
+#else
+#define _nc_fallback2(tp) _nc_fallback(tp)
+#endif
+
+#if NCURSES_EXT_NUMBERS
+extern NCURSES_EXPORT(void) _nc_copy_termtype2 (TERMTYPE2 *, const TERMTYPE2 *);
+extern NCURSES_EXPORT(void) _nc_export_termtype2(TERMTYPE *, const TERMTYPE2 *);
+extern NCURSES_EXPORT(void) _nc_import_termtype2(TERMTYPE2 *, const TERMTYPE *);
+#else
+#define _nc_copy_termtype2(dst,src) _nc_copy_termtype((dst),(src))
+#define _nc_export_termtype2(dst,src) /* nothing */
+#define _nc_import_termtype2(dst,src) /* nothing */
+#define _nc_free_termtype2(t) _nc_free_termtype(t)
+#endif
+
#if NO_LEAKS
extern NCURSES_EXPORT(void) _nc_alloc_entry_leaks(void);
extern NCURSES_EXPORT(void) _nc_captoinfo_leaks(void);
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE *_nc_fallback(
+const TERMTYPE2 *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE **)0); }
+ { return(*(const TERMTYPE2 **)0); }
/* ./tinfo/free_ttype.c */
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
{ return(*(int *)0); }
-#undef _nc_read_entry
-int _nc_read_entry(
+#undef _nc_read_entry2
+int _nc_read_entry2(
const char *const name,
char *const filename,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE *_nc_fallback(
+const TERMTYPE2 *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE **)0); }
+ { return(*(const TERMTYPE2 **)0); }
/* ./tinfo/free_ttype.c */
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
{ return(*(int *)0); }
-#undef _nc_read_entry
-int _nc_read_entry(
+#undef _nc_read_entry2
+int _nc_read_entry2(
const char *const name,
char *const filename,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
const TERMTYPE *src)
{ /* void */ }
+#undef _nc_copy_termtype2
+void _nc_copy_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_export_termtype2
+void _nc_export_termtype2(
+ TERMTYPE *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_import_termtype2
+void _nc_import_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE *src)
+ { /* void */ }
+
/* ./codes.c */
#undef _nc_boolcodes
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
+#undef _nc_fallback2
+const TERMTYPE2 *_nc_fallback2(
+ const char *name)
+ { return(*(const TERMTYPE2 **)0); }
+
#undef _nc_fallback
const TERMTYPE *_nc_fallback(
const char *name)
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype2
+void _nc_free_termtype2(
+ TERMTYPE2 *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
+ { return(*(int *)0); }
+
+#undef _nc_read_entry2
+int _nc_read_entry2(
+ const char *const name,
+ char *const filename,
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
const TERMTYPE *src)
{ /* void */ }
+#undef _nc_copy_termtype2
+void _nc_copy_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_export_termtype2
+void _nc_export_termtype2(
+ TERMTYPE *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_import_termtype2
+void _nc_import_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE *src)
+ { /* void */ }
+
/* ./codes.c */
#undef boolcodes
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
+#undef _nc_fallback2
+const TERMTYPE2 *_nc_fallback2(
+ const char *name)
+ { return(*(const TERMTYPE2 **)0); }
+
#undef _nc_fallback
const TERMTYPE *_nc_fallback(
const char *name)
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype2
+void _nc_free_termtype2(
+ TERMTYPE2 *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
+ { return(*(int *)0); }
+
+#undef _nc_read_entry2
+int _nc_read_entry2(
+ const char *const name,
+ char *const filename,
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
/****************************************************************************
- * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2012-2016,2017 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 *
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
/****************************************************************************
- * Copyright (c) 2013-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2013-2016,2017 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 *
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
/****************************************************************************
- * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2012-2016,2017 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 *
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
/****************************************************************************
- * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2012-2016,2017 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 *
#undef _nc_init_entry
void _nc_init_entry(
- TERMTYPE *const tp)
+ ENTRY *const tp)
{ /* void */ }
#undef _nc_copy_entry
#undef _nc_merge_entry
void _nc_merge_entry(
- TERMTYPE *const to,
- TERMTYPE *const from)
+ ENTRY *const target,
+ ENTRY *const source)
{ /* void */ }
/* ./tinfo/captoinfo.c */
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_check_termtype
void (*_nc_check_termtype)(
#undef _nc_parse_entry
int _nc_parse_entry(
- struct entry *entryp,
+ ENTRY *entryp,
int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE *tp,
+ TERMTYPE2 *tp,
char *buffer,
unsigned *offset,
unsigned limit)
/****************************************************************************
- * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2012-2016,2017 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 *
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE *_nc_fallback(
+const TERMTYPE2 *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE **)0); }
+ { return(*(const TERMTYPE2 **)0); }
/* ./tinfo/free_ttype.c */
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
{ return(*(int *)0); }
-#undef _nc_read_entry
-int _nc_read_entry(
+#undef _nc_read_entry2
+int _nc_read_entry2(
const char *const name,
char *const filename,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
/****************************************************************************
- * Copyright (c) 2013-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2013-2016,2017 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 *
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE *_nc_fallback(
+const TERMTYPE2 *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE **)0); }
+ { return(*(const TERMTYPE2 **)0); }
/* ./tinfo/free_ttype.c */
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
{ return(*(int *)0); }
-#undef _nc_read_entry
-int _nc_read_entry(
+#undef _nc_read_entry2
+int _nc_read_entry2(
const char *const name,
char *const filename,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
/****************************************************************************
- * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2012-2016,2017 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 *
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
const TERMTYPE *src)
{ /* void */ }
+#undef _nc_copy_termtype2
+void _nc_copy_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_export_termtype2
+void _nc_export_termtype2(
+ TERMTYPE *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_import_termtype2
+void _nc_import_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE *src)
+ { /* void */ }
+
/* ./codes.c */
#undef _nc_boolcodes
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
+#undef _nc_fallback2
+const TERMTYPE2 *_nc_fallback2(
+ const char *name)
+ { return(*(const TERMTYPE2 **)0); }
+
#undef _nc_fallback
const TERMTYPE *_nc_fallback(
const char *name)
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype2
+void _nc_free_termtype2(
+ TERMTYPE2 *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
+ { return(*(int *)0); }
+
+#undef _nc_read_entry2
+int _nc_read_entry2(
+ const char *const name,
+ char *const filename,
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
/****************************************************************************
- * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2012-2016,2017 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 *
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE *to,
- TERMTYPE *from)
+ TERMTYPE2 *to,
+ TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
const TERMTYPE *src)
{ /* void */ }
+#undef _nc_copy_termtype2
+void _nc_copy_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_export_termtype2
+void _nc_export_termtype2(
+ TERMTYPE *dst,
+ const TERMTYPE2 *src)
+ { /* void */ }
+
+#undef _nc_import_termtype2
+void _nc_import_termtype2(
+ TERMTYPE2 *dst,
+ const TERMTYPE *src)
+ { /* void */ }
+
/* ./codes.c */
#undef boolcodes
#undef _nc_free_entry
void _nc_free_entry(
ENTRY *headp,
- TERMTYPE *tterm)
+ TERMTYPE2 *tterm)
{ /* void */ }
#undef _nc_free_entries
ENTRY *headp)
{ /* void */ }
-#undef _nc_delink_entry
-ENTRY *_nc_delink_entry(
- ENTRY *headp,
- TERMTYPE *tterm)
- { return(*(ENTRY **)0); }
-
#undef _nc_leaks_tinfo
void _nc_leaks_tinfo(void)
{ /* void */ }
/* ./fallback.c */
+#undef _nc_fallback2
+const TERMTYPE2 *_nc_fallback2(
+ const char *name)
+ { return(*(const TERMTYPE2 **)0); }
+
#undef _nc_fallback
const TERMTYPE *_nc_fallback(
const char *name)
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype2
+void _nc_free_termtype2(
+ TERMTYPE2 *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
const char *const tn,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE *ptr,
+ TERMTYPE2 *ptr,
char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
const char *const filename,
- TERMTYPE *ptr)
+ TERMTYPE2 *ptr)
+ { return(*(int *)0); }
+
+#undef _nc_read_entry2
+int _nc_read_entry2(
+ const char *const name,
+ char *const filename,
+ TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE *tp)
+ TERMTYPE2 *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
/*
* Common type definitions and macros for new_pair.c, lib_color.c
*
- * $Id: new_pair.h,v 1.4 2017/03/31 11:32:07 tom Exp $
+ * $Id: new_pair.h,v 1.5 2017/04/02 14:46:34 tom Exp $
*/
#ifndef NEW_PAIR_H
#define USE_NEW_PAIR NCURSES_EXT_COLORS
-#define MAX_OF_TYPE(t) (int)(((unsigned t)(~0))>>1)
#define LIMIT_TYPED(n,t) (t)(((t)(n) < 0) ? MAX_OF_TYPE(t) : (n))
#define limit_COLOR(n) LIMIT_TYPED(n,NCURSES_COLOR_T)
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: MKfallback.sh,v 1.17 2017/01/07 16:05:16 tom Exp $
+# $Id: MKfallback.sh,v 1.21 2017/04/12 00:50:50 tom Exp $
#
# MKfallback.sh -- create fallback table for entry reads
#
for x in $*
do
echo "/* $x */"
- infocmp -E $x
+ infocmp -E $x | sed -e 's/\<short\>/NCURSES_INT2/g'
done
cat <<EOF
-static const TERMTYPE fallbacks[$#] =
+static const TERMTYPE2 fallbacks[$#] =
{
EOF
comma=""
fi
cat <<EOF
-NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *name GCC_UNUSED)
+NCURSES_EXPORT(const TERMTYPE2 *)
+_nc_fallback2 (const char *name GCC_UNUSED)
{
EOF
if [ "$*" ]
then
cat <<EOF
- const TERMTYPE *tp;
+ const TERMTYPE2 *tp;
for (tp = fallbacks;
- tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE);
+ tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE2);
tp++) {
if (_nc_name_match(tp->term_names, name, "|")) {
return(tp);
fi
cat <<EOF
- return((TERMTYPE *)0);
+ return((const TERMTYPE2 *)0);
}
+
+#if NCURSES_EXT_NUMBERS
+#undef _nc_fallback
+
+/*
+ * This entrypoint is used by tack.
+ */
+NCURSES_EXPORT(const TERMTYPE *)
+_nc_fallback (const char *name)
+{
+ const TERMTYPE2 *tp = _nc_fallback2(name);
+ const TERMTYPE *result = 0;
+ if (tp != 0) {
+ static TERMTYPE temp;
+ _nc_export_termtype2(&temp, tp);
+ result = &temp;
+ }
+ return result;
+}
+#endif
EOF
if test -n "$tmp_info" ; then
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: alloc_entry.c,v 1.58 2013/08/17 19:20:38 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.59 2017/04/09 23:33:51 tom Exp $")
#define ABSENT_OFFSET -1
#define CANCELLED_OFFSET -2
static size_t next_free; /* next free character in stringbuf */
NCURSES_EXPORT(void)
-_nc_init_entry(TERMTYPE *const tp)
+_nc_init_entry(ENTRY * const tp)
/* initialize a terminal type data block */
{
#if NO_LEAKS
next_free = 0;
- _nc_init_termtype(tp);
+ _nc_init_termtype(&(tp->tterm));
}
NCURSES_EXPORT(ENTRY *)
if (newp != 0) {
*newp = *oldp;
- _nc_copy_termtype(&(newp->tterm), &(oldp->tterm));
+ _nc_copy_termtype2(&(newp->tterm), &(oldp->tterm));
}
return newp;
}
int useoffsets[MAX_USES];
unsigned i, n;
unsigned nuses = ep->nuses;
- TERMTYPE *tp = &(ep->tterm);
+ TERMTYPE2 *tp = &(ep->tterm);
if (copy_strings) {
next_free = 0; /* clear static storage */
}
NCURSES_EXPORT(void)
-_nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from)
+_nc_merge_entry(ENTRY * const target, ENTRY * const source)
/* merge capabilities from `from' entry into `to' entry */
{
+ TERMTYPE2 *to = &(target->tterm);
+ TERMTYPE2 *from = &(source->tterm);
unsigned i;
#if NCURSES_XNAMES
if (mergebool == CANCELLED_BOOLEAN)
to->Booleans[i] = FALSE;
else if (mergebool == TRUE)
- to->Booleans[i] = (char) mergebool;
+ to->Booleans[i] = (NCURSES_SBOOL) mergebool;
}
}
for_each_number(i, from) {
if (to->Numbers[i] != CANCELLED_NUMERIC) {
- short mergenum = from->Numbers[i];
+ int mergenum = from->Numbers[i];
if (mergenum == CANCELLED_NUMERIC)
to->Numbers[i] = ABSENT_NUMERIC;
else if (mergenum != ABSENT_NUMERIC)
- to->Numbers[i] = mergenum;
+ to->Numbers[i] = (NCURSES_INT2) mergenum;
}
}
/****************************************************************************
- * Copyright (c) 1999-2013,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2016,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: alloc_ttype.c,v 1.28 2016/05/28 23:22:52 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.29 2017/04/09 23:15:34 tom Exp $")
#if NCURSES_XNAMES
/*
to->num = (unsigned short) (to->num + (ext - to->ext))
static void
-realign_data(TERMTYPE *to, char **ext_Names,
+realign_data(TERMTYPE2 *to, char **ext_Names,
int ext_Booleans,
int ext_Numbers,
int ext_Strings)
if (to->ext_Numbers != ext_Numbers) {
EXTEND_NUM(num_Numbers, ext_Numbers);
- TYPE_REALLOC(short, to->num_Numbers, to->Numbers);
+ TYPE_REALLOC(NCURSES_INT2, to->num_Numbers, to->Numbers);
for (n = to->ext_Numbers - 1,
m = ext_Numbers - 1,
base = to->num_Numbers - (m + 1); m >= 0; m--) {
* Returns the first index in ext_Names[] for the given token-type
*/
static unsigned
-_nc_first_ext_name(TERMTYPE *tp, int token_type)
+_nc_first_ext_name(TERMTYPE2 *tp, int token_type)
{
unsigned first;
* Returns the last index in ext_Names[] for the given token-type
*/
static unsigned
-_nc_last_ext_name(TERMTYPE *tp, int token_type)
+_nc_last_ext_name(TERMTYPE2 *tp, int token_type)
{
unsigned last;
* Lookup an entry from extended-names, returning -1 if not found
*/
static int
-_nc_find_ext_name(TERMTYPE *tp, char *name, int token_type)
+_nc_find_ext_name(TERMTYPE2 *tp, char *name, int token_type)
{
unsigned j;
unsigned first = _nc_first_ext_name(tp, token_type);
* (e.g., Booleans[]).
*/
static int
-_nc_ext_data_index(TERMTYPE *tp, int n, int token_type)
+_nc_ext_data_index(TERMTYPE2 *tp, int n, int token_type)
{
switch (token_type) {
case BOOLEAN:
* data.
*/
static bool
-_nc_del_ext_name(TERMTYPE *tp, char *name, int token_type)
+_nc_del_ext_name(TERMTYPE2 *tp, char *name, int token_type)
{
int first;
* index into the corresponding data array is returned.
*/
static int
-_nc_ins_ext_name(TERMTYPE *tp, char *name, int token_type)
+_nc_ins_ext_name(TERMTYPE2 *tp, char *name, int token_type)
{
unsigned first = _nc_first_ext_name(tp, token_type);
unsigned last = _nc_last_ext_name(tp, token_type);
case NUMBER:
tp->ext_Numbers++;
tp->num_Numbers++;
- TYPE_REALLOC(short, tp->num_Numbers, tp->Numbers);
+ TYPE_REALLOC(NCURSES_INT2, tp->num_Numbers, tp->Numbers);
for (k = (unsigned) (tp->num_Numbers - 1); k > j; k--)
tp->Numbers[k] = tp->Numbers[k - 1];
break;
* cancellation of a name that is inherited from another entry.
*/
static void
-adjust_cancels(TERMTYPE *to, TERMTYPE *from)
+adjust_cancels(TERMTYPE2 *to, TERMTYPE2 *from)
{
int first = to->ext_Booleans + to->ext_Numbers;
int last = first + to->ext_Strings;
}
NCURSES_EXPORT(void)
-_nc_align_termtype(TERMTYPE *to, TERMTYPE *from)
+_nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
{
int na = (int) NUM_EXT_NAMES(to);
int nb = (int) NUM_EXT_NAMES(from);
}
#endif
-NCURSES_EXPORT(void)
-_nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
+#define srcINT 1
+#define dstINT 2
+
+/*
+ * TERMTYPE and TERMTYPE2 differ only with regard to the values in Numbers.
+ * Use 'mode' to decide which to use.
+ */
+static void
+copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
{
-#if NCURSES_XNAMES
+#if NCURSES_XNAMES || NCURSES_EXT_NUMBERS
unsigned i;
#endif
+#if NCURSES_EXT_NUMBERS
+ short *oldptr = 0;
+ int *newptr = 0;
+#endif
+ DEBUG(2, ("copy_termtype"));
*dst = *src; /* ...to copy the sizes and string-tables */
TYPE_MALLOC(NCURSES_SBOOL, NUM_BOOLEANS(dst), dst->Booleans);
- TYPE_MALLOC(short, NUM_NUMBERS(dst), dst->Numbers);
TYPE_MALLOC(char *, NUM_STRINGS(dst), dst->Strings);
memcpy(dst->Booleans,
src->Booleans,
NUM_BOOLEANS(dst) * sizeof(dst->Booleans[0]));
- memcpy(dst->Numbers,
- src->Numbers,
- NUM_NUMBERS(dst) * sizeof(dst->Numbers[0]));
memcpy(dst->Strings,
src->Strings,
NUM_STRINGS(dst) * sizeof(dst->Strings[0]));
+#if NCURSES_EXT_NUMBERS
+ if ((mode & dstINT) == 0) {
+ DEBUG(2, ("...convert int ->short"));
+ TYPE_MALLOC(short, NUM_NUMBERS(dst), oldptr);
+ ((TERMTYPE *) dst)->Numbers = oldptr;
+ } else {
+ DEBUG(2, ("...copy without changing size"));
+ TYPE_MALLOC(int, NUM_NUMBERS(dst), newptr);
+ dst->Numbers = newptr;
+ }
+ if ((mode == srcINT) && (oldptr != 0)) {
+ DEBUG(2, ("...copy int ->short"));
+ for (i = 0; i < NUM_NUMBERS(dst); ++i) {
+ if (src->Numbers[i] > MAX_OF_TYPE(short)) {
+ oldptr[i] = MAX_OF_TYPE(short);
+ } else {
+ oldptr[i] = (short) src->Numbers[i];
+ }
+ }
+ } else if ((mode == dstINT) && (newptr != 0)) {
+ DEBUG(2, ("...copy short ->int"));
+ for (i = 0; i < NUM_NUMBERS(dst); ++i) {
+ newptr[i] = ((const short *) (src->Numbers))[i];
+ }
+ } else {
+ DEBUG(2, ("...copy %s without change",
+ (mode & dstINT)
+ ? "int"
+ : "short"));
+ memcpy(dst->Numbers,
+ src->Numbers,
+ NUM_NUMBERS(dst) * ((mode & dstINT)
+ ? sizeof(int)
+ : sizeof(short)));
+ }
+#else
+ (void) mode;
+ TYPE_MALLOC(short, NUM_NUMBERS(dst), dst->Numbers);
+ memcpy(dst->Numbers,
+ src->Numbers,
+ NUM_NUMBERS(dst) * sizeof(dst->Numbers[0]));
+#endif
+
/* FIXME: we probably should also copy str_table and ext_str_table,
* but tic and infocmp are not written to exploit that (yet).
*/
}
#endif
}
+
+/*
+ * This entrypoint is used by tack.
+ */
+NCURSES_EXPORT(void)
+_nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
+{
+ DEBUG(2, ("_nc_copy_termtype..."));
+ copy_termtype((TERMTYPE2 *) dst, (const TERMTYPE2 *) src, 0);
+}
+
+#if NCURSES_EXT_NUMBERS
+NCURSES_EXPORT(void)
+_nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src)
+{
+ DEBUG(2, ("_nc_copy_termtype2..."));
+ copy_termtype(dst, src, srcINT | dstINT);
+}
+
+/*
+ * Use this for exporting the internal TERMTYPE2 to the legacy format used via
+ * the CUR macro by applications.
+ */
+NCURSES_EXPORT(void)
+_nc_export_termtype2(TERMTYPE *dst, const TERMTYPE2 *src)
+{
+ DEBUG(2, ("_nc_export_termtype2..."));
+ copy_termtype((TERMTYPE2 *) dst, src, srcINT);
+}
+
+/* FIXME - this will go away when conversion is complete */
+NCURSES_EXPORT(void)
+_nc_import_termtype2(TERMTYPE2 *dst, const TERMTYPE *src)
+{
+ DEBUG(2, ("_nc_import_termtype2..."));
+ copy_termtype(dst, (const TERMTYPE2 *) src, dstINT);
+}
+#endif /* NCURSES_EXT_NUMBERS */
/****************************************************************************
- * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: comp_parse.c,v 1.92 2016/09/10 20:08:32 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.96 2017/04/15 15:36:58 tom Exp $")
-static void sanity_check2(TERMTYPE *, bool);
-NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2;
+static void sanity_check2(TERMTYPE2 *, bool);
+NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
-/* obsolete: 20040705 */
-static void sanity_check(TERMTYPE *);
-NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check;
-
-static void fixup_acsc(TERMTYPE *, int);
+static void fixup_acsc(TERMTYPE2 *, int);
static void
enqueue(ENTRY * ep)
/* if that didn't work, try to merge in a compiled entry */
if (!foundit) {
- TERMTYPE thisterm;
+ TERMTYPE2 thisterm;
char filename[PATH_MAX];
memset(&thisterm, 0, sizeof(thisterm));
- if (_nc_read_entry(lookfor, filename, &thisterm) == 1) {
+ if (_nc_read_entry2(lookfor, filename, &thisterm) == 1) {
DEBUG(2, ("%s: resolving use=%s (compiled)",
child, lookfor));
*/
if (fullresolve) {
do {
- TERMTYPE merged;
+ ENTRY merged;
keepgoing = FALSE;
* the merged entry the name field and string
* table pointer.
*/
- _nc_copy_termtype(&merged, &(qp->tterm));
+ _nc_copy_termtype2(&(merged.tterm), &(qp->tterm));
/*
* Now merge in each use entry in the proper
*/
for (; qp->nuses; qp->nuses--)
_nc_merge_entry(&merged,
- &qp->uses[qp->nuses - 1].link->tterm);
+ qp->uses[qp->nuses - 1].link);
/*
* Now merge in the original entry.
*/
- _nc_merge_entry(&merged, &qp->tterm);
+ _nc_merge_entry(&merged, qp);
/*
* Replace the original entry with the merged one.
#if NCURSES_XNAMES
FreeIfNeeded(qp->tterm.ext_Names);
#endif
- qp->tterm = merged;
+ qp->tterm = merged.tterm;
_nc_wrap_entry(qp, TRUE);
/*
DEBUG(2, ("RESOLUTION FINISHED"));
- if (fullresolve)
- if (_nc_check_termtype != 0) {
- _nc_curr_col = -1;
- for_entry_list(qp) {
- _nc_curr_line = (int) qp->startline;
- _nc_set_type(_nc_first_name(qp->tterm.term_names));
+ if (fullresolve) {
+ _nc_curr_col = -1;
+ for_entry_list(qp) {
+ _nc_curr_line = (int) qp->startline;
+ _nc_set_type(_nc_first_name(qp->tterm.term_names));
+ /*
+ * tic overrides this function pointer to provide more verbose
+ * checking.
+ */
+ if (_nc_check_termtype2 != sanity_check2) {
+ SCREEN *save_SP = SP;
+ SCREEN fake_sp;
+ TERMINAL fake_tm;
+ TERMINAL *save_tm = cur_term;
+
/*
- * tic overrides this function pointer to provide more verbose
- * checking.
+ * Setup so that tic can use ordinary terminfo interface to
+ * obtain capability information.
*/
- if (_nc_check_termtype2 != sanity_check2) {
- SCREEN *save_SP = SP;
- SCREEN fake_sp;
- TERMINAL fake_tm;
- TERMINAL *save_tm = cur_term;
-
- /*
- * Setup so that tic can use ordinary terminfo interface
- * to obtain capability information.
- */
- memset(&fake_sp, 0, sizeof(fake_sp));
- memset(&fake_tm, 0, sizeof(fake_tm));
- fake_sp._term = &fake_tm;
- fake_tm.type = qp->tterm;
- _nc_set_screen(&fake_sp);
- set_curterm(&fake_tm);
-
- _nc_check_termtype2(&qp->tterm, literal);
-
- _nc_set_screen(save_SP);
- set_curterm(save_tm);
- } else {
- fixup_acsc(&qp->tterm, literal);
- }
+ memset(&fake_sp, 0, sizeof(fake_sp));
+ memset(&fake_tm, 0, sizeof(fake_tm));
+ fake_sp._term = &fake_tm;
+ TerminalType(&fake_tm) = qp->tterm;
+ _nc_set_screen(&fake_sp);
+ set_curterm(&fake_tm);
+
+ _nc_check_termtype2(&qp->tterm, literal);
+
+ _nc_set_screen(save_SP);
+ set_curterm(save_tm);
+ } else {
+ fixup_acsc(&qp->tterm, literal);
}
- DEBUG(2, ("SANITY CHECK FINISHED"));
}
+ DEBUG(2, ("SANITY CHECK FINISHED"));
+ }
return (TRUE);
}
-/* obsolete: 20040705 */
-NCURSES_EXPORT(int)
-_nc_resolve_uses(bool fullresolve)
-{
- return _nc_resolve_uses2(fullresolve, FALSE);
-}
-
/*
* This bit of legerdemain turns all the terminfo variable names into
* references to locations in the arrays Booleans, Numbers, and Strings ---
#define CUR tp->
static void
-fixup_acsc(TERMTYPE *tp, int literal)
+fixup_acsc(TERMTYPE2 *tp, int literal)
{
if (!literal) {
if (acs_chars == 0
}
static void
-sanity_check2(TERMTYPE *tp, bool literal)
+sanity_check2(TERMTYPE2 *tp, bool literal)
{
if (!PRESENT(exit_attribute_mode)) {
#ifdef __UNUSED__ /* this casts too wide a net */
ANDMISSING(set_color_pair, initialize_pair);
}
-/* obsolete: 20040705 */
-static void
-sanity_check(TERMTYPE *tp)
-{
- sanity_check2(tp, FALSE);
-}
-
#if NO_LEAKS
NCURSES_EXPORT(void)
_nc_leaks_tic(void)
/****************************************************************************
- * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: comp_scan.c,v 1.103 2016/05/28 23:22:52 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.104 2017/04/08 11:30:52 tom Exp $")
/*
* Maximum length of string capability we'll accept before raising an error.
if (numchk == numbuf)
_nc_warning("no value given for `%s'", tok_buf);
if ((*numchk != '\0') || (ch != separator))
- _nc_warning("Missing separator");
+ _nc_warning("Missing separator for `%s'", tok_buf);
+ if (number < 0)
+ _nc_warning("value of `%s' cannot be negative", tok_buf);
+ if (number > MAX_OF_TYPE(NCURSES_INT2)) {
+ _nc_warning("limiting value of `%s' from %#lx to %#x",
+ tok_buf,
+ number, MAX_OF_TYPE(NCURSES_INT2));
+ number = MAX_OF_TYPE(NCURSES_INT2);
+ }
}
_nc_curr_token.tk_name = tok_buf;
_nc_curr_token.tk_valnumber = (int) number;
/****************************************************************************
- * Copyright (c) 2006-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2012,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: entries.c,v 1.21 2012/05/05 20:33:44 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.23 2017/04/13 22:39:57 tom Exp $")
/****************************************************************************
*
NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0;
NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0;
-NCURSES_EXPORT(void)
-_nc_free_entry(ENTRY * headp, TERMTYPE *tterm)
-/* free the allocated storage consumed by the given list entry */
-{
- ENTRY *ep;
-
- if ((ep = _nc_delink_entry(headp, tterm)) != 0) {
- free(ep);
- }
-}
-
-NCURSES_EXPORT(void)
-_nc_free_entries(ENTRY * headp)
-/* free the allocated storage consumed by list entries */
-{
- (void) headp; /* unused - _nc_head is altered here! */
-
- while (_nc_head != 0) {
- _nc_free_termtype(&(_nc_head->tterm));
- }
-}
-
-NCURSES_EXPORT(ENTRY *)
-_nc_delink_entry(ENTRY * headp, TERMTYPE *tterm)
+static ENTRY *
+_nc_delink_entry(ENTRY * headp, TERMTYPE2 *tterm)
/* delink the allocated storage for the given list entry */
{
ENTRY *ep, *last;
return ep;
}
+NCURSES_EXPORT(void)
+_nc_free_entry(ENTRY * headp, TERMTYPE2 *tterm)
+/* free the allocated storage consumed by the given list entry */
+{
+ ENTRY *ep;
+
+ if ((ep = _nc_delink_entry(headp, tterm)) != 0) {
+ free(ep);
+ }
+}
+
+NCURSES_EXPORT(void)
+_nc_free_entries(ENTRY * headp)
+/* free the allocated storage consumed by list entries */
+{
+ (void) headp; /* unused - _nc_head is altered here! */
+
+ while (_nc_head != 0) {
+ _nc_free_termtype2(&(_nc_head->tterm));
+ }
+}
+
NCURSES_EXPORT(void)
_nc_leaks_tinfo(void)
{
if (TerminalOf(CURRENT_SCREEN) != 0) {
del_curterm(TerminalOf(CURRENT_SCREEN));
}
+ free(_nc_prescreen.allocated);
_nc_comp_captab_leaks();
_nc_free_entries(_nc_head);
free(s);
#ifdef TRACE
+ T((T_RETURN("")));
trace(0);
_nc_trace_buf(-1, (size_t) 0);
#endif
/****************************************************************************
- * Copyright (c) 1999-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2011,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $")
+MODULE_ID("$Id: free_ttype.c,v 1.17 2017/04/13 01:06:04 tom Exp $")
-NCURSES_EXPORT(void)
-_nc_free_termtype(TERMTYPE *ptr)
+static void
+really_free_termtype(TERMTYPE2 *ptr, bool freeStrings)
{
T(("_nc_free_termtype(%s)", ptr->term_names));
- FreeIfNeeded(ptr->str_table);
+ if (freeStrings) {
+ FreeIfNeeded(ptr->str_table);
+ }
FreeIfNeeded(ptr->Booleans);
FreeIfNeeded(ptr->Numbers);
FreeIfNeeded(ptr->Strings);
#if NCURSES_XNAMES
- FreeIfNeeded(ptr->ext_str_table);
+ if (freeStrings) {
+ FreeIfNeeded(ptr->ext_str_table);
+ }
FreeIfNeeded(ptr->ext_Names);
#endif
memset(ptr, 0, sizeof(TERMTYPE));
_nc_free_entry(_nc_head, ptr);
}
+/*
+ * This entrypoint is used by tack.
+ */
+NCURSES_EXPORT(void)
+_nc_free_termtype(TERMTYPE *ptr)
+{
+ really_free_termtype((TERMTYPE2 *) ptr, !NCURSES_EXT_NUMBERS);
+}
+
+#if NCURSES_EXT_NUMBERS
+NCURSES_EXPORT(void)
+_nc_free_termtype2(TERMTYPE2 *ptr)
+{
+ really_free_termtype(ptr, TRUE);
+}
+#endif
+
#if NCURSES_XNAMES
NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE;
#include <curses.priv.h>
#include <termcap.h> /* ospeed */
-MODULE_ID("$Id: lib_cur_term.c,v 1.36 2017/04/01 17:19:03 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.40 2017/04/15 21:35:08 tom Exp $")
#undef CUR
-#define CUR termp->type.
+#define CUR TerminalType(termp).
#if USE_REENTRANT
#endif
NCURSES_EXPORT(TERMINAL *)
-NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp)
+NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL *termp)
{
TERMINAL *oldterm;
#ifdef USE_TERM_DRIVER
TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp;
ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate);
- if (TCB->drv->isTerminfo && termp->type.Strings) {
+ if (TCB->drv &&
+ TCB->drv->isTerminfo &&
+ TerminalType(termp).Strings) {
PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
}
TCB->csp = SP_PARM;
#else
ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate);
- if (termp->type.Strings) {
+ if (TerminalType(termp).Strings) {
PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
}
#endif
#if !USE_REENTRANT
#define MY_SIZE (size_t) (NAMESIZE - 1)
- _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE);
+ _nc_STRNCPY(ttytype, TerminalType(termp).term_names, MY_SIZE);
ttytype[MY_SIZE] = '\0';
#endif
}
#if NCURSES_SP_FUNCS
NCURSES_EXPORT(TERMINAL *)
-set_curterm(TERMINAL * termp)
+set_curterm(TERMINAL *termp)
{
return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp);
}
#endif
NCURSES_EXPORT(int)
-NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp)
+NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL *termp)
{
int rc = ERR;
#endif
);
- _nc_free_termtype(&(termp->type));
+#if NCURSES_EXT_NUMBERS
+ _nc_free_termtype(&termp->type);
+#endif
+ _nc_free_termtype2(&TerminalType(termp));
if (termp == cur)
NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0);
if (TCB->drv)
TCB->drv->td_release(TCB);
#endif
- free(termp);
#if NO_LEAKS
/* discard memory used in tgetent's cache for this terminal */
_nc_tgetent_leak(termp);
#endif
+ free(termp);
rc = OK;
}
#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-del_curterm(TERMINAL * termp)
+del_curterm(TERMINAL *termp)
{
int rc;
#include <curses.priv.h>
-MODULE_ID("$Id: lib_data.c,v 1.71 2017/03/31 17:06:34 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.72 2017/04/10 08:34:31 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
#define RIPOFF_0s { RIPOFF_0 }
NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
+ NULL, /* allocated */
TRUE, /* use_env */
FALSE, /* filter_mode */
A_NORMAL, /* previous_attr */
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2014,2017 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 *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_options.c,v 1.78 2014/09/27 21:55:24 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.79 2017/04/15 22:24:38 tom Exp $")
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
{
T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t));
- if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM))
+ if (t < 1 || t > 255 || !SP_PARM || !IsValidTIScreen(SP_PARM))
returnCode(ERR);
NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd)
{
T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd));
- if (IsValidTIScreen(SP_PARM)) {
+ if (SP_PARM && IsValidTIScreen(SP_PARM)) {
SP_PARM->_checkfd = fd;
returnCode(OK);
} else {
/****************************************************************************
- * Copyright (c) 1998-2012,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_raw.c,v 1.22 2016/05/28 23:22:52 tom Exp $")
+MODULE_ID("$Id: lib_raw.c,v 1.23 2017/04/15 22:24:45 tom Exp $")
#if HAVE_SYS_TERMIO_H
#include <sys/termio.h> /* needed for ISC */
kbdinfo.fsMask |= KEYBOARD_BINARY_MODE;
KbdSetStatus(&kbdinfo, 0);
#endif
- SP_PARM->_raw = TRUE;
- SP_PARM->_cbreak = 1;
+ if (SP_PARM) {
+ SP_PARM->_raw = TRUE;
+ SP_PARM->_cbreak = 1;
+ }
termp->Nttyb = buf;
}
AFTER("raw");
#endif
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
- SP_PARM->_cbreak = 1;
+ if (SP_PARM) {
+ SP_PARM->_cbreak = 1;
+ }
termp->Nttyb = buf;
}
AFTER("cbreak");
kbdinfo.fsMask |= KEYBOARD_ASCII_MODE;
KbdSetStatus(&kbdinfo, 0);
#endif
- SP_PARM->_raw = FALSE;
- SP_PARM->_cbreak = 0;
+ if (SP_PARM) {
+ SP_PARM->_raw = FALSE;
+ SP_PARM->_cbreak = 0;
+ }
termp->Nttyb = buf;
}
AFTER("noraw");
#endif
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
- SP_PARM->_cbreak = 0;
+ if (SP_PARM) {
+ SP_PARM->_cbreak = 0;
+ }
termp->Nttyb = buf;
}
AFTER("nocbreak");
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.174 2017/04/02 14:26:18 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.178 2017/04/11 23:51:32 tom Exp $")
/****************************************************************************
*
* Reduce explicit use of "cur_term" global variable.
*/
#undef CUR
-#define CUR termp->type.
+#define CUR TerminalType(termp).
/*
* Wrap global variables in this module.
NCURSES_EXPORT(void)
_nc_get_screensize(SCREEN *sp,
#ifdef USE_TERM_DRIVER
- TERMINAL * termp,
+ TERMINAL *termp,
#endif
int *linep, int *colp)
/* Obtain lines/columns values from the environment and/or terminfo entry */
* Put the derived values back in the screen-size caps, so
* tigetnum() and tgetnum() will do the right thing.
*/
- lines = (short) (*linep);
- columns = (short) (*colp);
+ lines = (NCURSES_INT2) (*linep);
+ columns = (NCURSES_INT2) (*colp);
+#if NCURSES_EXT_NUMBERS
+#define OldNumber(termp,name) \
+ (termp)->type.Numbers[(&name - (termp)->type2.Numbers)]
+ OldNumber(termp, lines) = (short) (*linep);
+ OldNumber(termp, columns) = (short) (*colp);
+#endif
}
T(("screen size is %dx%d", *linep, *colp));
* just like tgetent().
*/
int
-_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp)
+_nc_setup_tinfo(const char *const tn, TERMTYPE2 *const tp)
{
char filename[PATH_MAX];
- int status = _nc_read_entry(tn, filename, tp);
+ int status = _nc_read_entry2(tn, filename, tp);
/*
* If we have an entry, force all of the cancelled strings to null
** and substitute it in for the prototype given in 'command_character'.
*/
void
-_nc_tinfo_cmdch(TERMINAL * termp, int proto)
+_nc_tinfo_cmdch(TERMINAL *termp, int proto)
{
char *tmp;
* character set.
*/
NCURSES_EXPORT(int)
-_nc_locale_breaks_acs(TERMINAL * termp)
+_nc_locale_breaks_acs(TERMINAL *termp)
{
const char *env_name = "NCURSES_NO_UTF8_ACS";
const char *env;
}
NCURSES_EXPORT(int)
-TINFO_SETUP_TERM(TERMINAL ** tp,
+TINFO_SETUP_TERM(TERMINAL **tp,
NCURSES_CONST char *tname,
int Filedes,
int *errret,
}
#else
#if NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP
- status = _nc_setup_tinfo(tname, &termp->type);
+ status = _nc_setup_tinfo(tname, &TerminalType(termp));
#else
status = TGETENT_NO;
#endif
/* try fallback list if entry on disk */
if (status != TGETENT_YES) {
- const TERMTYPE *fallback = _nc_fallback(tname);
+ const TERMTYPE2 *fallback = _nc_fallback2(tname);
if (fallback) {
- _nc_copy_termtype(&(termp->type), fallback);
+ TerminalType(termp) = *fallback;
status = TGETENT_YES;
}
}
ret_error1(status, "unknown terminal type.\n", tname);
}
}
+#if NCURSES_EXT_NUMBERS
+ _nc_export_termtype2(&termp->type, &TerminalType(termp));
+#endif
#if !USE_REENTRANT
#define MY_SIZE (size_t) (NAMESIZE - 1)
_nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE);
sp = _nc_alloc_screen_sp();
T(("_nc_alloc_screen_sp %p", (void *) sp));
if (sp != 0) {
+ _nc_prescreen.allocated = sp;
sp->rsp = sp->rippedoff;
sp->_filtered = _nc_prescreen.filter_mode;
sp->_use_env = _nc_prescreen.use_env;
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_termcap.c,v 1.82 2017/04/01 17:24:07 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.84 2017/04/11 01:15:11 tom Exp $")
NCURSES_EXPORT_VAR(char *) UP = 0;
NCURSES_EXPORT_VAR(char *) BC = 0;
if (backspace_if_not_bs != NULL)
BC = backspace_if_not_bs;
- if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) {
+ if ((FIX_SGR0 = _nc_trim_sgr0(&TerminalType(TerminalOf(SP_PARM))))
+ != 0) {
if (!strcmp(FIX_SGR0, exit_attribute_mode)) {
if (FIX_SGR0 != exit_attribute_mode) {
free(FIX_SGR0);
T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id));
if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) {
- TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+ TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
struct name_table_entry const *entry_ptr;
int j = -1;
T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id));
if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) {
- TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+ TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
struct name_table_entry const *entry_ptr;
int j = -1;
T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area));
if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) {
- TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+ TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
struct name_table_entry const *entry_ptr;
int j = -1;
#undef CacheInx
#define CacheInx num
NCURSES_EXPORT(void)
-_nc_tgetent_leak(TERMINAL * termp)
+_nc_tgetent_leak(TERMINAL *termp)
{
if (termp != 0) {
int num;
/****************************************************************************
- * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: lib_ti.c,v 1.31 2016/05/28 23:22:52 tom Exp $")
+MODULE_ID("$Id: lib_ti.c,v 1.32 2017/04/11 01:15:42 tom Exp $")
#if 0
static bool
T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str));
if (HasTInfoTerminal(SP_PARM)) {
- TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+ TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
struct name_table_entry const *entry_ptr;
int j = -1;
T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str));
if (HasTInfoTerminal(SP_PARM)) {
- TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+ TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
struct name_table_entry const *entry_ptr;
int j = -1;
T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str));
if (HasTInfoTerminal(SP_PARM)) {
- TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+ TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM));
struct name_table_entry const *entry_ptr;
int j = -1;
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: parse_entry.c,v 1.82 2017/04/03 09:00:45 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.83 2017/04/06 22:15:54 tom Exp $")
#ifdef LINT
static short const parametrized[] =
#include <parametrized.h>
#endif
-static void postprocess_termcap(TERMTYPE *, bool);
-static void postprocess_terminfo(TERMTYPE *);
+static void postprocess_termcap(TERMTYPE2 *, bool);
+static void postprocess_terminfo(TERMTYPE2 *);
static struct name_table_entry const *lookup_fullname(const char *name);
#if NCURSES_XNAMES
_nc_extend_names(ENTRY * entryp, char *name, int token_type)
{
static struct name_table_entry temp;
- TERMTYPE *tp = &(entryp->tterm);
+ TERMTYPE2 *tp = &(entryp->tterm);
unsigned offset = 0;
unsigned actual;
unsigned tindex;
case NUMBER:
tp->ext_Numbers++;
tp->num_Numbers++;
- TYPE_REALLOC(short, tp->num_Numbers, tp->Numbers);
+ TYPE_REALLOC(NCURSES_INT2, tp->num_Numbers, tp->Numbers);
for_each_value(tp->num_Numbers)
tp->Numbers[last] = tp->Numbers[last - 1];
break;
#define MAX_NUMBER 0x7fff /* positive shorts only */
NCURSES_EXPORT(int)
-_nc_parse_entry(ENTRY *entryp, int literal, bool silent)
+_nc_parse_entry(ENTRY * entryp, int literal, bool silent)
{
int token_type;
struct name_table_entry const *entry_ptr;
if (token_type != NAMES)
_nc_err_abort("Entry does not start with terminal names in column one");
- _nc_init_entry(&entryp->tterm);
+ _nc_init_entry(entryp);
entryp->cstart = _nc_comment_start;
entryp->cend = _nc_comment_end;
#define CUR tp->
static void
-postprocess_termcap(TERMTYPE *tp, bool has_base)
+postprocess_termcap(TERMTYPE2 *tp, bool has_base)
{
char buf[MAX_LINE * 2 + 2];
string_desc result;
}
static void
-postprocess_terminfo(TERMTYPE *tp)
+postprocess_terminfo(TERMTYPE2 *tp)
{
/*
* TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION
#include <tic.h>
-MODULE_ID("$Id: read_entry.c,v 1.142 2017/03/16 08:19:06 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.143 2017/04/06 22:19:06 tom Exp $")
#define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
#if NCURSES_USE_DATABASE
static void
-convert_shorts(char *buf, short *Numbers, int count)
+convert_numbers(char *buf, NCURSES_INT2 *Numbers, int count)
{
int i;
for (i = 0; i < count; i++) {
#endif
NCURSES_EXPORT(void)
-_nc_init_termtype(TERMTYPE *const tp)
+_nc_init_termtype(TERMTYPE2 *const tp)
{
unsigned i;
if (tp->Booleans == 0)
TYPE_MALLOC(NCURSES_SBOOL, BOOLCOUNT, tp->Booleans);
if (tp->Numbers == 0)
- TYPE_MALLOC(short, NUMCOUNT, tp->Numbers);
+ TYPE_MALLOC(NCURSES_INT2, NUMCOUNT, tp->Numbers);
if (tp->Strings == 0)
TYPE_MALLOC(char *, STRCOUNT, tp->Strings);
* Return TGETENT_YES if read, TGETENT_NO if not found or garbled.
*/
NCURSES_EXPORT(int)
-_nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit)
+_nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
{
int offset = 0;
int name_size, bool_count, num_count, str_count, str_size;
even_boundary(name_size + bool_count);
/* grab the numbers */
- if ((ptr->Numbers = TYPE_CALLOC(short, max(NUMCOUNT, num_count))) == 0
+ if (!(ptr->Numbers = TYPE_CALLOC(NCURSES_INT2, max(NUMCOUNT, num_count)))
|| !read_shorts(buf, num_count)) {
returnDB(TGETENT_NO);
}
- convert_shorts(buf, ptr->Numbers, num_count);
+ convert_numbers(buf, ptr->Numbers, num_count);
if ((ptr->Strings = TYPE_CALLOC(char *, max(STRCOUNT, str_count))) == 0) {
returnDB(TGETENT_NO);
ptr->num_Strings = UShort(STRCOUNT + ext_str_count);
TYPE_REALLOC(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans);
- TYPE_REALLOC(short, ptr->num_Numbers, ptr->Numbers);
+ TYPE_REALLOC(NCURSES_INT2, ptr->num_Numbers, ptr->Numbers);
TYPE_REALLOC(char *, ptr->num_Strings, ptr->Strings);
TR(TRACE_DATABASE, ("extended header is %d/%d/%d(%d:%d)",
returnDB(TGETENT_NO);
}
TR(TRACE_DATABASE, ("Before converting extended-numbers"));
- convert_shorts(buf, ptr->Numbers + NUMCOUNT, ext_num_count);
+ convert_numbers(buf, ptr->Numbers + NUMCOUNT, ext_num_count);
}
TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset));
* table.
*/
NCURSES_EXPORT(int)
-_nc_read_file_entry(const char *const filename, TERMTYPE *ptr)
+_nc_read_file_entry(const char *const filename, TERMTYPE2 *ptr)
/* return 1 if read, 0 if not found or garbled */
{
FILE *fp = 0;
TR(TRACE_DATABASE, ("read terminfo %s", filename));
if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) {
- _nc_free_termtype(ptr);
+ _nc_free_termtype2(ptr);
}
} else {
code = TGETENT_NO;
unsigned limit,
const char *const path,
const char *name,
- TERMTYPE *const tp)
+ TERMTYPE2 *const tp)
{
int code = TGETENT_NO;
#if USE_HASHED_DB
#endif /* NCURSES_USE_DATABASE */
/*
- * _nc_read_entry(char *name, char *filename, TERMTYPE *tp)
- *
- * Find and read the compiled entry for a given terminal type,
- * if it exists. We take pains here to make sure no combination
- * of environment variables and terminal type name can be used to
- * overrun the file buffer.
+ * Find and read the compiled entry for a given terminal type, if it exists.
+ * We take pains here to make sure no combination of environment variables and
+ * terminal type name can be used to overrun the file buffer.
*/
-
NCURSES_EXPORT(int)
-_nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp)
+_nc_read_entry2(const char *const name, char *const filename, TERMTYPE2 *const tp)
{
int code = TGETENT_NO;
}
return code;
}
+
+#if NCURSES_EXT_NUMBERS
+/*
+ * This entrypoint is used by tack.
+ */
+NCURSES_EXPORT(int)
+_nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp)
+{
+ TERMTYPE2 dummy;
+ int rc;
+ rc = _nc_read_entry2(name, filename, &dummy);
+ if (rc == TGETENT_YES)
+ _nc_export_termtype2(tp, &dummy);
+ return rc;
+}
+#endif
/****************************************************************************
- * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#include <sys/types.h>
#include <tic.h>
-MODULE_ID("$Id: read_termcap.c,v 1.90 2016/09/10 20:13:11 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.92 2017/04/13 23:40:02 tom Exp $")
#if !PURE_TERMINFO
/****************************************************************************
* Author: Juergen Pfeifer *
- * *
+ * and: Thomas E. Dickey *
****************************************************************************/
#include <curses.priv.h>
-#define CUR ((TERMINAL*)TCB)->type.
+#define CUR TerminalType((TERMINAL*)TCB).
#include <tic.h>
#include <termcap.h> /* ospeed */
# endif
#endif
-MODULE_ID("$Id: tinfo_driver.c,v 1.47 2017/03/28 09:15:24 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.51 2017/04/14 08:19:49 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
}
static void
-get_baudrate(TERMINAL * termp)
+get_baudrate(TERMINAL *termp)
{
int my_ospeed;
int result;
TCB->magic = TCBMAGIC;
#if (NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP)
- status = _nc_setup_tinfo(tname, &termp->type);
+ status = _nc_setup_tinfo(tname, &TerminalType(termp));
#else
status = TGETENT_NO;
#endif
/* try fallback list if entry on disk */
if (status != TGETENT_YES) {
- const TERMTYPE *fallback = _nc_fallback(tname);
+ const TERMTYPE2 *fallback = _nc_fallback2(tname);
if (fallback) {
- termp->type = *fallback;
+ TerminalType(termp) = *fallback;
status = TGETENT_YES;
}
}
}
}
result = TRUE;
+#if NCURSES_EXT_NUMBERS
+ _nc_export_termtype2(&termp->type, &TerminalType(termp));
+#endif
#if !USE_REENTRANT
#define MY_SIZE (size_t) NAMESIZE - 1
_nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE);
/****************************************************************************
- * Copyright (c) 2005-2010,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2012,2017 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 *
#include <tic.h>
-MODULE_ID("$Id: trim_sgr0.c,v 1.15 2012/12/15 20:57:17 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.16 2017/04/05 22:33:07 tom Exp $")
#undef CUR
#define CUR tp->
#define L_BRACK '['
static char *
-set_attribute_9(TERMTYPE *tp, int flag)
+set_attribute_9(TERMTYPE2 *tp, int flag)
{
const char *value;
char *result;
* an error occurs, or the original sgr0 if no change is needed.
*/
NCURSES_EXPORT(char *)
-_nc_trim_sgr0(TERMTYPE *tp)
+_nc_trim_sgr0(TERMTYPE2 *tp)
{
char *result = exit_attribute_mode;
#define TRACE_OUT(p) /*nothing */
#endif
-MODULE_ID("$Id: write_entry.c,v 1.98 2017/02/05 01:47:34 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.99 2017/04/09 23:35:01 tom Exp $")
static int total_written;
static int total_parts;
#if !USE_HASHED_DB
static void
-write_file(char *filename, TERMTYPE *tp)
+write_file(char *filename, TERMTYPE2 *tp)
{
char buffer[MAX_ENTRY_SIZE];
unsigned limit = sizeof(buffer);
*/
NCURSES_EXPORT(void)
-_nc_write_entry(TERMTYPE *const tp)
+_nc_write_entry(TERMTYPE2 *const tp)
{
#if USE_HASHED_DB
}
}
+#if NCURSES_EXT_NUMBERS
+static void
+convert_numbers(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count)
+{
+ size_t i;
+ for (i = 0; i < count; i++) {
+ if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */
+ buf[2 * i] = buf[2 * i + 1] = 0377;
+ } else if (Numbers[i] == CANCELLED_NUMERIC) { /* HI/LO won't work */
+ buf[2 * i] = 0376;
+ buf[2 * i + 1] = 0377;
+ } else {
+ LITTLE_ENDIAN(buf + 2 * i, Numbers[i]);
+ TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i]));
+ }
+ }
+}
+
+#else
+#define convert_numbers(buf,vec,len) convert_shorts(buf,vec,len)
+#endif
+
#define even_boundary(value) \
((value) % 2 != 0 && Write(&zero, sizeof(char), 1) != 1)
#if NCURSES_XNAMES
static unsigned
-extended_Booleans(TERMTYPE *tp)
+extended_Booleans(TERMTYPE2 *tp)
{
unsigned result = 0;
unsigned i;
}
static unsigned
-extended_Numbers(TERMTYPE *tp)
+extended_Numbers(TERMTYPE2 *tp)
{
unsigned result = 0;
unsigned i;
}
static unsigned
-extended_Strings(TERMTYPE *tp)
+extended_Strings(TERMTYPE2 *tp)
{
unsigned short result = 0;
unsigned short i;
* clause - discard the unneeded data.
*/
static bool
-extended_object(TERMTYPE *tp)
+extended_object(TERMTYPE2 *tp)
{
bool result = FALSE;
#endif
NCURSES_EXPORT(int)
-_nc_write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit)
+_nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
{
char *namelist;
size_t namelen, boolmax, nummax, strmax;
TRACE_OUT(("Numerics begin at %04x", *offset));
/* the numerics */
- convert_shorts(buf, tp->Numbers, nummax);
+ convert_numbers(buf, tp->Numbers, nummax);
if (Write(buf, 2, nummax) != nummax)
return (ERR);
TRACE_OUT(("WRITE %d numbers @%d", tp->ext_Numbers, *offset));
if (tp->ext_Numbers) {
- convert_shorts(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers);
+ convert_numbers(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers);
if (Write(buf, 2, tp->ext_Numbers) != tp->ext_Numbers)
return (ERR);
}
/****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_mvcur.c,v 1.140 2016/10/01 17:37:33 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.141 2017/04/07 00:34:22 tom Exp $")
#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */
} else if (buf[0] == 'i') {
dump_init(NULL, F_TERMINFO, S_TERMINFO,
FALSE, 70, 0, 0, FALSE, FALSE, 0);
- dump_entry(&cur_term->type, FALSE, TRUE, 0, 0);
+ dump_entry(&TerminalType(cur_term), FALSE, TRUE, 0, 0);
putchar('\n');
} else if (buf[0] == 'o') {
if (_nc_optimize_enable & OPTIMIZE_MVCUR) {
/****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#define PSAPI_VERSION 2
#include <psapi.h>
-#define CUR my_term.type.
+#define CUR TerminalType(my_term).
-MODULE_ID("$Id: win_driver.c,v 1.56 2016/09/17 22:02:44 tom Exp $")
+MODULE_ID("$Id: win_driver.c,v 1.58 2017/04/14 09:11:00 tom Exp $")
#ifndef __GNUC__
# error We need GCC to compile for MinGW
* This is intentional, to avoid unnecessary breakage of applications
* using <term.h> symbols.
*/
- if (code && (TCB->term.type.Booleans == 0)) {
- _nc_init_termtype(&(TCB->term.type));
+ if (code && (TerminalType(&TCB->term).Booleans == 0)) {
+ _nc_init_termtype(&TerminalType(&TCB->term));
+#if NCURSES_EXT_NUMBERS
+ _nc_export_termtype2(&TCB->term.type, &TerminalType(&TCB->term));
+#endif
}
if (!code) {
-ncurses6 (6.0+20170408) unstable; urgency=low
+ncurses6 (6.0+20170415) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 02 Apr 2017 06:36:57 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 09 Apr 2017 06:43:26 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.0+20170408) unstable; urgency=low
+ncurses6 (6.0+20170415) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 02 Apr 2017 06:36:57 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 09 Apr 2017 06:43:26 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.0+20170408) unstable; urgency=low
+ncurses6 (6.0+20170415) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 02 Apr 2017 06:36:57 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 09 Apr 2017 06:43:26 -0400
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.206 2017/04/02 10:36:57 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.207 2017/04/09 10:43:26 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "0"\r
!define VERSION_YYYY "2017"\r
-!define VERSION_MMDD "0408"\r
+!define VERSION_MMDD "0415"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.0
-Release: 20170408
+Release: 20170415
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
-# $Id: ncurses.map,v 1.39 2017/03/17 21:40:34 tom Exp $
+# $Id: ncurses.map,v 1.42 2017/04/12 00:09:21 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
NCURSES_TIC_6.0.current {
global:
+ _nc_read_entry2;
_nc_write_object;
local:
_*;
use_tioctl;
use_tioctl_sp;
local:
- _*;
_nc_comp_error_leaks;
_nc_db_iterator_leaks;
_nc_setenv_num;
} NCURSES_TINFO_5.8.20110226;
+
+NCURSES_TINFO_6.0.current {
+ global:
+ _nc_copy_termtype2;
+ _nc_export_termtype2;
+ _nc_fallback2;
+ _nc_free_termtype2;
+ local:
+ _*;
+} NCURSES_TINFO_5.9.20150530;
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.0
-Release: 20170408
+Release: 20170415
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
-# $Id: ncurses.sym,v 1.28 2017/03/15 22:12:00 tom Exp $
+# $Id: ncurses.sym,v 1.30 2017/04/11 09:24:03 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
_nc_check_termtype2
_nc_comp_scan_leaks
_nc_copy_termtype
+_nc_copy_termtype2
_nc_curr_col
_nc_curr_line
_nc_db_close
_nc_env_access
_nc_err_abort
_nc_eventlist_timeout
+_nc_export_termtype2
_nc_fallback
+_nc_fallback2
_nc_find_entry
_nc_find_type_entry
_nc_first_db
_nc_free_and_exit
_nc_free_entries
_nc_free_termtype
+_nc_free_termtype2
_nc_free_tic
_nc_free_tinfo
_nc_free_tparm
_nc_putp_flush_sp
_nc_putp_sp
_nc_read_entry
+_nc_read_entry2
_nc_read_entry_source
_nc_read_file_entry
_nc_read_termtype
-# $Id: ncursest.map,v 1.35 2017/03/17 21:40:34 tom Exp $
+# $Id: ncursest.map,v 1.38 2017/04/12 00:11:27 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
NCURSES_TIC_6.0.current {
global:
+ _nc_read_entry2;
_nc_write_object;
local:
_*;
use_tioctl;
use_tioctl_sp;
local:
- _*;
_nc_comp_error_leaks;
_nc_db_iterator_leaks;
_nc_setenv_num;
} NCURSES_TINFO_5.8.20110226;
+NCURSES_TINFO_6.0.current {
+ global:
+ _nc_copy_termtype2;
+ _nc_export_termtype2;
+ _nc_fallback2;
+ _nc_free_termtype2;
+ local:
+ _*;
+} NCURSES_TINFO_5.9.20150530;
+
NCURSEST_5.7.20081102 {
global:
COLOR_PAIR;
-# $Id: ncursest.sym,v 1.30 2017/03/15 22:12:00 tom Exp $
+# $Id: ncursest.sym,v 1.32 2017/04/11 09:24:03 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
_nc_check_termtype2
_nc_codes_leaks
_nc_copy_termtype
+_nc_copy_termtype2
_nc_count_outchars
_nc_cur_term
_nc_curr_col
_nc_env_access
_nc_err_abort
_nc_eventlist_timeout
+_nc_export_termtype2
_nc_fallback
+_nc_fallback2
_nc_find_entry
_nc_find_type_entry
_nc_first_db
_nc_free_and_exit
_nc_free_entries
_nc_free_termtype
+_nc_free_termtype2
_nc_free_tic
_nc_free_tinfo
_nc_freeall
_nc_putp_flush_sp
_nc_putp_sp
_nc_read_entry
+_nc_read_entry2
_nc_read_entry_source
_nc_read_file_entry
_nc_read_termtype
-# $Id: ncursestw.map,v 1.36 2017/03/17 21:40:34 tom Exp $
+# $Id: ncursestw.map,v 1.39 2017/04/12 00:12:38 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
NCURSES_TIC_6.0.current {
global:
+ _nc_read_entry2;
_nc_write_object;
local:
_*;
use_tioctl;
use_tioctl_sp;
local:
- _*;
_nc_comp_error_leaks;
_nc_db_iterator_leaks;
_nc_setenv_num;
} NCURSES_TINFO_5.8.20110226;
+NCURSES_TINFO_6.0.current {
+ global:
+ _nc_copy_termtype2;
+ _nc_export_termtype2;
+ _nc_fallback2;
+ _nc_free_termtype2;
+ local:
+ _*;
+} NCURSES_TINFO_5.9.20150530;
+
NCURSESTW_5.7.20081102 {
global:
COLOR_PAIR;
-# $Id: ncursestw.sym,v 1.28 2017/03/15 22:12:00 tom Exp $
+# $Id: ncursestw.sym,v 1.30 2017/04/11 09:24:03 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
_nc_check_termtype2
_nc_codes_leaks
_nc_copy_termtype
+_nc_copy_termtype2
_nc_count_outchars
_nc_cur_term
_nc_curr_col
_nc_env_access
_nc_err_abort
_nc_eventlist_timeout
+_nc_export_termtype2
_nc_fallback
+_nc_fallback2
_nc_find_entry
_nc_find_type_entry
_nc_first_db
_nc_free_and_exit
_nc_free_entries
_nc_free_termtype
+_nc_free_termtype2
_nc_free_tic
_nc_free_tinfo
_nc_freeall
_nc_putp_flush_sp
_nc_putp_sp
_nc_read_entry
+_nc_read_entry2
_nc_read_entry_source
_nc_read_file_entry
_nc_read_termtype
-# $Id: ncursesw.map,v 1.41 2017/03/17 21:40:34 tom Exp $
+# $Id: ncursesw.map,v 1.44 2017/04/12 00:14:24 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
NCURSES_TIC_6.0.current {
global:
+ _nc_read_entry2;
_nc_write_object;
local:
_*;
use_tioctl;
use_tioctl_sp;
local:
- _*;
_nc_comp_error_leaks;
_nc_db_iterator_leaks;
_nc_setenv_num;
} NCURSES_TINFO_5.8.20110226;
+NCURSES_TINFO_6.0.current {
+ global:
+ _nc_copy_termtype2;
+ _nc_export_termtype2;
+ _nc_fallback2;
+ _nc_free_termtype2;
+ local:
+ _*;
+} NCURSES_TINFO_5.9.20150530;
+
NCURSESW_5.1.20000708 {
global:
COLORS;
-# $Id: ncursesw.sym,v 1.29 2017/03/15 22:12:00 tom Exp $
+# $Id: ncursesw.sym,v 1.31 2017/04/11 09:24:03 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
_nc_check_termtype2
_nc_comp_scan_leaks
_nc_copy_termtype
+_nc_copy_termtype2
_nc_curr_col
_nc_curr_line
_nc_db_close
_nc_env_access
_nc_err_abort
_nc_eventlist_timeout
+_nc_export_termtype2
_nc_fallback
+_nc_fallback2
_nc_find_entry
_nc_find_type_entry
_nc_first_db
_nc_free_and_exit
_nc_free_entries
_nc_free_termtype
+_nc_free_termtype2
_nc_free_tic
_nc_free_tinfo
_nc_free_tparm
_nc_putp_flush_sp
_nc_putp_sp
_nc_read_entry
+_nc_read_entry2
_nc_read_entry_source
_nc_read_file_entry
_nc_read_termtype
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.149 2017/03/04 20:18:20 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.150 2017/04/05 09:27:40 tom Exp $")
#define DISCARD(string) string = ABSENT_STRING
#define PRINTF (void) printf
_nc_progname, width, tversion, outform);
}
-static TERMTYPE *cur_type;
+static TERMTYPE2 *cur_type;
static int
dump_predicate(PredType type, PredIdx idx)
return (FALSE); /* pacify compiler */
}
-static void set_obsolete_termcaps(TERMTYPE *tp);
+static void set_obsolete_termcaps(TERMTYPE2 *tp);
/* is this the index of a function key string? */
#define FNKEY(i) \
}
static char *
-fmt_complex(TERMTYPE *tterm, const char *capability, char *src, int level)
+fmt_complex(TERMTYPE2 *tterm, const char *capability, char *src, int level)
{
bool percent = FALSE;
bool params = has_params(src);
#define EXTRA_CAP 20
int
-fmt_entry(TERMTYPE *tterm,
+fmt_entry(TERMTYPE2 *tterm,
PredFunc pred,
int content_only,
int suppress_untranslatable,
}
static bool
-kill_string(TERMTYPE *tterm, char *cap)
+kill_string(TERMTYPE2 *tterm, char *cap)
{
unsigned n;
for (n = 0; n < NUM_STRINGS(tterm); ++n) {
}
static char *
-find_string(TERMTYPE *tterm, char *name)
+find_string(TERMTYPE2 *tterm, char *name)
{
PredIdx n;
for (n = 0; n < NUM_STRINGS(tterm); ++n) {
* make it smaller.
*/
static int
-kill_labels(TERMTYPE *tterm, int target)
+kill_labels(TERMTYPE2 *tterm, int target)
{
int n;
int result = 0;
* make it smaller.
*/
static int
-kill_fkeys(TERMTYPE *tterm, int target)
+kill_fkeys(TERMTYPE2 *tterm, int target)
{
int n;
int result = 0;
#define SHOW_WHY PRINTF
static bool
-purged_acs(TERMTYPE *tterm)
+purged_acs(TERMTYPE2 *tterm)
{
bool result = FALSE;
* Dump a single entry.
*/
void
-dump_entry(TERMTYPE *tterm,
+dump_entry(TERMTYPE2 *tterm,
int suppress_untranslatable,
int limited,
int numbers,
PredFunc pred)
{
- TERMTYPE save_tterm;
+ TERMTYPE2 save_tterm;
int len, critlen;
const char *legend;
bool infodump;
void
compare_entry(PredHook hook,
- TERMTYPE *tp GCC_UNUSED,
+ TERMTYPE2 *tp GCC_UNUSED,
bool quiet)
/* compare two entries */
{
#define CUR tp->
static void
-set_obsolete_termcaps(TERMTYPE *tp)
+set_obsolete_termcaps(TERMTYPE2 *tp)
{
#include "capdefaults.c"
}
* unique.
*/
void
-repair_acsc(TERMTYPE *tp)
+repair_acsc(TERMTYPE2 *tp)
{
if (VALID_STRING(acs_chars)) {
size_t n, m;
/****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
****************************************************************************/
/*
- * $Id: dump_entry.h,v 1.39 2016/10/01 15:24:26 tom Exp $
+ * $Id: dump_entry.h,v 1.40 2017/04/05 22:33:07 tom Exp $
*
* Dump control definitions and variables
*/
extern NCURSES_CONST char *nametrans(const char *);
extern bool has_params(const char *src);
-extern int fmt_entry(TERMTYPE *, PredFunc, int, int, int, int);
+extern int fmt_entry(TERMTYPE2 *, PredFunc, int, int, int, int);
extern int show_entry(void);
-extern void compare_entry(PredHook, TERMTYPE *, bool);
-extern void dump_entry(TERMTYPE *, int, int, int, PredFunc);
+extern void compare_entry(PredHook, TERMTYPE2 *, bool);
+extern void dump_entry(TERMTYPE2 *, int, int, int, PredFunc);
extern void dump_init(const char *, int, int, bool, int, int, unsigned, bool,
bool, int);
extern void dump_uses(const char *, bool);
-extern void repair_acsc(TERMTYPE *tp);
+extern void repair_acsc(TERMTYPE2 *tp);
#define L_CURL "{"
#define R_CURL "}"
#include <dump_entry.h>
-MODULE_ID("$Id: infocmp.c,v 1.142 2017/02/18 18:40:18 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.143 2017/04/05 09:27:51 tom Exp $")
#define MAX_STRING 1024 /* maximum formatted string */
}
static bool
-entryeq(TERMTYPE *t1, TERMTYPE *t2)
+entryeq(TERMTYPE2 *t1, TERMTYPE2 *t2)
/* are two entries equivalent? */
{
unsigned i;
}
static void
-analyze_string(const char *name, const char *cap, TERMTYPE *tp)
+analyze_string(const char *name, const char *cap, TERMTYPE2 *tp)
{
char buf2[MAX_TERMINFO_LENGTH];
const char *sp;
/* dump C initializers for the terminal type */
static void
-dump_initializers(TERMTYPE *term)
+dump_initializers(TERMTYPE2 *term)
{
unsigned n;
const char *str = 0;
/* dump C initializers for the terminal type */
static void
-dump_termtype(TERMTYPE *term)
+dump_termtype(TERMTYPE2 *term)
{
(void) printf("\t%s\n\t\t%s,\n", L_CURL, name_initializer("alias"));
(void) printf("\t\t(char *)0,\t/* pointer to string table */\n");
_nc_progname,
tname[termcount]);
- status = _nc_read_entry(tname[termcount],
+ status = _nc_read_entry2(tname[termcount],
tfile[termcount],
&entries[termcount].tterm);
}
* Author: Thomas E. Dickey 1997-on *
****************************************************************************/
/*
- * $Id: progs.priv.h,v 1.42 2017/03/18 18:08:25 tom Exp $
+ * $Id: progs.priv.h,v 1.43 2017/04/06 23:02:26 tom Exp $
*
* progs.priv.h
*
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
+#define NCURSES_EXT_NUMBERS (NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR)
+
+#if NCURSES_EXT_NUMBERS
+#else
+#define _nc_free_termtype2(t) _nc_free_termtype(t)
+#endif
+
#endif /* PROGS_PRIV_H */
/****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
#include <parametrized.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.230 2016/12/31 12:24:00 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.232 2017/04/13 09:12:05 tom Exp $")
#define STDIN_NAME "<stdin>"
static char **namelst = 0;
static const char *to_remove;
-static void (*save_check_termtype) (TERMTYPE *, bool);
-static void check_termtype(TERMTYPE *tt, bool);
+static void (*save_check_termtype) (TERMTYPE2 *, bool);
+static void check_termtype(TERMTYPE2 *tt, bool);
static const char usage_string[] = "\
[-e names] \
#if NO_LEAKS
free_namelist(namelst);
+ _nc_leaks_dump_entry();
#endif
if (tmp_fp != 0)
fclose(tmp_fp);
* Check if the alternate character-set capabilities are consistent.
*/
static void
-check_acs(TERMTYPE *tp)
+check_acs(TERMTYPE2 *tp)
{
if (VALID_STRING(acs_chars)) {
const char *boxes = "lmkjtuvwqxn";
* Check if the color capabilities are consistent
*/
static void
-check_colors(TERMTYPE *tp)
+check_colors(TERMTYPE2 *tp)
{
if ((max_colors > 0) != (max_pairs > 0)
|| ((max_colors > max_pairs) && (initialize_pair == 0)))
#define UNEXPECTED(name) if (PRESENT(name)) _nc_warning("unexpected " #name ", for %s", why)
static void
-check_noaddress(TERMTYPE *tp, const char *why)
+check_noaddress(TERMTYPE2 *tp, const char *why)
{
UNEXPECTED(column_address);
UNEXPECTED(cursor_address);
}
static void
-check_cursor(TERMTYPE *tp)
+check_cursor(TERMTYPE2 *tp)
{
int count;
char *list[4];
* is mapped inconsistently.
*/
static void
-check_keypad(TERMTYPE *tp)
+check_keypad(TERMTYPE2 *tp)
{
char show[80];
}
static void
-check_printer(TERMTYPE *tp)
+check_printer(TERMTYPE2 *tp)
{
PAIRED(enter_doublewide_mode, exit_doublewide_mode);
PAIRED(enter_italics_mode, exit_italics_mode);
* Check consistency of termcap extensions related to "screen".
*/
static void
-check_screen(TERMTYPE *tp)
+check_screen(TERMTYPE2 *tp)
{
#if NCURSES_XNAMES
if (_nc_user_definable) {
* markers.
*/
static void
-check_params(TERMTYPE *tp, const char *name, char *value)
+check_params(TERMTYPE2 *tp, const char *name, char *value)
{
int expected = expected_params(name);
int actual = 0;
for (k = 1; k <= NUM_PARM; k++) {
numbers[k] = count;
_nc_SPRINTF(next,
- _nc_SLIMIT(sizeof(blob) - (next - blob))
+ _nc_SLIMIT(sizeof(blob) - (size_t) (next - blob))
"XYZ%d", count);
strings[k] = next;
next += strlen(next) + 1;
* Check terminfo to termcap translation.
*/
static void
-check_infotocap(TERMTYPE *tp, int i, const char *value)
+check_infotocap(TERMTYPE2 *tp, int i, const char *value)
{
const char *name = ExtStrname(tp, i, strnames);
int params = (((i < (int) SIZEOF(parametrized)) &&
}
static char *
-check_sgr(TERMTYPE *tp, char *zero, int num, char *cap, const char *name)
+check_sgr(TERMTYPE2 *tp, char *zero, int num, char *cap, const char *name)
{
char *test;
} NAME_VALUE;
static NAME_VALUE *
-get_fkey_list(TERMTYPE *tp)
+get_fkey_list(TERMTYPE2 *tp)
{
NAME_VALUE *result = typeMalloc(NAME_VALUE, NUM_STRINGS(tp) + 1);
const struct tinfo_fkeys *all_fkeys = _nc_tinfo_fkeys;
* last one assigned).
*/
static void
-check_conflict(TERMTYPE *tp)
+check_conflict(TERMTYPE2 *tp)
{
bool conflict = FALSE;
unsigned j, k;
* Check if the given capability contains a given SGR attribute.
*/
static void
-check_sgr_param(TERMTYPE *tp, int code, const char *name, char *value)
+check_sgr_param(TERMTYPE2 *tp, int code, const char *name, char *value)
{
if (VALID_STRING(value)) {
int ncv = ((code != 0) ? (1 << (code - 1)) : 0);
* logic that reads a terminfo entry)
*/
static void
-check_termtype(TERMTYPE *tp, bool literal)
+check_termtype(TERMTYPE2 *tp, bool literal)
{
unsigned j;
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2017 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 *
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: toe.c,v 1.74 2013/12/15 01:08:28 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.75 2017/04/05 23:19:24 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
typedef void (DescHook) (int /* db_index */ ,
int /* db_limit */ ,
const char * /* term_name */ ,
- TERMTYPE * /* term */ );
+ TERMTYPE2 * /* term */ );
static const char *
-term_description(TERMTYPE *tp)
+term_description(TERMTYPE2 *tp)
{
const char *desc;
/* display a description for the type */
static void
-deschook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
+deschook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
{
(void) db_index;
(void) db_limit;
}
static unsigned long
-checksum_of(TERMTYPE *tp)
+checksum_of(TERMTYPE2 *tp)
{
unsigned long result = string_sum(tp->term_names);
unsigned i;
/* collect data, to sort before display */
static void
-sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
+sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
{
TERMDATA *data = new_termdata();
static void
show_termcap(int db_index, int db_limit, char *buffer, DescHook hook)
{
- TERMTYPE data;
+ TERMTYPE2 data;
char *next = strchr(buffer, ':');
char *last;
char *list = buffer;
}
while ((entry = readdir(entrydir)) != 0) {
char *name_2;
- TERMTYPE lterm;
+ TERMTYPE2 lterm;
char *cn;
int status;
/* apply the selected hook function */
hook(i, eargc, cn, <erm);
}
- _nc_free_termtype(<erm);
+ _nc_free_termtype2(<erm);
free(name_2);
}
closedir(entrydir);
code = _nc_db_first(capdbp, &key, &data);
while (code == 0) {
- TERMTYPE lterm;
+ TERMTYPE2 lterm;
int used;
char *have;
char *cn;
/****************************************************************************
- * Copyright (c) 2003-2012,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2014,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: background.c,v 1.15 2014/08/09 22:31:23 tom Exp $
+ * $Id: background.c,v 1.16 2017/04/15 14:13:30 tom Exp $
*/
#define NEED_COLOR_CODE 1
row = 7;
mvprintw(row++, 10, "l");
for (chr = 0; chr < 32; ++chr)
- addch(' ');
+ AddCh(' ');
printw("x\n");
chr = 32;
while (chr < 128) {
if ((chr % 32) == 0)
mvprintw(row++, 10, "x");
- addch((chtype) ((chr == 127) ? ' ' : chr));
+ AddCh((chr == 127) ? ' ' : chr);
if ((++chr % 32) == 0)
printw("x\n");
}
mvprintw(row++, 10, "m");
for (chr = 0; chr < 32; ++chr)
- addch(' ');
+ AddCh(' ');
printw("j\n");
getch();
*****************************************************************************/
/*
- * $Id: blue.c,v 1.48 2017/01/22 00:39:52 tom Exp $
+ * $Id: blue.c,v 1.49 2017/04/15 13:36:36 tom Exp $
*/
#include <test.priv.h>
static void
printcard(int value)
{
- (void) addch(' ');
+ AddCh(' ');
if (value == NOCARD) {
(void) addstr(" ");
} else {
? RED_ON_WHITE
: BLACK_ON_WHITE);
- addch(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
- addch(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
+ AddCh(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
+ AddCh(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
#ifdef NCURSES_VERSION
(attron) ((int) color); /* quieter compiler warnings */
addwstr(values);
}
#else
- addch((chtype) suits[which]);
+ AddCh(suits[which]);
#endif
#ifdef NCURSES_VERSION
(attroff) ((int) color);
attroff(color);
#endif
}
- (void) addch(' ');
+ AddCh(' ');
}
static void
(void) addstr(buf);
move(PROMPTROW, (int) strlen(buf));
clrtoeol();
- (void) addch(' ');
+ AddCh(' ');
} while
(((c = (char) getch()) < 'a' || c > 'd')
&& (c != 'r')
* v2.0 featuring strict ANSI/POSIX conformance, November 1993.
* v2.1 with ncurses mouse support, September 1995
*
- * $Id: bs.c,v 1.65 2017/04/08 21:06:16 tom Exp $
+ * $Id: bs.c,v 1.66 2017/04/15 13:38:13 tom Exp $
*/
#include <test.priv.h>
board[b][newx][newy] = ss->symbol;
if (vis) {
pgoto(newy, newx);
- (void) addch((chtype) ss->symbol);
+ AddCh(ss->symbol);
}
}
ss->hits = 0;
if (has_colors())
attron(COLOR_PAIR(COLOR_BLUE));
#endif /* A_COLOR */
- (void) addch(' ');
+ AddCh(' ');
for (j = 0; j < BWIDTH; j++)
(void) addstr(" . ");
#ifdef A_COLOR
(void) attrset(0);
#endif /* A_COLOR */
- (void) addch(' ');
- (void) addch((chtype) (i + 'A'));
+ AddCh(' ');
+ AddCh(i + 'A');
}
MvAddStr(PYBASE + BDEPTH, PXBASE - 3, numbers);
MvAddStr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board");
if (has_colors())
attron(COLOR_PAIR(COLOR_BLUE));
#endif /* A_COLOR */
- (void) addch(' ');
+ AddCh(' ');
for (j = 0; j < BWIDTH; j++)
(void) addstr(" . ");
#ifdef A_COLOR
(void) attrset(0);
#endif /* A_COLOR */
- (void) addch(' ');
- (void) addch((chtype) (i + 'A'));
+ AddCh(' ');
+ AddCh(i + 'A');
}
MvAddStr(CYBASE + BDEPTH, CXBASE - 3, numbers);
if (has_colors())
attron(COLOR_PAIR(COLOR_GREEN));
#endif /* A_COLOR */
- (void) addch(MARK_MISS);
+ AddCh(MARK_MISS);
#ifdef A_COLOR
(void) attrset(0);
#endif /* A_COLOR */
} else {
pgoto(y1, x1);
- (void) addch(SHOWSPLASH);
+ AddCh(SHOWSPLASH);
}
}
}
hits[turn][x1][y1] = ss->symbol;
if (turn % 2 == PLAYER) {
cgoto(y1, x1);
- (void) addch((chtype) (ss->symbol));
+ AddCh(ss->symbol);
} else {
pgoto(y1, x1);
#ifdef A_COLOR
if (has_colors())
attron(COLOR_PAIR(COLOR_RED));
#endif /* A_COLOR */
- (void) addch(SHOWHIT);
+ AddCh(SHOWHIT);
#ifdef A_COLOR
(void) attrset(0);
#endif /* A_COLOR */
attron(COLOR_PAIR(COLOR_GREEN));
}
#endif /* A_COLOR */
- (void) addch((chtype) hits[PLAYER][curx][cury]);
+ AddCh(hits[PLAYER][curx][cury]);
#ifdef A_COLOR
(void) attrset(0);
#endif /* A_COLOR */
for (s1 = s; *s1 && ch != *s1; ++s1)
continue;
if (*s1) {
- (void) addch((chtype) ch);
+ AddCh(ch);
(void) refresh();
return (ch);
}
attron(COLOR_PAIR(COLOR_GREEN));
}
#endif /* A_COLOR */
- (void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH));
+ AddCh((hit ? SHOWHIT : SHOWSPLASH));
#ifdef A_COLOR
(void) attrset(0);
#endif /* A_COLOR */
for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++)
for (j = 0; j < ss->length; j++) {
cgoto(ss->y + j * yincr[ss->dir], ss->x + j * xincr[ss->dir]);
- (void) addch((chtype) ss->symbol);
+ AddCh(ss->symbol);
}
if (awinna())
/****************************************************************************
- * Copyright (c) 2006-2010,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2012,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: chgat.c,v 1.12 2012/11/18 01:55:35 tom Exp $
+ * $Id: chgat.c,v 1.15 2017/04/16 00:47:55 tom Exp $
*
* test-driver for chgat/wchgat/mvchgat/mvwchgat
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if HAVE_CHGAT
static void
show_help(WINDOW *win)
{
- static const char *table[] =
+ static const char *msgs[] =
{
"Basic commands:"
,"Use h/j/k/l or arrow keys to move the cursor."
,"= resets count to zero."
,"- negates count."
,"? shows this help-window"
- ,""
- ,""
+ ,0
};
- int y_max, x_max;
- int row;
-
- getmaxyx(win, y_max, x_max);
- for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
- MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
- }
- while (wgetch(win) != 'q')
- beep();
+ popup_msg(win, msgs);
}
static void
sp->count = -(sp->count);
show_status(win, sp);
break;
- case '?':
- do_subwindow(win, sp, show_help);
+ case HELP_KEY_1:
+ show_help(win);
break;
default:
if (isdigit(sp->ch)) {
/****************************************************************************
- * Copyright (c) 2008-2014,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2008-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: clip_printw.c,v 1.12 2016/09/10 21:21:44 tom Exp $
+ * $Id: clip_printw.c,v 1.14 2017/04/15 17:28:10 tom Exp $
*
* demonstrate how to use printw without wrapping.
*/
#include <test.priv.h>
+#include <popup_msg.h>
#ifdef HAVE_VW_PRINTW
static void
show_help(WINDOW *win)
{
- static const char *table[] =
+ static const char *msgs[] =
{
"Basic commands:"
,"Use h/j/k/l or arrow keys to move the cursor."
,"Other commands:"
,"space toggles through the set of video attributes and colors."
,"t touches (forces repaint) of the current line."
- ,". calls clip_wprintw at the current position with the given count."
+ ,". calls vw_printw at the current position with the given count."
,"= resets count to zero."
,"? shows this help-window"
- ,""
+ ,0
};
- int y_max, x_max;
- int row;
-
- getmaxyx(win, y_max, x_max);
- for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
- MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
- }
- while (wgetch(win) != 'q')
- beep();
+ popup_msg(win, msgs);
}
static void
sp->count = 0;
show_status(win, sp);
break;
- case '?':
- do_subwindow(win, sp, show_help);
+ case HELP_KEY_1:
+ show_help(win);
break;
default:
if (isdigit(sp->ch)) {
* authorization. *
****************************************************************************/
/*
- * $Id: demo_defkey.c,v 1.26 2017/01/21 22:07:43 tom Exp $
+ * $Id: demo_defkey.c,v 1.27 2017/04/09 23:57:56 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2002/11/23
break;
}
endwin();
- ExitProgram(EXIT_FAILURE);
+ ExitProgram(EXIT_SUCCESS);
}
#else
int
/****************************************************************************
- * Copyright (c) 2003-2014,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_forms.c,v 1.52 2016/09/10 21:14:55 tom Exp $
+ * $Id: demo_forms.c,v 1.53 2017/04/10 00:28:54 tom Exp $
*
* Demonstrate a variety of functions from the form library.
* Thomas Dickey - 2003/4/26
}
static void
-display_form(FORM * f)
+display_form(FORM *f)
{
WINDOW *w;
int rows, cols;
}
static void
-erase_form(FORM * f)
+erase_form(FORM *f)
{
WINDOW *w = form_win(f);
WINDOW *s = form_sub(f);
#define O_SELECTABLE (O_ACTIVE | O_VISIBLE)
static FIELD *
-another_field(FORM * form, FIELD * field)
+another_field(FORM *form, FIELD *field)
{
FIELD **f = form_fields(form);
FIELD *result = 0;
}
static int
-my_form_driver(FORM * form, int c)
+my_form_driver(FORM *form, int c)
{
static bool insert_mode = TRUE;
FIELD *field;
}
static void
-show_current_field(WINDOW *win, FORM * form)
+show_current_field(WINDOW *win, FORM *form)
{
FIELD *field;
FIELDTYPE *type;
free_form(form);
}
for (c = 0; f[c] != 0; c++) {
- void *ptr = field_userptr(f[c]);
- free(ptr);
+ free_edit_field(f[c]);
free_field(f[c]);
}
noraw();
/****************************************************************************
- * Copyright (c) 2002-2003,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2006,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_keyok.c,v 1.5 2006/11/04 20:09:51 tom Exp $
+ * $Id: demo_keyok.c,v 1.6 2017/04/10 00:37:08 tom Exp $
*
* Demonstrate the keyok() function.
* Thomas Dickey - 2002/11/23
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
int lastch = ERR;
+ int prior = ERR;
int ch;
WINDOW *win;
while ((ch = wgetch(win)) != ERR) {
const char *name = keyname(ch);
+ if (ch == ESCAPE && prior == ch)
+ break;
+ prior = ch;
wprintw(win, "Keycode %d, name %s\n",
ch,
name != 0 ? name : "<null>");
* authorization. *
****************************************************************************/
/*
- * $Id: demo_new_pair.c,v 1.11 2017/04/08 21:48:53 tom Exp $
+ * $Id: demo_new_pair.c,v 1.13 2017/04/15 17:36:00 tom Exp $
*
* Demonstrate the alloc_pair() function.
*/
#include <test.priv.h>
#include <time.h>
+#include <popup_msg.h>
#if HAVE_ALLOC_PAIR && USE_WIDEC_SUPPORT
return result;
}
-static void
-show_help(const char **help)
-{
- WINDOW *mywin = newwin(LINES, COLS, 0, 0);
- int n;
-
- wmove(mywin, 1, 1);
- for (n = 0; help[n] != 0; ++n) {
- wmove(mywin, 1 + n, 2);
- wprintw(mywin, "%.*s\n", COLS - 4, help[n]);
- }
- box(mywin, 0, 0);
- wgetch(mywin);
- delwin(mywin);
- touchwin(stdscr);
- refresh();
-}
-
static time_t
now(void)
{
int my_pair;
switch (getch()) {
- case '?':
- show_help(help);
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
break;
case 'p':
/* step-by-page */
++current;
}
endwin();
+ fclose(output);
printf("%.1f cells/second\n",
(double) (total_cells) / (double) (now() - start));
/****************************************************************************
- * Copyright (c) 2007-2014,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_panels.c,v 1.39 2016/09/04 20:38:33 tom Exp $
+ * $Id: demo_panels.c,v 1.41 2017/04/15 18:39:29 tom Exp $
*
* Demonstrate a variety of functions from the panel library.
*/
" m - move the panel (M for continuous move)",
" r - resize the panel",
" s - show the panel",
- " b - put the panel on the top of the stack"
+ " t - put the panel on the top of the stack"
};
struct {
wrefresh(curscr);
} else if (ch == '\n' || ch == KEY_ENTER) {
break;
- } else if (ch == '?') {
+ } else if (ch == HELP_KEY_1) {
show_panels(px);
} else if (length + 3 < limit) {
if (ch >= KEY_MIN) {
/*
* Author: Thomas E. Dickey
*
- * $Id: demo_termcap.c,v 1.53 2017/04/08 19:08:42 tom Exp $
+ * $Id: demo_termcap.c,v 1.54 2017/04/13 09:12:40 tom Exp $
*
* A simple demo of the termcap interface.
*/
show_number("PC", PC);
show_string("UP", UP);
show_string("BC", BC);
- show_number("ospeed", ospeed);
+ show_number("ospeed", (int) ospeed);
}
#endif
/****************************************************************************
- * Copyright (c) 2014 Free Software Foundation, Inc. *
+ * Copyright (c) 2014,2017 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 *
/*
* Author: Thomas E. Dickey
*
- * $Id: dots_curses.c,v 1.3 2014/08/09 22:28:42 tom Exp $
+ * $Id: dots_curses.c,v 1.4 2017/04/15 14:13:30 tom Exp $
*
* A simple demo of the curses interface used for comparison with termcap.
*/
napms(1);
}
}
- addch((chtype) p);
+ AddCh(p);
refresh();
++total_chars;
}
/****************************************************************************
- * Copyright (c) 2013 Free Software Foundation, Inc. *
+ * Copyright (c) 2013,2014 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 *
/*
* Author: Thomas E. Dickey
*
- * $Id: dots_termcap.c,v 1.8 2014/09/25 09:00:56 tom Exp $
+ * $Id: dots_termcap.c,v 1.9 2014/09/25 09:00:56 tom Exp $
*
* A simple demo of the termcap interface.
*/
* authorization. *
****************************************************************************/
/*
- * $Id: echochar.c,v 1.11 2017/04/08 21:53:51 tom Exp $
+ * $Id: echochar.c,v 1.13 2017/04/15 13:38:37 tom Exp $
*
* Demonstrate the echochar function (compare to dots.c).
* Thomas Dickey - 2006/11/4
}
}
if (opt_r) {
- addch(UChar(p));
+ AddCh(UChar(p));
refresh();
} else {
echochar(UChar(p));
++total_chars;
}
cleanup();
+ free(my_pairs);
ExitProgram(EXIT_SUCCESS);
}
/****************************************************************************
- * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2014,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: edit_field.c,v 1.24 2014/09/05 08:39:52 tom Exp $
+ * $Id: edit_field.c,v 1.27 2017/04/15 17:57:40 tom Exp $
*
* A wrapper for form_driver() which keeps track of the user's editing changes
* for each field, and makes the resulting length available as a
#if USE_LIBFORM
#include <edit_field.h>
+#include <popup_msg.h>
static struct {
int code;
}
};
-static WINDOW *old_window;
-
-static void
-begin_popup(void)
-{
- doupdate();
- old_window = dupwin(curscr);
-}
-
-static void
-end_popup(void)
-{
- touchwin(old_window);
- wnoutrefresh(old_window);
- doupdate();
- delwin(old_window);
-}
-
/*
* Display a temporary window listing the keystroke-commands we recognize.
*/
void
help_edit_field(void)
{
- int x0 = 4;
- int y0 = 2;
- int y1 = 0;
- int y2 = 0;
- int wide = COLS - ((x0 + 1) * 2);
- int high = LINES - ((y0 + 1) * 2);
- WINDOW *help = newwin(high, wide, y0, x0);
- WINDOW *data = newpad(2 + SIZEOF(commands), wide - 4);
+ int used = 0;
unsigned n;
- int ch = ERR;
+ char **msgs = typeCalloc(char *, 2 + SIZEOF(commands));
- begin_popup();
-
- keypad(help, TRUE);
- keypad(data, TRUE);
- waddstr(data, "Defined form edit/traversal keys:\n");
+ msgs[used++] = strdup("Defined form edit/traversal keys:");
for (n = 0; n < SIZEOF(commands); ++n) {
+ char *msg;
const char *name;
+ const char *code = keyname(commands[n].code);
+ size_t need = 5;
#ifdef NCURSES_VERSION
if ((name = form_request_name(commands[n].result)) == 0)
#endif
name = commands[n].help;
- wprintw(data, "%s -- %s\n",
- keyname(commands[n].code),
- name != 0 ? name : commands[n].help);
+ need = 5 + strlen(code) + strlen(name);
+ msg = typeMalloc(char, need);
+ sprintf(msg, "%s -- %s", code, name);
+ msgs[used++] = msg;
}
- waddstr(data, "Arrow keys move within a field as you would expect.");
- y2 = getcury(data);
-
- do {
- switch (ch) {
- case KEY_HOME:
- y1 = 0;
- break;
- case KEY_END:
- y1 = y2;
- break;
- case KEY_PREVIOUS:
- case KEY_PPAGE:
- if (y1 > 0) {
- y1 -= high / 2;
- if (y1 < 0)
- y1 = 0;
- } else {
- beep();
- }
- break;
- case KEY_NEXT:
- case KEY_NPAGE:
- if (y1 < y2) {
- y1 += high / 2;
- if (y1 >= y2)
- y1 = y2;
- } else {
- beep();
- }
- break;
- case CTRL('P'):
- case KEY_UP:
- if (y1 > 0)
- --y1;
- else
- beep();
- break;
- case CTRL('N'):
- case KEY_DOWN:
- if (y1 < y2)
- ++y1;
- else
- beep();
- break;
- default:
- beep();
- break;
- case ERR:
- break;
- }
- werase(help);
- box(help, 0, 0);
- wnoutrefresh(help);
- pnoutrefresh(data, y1, 0, y0 + 1, x0 + 1, high, wide);
- doupdate();
- } while ((ch = wgetch(data)) != ERR && ch != QUIT && ch != ESCAPE);
- werase(help);
- wrefresh(help);
- delwin(help);
- delwin(data);
-
- end_popup();
+ msgs[used++] =
+ strdup("Arrow keys move within a field as you would expect.");
+ msgs[used] = 0;
+ popup_msg2(stdscr, msgs);
+ for (n = 0; msgs[n] != 0; ++n) {
+ free(msgs[n]);
+ }
+ free(msgs);
}
static int
-offset_in_field(FORM * form)
+offset_in_field(FORM *form)
{
FIELD *field = current_field(form);
int currow, curcol;
}
static void
-inactive_field(FIELD * f)
+inactive_field(FIELD *f)
{
set_field_back(f, field_attrs(f)->background);
}
FieldAttrs *
-field_attrs(FIELD * f)
+field_attrs(FIELD *f)
{
return (FieldAttrs *) field_userptr(f);
}
static int
-buffer_length(FIELD * f)
+buffer_length(FIELD *f)
{
return field_attrs(f)->row_lengths[0];
}
static void
-set_buffer_length(FIELD * f, int length)
+set_buffer_length(FIELD *f, int length)
{
field_attrs(f)->row_lengths[0] = length;
}
* keeping track of the actual lengths of lines in a multiline field.
*/
void
-init_edit_field(FIELD * f, char *value)
+init_edit_field(FIELD *f, char *value)
{
char empty[1];
FieldAttrs *ptr = field_attrs(f);
}
int
-edit_field(FORM * form, int *result)
+edit_field(FORM *form, int *result)
{
int ch = wgetch(form_win(form));
int status;
inactive_field(before);
return status;
}
+
+void
+free_edit_field(FIELD *f)
+{
+ FieldAttrs *ptr = field_attrs(f);
+ if (ptr != 0) {
+ free(ptr->row_lengths);
+ free(ptr);
+ }
+}
#else
extern void no_edit_field(void);
/****************************************************************************
- * Copyright (c) 2003-2008,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2013,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: edit_field.h,v 1.9 2013/06/08 15:46:01 tom Exp $
+ * $Id: edit_field.h,v 1.10 2017/04/10 00:28:55 tom Exp $
*
* Interface of edit_field.c
*/
int *row_lengths;
} FieldAttrs;
-extern FieldAttrs *field_attrs(FIELD * field);
-extern void init_edit_field(FIELD * field, char *value);
+extern FieldAttrs *field_attrs(FIELD *field);
+extern void init_edit_field(FIELD *field, char *value);
extern void help_edit_field(void);
-extern int edit_field(FORM * form, int *result);
+extern int edit_field(FORM *form, int *result);
+extern void free_edit_field(FIELD *field);
#endif /* EDIT_FORM_H_incl */
* authorization. *
****************************************************************************/
/*
- * $Id: extended_color.c,v 1.9 2017/04/02 14:30:26 tom Exp $
+ * $Id: extended_color.c,v 1.10 2017/04/15 21:40:50 tom Exp $
*/
#include <test.priv.h>
} else {
i = extended_color_content(color, &r, &g, &b);
}
+ if (i != OK)
+ failed("color_content");
r = (adjust + 1000 + r) % 1000;
g = (adjust + 1000 + g) % 1000;
/****************************************************************************
- * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 2013-2014,2017 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 *
****************************************************************************/
/*
- * $Id: form_driver_w.c,v 1.13 2014/08/02 17:24:55 tom Exp $
+ * $Id: form_driver_w.c,v 1.15 2017/04/15 20:41:35 tom Exp $
*
* Test form_driver_w (int, int, wchar_t), a wide char aware
* replacement of form_driver.
*/
-#include <locale.h>
-
#include <test.priv.h>
+#include <popup_msg.h>
#if USE_WIDEC_SUPPORT && USE_LIBFORM && (defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH >= 20131207)
int
main(void)
{
- FIELD *field[3];
+ static const char *help[] =
+ {
+ "Commands:",
+ " ^D,^Q,ESC - quit program",
+ " <Tab>,<Down> - move to next field",
+ " <BackTab>,<Up> - move to previous field",
+ 0
+ };
+
+#define NUM_FIELDS 3
+#define MyRow(n) (4 + (n) * 2)
+#define MyCol(n) 10
+ FIELD *field[NUM_FIELDS + 1];
FORM *my_form;
bool done = FALSE;
+ int n;
setlocale(LC_ALL, "");
keypad(stdscr, TRUE);
/* Initialize the fields */
- field[0] = new_field(1, 10, 4, 18, 0, 0);
- field[1] = new_field(1, 10, 6, 18, 0, 0);
- field[2] = NULL;
-
- /* Set field options */
- set_field_back(field[0], A_UNDERLINE); /* Print a line for the option */
- field_opts_off(field[0], O_AUTOSKIP); /* Don't go to next field when this */
- /* Field is filled up */
- set_field_back(field[1], A_UNDERLINE);
- field_opts_off(field[1], O_AUTOSKIP);
+ for (n = 0; n < NUM_FIELDS; ++n) {
+ field[n] = new_field(1, 10, MyRow(n), 18, 0, 0);
+ set_field_back(field[n], A_UNDERLINE);
+ /* Print a line for the option */
+ field_opts_off(field[n], O_AUTOSKIP);
+ /* Don't go to next field when this is filled */
+ }
+ field[n] = NULL;
/* Create the form and post it */
my_form = new_form(field);
post_form(my_form);
refresh();
- mvprintw(4, 10, "Value 1:");
- mvprintw(6, 10, "Value 2:");
- refresh();
+ for (n = 0; n < NUM_FIELDS; ++n) {
+ mvprintw(MyRow(n), MyCol(n), "Value %d:", n + 1);
+ }
/* Loop through to get user requests */
while (!done) {
wint_t ch;
int ret = get_wch(&ch);
- mvprintw(8, 10, "Got %d (%#x), type: %s", (int) ch, (int) ch,
+ mvprintw(MyRow(NUM_FIELDS),
+ MyCol(NUM_FIELDS),
+ "Got %d (%#x), type: %s",
+ (int) ch,
+ (int) ch,
(ret == KEY_CODE_YES)
? "KEY_CODE_YES"
: ((ret == OK)
/* Leaves nicely at the last character */
form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE);
break;
+ case KEY_BTAB:
case KEY_UP:
/* Go to previous field */
form_driver_w(my_form, KEY_CODE_YES, REQ_PREV_FIELD);
case ESCAPE:
done = TRUE;
break;
+ case '\t':
+ form_driver_w(my_form, KEY_CODE_YES, REQ_NEXT_FIELD);
+ form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE);
+ break;
+ case HELP_KEY_1:
+ popup_msg(form_win(my_form), help);
+ break;
default:
form_driver_w(my_form, OK, (wchar_t) ch);
break;
/* Un post form and free the memory */
unpost_form(my_form);
free_form(my_form);
- free_field(field[0]);
- free_field(field[1]);
+ for (n = 0; n < NUM_FIELDS; ++n) {
+ free_field(field[n]);
+ }
endwin();
ExitProgram(EXIT_SUCCESS);
/****************************************************************************
- * Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2017 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 *
*
* Generate timing statistics for vertical-motion optimization.
*
- * $Id: hashtest.c,v 1.32 2013/04/27 19:50:17 tom Exp $
+ * $Id: hashtest.c,v 1.33 2017/04/15 14:13:40 tom Exp $
*/
#include <test.priv.h>
move(0, 0);
for (i = 0; i < head_lines; i++)
for (j = 0; j < COLS; j++)
- addch(UChar((j % 8 == 0) ? ('A' + j / 8) : '-'));
+ AddCh(UChar((j % 8 == 0) ? ('A' + j / 8) : '-'));
move(head_lines, 0);
for (i = head_lines; i < LINES - foot_lines; i++) {
+ LO_CHAR);
int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1;
for (j = 0; j < hi; j++)
- addch(c);
+ AddCh(c);
}
for (i = LINES - foot_lines; i < LINES; i++) {
move(i, 0);
for (j = 0; j < (extend_corner ? COLS : COLS - 1); j++)
- addch(UChar((j % 8 == 0) ? ('A' + j / 8) : '-'));
+ AddCh(UChar((j % 8 == 0) ? ('A' + j / 8) : '-'));
}
scrollok(stdscr, TRUE);
/****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2010,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: inch_wide.c,v 1.7 2010/05/01 19:13:46 tom Exp $
+ * $Id: inch_wide.c,v 1.8 2017/04/15 18:52:39 tom Exp $
*/
/*
int in_wch(cchar_t *wcval);
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if USE_WIDEC_SUPPORT
static int
test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
{
+ static const char *help[] =
+ {
+ "Test input from screen using inch(), etc., in a moveable viewport.",
+ "",
+ "Commands:",
+ " ESC/^Q - quit",
+ " h,j,k,l (and arrow-keys) - move viewport",
+ " w - recur to new window",
+ 0
+ };
+
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
FILE *fp;
wnoutrefresh(txtwin);
}
break;
+ case HELP_KEY_1:
+ popup_msg(txtwin, help);
+ break;
default:
beep();
break;
/****************************************************************************
- * Copyright (c) 2007-2010,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2012,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: inchs.c,v 1.12 2012/11/18 01:58:15 tom Exp $
+ * $Id: inchs.c,v 1.13 2017/04/15 18:52:10 tom Exp $
*
* Author: Thomas E Dickey
*/
*/
#include <test.priv.h>
+#include <popup_msg.h>
#define BASE_Y 7
#define MAX_COLS 1024
static int
test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
{
+ static const char *help[] =
+ {
+ "Test input from screen using inch(), etc., in a moveable viewport.",
+ "",
+ "Commands:",
+ " ESC/^Q - quit",
+ " h,j,k,l (and arrow-keys) - move viewport",
+ " w - recur to new window",
+ 0
+ };
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
FILE *fp;
wnoutrefresh(txtwin);
}
break;
+ case HELP_KEY_1:
+ popup_msg(txtwin, help);
+ break;
default:
beep();
break;
/****************************************************************************
- * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 2008-2014,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: insdelln.c,v 1.9 2014/08/02 23:09:32 tom Exp $
+ * $Id: insdelln.c,v 1.10 2017/04/15 17:40:11 tom Exp $
*
* test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln
*/
#include <test.priv.h>
+#include <popup_msg.h>
#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
#define COLOR_DEFAULT (-1)
,"q quit"
,"= resets count to zero."
,"? shows this help-window"
- ,""
- ,""
+ ,0
};
- int y_max, x_max;
- int row;
-
- getmaxyx(win, y_max, x_max);
- for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
- MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
- }
- while (wgetch(win) != 'q')
- beep();
+ popup_msg(win, table);
}
static void
sp->count = 0;
show_status(win, sp);
break;
- case '?':
- do_subwindow(win, sp, show_help);
+ case HELP_KEY_1:
+ show_help(win);
break;
default:
if (isdigit(sp->ch)) {
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2017 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 *
* Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995. Mouse support
* added September 20th 1995.
*
- * $Id: knight.c,v 1.36 2013/02/16 19:53:08 tom Exp $
+ * $Id: knight.c,v 1.37 2017/04/15 17:43:11 tom Exp $
*/
#include <test.priv.h>
case 'x':
goto dropout;
- case '?':
+ case HELP_KEY_1:
show_help(&keyhelp);
break;
-# $Id: modules,v 1.57 2017/03/31 13:01:31 tom Exp $
+# $Id: modules,v 1.61 2017/04/15 19:30:34 tom Exp $
##############################################################################
# Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. #
# #
blue progs $(srcdir) $(HEADER_DEPS)
bs progs $(srcdir) $(HEADER_DEPS)
cardfile progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/form.h
-chgat progs $(srcdir) $(HEADER_DEPS)
-clip_printw progs $(srcdir) $(HEADER_DEPS)
+chgat progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
+clip_printw progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
color_set progs $(srcdir) $(HEADER_DEPS)
demo_altkeys progs $(srcdir) $(HEADER_DEPS)
demo_defkey progs $(srcdir) $(HEADER_DEPS)
demo_forms progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h
demo_keyok progs $(srcdir) $(HEADER_DEPS)
demo_menus progs $(srcdir) $(HEADER_DEPS) ../include/menu.h
-demo_new_pair progs $(srcdir) $(HEADER_DEPS)
+demo_new_pair progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
demo_panels progs $(srcdir) $(HEADER_DEPS) ../include/panel.h
demo_termcap progs $(srcdir) $(HEADER_DEPS)
demo_terminfo progs $(srcdir) $(HEADER_DEPS)
dots_mvcur progs $(srcdir) $(HEADER_DEPS)
dots_termcap progs $(srcdir) $(HEADER_DEPS)
echochar progs $(srcdir) $(HEADER_DEPS)
-edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h
+edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h $(srcdir)/popup_msg.h
extended_color progs $(srcdir) $(HEADER_DEPS)
filter progs $(srcdir) $(HEADER_DEPS)
firework progs $(srcdir) $(HEADER_DEPS)
firstlast progs $(srcdir) $(HEADER_DEPS)
foldkeys progs $(srcdir) $(HEADER_DEPS)
-form_driver_w progs $(srcdir) $(HEADER_DEPS)
+form_driver_w progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
gdc progs $(srcdir) $(HEADER_DEPS)
hanoi progs $(srcdir) $(HEADER_DEPS)
hashtest progs $(srcdir) $(HEADER_DEPS)
-inch_wide progs $(srcdir) $(HEADER_DEPS)
-inchs progs $(srcdir) $(HEADER_DEPS)
+inch_wide progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
+inchs progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
ins_wide progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
-insdelln progs $(srcdir) $(HEADER_DEPS)
+insdelln progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
inserts progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
key_names progs $(srcdir) $(HEADER_DEPS)
keynames progs $(srcdir) $(HEADER_DEPS)
knight progs $(srcdir) $(HEADER_DEPS)
list_keys progs $(srcdir) $(HEADER_DEPS)
lrtest progs $(srcdir) $(HEADER_DEPS)
-movewindow progs $(srcdir) $(HEADER_DEPS)
+movewindow progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h
newdemo progs $(srcdir) $(HEADER_DEPS)
+popup_msg progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
railroad progs $(srcdir) $(HEADER_DEPS)
-rain progs $(srcdir) $(HEADER_DEPS)
-redraw progs $(srcdir) $(HEADER_DEPS)
-savescreen progs $(srcdir) $(HEADER_DEPS)
+rain progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
+redraw progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
+savescreen progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
sp_tinfo progs $(srcdir) $(HEADER_DEPS)
tclock progs $(srcdir) $(HEADER_DEPS)
test_add_wchstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
testaddch progs $(srcdir) $(HEADER_DEPS)
testcurs progs $(srcdir) $(HEADER_DEPS)
testscanw progs $(srcdir) $(HEADER_DEPS)
-view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h
+view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h $(srcdir)/popup_msg.h
worm progs $(srcdir) $(HEADER_DEPS)
xmas progs $(srcdir) $(HEADER_DEPS)
* authorization. *
****************************************************************************/
/*
- * $Id: movewindow.c,v 1.40 2017/04/08 23:01:47 tom Exp $
+ * $Id: movewindow.c,v 1.42 2017/04/15 18:37:42 tom Exp $
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
#include <test.priv.h>
#include <stdarg.h>
+#include <popup_msg.h>
#ifdef HAVE_XCURSES
#undef derwin
int key;
CONST_FMT char * msg;
} help[] = {
- { '?', "Show this screen" },
+ { HELP_KEY_1, "Show this screen" },
{ 'b', "Draw a box inside the current window" },
{ 'c', "Create a new window" },
{ 'd', "Create a new derived window" },
};
/* *INDENT-ON* */
- WINDOW *mywin = newwin(LINES, COLS, 0, 0);
- int row;
+ char **msgs = typeCalloc(char *, SIZEOF(help) + 1);
+ size_t n;
- for (row = 0; row < LINES - 2 && row < (int) SIZEOF(help); ++row) {
- wmove(mywin, row + 1, 1);
- wprintw(mywin, "%s", keyname(help[row].key));
- wmove(mywin, row + 1, 20);
- wprintw(mywin, "%s", help[row].msg);
+ for (n = 0; n < SIZEOF(help); ++n) {
+ msgs[n] = typeMalloc(char, 21 + strlen(help[n].msg));
+ sprintf(msgs[n], "%-20s%s", keyname(help[n].key), help[n].msg);
}
- box_inside(mywin);
- wmove(mywin, 1, 1);
- wgetch(mywin);
- delwin(mywin);
- refresh_all(current);
+ popup_msg2(current, msgs);
+ for (n = 0; n < SIZEOF(help); ++n) {
+ free(msgs[n]);
+ }
+ free(msgs);
}
int
getyx(current_win, y, x);
switch (ch) {
- case '?':
+ case HELP_KEY_1:
show_help(current_win);
break;
case 'b':
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.447 2017/03/11 23:20:12 Petr.Vanek Exp $
+$Id: ncurses.c,v 1.449 2017/04/15 18:53:50 tom Exp $
***************************************************************************/
case CTRL('L'):
Repaint();
break;
- case '?':
+ case HELP_KEY_1:
if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) {
box(helpwin, 0, 0);
attr_legend(helpwin);
case CTRL('L'):
Repaint();
break;
- case '?':
+ case HELP_KEY_1:
if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) {
box_set(helpwin, 0, 0);
attr_legend(helpwin);
}
}
break;
- case '?':
+ case HELP_KEY_1:
if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) {
box(helpwin, 0, 0);
color_legend(helpwin, FALSE);
}
}
break;
- case '?':
+ case HELP_KEY_1:
if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) {
box(helpwin, 0, 0);
color_legend(helpwin, TRUE);
change_color((NCURSES_PAIRS_T) current, field, value, 0);
break;
- case '?':
+ case HELP_KEY_1:
erase();
P(" RGB Value Editing Help");
P("");
case 's':
MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
while ((c = Getchar()) != 'Q' && (c != ERR))
- addch((chtype) c);
+ AddCh(c);
break;
case 'd':
case 's':
MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
while ((c = Getchar()) != 'Q' && (c != ERR))
- addch((chtype) c);
+ AddCh(c);
break;
case 'd':
int col = (int) (5 * (code % 16));
IGNORE_RC(mvaddch(row, col, colored_chtype(code, attr, pair)));
for (count = 1; count < repeat; ++count) {
- addch(colored_chtype(code, attr, pair));
+ AddCh(colored_chtype(code, attr, pair));
}
}
if (C1) {
/* (yes, this _is_ crude) */
while ((reply = Getchar()) != ERR) {
- addch(UChar(reply));
+ AddCh(UChar(reply));
napms(10);
}
nodelay(stdscr, FALSE);
*/
break;
default:
- addch(colored_chtype(code, A_ALTCHARSET | attr, pair));
+ AddCh(colored_chtype(code, A_ALTCHARSET | attr, pair));
break;
}
} while (--count > 0);
MvPrintw(row, col, "%*s : ", COLS / 4, name);
do {
- addch(code);
+ AddCh(code);
} while (--repeat > 0);
return n + 1;
}
setcchar(&temp, codes, attr, pair, 0);
move(row, col);
if (wcwidth(code) == 0 && code != 0) {
- addch((chtype) space |
+ AddCh((chtype) space |
(A_REVERSE ^ attr) |
(attr_t) COLOR_PAIR(pair));
}
* the display.
*/
if (wcwidth(code) == 0) {
- addch((chtype) space |
+ AddCh((chtype) space |
(A_REVERSE ^ attr) |
(attr_t) COLOR_PAIR(pair));
}
erase();
/* FALLTHRU */
- case '?':
- if (c == '?')
+ case HELP_KEY_1:
+ if (c == HELP_KEY_1)
show_panner_legend = !show_panner_legend;
panner_legend(LINES - 4);
panner_legend(LINES - 3);
state = overlap_help(state, flavor);
break;
- case '?':
+ case HELP_KEY_1:
state = overlap_help(state, flavor);
break;
addstr("<NULL>");
attroff(A_REVERSE);
}
- addch('\n');
+ AddCh('\n');
}
static void
printw("%d", value);
attroff(A_REVERSE);
}
- addch('\n');
+ AddCh('\n');
}
static void
printw("%d", value);
attroff(A_REVERSE);
}
- addch('\n');
+ AddCh('\n');
}
static void
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2017 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. *
+ ****************************************************************************/
+/*
+ * $Id: popup_msg.c,v 1.7 2017/04/15 19:16:41 tom Exp $
+ *
+ * Show a multi-line message in a window which may extend beyond the screen.
+ *
+ * Thomas Dickey - 2017/4/15.
+ */
+
+#include <test.priv.h>
+
+#include <popup_msg.h>
+
+static WINDOW *old_window;
+
+static void
+begin_popup(void)
+{
+ doupdate();
+ old_window = dupwin(curscr);
+}
+
+static void
+end_popup(void)
+{
+ touchwin(old_window);
+ wnoutrefresh(old_window);
+ doupdate();
+ delwin(old_window);
+}
+
+/*
+ * Display a temporary window, e.g., to display a help-message.
+ */
+void
+popup_msg(WINDOW *parent, const char *const *msg)
+{
+ int x0 = 4;
+ int y0 = 2;
+ int y1 = 0;
+ int y2 = 0;
+ int wide = getmaxx(parent) - ((x0 + 1) * 2);
+ int high = getmaxy(parent) - ((y0 + 1) * 2);
+ WINDOW *help;
+ WINDOW *data;
+ int n;
+ int width = 0;
+ int length;
+ int last_y;
+ int ch = ERR;
+
+ for (n = 0; msg[n] != 0; ++n) {
+ int check = (int) strlen(msg[n]);
+ if (width < check)
+ width = check;
+ }
+ length = n;
+
+ if ((help = newwin(high, wide, y0, x0)) == 0)
+ return;
+ if ((data = newpad(length + 1, width)) == 0)
+ return;
+
+ begin_popup();
+
+ keypad(data, TRUE);
+
+ for (n = 0; n < length; ++n) {
+ waddstr(data, msg[n]);
+ if ((n + 1) < length) {
+ waddch(data, '\n');
+ }
+ }
+ y2 = getcury(data);
+ last_y = (y2 - (high - 3));
+
+ do {
+ switch (ch) {
+ case KEY_HOME:
+ y1 = 0;
+ break;
+ case KEY_END:
+ y1 = last_y;
+ break;
+ case KEY_PREVIOUS:
+ case KEY_PPAGE:
+ if (y1 > 0) {
+ y1 -= high / 2;
+ if (y1 < 0)
+ y1 = 0;
+ } else {
+ beep();
+ }
+ break;
+ case KEY_NEXT:
+ case KEY_NPAGE:
+ if (y1 < last_y) {
+ y1 += high / 2;
+ if (y1 > last_y)
+ y1 = last_y;
+ } else {
+ beep();
+ }
+ break;
+ case CTRL('P'):
+ case KEY_UP:
+ if (y1 > 0)
+ --y1;
+ else
+ beep();
+ break;
+ case CTRL('N'):
+ case KEY_DOWN:
+ if (y1 < last_y)
+ ++y1;
+ else
+ beep();
+ break;
+ default:
+ beep();
+ break;
+ case ERR:
+ break;
+ }
+ werase(help);
+ box(help, 0, 0);
+ wnoutrefresh(help);
+ pnoutrefresh(data, y1, 0, y0 + 1, x0 + 1, high, wide);
+ doupdate();
+ } while ((ch = wgetch(data)) != ERR && ch != QUIT && ch != ESCAPE);
+ werase(help);
+ wrefresh(help);
+ delwin(help);
+ delwin(data);
+
+ end_popup();
+}
+
+void
+popup_msg2(WINDOW *parent, char **msg)
+{
+ popup_msg(parent, (const char *const *) msg);
+}
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2003-2013,2017 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. *
+ ****************************************************************************/
+/*
+ * $Id: popup_msg.h,v 1.3 2017/04/15 19:16:35 tom Exp $
+ *
+ * Interface of edit_field.c
+ */
+
+#ifndef POPUP_MSG_H_incl
+#define POPUP_MSG_H_incl 1
+
+#include <test.priv.h>
+
+extern void popup_msg(WINDOW *parent, const char *const *msg);
+extern void popup_msg2(WINDOW *parent, char **msg);
+
+#endif /* POPUP_MSG_H_incl */
-# $Id: programs,v 1.30 2017/03/31 13:01:52 tom Exp $
+# $Id: programs,v 1.34 2017/04/15 19:29:33 tom Exp $
##############################################################################
# Copyright (c) 2006-2016,2017 Free Software Foundation, Inc. #
# #
blue $(LDFLAGS_CURSES) $(LOCAL_LIBS) blue
bs $(LDFLAGS_CURSES) $(LOCAL_LIBS) bs
cardfile $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) cardfile
-chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat
-clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw
+chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat popup_msg
+clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw popup_msg
color_set $(LDFLAGS_CURSES) $(LOCAL_LIBS) color_set
demo_altkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_altkeys
demo_defkey $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_defkey
-demo_forms $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_forms edit_field
+demo_forms $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_forms edit_field popup_msg
demo_keyok $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_keyok
demo_menus $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_menus
-demo_new_pair $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_new_pair
+demo_new_pair $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_new_pair popup_msg
demo_panels $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_panels
demo_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_termcap
demo_terminfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_terminfo
firework $(LDFLAGS_CURSES) $(LOCAL_LIBS) firework
firstlast $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) firstlast
foldkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) foldkeys
-form_driver_w $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) form_driver_w
+form_driver_w $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) form_driver_w popup_msg
gdc $(LDFLAGS_CURSES) $(LOCAL_LIBS) gdc
hanoi $(LDFLAGS_CURSES) $(LOCAL_LIBS) hanoi
hashtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) hashtest
-inch_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) inch_wide
-inchs $(LDFLAGS_CURSES) $(LOCAL_LIBS) inchs
+inch_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) inch_wide popup_msg
+inchs $(LDFLAGS_CURSES) $(LOCAL_LIBS) inchs popup_msg
ins_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) ins_wide
-insdelln $(LDFLAGS_CURSES) $(LOCAL_LIBS) insdelln
+insdelln $(LDFLAGS_CURSES) $(LOCAL_LIBS) insdelln popup_msg
inserts $(LDFLAGS_CURSES) $(LOCAL_LIBS) inserts
key_names $(LDFLAGS_CURSES) $(LOCAL_LIBS) key_names
keynames $(LDFLAGS_CURSES) $(LOCAL_LIBS) keynames
knight $(LDFLAGS_CURSES) $(LOCAL_LIBS) knight
list_keys $(LDFLAGS_TINFO) $(LOCAL_LIBS) list_keys
lrtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) lrtest
-movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow
+movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow popup_msg
ncurses $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) ncurses
newdemo $(LDFLAGS_CURSES) $(LOCAL_LIBS) newdemo
railroad $(LDFLAGS_TINFO) $(LOCAL_LIBS) railroad
-rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain
-redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw
-savescreen $(LDFLAGS_CURSES) $(LOCAL_LIBS) savescreen
+rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain popup_msg
+redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw popup_msg
+savescreen $(LDFLAGS_CURSES) $(LOCAL_LIBS) savescreen popup_msg
sp_tinfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) sp_tinfo
tclock $(LDFLAGS_CURSES) $(LOCAL_LIBS) tclock
test_add_wchstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_add_wchstr
testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch
testcurs $(LDFLAGS_CURSES) $(LOCAL_LIBS) testcurs
testscanw $(LDFLAGS_CURSES) $(LOCAL_LIBS) testscanw
-view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view
+view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view popup_msg
worm $(LDFLAGS_THREADS) $(LOCAL_LIBS) worm
xmas $(LDFLAGS_CURSES) $(LOCAL_LIBS) xmas
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2014,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: rain.c,v 1.41 2014/08/02 17:24:07 tom Exp $
+ * $Id: rain.c,v 1.42 2017/04/15 19:32:33 tom Exp $
*/
#include <test.priv.h>
+#include <popup_msg.h>
/* rain 11/3/1980 EPS/CITHEP */
main(int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
+ static const char *help[] =
+ {
+ "Commands:",
+ " q/Q exit the program",
+ " s do single-step",
+ " <space> undo single-step",
+ "",
+ 0
+ };
+
bool done = FALSE;
DATA drop;
#ifndef USE_PTHREADS
case (KEY_RESIZE):
break;
#endif
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
+ default:
+ beep();
}
napms(50);
}
/****************************************************************************
- * Copyright (c) 2006-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2012,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: redraw.c,v 1.8 2012/12/08 20:46:02 tom Exp $
+ * $Id: redraw.c,v 1.9 2017/04/15 19:57:47 tom Exp $
*
* Demonstrate the redrawwin() and wredrawln() functions.
* Thomas Dickey - 2006/11/4
*/
#include <test.priv.h>
+#include <popup_msg.h>
static void
trash(int beg_x, int max_x, int cur_x)
for (x = max_x; x > cur_x; --x) {
putchar('\b');
}
+ fflush(stdout);
}
static void
test_redraw(WINDOW *win)
{
+ static const char *help[] =
+ {
+ "Commands:",
+ " ^Q/ESC/q - quit",
+ " w - recur in a new window",
+ " ! - overwrite current line using stdio outside curses.",
+#ifdef NCURSES_VERSION
+ " @ - run \"date\" command, to put its output on screen.",
+#endif
+ " ^L - call redrawwin() for current window.",
+ " ^W - call wredrawln() for current line/current window.",
+ " arrow-keys - move cursor on the screen",
+ "",
+ "Other control characters are added to the screen in printable form.",
+ "Other printable characters are added to the screen as is.",
+ 0
+ };
+
WINDOW *win1;
WINDOW *win2;
bool done = FALSE;
switch (ch) {
case 'q':
/* FALLTHRU */
+ case QUIT:
case ESCAPE:
done = TRUE;
break;
wmove(win, y, x + 1);
break;
+ case HELP_KEY_1:
+ popup_msg(win, help);
+ break;
+
default:
if (ch > KEY_MIN) {
waddstr(win, keyname(ch));
+ waddch(win, '\n');
} else {
waddstr(win, unctrl(UChar(ch)));
}
/****************************************************************************
- * Copyright (c) 2007-2011,2015 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2015,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: savescreen.c,v 1.28 2015/08/22 22:40:22 tom Exp $
+ * $Id: savescreen.c,v 1.32 2017/04/15 17:33:50 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if HAVE_SCR_DUMP
# endif
#endif
+#if defined(__hpux)
+#define MyMarker 'X'
+#else
+#define MyMarker ACS_DIAMOND
+#endif
+
static bool use_init = FALSE;
static bool keep_dumps = FALSE;
+#if USE_WIDEC_SUPPORT
+/* In HPUX curses, cchar_t is opaque; other implementations are not */
+static wchar_t
+BaseChar(cchar_t data)
+{
+ wchar_t my_wchar[sizeof(cchar_t)];
+ attr_t my_attr;
+ short my_pair;
+ getcchar(&data, my_wchar, &my_attr, &my_pair, NULL);
+ return my_wchar[0];
+}
+#endif
+
static int
fexists(const char *name)
{
return ch;
}
-static void
-show_help(const char **help)
-{
- WINDOW *mywin = newwin(LINES, COLS, 0, 0);
- int n;
-
- box(mywin, 0, 0);
- wmove(mywin, 1, 1);
- for (n = 0; help[n] != 0; ++n) {
- wmove(mywin, 1 + n, 2);
- wprintw(mywin, "%.*s", COLS - 4, help[n]);
- }
- wgetch(mywin);
- delwin(mywin);
- touchwin(stdscr);
- refresh();
-}
-
static void
editor_help(void)
{
" a toggle between '#' and graphic symbol for drawing",
" c change color drawn by line to next in palette",
" h,j,k,l or arrows to move around the screen, drawing",
+ 0
};
- show_help(msgs);
+ popup_msg(stdscr, msgs);
}
static void
" q quit",
" <space> load the next screen",
" <backspace> load the previous screen",
+ 0
};
- show_help(msgs);
+ popup_msg(stdscr, msgs);
}
static void
if (++which > last)
which = 0;
break;
- case '?':
+ case HELP_KEY_1:
replay_help();
break;
default:
wmove(stdscr, cy, cx);
#if USE_WIDEC_SUPPORT
if (win_wch(curscr, &mycc) != ERR) {
- myxx = wcwidth(mycc.chars[0]);
+ myxx = wcwidth(BaseChar(mycc));
if (myxx > 0) {
wadd_wchnstr(stdscr, &mycc, 1);
cx += (myxx - 1);
case 'c':
color = (color + 1) % COLORS;
break;
- case '?':
+ case HELP_KEY_1:
editor_help();
break;
default:
}
if (!done) {
attr_t attr = (A_REVERSE | (attr_t) COLOR_PAIR(color * COLORS));
- chtype ch2 = (altchars ? ACS_DIAMOND : '#');
+ chtype ch2 = (altchars ? MyMarker : '#');
move(y, x);
- addch(ch2 | attr);
+ AddCh(ch2 | attr);
move(y, x);
}
}
****************************************************************************/
/*
- * $Id: sp_tinfo.c,v 1.17 2017/04/02 01:03:30 tom Exp $
+ * $Id: sp_tinfo.c,v 1.18 2017/04/13 21:35:31 tom Exp $
*
* TOTO: add option for non-sp-funcs interface
*/
{
set_curterm(data->term);
del_curterm(data->term);
+#if !NO_LEAKS
free(data->sp); /* cannot use delscreen in tinfo */
+#endif
free(data);
}
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.141 2017/03/31 13:09:31 tom Exp $ */
+/* $Id: test.priv.h,v 1.143 2017/04/15 17:19:47 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
#define KEY_MIN 256 /* not defined in Solaris 8 */
#endif
+#define HELP_KEY_1 '?'
+#define HELP_KEY_2 KEY_F(1)
+
/* from nc_string.h, to make this stand alone */
#if HAVE_BSD_STRING_H
#include <bsd/string.h>
#define Trace2(p) /* nothing */
-#define MvAddCh (void) mvaddch
-#define MvWAddCh (void) mvwaddch
-#define MvAddStr (void) mvaddstr
-#define MvWAddStr (void) mvwaddstr
-#define MvWAddChStr (void) mvwaddchstr
-#define MvPrintw (void) mvprintw
-#define MvWPrintw (void) mvwprintw
-#define MvHLine (void) mvhline
-#define MvWHLine (void) mvwhline
-#define MvVLine (void) mvvline
-#define MvWVLine (void) mvwvline
+#define AddCh(c) (void) addch((chtype)(c))
+#define WAddCh(w,c) (void) waddch((w),(chtype)(c))
+#define MvAddCh(y,x,c) (void) mvaddch((y),(x),(chtype)(c))
+#define MvWAddCh(w,y,x,c) (void) mvwaddch((w),(y),(x),(chtype)(c))
+#define MvAddStr(y,x,s) (void) mvaddstr((y),(x),(s))
+#define MvWAddStr(w,y,x,s) (void) mvwaddstr((w),(y),(x),(s))
+#define MvWAddChStr(w,y,x,s) (void) mvwaddchstr((w),(y),(x),(s))
+#define MvPrintw (void) mvprintw
+#define MvWPrintw (void) mvwprintw
+#define MvHLine (void) mvhline
+#define MvWHLine (void) mvwhline
+#define MvVLine (void) mvvline
+#define MvWVLine (void) mvwvline
/*
* The macro likely uses unsigned values, while X/Open prototype uses int.
* authorization. *
****************************************************************************/
/*
- * $Id: test_add_wchstr.c,v 1.23 2017/04/08 23:10:35 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.26 2017/04/15 15:15:25 tom Exp $
*
* Demonstrate the waddwchstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
#define WIDE_LINEDATA
#include <linedata.h>
+#undef AddCh
#undef MvAddCh
#undef MvAddStr
#undef MvWAddCh
+#undef MvWAddChStr
#undef MvWAddStr
+#undef WAddCh
-/* definitions to make it simpler to compare with test_addstr.c */
+/*
+ * redefinitions to simplify comparison between test_*str programs
+ */
#define AddNStr add_wchnstr
#define AddStr add_wchstr
#define MvAddNStr (void) mvadd_wchnstr
#define MvAddStr (void) mvadd_wchstr
#define MvWAddNStr (void) mvwadd_wchnstr
#define MvWAddStr (void) mvwadd_wchstr
+#define MvWAddChStr(w,y,x,s) (void) mvwadd_wchstr((w),(y),(x),(s))
#define WAddNStr wadd_wchnstr
#define WAddStr wadd_wchstr
#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
static void
-test_add_wchstr(int level)
+recursive_test(int level)
{
static bool first = TRUE;
WINDOW *work = 0;
WINDOW *show = 0;
int margin = (2 * MY_TABSIZE) - 1;
- Options option = ((m_opt ? oMove : oDefault)
- | ((w_opt || (level > 0)) ? oWindow : oDefault));
+ Options option = (Options) ((unsigned) (m_opt
+ ? oMove
+ : oDefault)
+ | (unsigned) ((w_opt || (level > 0))
+ ? oWindow
+ : oDefault));
if (first) {
static char cmd[80];
MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
limit /= 2;
- (void) mvwadd_wchstr(work, 1, 2, ChStr("String"));
- (void) mvwadd_wchstr(work, limit + 1, 2, ChStr("Chars"));
+ MvWAddChStr(work, 1, 2, ChStr("String"));
+ MvWAddChStr(work, limit + 1, 2, ChStr("Chars"));
wnoutrefresh(work);
buffer[length = 0] = '\0';
wmove(work, row, margin + 1);
switch (ch) {
case key_RECUR:
- test_add_wchstr(level + 1);
+ recursive_test(level + 1);
if (look)
touchwin(look);
if (optind < argc)
usage();
- test_add_wchstr(0);
+ recursive_test(0);
endwin();
#if NO_LEAKS
free(temp_buffer);
* authorization. *
****************************************************************************/
/*
- * $Id: test_addchstr.c,v 1.20 2017/04/08 23:11:55 tom Exp $
+ * $Id: test_addchstr.c,v 1.21 2017/04/15 14:09:14 tom Exp $
*
* Demonstrate the waddchstr() and waddch functions.
* Thomas Dickey - 2009/9/12
#include <linedata.h>
+/*
+ * redefinitions to simplify comparison between test_*str programs
+ */
#undef MvAddStr
#undef MvWAddStr
#define WAddNStr waddchnstr
#define WAddStr waddchstr
-#define AddCh addch
-#define WAddCh waddch
-
#define MY_TABSIZE 8
typedef enum {
#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
static void
-test_adds(int level)
+recursive_test(int level)
{
static bool first = TRUE;
wmove(work, row, margin + 1);
switch (ch) {
case key_RECUR:
- test_adds(level + 1);
+ recursive_test(level + 1);
if (look)
touchwin(look);
if (optind < argc)
usage();
- test_adds(0);
+ recursive_test(0);
endwin();
#if NO_LEAKS
free(temp_buffer);
/****************************************************************************
- * Copyright (c) 2009-2012,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_addstr.c,v 1.11 2016/09/10 21:28:20 tom Exp $
+ * $Id: test_addstr.c,v 1.13 2017/04/15 14:56:27 tom Exp $
*
* Demonstrate the waddstr() and waddch functions.
* Thomas Dickey - 2009/9/12
#include <linedata.h>
+/*
+ * redefinitions to simplify comparison between test_*str programs
+ */
#define AddNStr addnstr
#define AddStr addstr
#define MvAddNStr (void) mvaddnstr
#define WAddNStr waddnstr
#define WAddStr waddstr
-#define AddCh addch
-#define WAddCh waddch
-
#define MY_TABSIZE 8
typedef enum {
#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
static void
-test_adds(int level)
+recursive_test(int level)
{
static bool first = TRUE;
wmove(work, row, margin + 1);
switch (ch) {
case key_RECUR:
- test_adds(level + 1);
+ recursive_test(level + 1);
if (look)
touchwin(look);
if (optind < argc)
usage();
- test_adds(0);
+ recursive_test(0);
endwin();
ExitProgram(EXIT_SUCCESS);
}
/****************************************************************************
- * Copyright (c) 2009-2014,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_addwstr.c,v 1.13 2016/09/10 21:27:59 tom Exp $
+ * $Id: test_addwstr.c,v 1.16 2017/04/15 15:08:03 tom Exp $
*
* Demonstrate the waddwstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
#define WIDE_LINEDATA
#include <linedata.h>
+#undef AddCh
#undef MvAddCh
#undef MvAddStr
#undef MvWAddCh
#undef MvWAddStr
+#undef WAddCh
-/* definitions to make it simpler to compare with inserts.c */
+/*
+ * redefinitions to simplify comparison between test_*str programs
+ */
#define AddNStr addnwstr
#define AddStr addwstr
#define MvAddNStr (void) mvaddnwstr
wprintw(win,
"down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
- wprintw(win, "Level %d,%s inserted %d characters <", level,
- showstate, length);
+ wprintw(win, "Level %d,%s added %d characters <", level, showstate, length);
waddwstr(win, buffer);
waddstr(win, ">");
}
#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
static void
-test_inserts(int level)
+recursive_test(int level)
{
static bool first = TRUE;
WINDOW *work = 0;
WINDOW *show = 0;
int margin = (2 * MY_TABSIZE) - 1;
- Options option = (Options) ((int) (m_opt ? oMove : oDefault)
- | (int) ((w_opt || (level > 0))
- ? oWindow : oDefault));
+ Options option = (Options) ((unsigned) (m_opt
+ ? oMove
+ : oDefault)
+ | (unsigned) ((w_opt || (level > 0))
+ ? oWindow
+ : oDefault));
if (first) {
static char cmd[80];
keypad(stdscr, TRUE);
/*
- * Show the characters inserted in color, to distinguish from those that
+ * Show the characters added in color, to distinguish from those that
* are shifted.
*/
if (has_colors()) {
wmove(work, row, margin + 1);
switch (ch) {
case key_RECUR:
- test_inserts(level + 1);
+ recursive_test(level + 1);
if (look)
touchwin(look);
break;
}
- /* do the corresponding single-character insertion */
+ /* do the corresponding single-character add */
row2 = limit + row;
for (col = 0; col < length; ++col) {
col2 = ColOf(buffer, col, margin);
break;
}
- /* do the corresponding single-character insertion */
+ /* do the corresponding single-character add */
switch (option) {
case oDefault:
if (move(limit + row, col) != ERR) {
{
static const char *tbl[] =
{
- "Usage: inserts [options]"
+ "Usage: test_addwstr [options]"
,""
,"Options:"
," -f FILE read data from given file"
- ," -n NUM limit string-inserts to NUM bytes on ^N replay"
- ," -m perform wmove/move separately from insert-functions"
+ ," -n NUM limit string-adds to NUM bytes on ^N replay"
+ ," -m perform wmove/move separately from add-functions"
," -w use window-parameter even when stdscr would be implied"
};
unsigned n;
if (optind < argc)
usage();
- test_inserts(0);
+ recursive_test(0);
endwin();
ExitProgram(EXIT_SUCCESS);
}
/****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2008,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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_arrays.c,v 1.5 2010/11/13 19:57:57 tom Exp $
+ * $Id: test_arrays.c,v 1.6 2010/11/13 19:57:57 tom Exp $
*
* Author: Thomas E Dickey
*
/****************************************************************************
- * Copyright (c) 2007-2009,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2011,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_get_wstr.c,v 1.8 2011/01/15 18:15:11 tom Exp $
+ * $Id: test_get_wstr.c,v 1.9 2017/04/15 14:14:25 tom Exp $
*
* Author: Thomas E Dickey
*
}
static int
-test_get_wstr(int level, char **argv, WINDOW *strwin)
+recursive_test(int level, char **argv, WINDOW *strwin)
{
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
break;
case 'w':
- test_get_wstr(level + 1, argv, strwin);
+ recursive_test(level + 1, argv, strwin);
if (txtbox != 0) {
touchwin(txtbox);
wnoutrefresh(txtbox);
strwin = derwin(chrbox, 4, COLS - 2, 1, 1);
- test_get_wstr(1, argv, strwin);
+ recursive_test(1, argv, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
/****************************************************************************
- * Copyright (c) 2007-2009,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2012,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $
+ * $Id: test_getstr.c,v 1.11 2017/04/15 14:14:37 tom Exp $
*
* Author: Thomas E Dickey
*
}
static int
-test_getstr(int level, char **argv, WINDOW *strwin)
+recursive_test(int level, char **argv, WINDOW *strwin)
{
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
break;
case 'w':
- test_getstr(level + 1, argv, strwin);
+ recursive_test(level + 1, argv, strwin);
if (txtbox != 0) {
touchwin(txtbox);
wnoutrefresh(txtbox);
strwin = derwin(chrbox, 4, COLS - 2, 1, 1);
- test_getstr(1, argv, strwin);
+ recursive_test(1, argv, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
* authorization. *
****************************************************************************/
/*
- * $Id: test_instr.c,v 1.6 2017/04/08 23:21:53 tom Exp $
+ * $Id: test_instr.c,v 1.7 2017/04/15 14:08:40 tom Exp $
*
* Author: Thomas E Dickey
*
}
static int
-test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
+recursive_test(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
{
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
beep();
break;
case 'w':
- test_inchs(level + 1, argv, chrwin, strwin);
+ recursive_test(level + 1, argv, chrwin, strwin);
if (txtbox != 0) {
touchwin(txtbox);
wnoutrefresh(txtbox);
chrwin = derwin(chrbox, 2, COLS - 2, 1, 1);
strwin = derwin(chrbox, 2, COLS - 2, 3, 1);
- test_inchs(1, argv, chrwin, strwin);
+ recursive_test(1, argv, chrwin, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
/****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2010,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_inwstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_inwstr.c,v 1.5 2017/04/15 14:14:48 tom Exp $
*
* Author: Thomas E Dickey
*
}
static int
-test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
+recursive_test(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
{
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
beep();
break;
case 'w':
- test_inchs(level + 1, argv, chrwin, strwin);
+ recursive_test(level + 1, argv, chrwin, strwin);
if (txtbox != 0) {
touchwin(txtbox);
wnoutrefresh(txtbox);
chrwin = derwin(chrbox, 2, COLS - 2, 1, 1);
strwin = derwin(chrbox, 2, COLS - 2, 3, 1);
- test_inchs(1, argv, chrwin, strwin);
+ recursive_test(1, argv, chrwin, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
/****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
- * $Id: view.c,v 1.97 2016/09/10 21:05:46 tom Exp $
+ * $Id: view.c,v 1.101 2017/04/15 20:14:01 tom Exp $
*/
#include <test.priv.h>
#include <widechars.h>
+#include <popup_msg.h>
#include <time.h>
int
main(int argc, char *argv[])
{
+ static const char *help[] =
+ {
+ "Commands:",
+ " q,^Q,ESC - quit this program",
+ "",
+ " p,<Up> - scroll the viewport up by one row",
+ " n,<Down> - scroll the viewport down by one row",
+ " l,<Left> - scroll the viewport left by one column",
+ " r,<Right> - scroll the viewport right by one column",
+ "",
+ " h,<Home> - scroll the viewport to top of file",
+ " e,<End> - scroll the viewport to end of file",
+ "",
+ " ^L - repaint using redrawwin()",
+ "",
+ " 0 through 9 - enter digits for count",
+ " s - use entered count for halfdelay() parameter",
+ " - if no entered count, stop nodelay()",
+ " <space> - begin nodelay()",
+ 0
+ };
+
int MAXLINES = 1000;
FILE *fp;
char buf[BUFSIZ];
break;
case 'q':
+ case QUIT:
+ case ESCAPE:
done = TRUE;
break;
if (!my_delay)
napms(50);
break;
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
default:
beep();
break;
"%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
i = (int) strlen(temp);
if ((i + 7) < (int) sizeof(temp)) {
- _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - i)
+ _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i)
"view %.*s",
(int) (sizeof(temp) - 7 - (size_t) i),
fname);
/****************************************************************************
- * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
- $Id: worm.c,v 1.67 2017/04/09 00:27:42 tom Exp $
+ $Id: worm.c,v 1.68 2017/04/15 14:15:00 tom Exp $
*/
#include <test.priv.h>