mirror of
https://github.com/openharmony/third_party_ncurses.git
synced 2026-07-01 13:20:30 -04:00
[Update] upgrade ncurses to 6.6
- replace upstream ncurses sources with version 6.6 - update VERSION file to 6.6 - update ncurses.spec to reference ncurses-6.6.tar.gz - update README.OpenSource with new version and URL - keep original patches for adaptation Signed-off-by: manjiamu <wanghao636@huawei.com>
This commit is contained in:
+12
-11
@@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.30 2022/12/17 23:33:33 tom Exp $
|
||||
# $Id: Makefile.in,v 1.34 2025/10/18 15:20:43 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2020-2021,2022 Thomas E. Dickey #
|
||||
# Copyright 2020-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2010,2015 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -31,7 +31,7 @@
|
||||
# Author: Juergen Pfeifer, 1996
|
||||
#
|
||||
# Version Control
|
||||
# $Revision: 1.30 $
|
||||
# $Revision: 1.34 $
|
||||
#
|
||||
SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
@@ -47,19 +47,20 @@ libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
includedir = @includedir@
|
||||
|
||||
BINDIR = $(DESTDIR)$(bindir)
|
||||
DATADIR = $(DESTDIR)$(datadir)
|
||||
LIBDIR = $(DESTDIR)$(libdir)
|
||||
LIBEXECDIR = $(DESTDIR)$(libexecdir)
|
||||
@SET_MAKE@
|
||||
@SET_DESTDIR@
|
||||
TOP_MFLAGS = DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
|
||||
|
||||
SUBDIRS = @ADA_SUBDIRS@
|
||||
BINDIR = $(DESTDIR)$(bindir@MERGE_PREFIX@)
|
||||
DATADIR = $(DESTDIR)$(datadir@MERGE_PREFIX@)
|
||||
LIBDIR = $(DESTDIR)$(libdir@MERGE_PREFIX@)
|
||||
LIBEXECDIR = $(DESTDIR)$(libexecdir@MERGE_PREFIX@)
|
||||
|
||||
SUBDIRS = @ADA_SUBDIRS@
|
||||
|
||||
INSTALL = @INSTALL@ @INSTALL_OPT_O@
|
||||
INSTALL_SCRIPT = @INSTALL@
|
||||
|
||||
TOP_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
|
||||
@SET_MAKE@
|
||||
|
||||
################################################################################
|
||||
|
||||
@MAKE_PHONY@.PHONY : all
|
||||
|
||||
Vendored
+567
-306
File diff suppressed because it is too large
Load Diff
Vendored
+4432
-3186
File diff suppressed because it is too large
Load Diff
+18
-29
@@ -1,5 +1,5 @@
|
||||
dnl***************************************************************************
|
||||
dnl Copyright 2018-2022,2023 Thomas E. Dickey *
|
||||
dnl Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
dnl Copyright 2010-2016,2018 Free Software Foundation, Inc. *
|
||||
dnl *
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -29,7 +29,7 @@ dnl***************************************************************************
|
||||
dnl
|
||||
dnl Author: Thomas E. Dickey
|
||||
dnl
|
||||
dnl $Id: configure.in,v 1.91 2023/02/18 23:21:29 tom Exp $
|
||||
dnl $Id: configure.in,v 1.97 2025/12/25 23:49:07 tom Exp $
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl For additional information, see
|
||||
@@ -38,9 +38,10 @@ dnl https://invisible-island.net/autoconf/my-autoconf.html
|
||||
dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_PREREQ(2.52.20210509)
|
||||
AC_REVISION($Revision: 1.91 $)
|
||||
AC_INIT(gen/gen.c)
|
||||
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
|
||||
AC_REVISION($Revision: 1.97 $)
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([gen/gen.c])
|
||||
AC_CONFIG_HEADERS([include/ncurses_cfg.h:include/ncurses_cfg.hin])
|
||||
|
||||
AC_DEFUN([AC_PATH_XTRA],[])dnl ignore dependencies on this
|
||||
|
||||
@@ -59,7 +60,7 @@ cf_user_CFLAGS="$CFLAGS"
|
||||
CF_CFG_DEFAULTS
|
||||
|
||||
### Checks for programs.
|
||||
CF_PROG_CC(gnatgcc gcc cc)
|
||||
CF_WITH_ADA
|
||||
AC_PROG_CPP
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
CF_PROG_CC_C_O(CC,[$CFLAGS $CPPFLAGS])
|
||||
@@ -106,7 +107,6 @@ fi
|
||||
AC_PROG_MAKE_SET
|
||||
CF_MAKE_PHONY
|
||||
CF_MAKE_TAGS
|
||||
CF_MAKEFLAGS
|
||||
|
||||
dnl These are standard among *NIX systems, but not when cross-compiling
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, ':')
|
||||
@@ -115,20 +115,7 @@ AC_CHECK_TOOL(AR, ar, ar)
|
||||
CF_AR_FLAGS
|
||||
CF_PATHSEP
|
||||
|
||||
dnl Special option for use by system-builders: the install-prefix is used to
|
||||
dnl adjust the location into which the actual install is done, so that an
|
||||
dnl archive can be built without modifying the host system's configuration.
|
||||
AC_MSG_CHECKING(if you have specified an install-prefix)
|
||||
AC_ARG_WITH(install-prefix,
|
||||
[ --with-install-prefix prefixes actual install-location ($DESTDIR)],
|
||||
[case "$withval" in
|
||||
(yes|no)
|
||||
;;
|
||||
(*) DESTDIR="$withval"
|
||||
;;
|
||||
esac])
|
||||
AC_MSG_RESULT($DESTDIR)
|
||||
AC_SUBST(DESTDIR)
|
||||
CF_INSTALL_PREFIX
|
||||
|
||||
###############################################################################
|
||||
CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
|
||||
@@ -410,7 +397,7 @@ AC_MSG_RESULT($cf_with_trace)
|
||||
|
||||
if test "$cf_with_trace" = yes ; then
|
||||
ADA_TRACE=TRUE
|
||||
CF_ADD_CFLAGS(-DTRACE)
|
||||
AC_DEFINE(TRACE,1,[Define to 1 if we have support trace functions])
|
||||
else
|
||||
ADA_TRACE=FALSE
|
||||
fi
|
||||
@@ -435,7 +422,7 @@ AC_HEADER_DIRENT
|
||||
AC_HEADER_TIME
|
||||
|
||||
### checks for compiler characteristics
|
||||
AC_LANG_C
|
||||
AC_LANG([C])
|
||||
AC_C_CONST
|
||||
|
||||
### Checks for external-data
|
||||
@@ -455,7 +442,6 @@ cf_with_ada=yes
|
||||
dnl Check for availability of GNU Ada Translator (GNAT).
|
||||
dnl At the moment we support no other Ada95 compiler.
|
||||
if test "$cf_with_ada" != "no" ; then
|
||||
CF_PROG_GNAT
|
||||
if test "$cf_cv_prog_gnat_correct" = yes; then
|
||||
CF_FIXUP_ADAFLAGS
|
||||
|
||||
@@ -527,8 +513,8 @@ fi
|
||||
USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
|
||||
AC_SUBST(USE_ARG_SUFFIX)
|
||||
|
||||
USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
|
||||
AC_SUBST(USE_LIB_SUFFIX)
|
||||
ABI_SUFFIX=${DFT_ARG_SUFFIX}
|
||||
AC_SUBST(ABI_SUFFIX)
|
||||
|
||||
USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
|
||||
AC_SUBST(USE_CFG_SUFFIX)
|
||||
@@ -580,11 +566,12 @@ fi
|
||||
|
||||
AC_SUBST(ADAGEN_LDFLAGS)
|
||||
|
||||
AC_OUTPUT( \
|
||||
AC_CONFIG_FILES([\
|
||||
$SUB_MAKEFILES \
|
||||
src/library.gpr:src/library.gpr.in \
|
||||
doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \
|
||||
Makefile,[
|
||||
Makefile])
|
||||
AC_CONFIG_COMMANDS([default],[
|
||||
$AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
|
||||
if test -z "$USE_OLD_MAKERULES" ; then
|
||||
$AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
|
||||
@@ -617,5 +604,7 @@ cf_cv_system_name="$cf_cv_system_name"
|
||||
host="$host"
|
||||
target="$target"
|
||||
|
||||
],cat)dnl
|
||||
])
|
||||
AC_SETUP_DEFS([cat])
|
||||
AC_OUTPUT
|
||||
${MAKE:-make} preinstall
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.9 2021/07/03 15:45:33 tom Exp $
|
||||
# $Id: Makefile.in,v 1.11 2025/10/18 16:08:08 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2019-2020,2021 Thomas E. Dickey #
|
||||
# Copyright 2019-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 2011-2015,2018 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -35,7 +35,7 @@
|
||||
SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
|
||||
DESTDIR = @DESTDIR@
|
||||
@SET_DESTDIR@
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
@@ -49,8 +49,8 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
DFT_ARG_SUFFIX = @DFT_ARG_SUFFIX@
|
||||
|
||||
THIS = @ADA_LIBNAME@
|
||||
DOCDIR = $(DESTDIR)$(datadir)/doc/$(THIS)
|
||||
MANDIR = $(DESTDIR)$(mandir)/man1
|
||||
DOCDIR = $(DESTDIR)$(datadir@MERGE_PREFIX@)/doc/$(THIS)
|
||||
MANDIR = $(DESTDIR)$(mandir@MERGE_PREFIX@)/man1
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
+43
-34
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright 2019-2022,2024 Thomas E. Dickey #
|
||||
# Copyright 2019-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2015,2018 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -30,7 +30,7 @@
|
||||
# Author: Juergen Pfeifer, 1996
|
||||
# and: Thomas E. Dickey, 1997
|
||||
#
|
||||
# $Id: Makefile.in,v 1.103 2024/01/19 16:51:56 tom Exp $
|
||||
# $Id: Makefile.in,v 1.109 2025/10/18 22:11:58 tom Exp $
|
||||
#
|
||||
.SUFFIXES:
|
||||
|
||||
@@ -38,16 +38,19 @@ SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
THIS = Makefile
|
||||
|
||||
@SET_DESTDIR@
|
||||
|
||||
x = @EXEEXT@
|
||||
|
||||
top_srcdir = @top_srcdir@
|
||||
DESTDIR = @DESTDIR@
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
includedir = @includedir@
|
||||
|
||||
BINDIR = $(DESTDIR)$(bindir@MERGE_PREFIX@)
|
||||
|
||||
INSTALL = @INSTALL@ @INSTALL_OPT_O@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
@@ -111,36 +114,37 @@ ABASE = $(ALIB)-curses
|
||||
|
||||
ADA_SRCDIR = ../src
|
||||
|
||||
GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \
|
||||
$(ADA_SRCDIR)/$(ABASE).adb \
|
||||
$(ADA_SRCDIR)/$(ABASE)-aux.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-trace.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-mouse.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-panels.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)_constants.ads
|
||||
GEN_TARGETS = options.m4 \
|
||||
$(ADA_SRCDIR)/$(ABASE).ads \
|
||||
$(ADA_SRCDIR)/$(ABASE).adb \
|
||||
$(ADA_SRCDIR)/$(ABASE)-aux.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-trace.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-mouse.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-panels.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads \
|
||||
$(ADA_SRCDIR)/$(ABASE)_constants.ads
|
||||
|
||||
GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \
|
||||
$(srcdir)/$(ABASE).adb.m4 \
|
||||
$(srcdir)/$(ABASE)-aux.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-trace.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-mouse.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-panels.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-panels-user_data.ads.m4
|
||||
$(srcdir)/$(ABASE)-aux.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-trace.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-mouse.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-panels.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
|
||||
$(srcdir)/$(ABASE)-panels-user_data.ads.m4
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -162,19 +166,24 @@ libs : $(GEN_TARGETS)
|
||||
|
||||
sources:
|
||||
|
||||
$(DESTDIR)$(bindir) :
|
||||
$(BINDIR) :
|
||||
mkdir -p $@
|
||||
|
||||
install \
|
||||
install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
|
||||
$(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
|
||||
install.libs :: \
|
||||
$(GEN_TARGETS) \
|
||||
$(BINDIR) \
|
||||
$(ADACURSES_CONFIG)
|
||||
$(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(BINDIR)/$(ADACURSES_CONFIG)
|
||||
|
||||
uninstall \
|
||||
uninstall.libs ::
|
||||
-rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
|
||||
-rm -f $(BINDIR)/$(ADACURSES_CONFIG)
|
||||
|
||||
$(PROG_GENERATE): gen.o
|
||||
@ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@
|
||||
@$(PROG_GENERATE) "-?"
|
||||
@echo "... made $@"
|
||||
|
||||
gen.o: $(srcdir)/gen.c
|
||||
$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# $Id: adacurses-config.in,v 1.15 2022/07/16 21:16:43 tom Exp $
|
||||
# $Id: adacurses-config.in,v 1.17 2025/11/12 00:56:49 Branden.Robinson Exp $
|
||||
##############################################################################
|
||||
# Copyright 2019-2020,2022 Thomas E. Dickey #
|
||||
# Copyright 2019-2022,2025 Thomas E. Dickey #
|
||||
# Copyright 2007-2014,2016 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -31,7 +31,7 @@
|
||||
#
|
||||
# This script returns the options to add to `gnatmake' for using AdaCurses.
|
||||
|
||||
DESTDIR=@DESTDIR@
|
||||
: "${@SET_DESTDIR@}"
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
@@ -66,14 +66,14 @@ case "x$1" in
|
||||
Usage: ${THIS_CFG} [options]
|
||||
|
||||
Options:
|
||||
--cflags echos the gnat (Ada compiler) flags needed to compile with ${THIS}
|
||||
--libs echos the gnat libraries needed to link with ${THIS}
|
||||
--cflags echoes the gnat (Ada compiler) flags needed to compile with ${THIS}
|
||||
--libs echoes the gnat libraries needed to link with ${THIS}
|
||||
|
||||
--version echos the release+patchdate version of ${THIS}
|
||||
--version echoes the release+patchdate version of ${THIS}
|
||||
|
||||
--help prints this message
|
||||
|
||||
If no options are given, echos the full set of flags needed by gnatmake.
|
||||
If no options are given, echoes the full set of flags needed by gnatmake.
|
||||
ENDHELP
|
||||
;;
|
||||
*)
|
||||
|
||||
+8
-4
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright 2020-2021,2024 Thomas E. Dickey *
|
||||
* Copyright 2020-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2014,2016 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
/*
|
||||
Version Control
|
||||
$Id: gen.c,v 1.79 2024/01/19 13:41:45 tom Exp $
|
||||
$Id: gen.c,v 1.84 2025/11/12 00:49:19 Branden.Robinson Exp $
|
||||
--------------------------------------------------------------------------*/
|
||||
/*
|
||||
This program prints on its standard output the source for the
|
||||
@@ -189,7 +189,7 @@ find_pos(const UCHAR * const data,
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
FILE *fp = 0;
|
||||
FILE *fp = NULL;
|
||||
const int x = 0x12345678;
|
||||
|
||||
little_endian = (*((const char *)&x) == 0x78);
|
||||
@@ -203,6 +203,10 @@ main(int argc, const char *argv[])
|
||||
{
|
||||
fp = fopen(argv[2], "wb");
|
||||
}
|
||||
else if (argc == 2 && !strcmp(argv[1], "-?"))
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
else if (argc == 2)
|
||||
{
|
||||
fp = stdout;
|
||||
@@ -301,7 +305,7 @@ main(int argc, const char *argv[])
|
||||
PRINT_NAMED_CONSTANT(E_INVALID_FIELD);
|
||||
PRINT_NAMED_CONSTANT(E_CURRENT);
|
||||
|
||||
print_comment(fp, "Input key codes not defined in any ncurses manpage");
|
||||
print_comment(fp, "Input key codes not defined in any ncurses man page");
|
||||
PRINT_NAMED_CONSTANT(KEY_MIN);
|
||||
PRINT_NAMED_CONSTANT(KEY_MAX);
|
||||
#ifdef KEY_CODE_YES
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.7 2021/07/03 15:45:33 tom Exp $
|
||||
# $Id: Makefile.in,v 1.8 2025/10/18 15:23:07 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2020,2021 Thomas E. Dickey #
|
||||
# Copyright 2020-2021,2025 Thomas E. Dickey #
|
||||
# Copyright 2010-2015,2018 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -44,7 +44,8 @@ SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
THIS = Makefile
|
||||
|
||||
DESTDIR = @DESTDIR@
|
||||
@SET_DESTDIR@
|
||||
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright 2020 Thomas E. Dickey *
|
||||
* Copyright 2020,2024 Thomas E. Dickey *
|
||||
* Copyright 2005-2017,2018 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -31,7 +31,7 @@
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1997 *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: ncurses_cfg.hin,v 1.11 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: ncurses_cfg.hin,v 1.13 2024/06/08 14:04:14 tom Exp $
|
||||
*
|
||||
* This is a template-file used to generate the "ncurses_cfg.h" file.
|
||||
*
|
||||
@@ -41,7 +41,7 @@
|
||||
*
|
||||
* See:
|
||||
* https://invisible-island.net/autoconf/
|
||||
* ftp://ftp.invisible-island.net/autoconf/
|
||||
* https://invisible-island.net/archives/autoconf/
|
||||
*/
|
||||
#ifndef NC_CONFIG_H
|
||||
#define NC_CONFIG_H
|
||||
|
||||
+26
-23
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# $Id: make-tar.sh,v 1.23 2022/11/05 20:29:41 tom Exp $
|
||||
# $Id: make-tar.sh,v 1.26 2025/06/20 19:42:53 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2019-2021,2022 Thomas E. Dickey #
|
||||
# Copyright 2019-2022,2025 Thomas E. Dickey #
|
||||
# Copyright 2010-2015,2017 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -44,6 +44,7 @@ TARGET=`pwd`
|
||||
|
||||
# make timestamps of generated files predictable
|
||||
same_timestamp() {
|
||||
[ -f ../NEWS ] || echo "OOPS $1"
|
||||
touch -r ../NEWS "$1"
|
||||
}
|
||||
|
||||
@@ -61,10 +62,12 @@ grep_patchdate() {
|
||||
# The rpm spec-file in the ncurses tree is a template. Fill in the version
|
||||
# information from dist.mk
|
||||
edit_specfile() {
|
||||
RPM_DATE=`date +'%a %b %d %Y' -d "$NCURSES_PATCH"`
|
||||
sed \
|
||||
-e "s/\\<MAJOR\\>/$NCURSES_MAJOR/g" \
|
||||
-e "s/\\<MINOR\\>/$NCURSES_MINOR/g" \
|
||||
-e "s/\\<YYYYMMDD\\>/$NCURSES_PATCH/g" "$1" >"$1.new"
|
||||
-e "s/\\<YYYYMMDD\\>/$NCURSES_PATCH/g" \
|
||||
-e "s/\\<RPM_DATE\\>/$RPM_DATE/g" "$1" >"$1.new"
|
||||
chmod u+w "$1"
|
||||
mv "$1.new" "$1"
|
||||
same_timestamp "$1"
|
||||
@@ -73,7 +76,7 @@ edit_specfile() {
|
||||
make_changelog() {
|
||||
[ -f "$1" ] && chmod u+w "$1"
|
||||
cat >"$1" <<EOF
|
||||
`echo $PKG_NAME|tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ($NCURSES_MAJOR.$NCURSES_MINOR+$NCURSES_PATCH) unstable; urgency=low
|
||||
`echo "$PKG_NAME"|tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ($NCURSES_MAJOR.$NCURSES_MINOR+$NCURSES_PATCH) unstable; urgency=low
|
||||
|
||||
* snapshot of ncurses subpackage for $PKG_NAME.
|
||||
|
||||
@@ -92,25 +95,25 @@ SOURCE=`cd ..;pwd`
|
||||
|
||||
BUILD=$TMPDIR/make-tar$$
|
||||
trap "cd /; rm -rf $BUILD; exit 1" 1 2 3 15
|
||||
trap "cd /; rm -rf $BUILD" 0
|
||||
trap "cd /; rm -rf $BUILD; exit 0" 0
|
||||
|
||||
umask 077
|
||||
if ! ( mkdir $BUILD )
|
||||
if ! ( mkdir "$BUILD" )
|
||||
then
|
||||
echo "? cannot make build directory $BUILD"
|
||||
fi
|
||||
|
||||
umask 022
|
||||
mkdir $BUILD/$ROOTNAME
|
||||
mkdir "$BUILD/$ROOTNAME"
|
||||
|
||||
cp -p -r ./* $BUILD/$ROOTNAME/ || exit
|
||||
cp -p -r ./* "$BUILD/$ROOTNAME/" || exit
|
||||
|
||||
# Add the config.* utility scripts from the top-level directory.
|
||||
for i in . ..
|
||||
do
|
||||
for j in COPYING config.guess config.sub install-sh tar-copy.sh
|
||||
do
|
||||
[ -f $i/$j ] && cp -p $i/$j $BUILD/$ROOTNAME/
|
||||
[ -f "$i/$j" ] && cp -p "$i/$j" "$BUILD/$ROOTNAME"/
|
||||
done
|
||||
done
|
||||
|
||||
@@ -125,36 +128,36 @@ do
|
||||
make_changelog "$spec"/changelog
|
||||
done
|
||||
|
||||
cp -p ../man/MKada_config.in $BUILD/$ROOTNAME/doc/
|
||||
cp -p ../man/MKada_config.in "$BUILD/$ROOTNAME/doc/"
|
||||
if [ -z "$NO_HTML_DOCS" ]
|
||||
then
|
||||
# Add the ada documentation.
|
||||
cd ../doc/html || exit
|
||||
|
||||
cp -p -r Ada* $BUILD/$ROOTNAME/doc/
|
||||
cp -p -r ada $BUILD/$ROOTNAME/doc/
|
||||
cp -p -r Ada* "$BUILD/$ROOTNAME/doc/"
|
||||
cp -p -r ada "$BUILD/$ROOTNAME/doc/"
|
||||
|
||||
cd ../../Ada95 || exit
|
||||
fi
|
||||
|
||||
cp -p "$SOURCE/NEWS" $BUILD/$ROOTNAME
|
||||
cp -p "$SOURCE/NEWS" "$BUILD/$ROOTNAME"
|
||||
|
||||
# cleanup empty directories (an artifact of ncurses source archives)
|
||||
|
||||
touch $BUILD/$ROOTNAME/MANIFEST
|
||||
( cd $BUILD/$ROOTNAME && find . -type f -print | "$SOURCE/misc/csort" >MANIFEST )
|
||||
same_timestamp $BUILD/$ROOTNAME/MANIFEST
|
||||
touch "$BUILD/$ROOTNAME"/MANIFEST
|
||||
( cd "$BUILD/$ROOTNAME" && find . -type f -print | "$SOURCE/misc/csort" >MANIFEST )
|
||||
same_timestamp "$BUILD/$ROOTNAME"/MANIFEST
|
||||
|
||||
cd $BUILD || exit
|
||||
cd "$BUILD" || exit
|
||||
|
||||
# Remove build-artifacts.
|
||||
find . -name RCS -exec rm -rf {} \;
|
||||
find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
|
||||
find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
|
||||
find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
|
||||
find "$BUILD/$ROOTNAME" -type d -exec rmdir {} \; 2>/dev/null
|
||||
find "$BUILD/$ROOTNAME" -type d -exec rmdir {} \; 2>/dev/null
|
||||
find "$BUILD/$ROOTNAME" -type d -exec rmdir {} \; 2>/dev/null
|
||||
|
||||
# There is no need for this script in the tar file.
|
||||
rm -f $ROOTNAME/make-tar.sh
|
||||
rm -f "$ROOTNAME"/make-tar.sh
|
||||
|
||||
# Remove build-artifacts.
|
||||
find . -name "*.gz" -exec rm -rf {} \;
|
||||
@@ -165,10 +168,10 @@ chmod -R u+w .
|
||||
# Cleanup timestamps
|
||||
[ -n "$TOUCH_DIRS" ] && "$TOUCH_DIRS" "$ROOTNAME"
|
||||
|
||||
tar cf - $TAR_OPTIONS $ROOTNAME | gzip >"$DESTDIR/$ROOTNAME.tar.gz"
|
||||
tar cf - $TAR_OPTIONS "$ROOTNAME" | gzip >"$DESTDIR/$ROOTNAME.tar.gz"
|
||||
cd "$DESTDIR" || exit
|
||||
|
||||
pwd
|
||||
ls -l $ROOTNAME.tar.gz
|
||||
ls -l "$ROOTNAME".tar.gz
|
||||
|
||||
# vi:ts=4 sw=4
|
||||
|
||||
@@ -3,13 +3,13 @@ Summary: AdaCurses - Ada95 binding documentation for ncurses
|
||||
%define AppVersion MAJOR.MINOR
|
||||
%define AppRelease YYYYMMDD
|
||||
%define AppPackage %{AppProgram}-doc
|
||||
# $Id: AdaCurses-doc.spec,v 1.7 2019/11/23 21:15:53 tom Exp $
|
||||
# $Id: AdaCurses-doc.spec,v 1.10 2025/06/21 18:34:55 tom Exp $
|
||||
Name: %{AppPackage}
|
||||
Version: %{AppVersion}
|
||||
Release: %{AppRelease}
|
||||
License: MIT
|
||||
License: X11 License Distribution Modification Variant
|
||||
Group: Applications/Development
|
||||
URL: ftp://ftp.invisible-island.net/%{AppProgram}
|
||||
URL: https://invisible-island.net/%{AppProgram}
|
||||
Source0: %{AppProgram}-%{AppRelease}.tgz
|
||||
Packager: Thomas Dickey <dickey@invisible-island.net>
|
||||
|
||||
@@ -51,6 +51,9 @@ exit 0
|
||||
%changelog
|
||||
# each patch should add its ChangeLog entries here
|
||||
|
||||
* RPM_DATE Thomas Dickey
|
||||
- testing ncurses MAJOR.MINOR.YYYYMMDD
|
||||
|
||||
* Sat Nov 16 2019 Thomas Dickey
|
||||
- modify clean-rule to work around Fedora NFS bugs.
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@ Summary: Ada95 binding for ncurses
|
||||
%define AppProgram AdaCurses
|
||||
%define AppVersion MAJOR.MINOR
|
||||
%define AppRelease YYYYMMDD
|
||||
# $Id: AdaCurses.spec,v 1.31 2022/12/18 00:08:17 tom Exp $
|
||||
# $Id: AdaCurses.spec,v 1.36 2025/06/21 18:34:55 tom Exp $
|
||||
Name: %{AppProgram}
|
||||
Version: %{AppVersion}
|
||||
Release: %{AppRelease}
|
||||
License: MIT
|
||||
License: X11 License Distribution Modification Variant
|
||||
Group: Applications/Development
|
||||
URL: ftp://ftp.invisible-island.net/%{AppProgram}
|
||||
URL: https://invisible-island.net/%{AppProgram}
|
||||
Source0: %{AppProgram}-%{AppRelease}.tgz
|
||||
Packager: Thomas Dickey <dickey@invisible-island.net>
|
||||
|
||||
@@ -69,6 +69,7 @@ INSTALL_PROGRAM='${INSTALL}' \
|
||||
--disable-rpath-link \
|
||||
--disable-echo \
|
||||
--verbose \
|
||||
--with-screen=ncursesw6dev \
|
||||
--enable-warnings
|
||||
|
||||
make
|
||||
@@ -106,6 +107,9 @@ exit 0
|
||||
%changelog
|
||||
# each patch should add its ChangeLog entries here
|
||||
|
||||
* RPM_DATE Thomas Dickey
|
||||
- testing ncurses MAJOR.MINOR.YYYYMMDD
|
||||
|
||||
* Sat Dec 17 2022 Thomas Dickey
|
||||
- install sample programs in libexec
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# $Id: adacurses.lintian-overrides,v 1.1 2025/06/14 19:16:06 tom Exp $
|
||||
|
||||
# dh_fixperms sets *.ali to 444, but lintian disagrees
|
||||
non-standard-file-perm 0444 != 0644 [usr/lib/ada/adalib/*.ali]
|
||||
@@ -3,9 +3,10 @@ Maintainer: Thomas E. Dickey <dickey@invisible-island.net>
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>= 5),
|
||||
chrpath,
|
||||
gnat,
|
||||
gprbuild
|
||||
Homepage: https://invisible-island.net/adacurses/
|
||||
Homepage: https://invisible-island.net/ncurses/ncurses-Ada95.html
|
||||
Standards-Version: 4.6.1.0
|
||||
|
||||
Package: adacurses
|
||||
|
||||
@@ -1,79 +1,60 @@
|
||||
Upstream source https://invisible-island.net/ncurses/Ada95.html
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: AdaCurses
|
||||
Upstream-Contact: Thomas E. Dickey <dickey@invisible-island.net>
|
||||
Source: https://invisible-island.net/ncurses/Ada95.html
|
||||
|
||||
Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Files: *
|
||||
Copyright: 2017-2023,2024 by Thomas E. Dickey
|
||||
Copyright: 2017-2024,2025 by Thomas E. Dickey
|
||||
Copyright: 1998-2016,2017 Free Software Foundation, Inc.
|
||||
License: X11
|
||||
License: X11 License Distribution Modification Variant
|
||||
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.
|
||||
Comment:
|
||||
https://invisible-island.net/ncurses/ncurses-license.html
|
||||
|
||||
Files: aclocal.m4 package
|
||||
Copyright: 2010-2023,2024 by Thomas E. Dickey
|
||||
License: X11
|
||||
|
||||
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.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Files: install-sh
|
||||
Copyright: 1994 X Consortium
|
||||
License: X11
|
||||
|
||||
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, 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
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
ings in this Software without prior written authorization from the X Consor-
|
||||
tium.
|
||||
|
||||
FSF changes to this file are in the public domain.
|
||||
|
||||
Calling this script install-sh is preferred over install.sh, to prevent
|
||||
`make' implicit rules from creating a file called install from it
|
||||
when there is no Makefile.
|
||||
|
||||
This script is compatible with the BSD install script, but was written
|
||||
from scratch. It can only install one file at a time, a restriction
|
||||
shared with many OS's install programs.
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in '/usr/share/common-licenses/GPL-2'
|
||||
|
||||
-- vile: txtmode file-encoding=utf-8
|
||||
Files: install-sh
|
||||
Copyright: 1994 X Consortium
|
||||
License: X11
|
||||
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, 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 LISTED COPYRIGHT HOLDER(S) 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.
|
||||
Comment: vile: txtmode file-encoding=utf-8
|
||||
|
||||
+31
-23
@@ -1,11 +1,18 @@
|
||||
#!/usr/bin/make -f
|
||||
# MAde with the aid of dh_make, by Craig Small
|
||||
# $Id: rules,v 1.18 2025/06/14 20:41:28 tom Exp $
|
||||
# Made with the aid of dh_make, by Craig Small
|
||||
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
|
||||
# Some lines taken from debmake, by Cristoph Lameter.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
SHELL = /bin/bash
|
||||
DPKG_EXPORT_BUILDFLAGS = 1
|
||||
export DEB_BUILD_MAINT_OPTIONS := hardening=+all qa=+bug reproducible=+all
|
||||
|
||||
include /usr/share/dpkg/buildflags.mk
|
||||
|
||||
# These are used for cross-compiling and for saving the configure script
|
||||
# from having to guess our platform (since we know it already)
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
@@ -13,10 +20,7 @@ DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
TARGET_DIR = $(CURDIR)/debian/adacurses
|
||||
SAMPLE_DIR = $(TARGET_DIR)/usr/libexec/AdaCurses
|
||||
|
||||
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(CC_NORMAL)
|
||||
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
|
||||
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
|
||||
OUR_LIBDIR = /usr/lib/$(DEB_HOST_GNU_TYPE)
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
@@ -27,20 +31,21 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||
INSTALL_PROGRAM += -s
|
||||
endif
|
||||
|
||||
verbose = # -v
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
|
||||
CFLAGS="$(CFLAGS)" \
|
||||
CPPFLAGS="$(CPPFLAGS)" \
|
||||
LDFLAGS="$(LDFLAGS)" ./configure \
|
||||
./configure \
|
||||
--host=$(DEB_HOST_GNU_TYPE) \
|
||||
--build=$(DEB_BUILD_GNU_TYPE) \
|
||||
--libdir=$(OUR_LIBDIR) \
|
||||
--prefix=/usr \
|
||||
--disable-rpath-link \
|
||||
--with-shared \
|
||||
--with-ada-sharedlib \
|
||||
--with-screen=ncursesw6td \
|
||||
--without-pkg-config
|
||||
|
||||
touch configure-stamp
|
||||
@@ -61,14 +66,14 @@ clean:
|
||||
|
||||
rm -f configure-stamp build-stamp install-stamp
|
||||
|
||||
dh_clean
|
||||
dh_clean $(verbose)
|
||||
|
||||
install: install-stamp
|
||||
install-stamp: build-stamp
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
dh_prep $(verbose)
|
||||
dh_installdirs $(verbose)
|
||||
|
||||
$(MAKE) install DESTDIR=$(TARGET_DIR)
|
||||
|
||||
@@ -76,6 +81,8 @@ install-stamp: build-stamp
|
||||
( cd samples && $(MAKE) install.examples DESTDIR=$(TARGET_DIR) BINDIR=$(SAMPLE_DIR) )
|
||||
( cd doc && $(MAKE) install.html DESTDIR=$(TARGET_DIR) )
|
||||
|
||||
find $(TARGET_DIR) -type f -name '*.so*' -print -exec chrpath -d {} \;
|
||||
|
||||
touch install-stamp
|
||||
|
||||
# Build architecture-independent files here.
|
||||
@@ -86,18 +93,19 @@ binary-indep: build install
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_installchangelogs NEWS
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_makeshlibs
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
dh_lintian $(verbose)
|
||||
dh_installdocs $(verbose)
|
||||
dh_installexamples $(verbose)
|
||||
dh_installchangelogs $(verbose) NEWS
|
||||
dh_strip $(verbose)
|
||||
dh_compress $(verbose)
|
||||
dh_fixperms $(verbose)
|
||||
dh_installdeb $(verbose)
|
||||
dh_makeshlibs $(verbose)
|
||||
dh_shlibdeps $(verbose) -l$(OUR_LIBDIR)
|
||||
dh_gencontrol $(verbose)
|
||||
dh_md5sums $(verbose)
|
||||
dh_builddeb $(verbose)
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install install-stamp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version=3
|
||||
|
||||
opts=passive ftp://ftp.invisible-island.net/AdaCurses/AdaCurses-([\d.]+)\.tgz \
|
||||
opts=passive https://invisible-island.net/archives/AdaCurses/AdaCurses-([\d.]+)\.tgz \
|
||||
debian uupdate
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright 2018-2020,2021 Thomas E. Dickey #
|
||||
# Copyright 2018-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2015,2018 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -29,7 +29,7 @@
|
||||
#
|
||||
# Author: Juergen Pfeifer, 1996
|
||||
#
|
||||
# $Id: Makefile.in,v 1.64 2021/07/03 15:45:33 tom Exp $
|
||||
# $Id: Makefile.in,v 1.67 2025/10/18 13:40:00 tom Exp $
|
||||
#
|
||||
.SUFFIXES:
|
||||
|
||||
@@ -37,6 +37,8 @@ SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
THIS = Makefile
|
||||
|
||||
@SET_DESTDIR@
|
||||
|
||||
x = @EXEEXT@
|
||||
|
||||
srcdir = @srcdir@
|
||||
@@ -78,9 +80,9 @@ LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
|
||||
|
||||
RANLIB = @RANLIB@
|
||||
################################################################################
|
||||
BINDIR = $(DESTDIR)$(bindir)
|
||||
DATADIR = $(DESTDIR)$(datadir)
|
||||
LIBDIR = $(DESTDIR)$(libdir)
|
||||
BINDIR = $(DESTDIR)$(bindir@MERGE_PREFIX@)
|
||||
DATADIR = $(DESTDIR)$(datadir@MERGE_PREFIX@)
|
||||
LIBDIR = $(DESTDIR)$(libdir@MERGE_PREFIX@)
|
||||
|
||||
MY_DATADIR = $(DATADIR)/@ADA_LIBNAME@
|
||||
THIS_DATADIR = $(datadir)/@ADA_LIBNAME@
|
||||
@@ -133,7 +135,7 @@ sources :
|
||||
|
||||
libs \
|
||||
install \
|
||||
install.libs ::
|
||||
install.libs :: $(PROGS)
|
||||
@echo made $@
|
||||
|
||||
uninstall \
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-- B O D Y --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright 2019,2020 Thomas E. Dickey --
|
||||
-- Copyright 2019-2020,2025 Thomas E. Dickey --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
@@ -35,8 +35,8 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control
|
||||
-- $Revision: 1.5 $
|
||||
-- $Date: 2020/02/02 23:34:34 $
|
||||
-- $Revision: 1.6 $
|
||||
-- $Date: 2025/01/24 20:39:23 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
-- Poor mans help system. This scans a sequential file for key lines and
|
||||
@@ -136,7 +136,7 @@ package body Sample.Explanation is
|
||||
H : Help_Line_Access := Top_Line;
|
||||
begin
|
||||
if Top_Line /= null then
|
||||
for L in 0 .. (Height - 1) loop
|
||||
for L in 0 .. Height - 1 loop
|
||||
Add (W, L, 0, H.all.Line.all);
|
||||
exit when H.all.Next = null;
|
||||
H := H.all.Next;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
-- 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 : --
|
||||
-- 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. --
|
||||
@@ -36,7 +36,7 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control
|
||||
-- $Revision: 1.17 $
|
||||
-- $Revision: 1.18 $
|
||||
-- $Date: 2020/02/02 23:34:34 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
+14
-9
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright 2018-2020,2021 Thomas E. Dickey #
|
||||
# Copyright 2018-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 1999-2016,2018 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -29,7 +29,7 @@
|
||||
#
|
||||
# Author: Juergen Pfeifer, 1996
|
||||
#
|
||||
# $Id: Makefile.in,v 1.96 2021/07/03 15:45:33 tom Exp $
|
||||
# $Id: Makefile.in,v 1.102 2025/10/18 13:35:27 tom Exp $
|
||||
#
|
||||
.SUFFIXES:
|
||||
|
||||
@@ -37,13 +37,12 @@ SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
THIS = Makefile
|
||||
|
||||
ADA_MFLAGS = @cf_cv_makeflags@
|
||||
ADA_MFLAGS =
|
||||
@SET_MAKE@
|
||||
@SET_DESTDIR@
|
||||
|
||||
MODEL = ../../@DFT_OBJ_SUBDIR@
|
||||
|
||||
DESTDIR = @DESTDIR@
|
||||
|
||||
top_srcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
@@ -51,7 +50,7 @@ exec_prefix = @exec_prefix@
|
||||
includedir = @includedir@
|
||||
libdir = @libdir@
|
||||
|
||||
LIBDIR = $(DESTDIR)$(libdir)
|
||||
LIBDIR = $(DESTDIR)$(libdir@MERGE_PREFIX@)
|
||||
ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@
|
||||
ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@
|
||||
|
||||
@@ -284,9 +283,11 @@ STATIC_DIRS = \
|
||||
$(BUILD_DIR)/static-obj
|
||||
|
||||
@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
|
||||
@USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \
|
||||
@USE_GNAT_PROJECTS@ $(STATIC_C_OBJS) \
|
||||
@USE_GNAT_PROJECTS@ $(STATIC_DIRS)
|
||||
@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
|
||||
@USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \
|
||||
@USE_GNAT_PROJECTS@ $(STATIC_C_OBJS)
|
||||
@USE_GNAT_PROJECTS@ @echo "Making $@"
|
||||
@USE_GNAT_PROJECTS@ @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
|
||||
@USE_GNAT_PROJECTS@ -rm -f $(GNAT_PROJECT)
|
||||
@USE_GNAT_PROJECTS@ $(SHELL) $(srcdir)/library-cfg.sh static library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT)
|
||||
@@ -320,6 +321,7 @@ STATIC_DIRS = \
|
||||
#NEW:BEGIN
|
||||
#@USE_GNAT_LIBRARIES@install \
|
||||
#@USE_GNAT_LIBRARIES@install.libs ::
|
||||
#@USE_GNAT_LIBRARIES@ @echo "Making $@"
|
||||
#@USE_GNAT_LIBRARIES@ @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
|
||||
#@USE_GNAT_LIBRARIES@ -rm -f $(GNAT_PROJECT)
|
||||
#@USE_GNAT_LIBRARIES@ $(SHELL) $(srcdir)/library-cfg.sh static library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT)
|
||||
@@ -344,6 +346,7 @@ uninstall.libs ::
|
||||
#NEW:BEGIN
|
||||
#@USE_GNAT_LIBRARIES@uninstall \
|
||||
#@USE_GNAT_LIBRARIES@uninstall.libs ::
|
||||
#@USE_GNAT_LIBRARIES@ @echo "Making $@"
|
||||
#@USE_GNAT_LIBRARIES@ @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
|
||||
#@USE_GNAT_LIBRARIES@ -rm -f $(GNAT_PROJECT)
|
||||
#@USE_GNAT_LIBRARIES@ $(SHELL) $(srcdir)/library-cfg.sh static library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT)
|
||||
@@ -369,9 +372,11 @@ SHARED_DIRS = \
|
||||
|
||||
@MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME)
|
||||
@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: \
|
||||
@MAKE_ADA_SHAREDLIB@ $(SHARED_DIRS)
|
||||
@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: \
|
||||
@MAKE_ADA_SHAREDLIB@ $(ABASE)-trace.adb \
|
||||
@MAKE_ADA_SHAREDLIB@ $(SHARED_DIRS) \
|
||||
@MAKE_ADA_SHAREDLIB@ $(SHARED_OBJS)
|
||||
@MAKE_ADA_SHAREDLIB@ @echo "Making $@"
|
||||
@MAKE_ADA_SHAREDLIB@ cp $(SHARED_OBJS) $(BUILD_DIR)/dynamic-obj/
|
||||
@MAKE_ADA_SHAREDLIB@ @cf_ada_config@gprconfig --batch --config=Ada --config=C,,,,@cf_ada_config_C@
|
||||
@MAKE_ADA_SHAREDLIB@ -rm -f $(GNAT_PROJECT)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright 2019,2020 Thomas E. Dickey --
|
||||
-- Copyright 2019-2020,2025 Thomas E. Dickey --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
@@ -25,7 +25,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
------------------------------------------------------------------------------
|
||||
-- $Id: library.gpr.in,v 1.3 2020/06/27 20:47:40 tom Exp $
|
||||
-- $Id: library.gpr.in,v 1.5 2025/10/04 20:20:42 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
|
||||
@@ -43,7 +43,7 @@ project AdaCurses is
|
||||
for Source_Dirs use (Source_Dir & "/src",
|
||||
Source_Dir2,
|
||||
Build_Dir & "/src");
|
||||
-- for Library_Options use ("-lncurses@USE_LIB_SUFFIX@", "-lpanel@USE_LIB_SUFFIX@", "-lmenu@USE_LIB_SUFFIX@", "-lform@USE_LIB_SUFFIX@");
|
||||
-- for Library_Options use ("-lncurses@ABI_SUFFIX@", "-lpanel@ABI_SUFFIX@", "-lmenu@ABI_SUFFIX@", "-lform@ABI_SUFFIX@");
|
||||
package Compiler is
|
||||
for Default_Switches ("Ada") use
|
||||
("-g",
|
||||
|
||||
+4
-2
@@ -1,6 +1,6 @@
|
||||
# $Id: modules,v 1.4 2020/02/02 23:34:34 tom Exp $
|
||||
# $Id: modules,v 1.5 2024/06/15 20:51:03 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2020 Thomas E. Dickey #
|
||||
# Copyright 2020,2024 Thomas E. Dickey #
|
||||
# Copyright 2010 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -69,3 +69,5 @@ $(ABASE)-text_io-decimal_io $(srcdir) $(srcdir) body
|
||||
$(ABASE)-text_io-enumeration_io $(srcdir) $(srcdir) body
|
||||
$(ABASE)-text_io-modular_io $(srcdir) $(srcdir) body
|
||||
$(ABASE)-text_io-complex_io $(srcdir) $(srcdir) body
|
||||
|
||||
# vile:makemode
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-- B O D Y --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright 2020 Thomas E. Dickey --
|
||||
-- Copyright 2020,2025 Thomas E. Dickey --
|
||||
-- Copyright 1999-2011,2014 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
@@ -36,8 +36,8 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control:
|
||||
-- $Revision: 1.33 $
|
||||
-- $Date: 2020/02/02 23:34:34 $
|
||||
-- $Revision: 1.34 $
|
||||
-- $Date: 2025/01/24 20:39:23 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
with Ada.Unchecked_Deallocation;
|
||||
@@ -1006,7 +1006,7 @@ package body Terminal_Interface.Curses.Forms is
|
||||
(Field_Array, Field_Array_Access);
|
||||
begin
|
||||
if FA /= null and then Free_Fields then
|
||||
for I in FA'First .. (FA'Last - 1) loop
|
||||
for I in FA'First .. FA'Last - 1 loop
|
||||
if FA.all (I) /= Null_Field then
|
||||
Delete (FA.all (I));
|
||||
end if;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-- B O D Y --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright 2018,2020 Thomas E. Dickey --
|
||||
-- Copyright 2018-2020,2025 Thomas E. Dickey --
|
||||
-- Copyright 1999-2011,2014 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
@@ -36,8 +36,8 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control:
|
||||
-- $Revision: 1.34 $
|
||||
-- $Date: 2020/02/02 23:34:34 $
|
||||
-- $Revision: 1.35 $
|
||||
-- $Date: 2025/01/24 20:39:23 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
with Ada.Unchecked_Deallocation;
|
||||
@@ -878,7 +878,7 @@ package body Terminal_Interface.Curses.Menus is
|
||||
(Item_Array, Item_Array_Access);
|
||||
begin
|
||||
if IA /= null and then Free_Items then
|
||||
for I in IA'First .. (IA'Last - 1) loop
|
||||
for I in IA'First .. IA'Last - 1 loop
|
||||
if IA.all (I) /= Null_Item then
|
||||
Delete (IA.all (I));
|
||||
end if;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-- B O D Y --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
-- Copyright 2020 Thomas E. Dickey --
|
||||
-- Copyright 2020,2025 Thomas E. Dickey --
|
||||
-- Copyright 1999-2003,2009 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
@@ -36,7 +36,7 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- Author: Juergen Pfeifer, 1996
|
||||
-- Version Control:
|
||||
-- $Revision: 1.13 $
|
||||
-- $Revision: 1.14 $
|
||||
-- Binding Version 01.00
|
||||
------------------------------------------------------------------------------
|
||||
with Interfaces.C;
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
./Ada95/mk-pkg.awk
|
||||
./Ada95/package/AdaCurses-doc.spec
|
||||
./Ada95/package/AdaCurses.spec
|
||||
./Ada95/package/debian/adacurses.lintian-overrides
|
||||
./Ada95/package/debian/adacurses.triggers
|
||||
./Ada95/package/debian/compat
|
||||
./Ada95/package/debian/control
|
||||
./Ada95/package/debian/copyright
|
||||
@@ -556,21 +558,18 @@
|
||||
./include/headers
|
||||
./include/nc_access.h
|
||||
./include/nc_alloc.h
|
||||
./include/nc_mingw.h
|
||||
./include/nc_panel.h
|
||||
./include/nc_string.h
|
||||
./include/nc_termios.h
|
||||
./include/nc_tparm.h
|
||||
./include/nc_win32.h
|
||||
./include/nc_win32.h.in
|
||||
./include/ncurses_cfg.hin
|
||||
./include/ncurses_defs
|
||||
./include/ncurses_dll.h.in
|
||||
./include/ncurses_mingw.h
|
||||
./include/term_entry.h
|
||||
./include/termcap.h.in
|
||||
./include/tic.h
|
||||
./include/unctrl.h.in
|
||||
./include/win32_curses.h
|
||||
./install-sh
|
||||
./man/MKada_config.in
|
||||
./man/MKncu_config.in
|
||||
@@ -900,6 +899,7 @@
|
||||
./ncurses/llib-ltinfow
|
||||
./ncurses/modules
|
||||
./ncurses/new_pair.h
|
||||
./ncurses/report_ctype.c
|
||||
./ncurses/report_hashing.c
|
||||
./ncurses/report_offsets.c
|
||||
./ncurses/term.priv.h
|
||||
@@ -1007,12 +1007,11 @@
|
||||
./ncurses/win32con/gettimeofday.c
|
||||
./ncurses/win32con/wcwidth.c
|
||||
./ncurses/win32con/win32_driver.c
|
||||
./ncurses/win32con/win_driver.c
|
||||
./package/debian-mingw/changelog
|
||||
./package/debian-mingw/compat
|
||||
./package/debian-mingw/control
|
||||
./package/debian-mingw/copyright
|
||||
./package/debian-mingw/mingw32-ncurses6.lintian-overrides
|
||||
./package/debian-mingw/mingw32-ncurses6td.lintian-overrides
|
||||
./package/debian-mingw/rules
|
||||
./package/debian-mingw/source/format
|
||||
./package/debian-mingw/watch
|
||||
@@ -1020,7 +1019,7 @@
|
||||
./package/debian-mingw64/compat
|
||||
./package/debian-mingw64/control
|
||||
./package/debian-mingw64/copyright
|
||||
./package/debian-mingw64/mingw64-ncurses6.lintian-overrides
|
||||
./package/debian-mingw64/mingw64-ncurses6td.lintian-overrides
|
||||
./package/debian-mingw64/rules
|
||||
./package/debian-mingw64/source/format
|
||||
./package/debian-mingw64/watch
|
||||
@@ -1028,10 +1027,10 @@
|
||||
./package/debian/compat
|
||||
./package/debian/control
|
||||
./package/debian/copyright
|
||||
./package/debian/ncurses6.lintian-overrides
|
||||
./package/debian/ncurses6.triggers
|
||||
./package/debian/ncursest6.lintian-overrides
|
||||
./package/debian/ncursest6.triggers
|
||||
./package/debian/ncurses6td.lintian-overrides
|
||||
./package/debian/ncurses6td.triggers
|
||||
./package/debian/ncursest6td.lintian-overrides
|
||||
./package/debian/ncursest6td.triggers
|
||||
./package/debian/rules
|
||||
./package/debian/source/format
|
||||
./package/debian/watch
|
||||
@@ -1190,6 +1189,8 @@
|
||||
./test/package/debian/control
|
||||
./test/package/debian/copyright
|
||||
./test/package/debian/docs
|
||||
./test/package/debian/ncurses-examples.lintian-overrides
|
||||
./test/package/debian/ncursest-examples.lintian-overrides
|
||||
./test/package/debian/rules
|
||||
./test/package/debian/source/format
|
||||
./test/package/debian/watch
|
||||
|
||||
+7
-10
@@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.46 2022/10/01 22:53:36 tom Exp $
|
||||
# $Id: Makefile.in,v 1.51 2025/10/25 18:01:01 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2018-2021,2022 Thomas E. Dickey #
|
||||
# Copyright 2018-2022,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2014,2015 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -35,11 +35,10 @@
|
||||
SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
|
||||
DESTDIR=@DESTDIR@
|
||||
RPATH_LIST=@RPATH_LIST@
|
||||
TOP_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
|
||||
|
||||
@SET_MAKE@
|
||||
@SET_DESTDIR@
|
||||
RPATH_LIST = @RPATH_LIST@
|
||||
TOP_MFLAGS = DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
|
||||
|
||||
NCURSES_MAJOR = @NCURSES_MAJOR@
|
||||
NCURSES_MINOR = @NCURSES_MINOR@
|
||||
@@ -93,6 +92,7 @@ preinstall :
|
||||
@ echo ''
|
||||
@ echo ' extended funcs: '`test @NCURSES_EXT_FUNCS@ != 0 && echo yes || echo no`
|
||||
@ echo ' xterm terminfo: '@WHICH_XTERM@
|
||||
@ echo ' ABI suffix: '`if test -n "@ABI_SUFFIX@"; then echo @ABI_SUFFIX@; else echo "(none)"; fi`
|
||||
@ echo ''
|
||||
@ echo ' bin directory: '$(bindir)
|
||||
@ echo ' lib directory: '$(libdir)
|
||||
@@ -114,13 +114,10 @@ preinstall :
|
||||
distclean \
|
||||
realclean ::
|
||||
|
||||
check :
|
||||
@ echo The test-programs are interactive
|
||||
|
||||
|
||||
# Put the common rules here so that we can easily construct the list of
|
||||
# directories to visit.
|
||||
all \
|
||||
check \
|
||||
clean \
|
||||
distclean \
|
||||
mostlyclean \
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright 2020,2021 Thomas E. Dickey #
|
||||
# Copyright 2020-2021,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2000,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -26,7 +26,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
################################################################################
|
||||
# $Id: Makefile.os2,v 1.13 2021/06/17 21:20:30 tom Exp $
|
||||
# $Id: Makefile.os2,v 1.15 2025/07/12 10:48:01 tom Exp $
|
||||
#
|
||||
# Wrapper Makefile for ncurses library under OS/2.
|
||||
# Author: Juan Jose Garcia Ripoll <worm@arrakis.es>.
|
||||
@@ -247,7 +247,7 @@ OS2NAME=ncurses-$(NCURSES_MAJOR).$(NCURSES_MINOR)-emx
|
||||
os2dist :
|
||||
$(MAKE) -f Makefile.os2 os2clean
|
||||
./configure --without-debug --with-install-prefix=`pwd|sed -e 's@^.:@@'`/$(OS2NAME)
|
||||
$(MAKE) -f Makefile.os2 $(CF_MFLAGS) install.os2
|
||||
$(MAKE) -f Makefile.os2 install.os2
|
||||
-rm -f $(OS2NAME).zip
|
||||
echo NCurses-$(NCURSES_MAJOR).$(NCURSES_MINOR)-$(NCURSES_PATCH) for emx > $(OS2NAME)/FILE_ID.DIZ
|
||||
echo Binary release. >> $(OS2NAME)/FILE_ID.DIZ
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright 2018-2023,2024 Thomas E. Dickey --
|
||||
-- Copyright 2018-2024,2025 Thomas E. Dickey --
|
||||
-- Copyright 1998-2017,2018 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
@@ -26,7 +26,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: NEWS,v 1.4114 2024/04/27 18:00:35 tom Exp $
|
||||
-- $Id: NEWS,v 1.4390 2025/12/30 20:31:07 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a log of changes that ncurses has gone through since Zeyd started
|
||||
@@ -46,6 +46,575 @@ See the AUTHORS file for the corresponding full names.
|
||||
Changes through 1.9.9e did not credit all contributions;
|
||||
it is not possible to add this information.
|
||||
|
||||
20251230 6.6 release for upload to ftp.gnu.org
|
||||
+ update announcement
|
||||
+ corrected an ifdef needed for mouse support in MinGW/Windows
|
||||
+ eliminate remaining duplicate code between MinGW/Windows drivers
|
||||
|
||||
20251227
|
||||
+ make win32_curses.h obsolete in favor of nc_win32.h
|
||||
+ modify MinGW32 configuration to account for its use of Windows-style
|
||||
pathnames in filesystem checks.
|
||||
+ replace --enable-exp-win32 option with --enable-named-pipes
|
||||
|
||||
20251220
|
||||
> in-progress work to merge MinGW/Windows port.
|
||||
+ eliminate EXP_WIN32_DRIVER with USE_NAMED_PIPES
|
||||
+ change MS_TERMINAL to DEFAULT_TERM_VAR
|
||||
|
||||
20251213
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
+ add a null-pointer check in tic -c option.
|
||||
+ add a limit-check in infocmp -i option (report/example by Yixuan Cao).
|
||||
|
||||
20251206
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
|
||||
20251129
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
|
||||
20251123
|
||||
+ revert change using NCURSES_SBOOL in tic.h which interfered with
|
||||
sign-extension in tigetflag (Debian #1121191, cf: 20251101).
|
||||
|
||||
20251122
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
+ correct expression for TINFO_LIB variable in misc/ncurses-config.in
|
||||
(Debian #1121208, cf: 20251004).
|
||||
|
||||
20251115
|
||||
+ check for special case of wcrtomb() converting a single byte code to
|
||||
a different single byte code, which glibc does for code 160 in the
|
||||
KOI8-R encoding (report by Yury V Zaytsev).
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ amend recent changes to mouse handling to avoid a case which caused
|
||||
a loop in wgetch until additional input is provided (htop #1769,
|
||||
cf: 20250913).
|
||||
|
||||
20251101
|
||||
+ adjust generated terminfo.5 to omit tbl "x" column modifier if that
|
||||
is unsupported, i.e., with old nroff/tbl (adapted from patch by
|
||||
Branden Robinson).
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
|
||||
20251025
|
||||
+ amend locale-portability fix in tty_update.c (MidnightCommander #4799,
|
||||
cf: 20240203).
|
||||
+ add testing utility report_ctype
|
||||
+ update configure macros, improving check for $host_os
|
||||
+ correct a recent change to curs_termino.3x, along with formatting
|
||||
fixes for manpages.
|
||||
+ corrected note about box() in curs_border.3x (patch by Jakub Horky,
|
||||
cf: 20250201).
|
||||
|
||||
20251018
|
||||
+ add check for build-time utilities, in case cross-compiling is setup
|
||||
with an invalid $BUILD_CC (prompted by discussion with Stas Sergeev).
|
||||
+ modify configure-script and makefiles to make it easier to override
|
||||
the "--with-install-prefix" default with environment variable
|
||||
(report by Stas Sergeev).
|
||||
|
||||
20251010
|
||||
+ fix stray "\" in curs_extend.3x, regen html manpages.
|
||||
+ regen html manpages with man2html 1.42, fixing a few cases where
|
||||
headers were not linked (report by Branden Robinson).
|
||||
|
||||
20251004
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
+ improve configure check for "install".
|
||||
|
||||
20250927
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
|
||||
20250920
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
+ add configure check for <sys/fsuid.h>, build-fix for flatpacks
|
||||
(report by Stas Sergeev).
|
||||
+ update config.guess, config.sub
|
||||
|
||||
20250913
|
||||
+ update ncurses-howto.
|
||||
+ modify MKfallback.sh to eliminate TERMINFO environment variable.
|
||||
+ improve checks in run_tic.sh script, change some variable names to
|
||||
reduce packager confusion (report by Stas Sergeev).
|
||||
+ disallow configure options which apply only to multiuser systems, to
|
||||
improve ports to single-user systems such as Haiku (report by Stas
|
||||
Sergeev).
|
||||
+ update ncurses/wcwidth.c, for MinGW ports, from xterm.
|
||||
+ correct _nc_to_char() for the case when wctob() is not found by
|
||||
configure script (report/patch by Benno Schulenberg).
|
||||
> patches by Robin Haberkorn
|
||||
+ modify handle_wheel case 2 to ignore the event as in case 1 for
|
||||
mouse version 1, since that corresponds to a button 6 or 7 event
|
||||
which is not supported with ABI 6.
|
||||
+ use separate read/write pointers in the mouse event queue to work
|
||||
with too-close events for the click-detection to work reliably,
|
||||
and further improve that in case mouseinterval(0) is used to
|
||||
suppress click-detection.
|
||||
|
||||
20250830
|
||||
+ in-progress work to merge MinGW/Windows port.
|
||||
+ build-fix for experimental Windows configuration (report by Kirill
|
||||
Makurin).
|
||||
+ improve pattern used for configure --with-xterm-kbs option.
|
||||
|
||||
20250823
|
||||
+ improve style of MKterminfo.sh script (patches by Branden Robinson).
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ remove redundant definition of ConsoleInfo.
|
||||
+ change scope of TTY, GET_TTY and SET_TTY to ncurses-internals
|
||||
|
||||
20250816
|
||||
+ remove redundant reference to compiler in libtool configuration of
|
||||
mk-1st.awk (report by Lorinczy Zsigmond).
|
||||
+ build-fixes for --enable-exp-win32 configuration
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
|
||||
20250809
|
||||
+ add configure check for Win32 named pipes feature, using that to make
|
||||
nc_mingw.h obsolete in favor of nc_win32.h
|
||||
+ amend limit used in alloc_pair, by applying an adjustment for default
|
||||
colors only when the maximum number of color pairs is greater than
|
||||
the maximum number of colors (report by "Ingvix").
|
||||
|
||||
20250802
|
||||
+ fixes for reading Unicode characters in MinGW/Windows port (report by
|
||||
Axel Reinhold).
|
||||
|
||||
20250726
|
||||
+ modify configure script cases for $host_os, to accommodate 64-bit
|
||||
big-endian POWER linux with glibc (patch by Cosima Neidahl).
|
||||
+ add warning to configure script to address conflict between the
|
||||
--enable-lp64 option and the options for overriding the types used
|
||||
for chtype and mmask_t.
|
||||
|
||||
20250720
|
||||
+ further improve readability of header-files
|
||||
+ add a consistency-check for termio(s)/tty headers, to help with
|
||||
cross-compiles (report by Stas Sergeev).
|
||||
+ remove some unused configure-macros
|
||||
+ add xterm+keypad to pccon+base -TD
|
||||
+ trim trailing blanks from a few files (report by Stas Sergeev).
|
||||
|
||||
20250712
|
||||
+ improve readability of term.h
|
||||
+ modify recursive make rules to avoid interference with GNU make's
|
||||
"-j" option (report by Stas Sergeev).
|
||||
|
||||
20250705
|
||||
+ when installing the terminfo database, check if symbolic links are
|
||||
supported before attemping to link lib/terminfo from share/terminfo
|
||||
(report by Kirill Makurin).
|
||||
+ modify configure check for MAKEFLAGS/MFLAGS to ignore existing value
|
||||
of these environment variables (report by Stas Sergeev).
|
||||
+ reserve -c/-l options in test/*.c for command/logging like vttest.
|
||||
+ add options to test/worm.c for benchmarking (Nibby Nebbulous)
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ improve readability of header-files (patches by Branden Robinson).
|
||||
|
||||
20250628
|
||||
+ fix a few compiler-warnings.
|
||||
+ simplify include for wchar.h in Windows port by removing the platform
|
||||
ifdef's (report by Kirill Makurin).
|
||||
+ regen Ada95/configure (report by Sven Joachim).
|
||||
|
||||
20250621
|
||||
+ revise loop in wins_nwstr, to ensure that non-spacing characters are
|
||||
combined with the base spacing character (report by Karl Knechtel).
|
||||
+ fixes for port using clang-cl or cl MSVC (report by Kirill Makurin).
|
||||
+ improve test-packages:
|
||||
+ convert debian*/copyright to DEP-5 format.
|
||||
+ modify ".spec" test-files to work around timestamp-clamping in
|
||||
recent Fedora releases.
|
||||
|
||||
20250614
|
||||
+ reduce lintian warnings for test-packages.
|
||||
+ clean up some shellcheck warnings
|
||||
+ improve test/configure checks for X libraries, reducing duplicates
|
||||
+ fix some typos/errata in license text, to help with scripted checks
|
||||
|
||||
20250531
|
||||
+ improve logic in misc/run_tic.in for constructing symbolic link
|
||||
when $DESTDIR is set.
|
||||
|
||||
20250524
|
||||
+ correct option-name used in configure script, which resulted in size
|
||||
change for cchar_t (cf: 20250517).
|
||||
|
||||
20250517
|
||||
+ initial changes for some ABI 7 features:
|
||||
+ disable wgetch-events
|
||||
+ add feature for extending mouse-buttons
|
||||
+ add feature for extending direct-color support
|
||||
+ use bracketed+paste in nsterm, rlogin-color, screen, terminology -TD
|
||||
|
||||
20250510
|
||||
+ add rv/xr codes for domterm, mintty, mlterm -TD
|
||||
+ add xr code for putty -TD
|
||||
+ update teraterm to 5.0 -TD
|
||||
+ add rlogin-color -TD
|
||||
|
||||
20250503
|
||||
+ update/correct some of the rv/xr strings, checked with tack -TD
|
||||
+ use ansi+rca in sclp -TD
|
||||
+ use vt220+pcedit in sclp (Werner Fink)
|
||||
+ move some building blocks from illumos to sun-color, based on
|
||||
illumos source-history -TD
|
||||
+ improve use-clauses: ansi+cup, ansi+idl1, ansi+rca, ansi+rca2,
|
||||
ansi+sgrso, ansi+sgrul -TD
|
||||
+ add ecma+standout, ecma+underline -TD
|
||||
+ add rv code for alacritty -TD
|
||||
+ add rv/xr codes for contour, ghostty, iterm2, kitty, konsole,
|
||||
vscode, vte, wezterm -TD
|
||||
|
||||
20250426
|
||||
+ expand note on extensions in curs_addch.3x
|
||||
+ add illumos, sun-16color, sun-256color, sun-direct -TD
|
||||
+ add wyse+cvis -TD
|
||||
|
||||
20250419
|
||||
+ add note on scrolling and lower-right corner to waddch and wadd_wch
|
||||
manual pages.
|
||||
|
||||
20250412
|
||||
+ add pangoterm -TD
|
||||
+ add kf1 to kf5 to sclp (report by Werner Fink)
|
||||
+ add vt100+pf1-pf4 -TD
|
||||
|
||||
20250405
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ improve infocmp -E/-e fallback feature (report by Ville Rissanen):
|
||||
+ prefix names with "ti_" if they begin with a digit, e.g., 9term
|
||||
+ escape backslashes and double-quotes in description fields
|
||||
+ modify infocmp -E/-e fallback feature to reduce stricter compiler
|
||||
warnings for the extended capability data.
|
||||
+ add sclp -TD
|
||||
+ add op to vt525 -TD
|
||||
+ update contour -TD
|
||||
|
||||
20250329
|
||||
+ add XM/xm to ms-terminal, to enable mouse with experimental Windows
|
||||
driver -TD
|
||||
+ add -x option to infocmp in MKfallback.sh
|
||||
+ improve experimental Windows driver by restoring the scroll buffer
|
||||
and console mode, e.g., when reset_prog_mode or endwin is called
|
||||
(patch by Daniel Starke).
|
||||
+ add a buffer-limit check in postprocess_termcap (report/testcase by
|
||||
Yifan Zhang).
|
||||
|
||||
20250322
|
||||
+ add a null pointer check in mouse-initialization, for the
|
||||
experimental Windows driver (patch by Daniel Starke).
|
||||
+ improve makefile dependency in Ada95/src
|
||||
+ add note in user_caps.5 addressing a quibble about dates.
|
||||
|
||||
20250315
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
|
||||
20250308
|
||||
+ remove test in wgetch which applied notimeout to the initial read
|
||||
of a character (patch by Branden Robinson).
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ fix a few compiler-warnings in MinGW port.
|
||||
|
||||
20250301
|
||||
+ add color to vt525 (Branden Robinson)
|
||||
+ add vt520-w and vt525-w (Branden Robinson)
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ improve configurability of alloca() as used in Windows ports.
|
||||
+ fix some typos in manpages.
|
||||
+ modify configure script checks for stdbool.h to fix build with older
|
||||
gcc version.
|
||||
|
||||
20250222
|
||||
+ modify treatment of "n" parameter for waddnstr, waddnwstr, and
|
||||
wins_nwstr to return OK when "n" is zero, for consistency with other
|
||||
implementations (report by Benjamin Barenblat, cf: 20231118).
|
||||
+ formatting improvements for terminfo.5 (Debian #1096164).
|
||||
|
||||
20250216
|
||||
+ add limit-checks in alloc_entry.c and alloc_ttype.c to avoid indexing
|
||||
errors when using infocmp to compare all capabilities when processing
|
||||
a malformed terminfo binary which has a valid header (testcase by
|
||||
"Ekkosun").
|
||||
|
||||
20250215
|
||||
+ add gzip option for suppressing filename/timestamp information to an
|
||||
overlooked case (cf: 20240330).
|
||||
+ correct spelling errors found with codespell.
|
||||
+ fix some typos in manpages (report by Sven Joachim)
|
||||
+ amend change to lib_set_term.c to work with thread configuration
|
||||
(report by Rajeev Pillai, cf: 20250208).
|
||||
|
||||
20250208
|
||||
+ change etip.h.in to include either/both of <new> and <exception>,
|
||||
needed for another old BSD.
|
||||
+ update st (report by Alexander Kashpir) -TD
|
||||
+ add note for ghostty 1.1.0 -TD
|
||||
+ fix a few issues found with coverity.
|
||||
|
||||
20250201
|
||||
+ add <new> to the possible headers declaring the C++ std::bad_alloc
|
||||
(report by Carl Hansen).
|
||||
+ modify check for stdbool.h to be more conservative in case the
|
||||
headers are used with a compiler other than that which was used to
|
||||
configure (Redhat #2342514).
|
||||
+ improve MKlib_gen.sh handling of "bool" type, for building link_test
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
|
||||
20250125
|
||||
+ improve error-handling in c++ binding (report by Mingjie Shen).
|
||||
+ strict compiler-warning fixes for upcoming gcc15
|
||||
|
||||
20250118
|
||||
+ improve pattern used for configure --with-xterm-kbs option (report by
|
||||
Mingyu Wang)
|
||||
+ update configure macros, from work on cdk and dialog.
|
||||
+ change a parameter name in curs_sp_funcs.3x, for consistency (patch
|
||||
by "WHR").
|
||||
> patches by Branden Robinson:
|
||||
+ improve formatting/style of manpages
|
||||
+ change winwstr() to a generated function, using the macro definition,
|
||||
moving its handling of negative length parameter into winnwstr().
|
||||
+ correct actual-function name in a few trace calls.
|
||||
|
||||
20250111
|
||||
+ add check for infinite loop in tic's use-resolution.
|
||||
+ increase limit on use-clauses from 32 to 40, warn but allow entries
|
||||
which exceed the old limit.
|
||||
+ add some null-pointer checks after mallocs in test-programs.
|
||||
|
||||
20250104
|
||||
+ modify tput to warn about capabilities which expect parameters where
|
||||
none are given; also repair the feature where multiple capabilities
|
||||
can be handled on a single line.
|
||||
+ cleanup use-clauses -TD
|
||||
+ add linux+lockeys, xterm+r5+lockeys, xterm+r5+fkeys -TD
|
||||
+ add vt220+ufkeys, vt220+sfkeys
|
||||
+ revert man/manlinks.sed change, which loses aliases (cf: 20241228).
|
||||
+ modify MKlib_gen.c to allow for Solaris's definition of NULL as 0L
|
||||
|
||||
20241228
|
||||
+ correct conditional-compile for a case when the C compiler does not
|
||||
have a bool type.
|
||||
+ add ghostty -TD
|
||||
> patches by Branden Robinson:
|
||||
+ add comments to generated term.h to hint the configure options used
|
||||
+ use same subdir-convention for term.h, in configure script
|
||||
+ improve formatting/style of manpages
|
||||
|
||||
20241221
|
||||
+ modify ncurses/tinfo/MKfallback.sh to work with MacOS sed, which
|
||||
lacks BSD-style \< and \>
|
||||
+ trim padding from sgr expression used in trim_sgr0, to avoid copying
|
||||
the padding into the resulting sgr0 (report by Rajeev Pillai).
|
||||
+ strict compiler-warning fixes for upcoming gcc15
|
||||
|
||||
20241214
|
||||
+ avoid redefining bool in curses.h if the platform already supports
|
||||
that type (cf: 20241123).
|
||||
+ move include <curses.h> from etip.h.in to cursesw.h, to work around
|
||||
breakage in Apple's port of ncurses.
|
||||
+ strict compiler-warning fixes for upcoming gcc15
|
||||
|
||||
20241207
|
||||
+ strict compiler-warning fixes for upcoming gcc15
|
||||
|
||||
20241130
|
||||
+ improve configure check for lint program.
|
||||
+ adjust options in test-programs to allow for consistent use of -c/-l
|
||||
for command/logging.
|
||||
+ modify win_driver.c for MinGW to handle shift-tab and control-tab as
|
||||
back-tab (report by Axel Reinhold)
|
||||
|
||||
20241123
|
||||
+ remove dependency on stdbool.h from configure script check for type
|
||||
of bool when C++ binding is omitted (report by Sam James).
|
||||
+ compiler-warning fixes
|
||||
|
||||
20241109
|
||||
+ work around musl header ifdef's (report by Urs Jansen, cf: Gentoo
|
||||
#920266).
|
||||
+ improve error-reporting in write_entry.c (report by Changqing Li).
|
||||
+ remove unused #include from DJGPP configuration (report by Stas
|
||||
Sergeev).
|
||||
+ workaround/fix issues from clang-analyze
|
||||
|
||||
20241102
|
||||
+ remove djgpp-specific initialization to binary mode (report/patch by
|
||||
Stas Sergeev).
|
||||
+ add extended-keys for djgpp 2.05 -TD
|
||||
|
||||
20241026
|
||||
+ update ms-terminal -TD
|
||||
+ add ms-terminal-direct -TD
|
||||
+ correct dimensions in test/popup_msg.c, fixing an overrun (patch by
|
||||
Stas Sergeev, cf: 20211219).
|
||||
|
||||
20241019
|
||||
+ fixes for compiler warnings/cppcheck.
|
||||
+ build-fixes for DJGPP configuration (patches by Stas Sergeev)
|
||||
|
||||
20241006
|
||||
+ fixes for compiler warnings/cppcheck.
|
||||
+ use xterm+alt+title in wezterm -TD
|
||||
|
||||
20240928
|
||||
+ improve error-message from infocmp when a terminal entry cannot be
|
||||
opened (patch by Branden Robinson).
|
||||
+ improve filtering of -L options in misc/gen-pkgconfig.in and in
|
||||
misc/ncurses-config.in
|
||||
+ add check in wresize() for out-of-range dimensions (report by Peter
|
||||
Bierma).
|
||||
|
||||
20240922
|
||||
+ add a few null-pointer checks in ncurses
|
||||
+ improve test-driver in ncurses/link_test.c
|
||||
+ restore background character in manpages as described in X/Open
|
||||
Curses section 3.3.6, and add option "-c" to test programs to
|
||||
illustrate a non-blank character in the window background property.
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ modify ncurses*-config to add -I option in --cflag where needed for
|
||||
--disable-overwrite to match ".pc" files.
|
||||
+ disallow directories and block/character devices in safe-open.
|
||||
+ amend scr_restore() and scr_init() to remove the target window only
|
||||
after validating the source window which will replace the target
|
||||
(report by Zixi Liu).
|
||||
|
||||
20240914
|
||||
+ modify _nc_flush() to also flush stderr to help the flash capability
|
||||
to work in bash (patch by Harm te Hennepe, cf: 20201128)
|
||||
+ omit -g and -fXXX flags from CFLAGS in misc/ncurses-config.in
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ improve examples in NCURSES-Programming-HOWTO.html
|
||||
+ update comments in terminfo.src -TD
|
||||
|
||||
20240831
|
||||
+ build-fix for a case in msys2 where gettimeofday() was available but
|
||||
the fallback was partly configured.
|
||||
> patch by Rafael Kitover:
|
||||
+ separate the _NC_WINDOWS platform macro into _NC_WINDOWS_NATIVE,
|
||||
for MinGW and other native Win32 support, and _NC_WINDOWS, to make
|
||||
some Win32 features available under the Cygwin runtime, in this case
|
||||
the term-driver.
|
||||
+ make some minor adjustments to allow
|
||||
./configure --enable-term-driver
|
||||
to also work on Cygwin platforms such as Cygwin and MSYS2.
|
||||
|
||||
20240824
|
||||
+ modify infocmp and tabs to use actual name in usage and header.
|
||||
+ modify test/demo_keyok.c to accept ^Q for quit, for consistency.
|
||||
|
||||
20240817
|
||||
+ review/update foot for 1.18.1 -TD
|
||||
+ add a note about DomTerm 3.2.0 -TD
|
||||
+ add new glob-expressions variables to list in config.status script
|
||||
(patch by Werner Fink).
|
||||
+ add --enable-install-prefix to modify behavior of $DESTDIR to merge
|
||||
or replace the value set by --prefix (adapted from suggestion by
|
||||
Eli Zaretskii).
|
||||
|
||||
20240810
|
||||
+ modify misc/Makefile.in and misc/run_tic.in so that $DESTDIR is set
|
||||
and used only in the makefile.
|
||||
+ modify CF_WITH_PKG_CONFIG_LIBDIR to allow for pkg-config using
|
||||
DOS/Windows pathname syntax (report by Eli Zaretskii).
|
||||
+ improve glob-expressions in configure script
|
||||
+ remove unused Get_Menu_Screen() macro from menu.priv.h
|
||||
+ update config.guess, config.sub
|
||||
|
||||
20240727
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ fixes for compiler warnings/cppcheck.
|
||||
+ modify wattron/wattroff calls in form/m_post.c to call wattr_on and
|
||||
wattr_off to omit cast used in the former for X/Open compatibility
|
||||
(patch by Bill Gray).
|
||||
+ modify wezterm, omitting its broken left/right margin feature (report
|
||||
by Thayne McCombs) -TD
|
||||
|
||||
20240720
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ modify configure script and misc/Makefile to accept glob expressions
|
||||
that include Windows/DOS drive-letters (report by Eli Zaretskii).
|
||||
+ fix misspelled ifdef and correct return-value of _nc_mingw_tcflush in
|
||||
win_driver.c (report/patch by Eli Zaretskii).
|
||||
|
||||
20240713
|
||||
+ modify misc/ncurses-config.in, improved match with pkg-config output.
|
||||
|
||||
20240706
|
||||
+ update configure script to use macro changes from dialog.
|
||||
+ modify CF_NCURSES_PTHREADS to avoid equating package and library
|
||||
names.
|
||||
|
||||
20240629
|
||||
+ build-fix for ncurses-examples with newer PDCurses, which no longer
|
||||
has stubs for unimplemented features.
|
||||
+ add help-popup for test_instr.c, test_inwstr.c
|
||||
+ modify checks in delwin to avoid checking if the window is a pad
|
||||
until first checking if it is still on the active window-list
|
||||
(cf: 20211115).
|
||||
+ improve -t option of test/gdc.c, allowing hours only, or hours and
|
||||
minutes only.
|
||||
|
||||
20240622
|
||||
+ improve test/gdc.c (patch by Branden Robinson).
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ adjust naming of mingw *-config scripts to match the pkg-config names
|
||||
+ widen pattern in pc/*-config scripts to disallow more linker options
|
||||
+ add --cflags-only-I and --cflags-only-other options to
|
||||
misc/ncurses-config.in
|
||||
+ revert change to CF_BUILD_CC macro (report by Vassili Courzakis,
|
||||
cf: 20240518).
|
||||
|
||||
20240615
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ review/update modules files.
|
||||
+ improve install-rules in Ada95 makefiles (report by Branden Robinson).
|
||||
+ improve formatting/style of manpages in test-directory.
|
||||
|
||||
20240608
|
||||
+ change winwstr to return wide character count instead of OK (patch
|
||||
by Branden Robinson).
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ rename testing dpkg's for ncurses6 to resolve a naming conflict with
|
||||
Debian's ncurses packages.
|
||||
|
||||
20240601
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ change Ada95/configure to use --with-screen option rather than
|
||||
--enable-widec, to provide more choices of underlying curses library
|
||||
|
||||
20240525
|
||||
+ build-fix for configure option --disable-ext-funcs
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ review/update iTerm2 for 3.5.0 -TD
|
||||
|
||||
20240519
|
||||
+ update Ada95/configure to match change for -DTRACE
|
||||
+ revert change to include/ncurses_defs, which caused build failure if
|
||||
tracing was not enabled (report by Branden Robinson).
|
||||
|
||||
20240518
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ move makefile's -DTRACE into include/ncurses_cfg.h, to simplify use
|
||||
of CFLAGS/CPPFLAGS.
|
||||
+ improve check for clock_gettime(), from xterm.
|
||||
+ modify configure script to work around broken gnatgcc script found in
|
||||
gcc-13 builds.
|
||||
|
||||
20240511
|
||||
+ improve formatting/style of manpages (patches by Branden Robinson).
|
||||
+ limit value from ESCDELAY environment variable to 30 seconds, like
|
||||
other delay limits.
|
||||
+ limit values from LINES and COLUMNS environment variables to 512
|
||||
(report by Miroslav Lichvar).
|
||||
|
||||
20240504
|
||||
+ update ncurses/wcwidth.c, for MinGW ports, from xterm.
|
||||
+ trim obsolete comment about tack from INSTALL.
|
||||
|
||||
20240427 6.5 release for upload to ftp.gnu.org
|
||||
+ update announcement
|
||||
+ fixes/corrections for manpages (patches by Branden Robinson).
|
||||
@@ -223,7 +792,7 @@ it is not possible to add this information.
|
||||
modem (prompted by discussion with Werner Fink, Michal Suchanek,
|
||||
OpenSUSE #1201384, Debian #60377).
|
||||
+ build-fixes for --with-caps variations.
|
||||
+ correct a couple of section-references in INSTALL.
|
||||
+ correct a couple of section references in INSTALL.
|
||||
|
||||
20231028
|
||||
+ move xterm focus mode 1004 from xterm+sm+1006 into xterm+focus as
|
||||
@@ -319,7 +888,7 @@ it is not possible to add this information.
|
||||
+ minor grammatical fix for manpages (Branden Robinson).
|
||||
|
||||
20230729
|
||||
+ improve manpages for wgetnstr() and wget_wnstr().
|
||||
+ improve manpages for wgetnstr() and wget_nwstr().
|
||||
+ modify MinGW configuration to provide for running in MSYS/MSYS2
|
||||
shells, assuming ConPTY support (patch by Pavel Fedin).
|
||||
+ add assignment in CF_MAN_PAGES to fill in value for TERMINFO_DIRS in
|
||||
@@ -4262,7 +4831,7 @@ it is not possible to add this information.
|
||||
20140621
|
||||
+ change shared-library suffix for AIX 5 and 6 to ".so", avoiding
|
||||
conflict with the static library (report by Ben Lentz).
|
||||
+ document RPATH_LIST in INSTALLATION file, as part of workarounds for
|
||||
+ document RPATH_LIST in INSTALL file, as part of workarounds for
|
||||
upgrading an ncurses library using the "--with-shared" option.
|
||||
+ modify test/ncurses.c c/C tests to cycle through subsets of the
|
||||
total number of colors, to better illustrate 8/16/88/256-colors by
|
||||
@@ -10577,7 +11146,7 @@ it is not possible to add this information.
|
||||
(adapted from a patch by Ilya Zakharevich).
|
||||
+ correct parameter types of vidputs() and vidattr() to agree with
|
||||
header files (report by William P Setzer).
|
||||
+ fix typos in several man-pages (patch by William P Setzer).
|
||||
+ fix typos in several man pages (patch by William P Setzer).
|
||||
+ remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure
|
||||
macro, which made ncurses C++ binding fail to build with other
|
||||
C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young).
|
||||
@@ -10630,7 +11199,7 @@ it is not possible to add this information.
|
||||
wide-character structures (report by <George.R.Goffe@seagate.com>).
|
||||
+ ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if
|
||||
compiling for wide-character configuration.
|
||||
+ make addwnstr() handle non-spacing characters (patch by Sven
|
||||
+ make addnwstr() handle non-spacing characters (patch by Sven
|
||||
Verdoolaege).
|
||||
|
||||
20010630
|
||||
@@ -11109,7 +11678,7 @@ it is not possible to add this information.
|
||||
absolute pathname for the build tree's lib directory (prompted by
|
||||
discussion with Albert Chin-A-Young).
|
||||
+ modify "make install.man" and "make uninstall.man" to include tack's
|
||||
man-page.
|
||||
man page.
|
||||
+ various fixes for install scripts used to support configure --srcdir
|
||||
and --with-install-prefix (reported by Matthew Clarke
|
||||
<Matthew_Clarke@mindlink.bc.ca>).
|
||||
@@ -11336,7 +11905,7 @@ it is not possible to add this information.
|
||||
|
||||
20000708 5.1 release for upload to ftp.gnu.org
|
||||
+ document configure options in INSTALL.
|
||||
+ add man-page for ncurses trace functions.
|
||||
+ add man page for ncurses trace functions.
|
||||
+ correct return value shown in curs_touch.3x for is_linetouched() and
|
||||
is_wintouched(), in curs_initscr.3x for isendwin(), and in
|
||||
curs_termattr.3x for has_ic() and has_il().
|
||||
@@ -12465,7 +13034,7 @@ it is not possible to add this information.
|
||||
running screen built with ncurses.
|
||||
+ check if tmp_fp is opened in tic.c before closing it (patch by Pavel
|
||||
Roskin <pavel_roskin@geocities.com>).
|
||||
+ correct several font specification typos in man-pages.
|
||||
+ correct several font specification typos in man pages.
|
||||
|
||||
981220
|
||||
+ correct default value for BUILD_CC (reported by Larry Virden).
|
||||
@@ -12814,7 +13383,7 @@ it is not possible to add this information.
|
||||
+ modify init_pair so that if a color-pair is reinitialized, we will
|
||||
repaint the areas of the screen whose color changes, like SVr4 curses
|
||||
(reported by Christian Maurer <maurer@inf.fu-berlin.de>).
|
||||
+ modify getsyx/setsyx macros to comply with SVr4 man-page which
|
||||
+ modify getsyx/setsyx macros to comply with SVr4 man page which
|
||||
says that leaveok() affects their behavior (report by Darryl Miles,
|
||||
patch by Alexander V Lukyanov).
|
||||
|
||||
@@ -12827,7 +13396,7 @@ it is not possible to add this information.
|
||||
+ implement tparm dynamic variables (reported by Xiaodan Tang).
|
||||
|
||||
980613
|
||||
+ update man-page for for wattr_set, wattr_get (cf: 980509)
|
||||
+ update man page for wattr_set, wattr_get (cf: 980509)
|
||||
+ correct limits in hashtest, which would cause nonprinting characters
|
||||
to be written to large screens.
|
||||
+ correct configure script, when --without-cxx was specified: the
|
||||
@@ -13009,12 +13578,12 @@ it is not possible to add this information.
|
||||
option (patch by Jesse Thilo).
|
||||
+ correct some places in configure script where $enableval was used
|
||||
rather than $withval (patch by Darryl Miles <dlm@g7led.demon.co.uk>).
|
||||
+ modify some man-pages so no '.' or '..' falls between TH and SH
|
||||
+ modify some man pages so no '.' or '..' falls between TH and SH
|
||||
macros, to accommodate man_db program (reported by Ian T. Zimmerman
|
||||
<itz@rahul.net>).
|
||||
+ terminfo.src 10.2.1 downloaded from ESR's webpage (ESR).
|
||||
> several changes by Juergen Pfeifer:
|
||||
+ add copyright notices (and rcs id's) on remaining man-pages.
|
||||
+ add copyright notices (and rcs id's) on remaining man pages.
|
||||
+ corrected prototypes for slk_* functions, using chtype rather than
|
||||
attr_t.
|
||||
+ implemented the wcolor_set() and slk_color() functions
|
||||
@@ -13164,7 +13733,7 @@ it is not possible to add this information.
|
||||
implemented.
|
||||
+ correct _tracef calls in _tracedump(), which did not separate format
|
||||
from parameters.
|
||||
+ correct getopt string for tic "-o" option, and add it to man-page
|
||||
+ correct getopt string for tic "-o" option, and add it to man page
|
||||
synopsis (reported by Darren Hiebert <darren@hmi.com>).
|
||||
+ correct typo in panel/Makefile.in, reversed if-statement in scrolling
|
||||
optimization (Alexander V. Lukyanov).
|
||||
@@ -13251,7 +13820,7 @@ it is not possible to add this information.
|
||||
+ resynchronizes the generated html manpages
|
||||
|
||||
971213
|
||||
+ additional fixes for man-pages section-references
|
||||
+ additional fixes for man pages' section references
|
||||
+ add (for debugging) a check for ich/ich1 conflict with smir/rmir
|
||||
to tic, etc.
|
||||
+ remove hpa/vpa from rxvt terminal description because they are not
|
||||
@@ -13263,7 +13832,7 @@ it is not possible to add this information.
|
||||
+ modify protection when installing libraries to (normally) not
|
||||
executable. HP-UX shared libraries are an exception.
|
||||
+ add configure check for 'tack'.
|
||||
+ implement script for renaming section-references in man-page install,
|
||||
+ implement script for renaming section references in man page install,
|
||||
for Debian configuration.
|
||||
+ add validity-check for SP in trace code in baudrate() (reported by
|
||||
Daniel Weaver).
|
||||
@@ -14398,9 +14967,9 @@ it is not possible to add this information.
|
||||
970104
|
||||
+ workaround defect in autoconf 2.12 (which terminates configuration
|
||||
if no C++ compiler is found) by adding an option --without-cxx.
|
||||
+ modify several man-pages to use tbl, where .nf/.fi was used (reported
|
||||
+ modify several man pages to use tbl, where .nf/.fi was used (reported
|
||||
by Jesse Thilo).
|
||||
+ correct font-codes in some man-pages (patch by Jesse Thilo
|
||||
+ correct font codes in some man pages (patch by Jesse Thilo
|
||||
<Jesse.Thilo@pobox.com>)
|
||||
+ use configure script's knowledge of existence of g++ library for the
|
||||
c++ Makefile (reported by Paul Jackson).
|
||||
@@ -14666,7 +15235,7 @@ it is not possible to add this information.
|
||||
simpler to construct tests (for double-check of _nc_hash_map tests).
|
||||
+ correct ifdef's for c++ in curses.h
|
||||
+ change default xterm type to xterm-x11r6.
|
||||
+ correct quoting in configure that made man-pages installed with
|
||||
+ correct quoting in configure that made man pages installed with
|
||||
$datadir instead of actual terminfo path.
|
||||
+ correct whitespace in include/Caps, which caused kf11, clr_eol and
|
||||
clr_end to be omitted from terminfo.5
|
||||
@@ -14878,7 +15447,7 @@ it is not possible to add this information.
|
||||
960707
|
||||
+ rollback ESR's #305 change to terminfo.src (it breaks existing
|
||||
applications, e.g., 'less 290').
|
||||
+ correct path of edit_man.sh, and fix typo that made all man-pages
|
||||
+ correct path of edit_man.sh, and fix typo that made all man pages
|
||||
preformatted.
|
||||
+ restore man/menu_requestname.3x omitted in Zeyd's resync (oops).
|
||||
+ auto-configure the GCC_PRINTFLIKE/GCC_SCANFLIKE macros (reported by
|
||||
@@ -14890,7 +15459,7 @@ it is not possible to add this information.
|
||||
descriptions.
|
||||
+ work around autoconf bug, force $INSTALL to absolute path
|
||||
(reported by Zeyd).
|
||||
+ modify man-page install for BSDI to install preformatted .0 files
|
||||
+ modify man page install for BSDI to install preformatted .0 files
|
||||
(reported by David MacKenzie).
|
||||
+ add/use gcc __attribute__ for printf and scanf in curses.h
|
||||
+ added SGR attributes test-case to ncurses
|
||||
@@ -14991,7 +15560,7 @@ it is not possible to add this information.
|
||||
+ misc/ncurses-intro.html syntax fix (Kajiyama Tamito).
|
||||
|
||||
960601 - snapshot
|
||||
+ auto-configure man-page compression-format and renames for Debian.
|
||||
+ auto-configure man page compression format and renames for Debian.
|
||||
+ corrected several typos in curses.h.in (i.e., the mvXXXX macros).
|
||||
+ re-order curses.priv.h for lint.
|
||||
+ added rules for lintlib, lint
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
"Name": "ncurses",
|
||||
"License": "MIT",
|
||||
"License File": "COPYING",
|
||||
"Version Number": "6.5",
|
||||
"Version Number": "6.6",
|
||||
"Owner": "liyiming13@huawei.com",
|
||||
"Upstream URL": "https://invisible-mirror.net/archives/ncurses/ncurses-6.5.tar.gz",
|
||||
"Upstream URL": "https://invisible-mirror.net/archives/ncurses/ncurses-6.6.tar.gz",
|
||||
"Description": "The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0 (SVr4), and more. It uses terminfo format, supports pads and color and multiple highlights and forms characters and function-key mapping, and has all the other SVr4-curses enhancements over BSD curses. SVr4 curses became the basis of X/Open Curses."
|
||||
}
|
||||
]
|
||||
Vendored
+853
-527
File diff suppressed because it is too large
Load Diff
+639
-518
File diff suppressed because it is too large
Load Diff
+15
-13
@@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.133 2021/07/03 18:53:57 tom Exp $
|
||||
# $Id: Makefile.in,v 1.139 2025/10/18 13:33:46 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2018-2020,2021 Thomas E. Dickey #
|
||||
# Copyright 2018-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2015,2016 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -38,13 +38,13 @@
|
||||
SHELL = @SHELL@
|
||||
VPATH = @srcdir@
|
||||
|
||||
CF_MFLAGS = @cf_cv_makeflags@
|
||||
@SET_MAKE@
|
||||
@SET_DESTDIR@
|
||||
|
||||
x = @EXEEXT@
|
||||
o = .@OBJEXT@
|
||||
|
||||
MODEL = ../@DFT_OBJ_SUBDIR@
|
||||
DESTDIR = @DESTDIR@
|
||||
top_srcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
@@ -54,7 +54,9 @@ libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
includesubdir = @includesubdir@
|
||||
|
||||
INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
|
||||
INCLUDEDIR = $(DESTDIR)$(includedir@MERGE_PREFIX@)$(includesubdir)
|
||||
BINDIR = $(DESTDIR)$(bindir@MERGE_PREFIX@)
|
||||
LIBDIR = $(DESTDIR)$(libdir@MERGE_PREFIX@)
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
|
||||
@@ -115,15 +117,15 @@ LOCAL_LIBDIR = @top_builddir@/lib
|
||||
LINK = @LINK_PROGS@ $(LIBTOOL_LINK) @CXXLDFLAGS@
|
||||
SHLIB_DIRS = -L../lib
|
||||
SHLIB_LIST = $(SHLIB_DIRS) \
|
||||
-l@FORM_NAME@@USE_LIB_SUFFIX@ \
|
||||
-l@MENU_NAME@@USE_LIB_SUFFIX@ \
|
||||
-l@PANEL_NAME@@USE_LIB_SUFFIX@ \
|
||||
-lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@
|
||||
-l@FORM_NAME@@ABI_SUFFIX@ \
|
||||
-l@MENU_NAME@@ABI_SUFFIX@ \
|
||||
-l@PANEL_NAME@@ABI_SUFFIX@ \
|
||||
-lncurses@ABI_SUFFIX@ @SHLIB_LIST@
|
||||
|
||||
LIBROOT = ncurses++
|
||||
|
||||
LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@USE_LIB_SUFFIX@.la
|
||||
LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@USE_LIB_SUFFIX@.a
|
||||
LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@ABI_SUFFIX@.la
|
||||
LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@ABI_SUFFIX@.a
|
||||
LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@
|
||||
|
||||
LIBRARIES = @Libs_To_Make@
|
||||
@@ -132,7 +134,7 @@ LINT = @LINT@
|
||||
LINT_OPTS = @LINT_OPTS@
|
||||
LINT_LIBS = -lncurses @LIBS@
|
||||
|
||||
LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@USE_LIB_SUFFIX@
|
||||
LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@ABI_SUFFIX@
|
||||
RPATH_LIST = @RPATH_LIST@
|
||||
MK_SHARED_LIB = @MK_SHARED_LIB@
|
||||
|
||||
@@ -191,7 +193,7 @@ sources : $(AUTO_SRC)
|
||||
tags:
|
||||
$(CTAGS) *.[h] *.cc
|
||||
|
||||
$(DESTDIR)$(libdir) :
|
||||
$(LIBDIR) :
|
||||
mkdir -p $@
|
||||
|
||||
mostlyclean ::
|
||||
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019,2020 Thomas E. Dickey *
|
||||
* Copyright 2019-2020,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2007,2008 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "internal.h"
|
||||
#include "cursesapp.h"
|
||||
|
||||
MODULE_ID("$Id: cursesapp.cc,v 1.18 2020/07/18 19:57:11 anonymous.maarten Exp $")
|
||||
MODULE_ID("$Id: cursesapp.cc,v 1.19 2025/01/25 21:20:17 tom Exp $")
|
||||
|
||||
void
|
||||
NCursesApplication::init(bool bColors)
|
||||
@@ -65,9 +65,9 @@ NCursesApplication::init(bool bColors)
|
||||
Root_Window->bkgd(' '|window_backgrounds());
|
||||
}
|
||||
|
||||
NCursesApplication* NCursesApplication::theApp = 0;
|
||||
NCursesWindow* NCursesApplication::titleWindow = 0;
|
||||
NCursesApplication::SLK_Link* NCursesApplication::slk_stack = 0;
|
||||
NCursesApplication* NCursesApplication::theApp = NULL;
|
||||
NCursesWindow* NCursesApplication::titleWindow = NULL;
|
||||
NCursesApplication::SLK_Link* NCursesApplication::slk_stack = NULL;
|
||||
|
||||
|
||||
NCursesWindow *&NCursesApplication::getTitleWindow() {
|
||||
@@ -79,7 +79,7 @@ NCursesApplication::~NCursesApplication() THROWS(NCursesException)
|
||||
Soft_Label_Key_Set* S;
|
||||
|
||||
delete titleWindow;
|
||||
titleWindow = 0;
|
||||
titleWindow = NULL;
|
||||
|
||||
while( (S=top()) ) {
|
||||
pop();
|
||||
@@ -87,7 +87,7 @@ NCursesApplication::~NCursesApplication() THROWS(NCursesException)
|
||||
}
|
||||
|
||||
delete Root_Window;
|
||||
Root_Window = 0;
|
||||
Root_Window = NULL;
|
||||
|
||||
::endwin();
|
||||
}
|
||||
@@ -105,7 +105,7 @@ int NCursesApplication::rinit(NCursesWindow& w)
|
||||
void NCursesApplication::push(Soft_Label_Key_Set& S)
|
||||
{
|
||||
SLK_Link* L = new SLK_Link;
|
||||
assert(L != 0);
|
||||
assert(L != NULL);
|
||||
L->prev = slk_stack;
|
||||
L->SLKs = &S;
|
||||
slk_stack = L;
|
||||
@@ -121,7 +121,7 @@ bool NCursesApplication::pop()
|
||||
delete L;
|
||||
if (Root_Window) {
|
||||
Soft_Label_Key_Set* xx = top();
|
||||
if (xx != 0)
|
||||
if (xx != NULL)
|
||||
xx->show();
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ Soft_Label_Key_Set* NCursesApplication::top() const
|
||||
int NCursesApplication::operator()(void)
|
||||
{
|
||||
bool bColors = b_Colors;
|
||||
Soft_Label_Key_Set* S = 0;
|
||||
Soft_Label_Key_Set* S = NULL;
|
||||
|
||||
int ts = titlesize();
|
||||
if (ts>0)
|
||||
@@ -147,7 +147,7 @@ int NCursesApplication::operator()(void)
|
||||
Soft_Label_Key_Set::Label_Layout fmt = useSLKs();
|
||||
if (fmt!=Soft_Label_Key_Set::None) {
|
||||
S = new Soft_Label_Key_Set(fmt);
|
||||
assert(S != 0);
|
||||
assert(S != NULL);
|
||||
init_labels(*S);
|
||||
}
|
||||
|
||||
|
||||
+72
-61
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2020,2021 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2005,2011 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "cursesf.h"
|
||||
#include "cursesapp.h"
|
||||
|
||||
MODULE_ID("$Id: cursesf.cc,v 1.26 2021/04/17 18:11:08 tom Exp $")
|
||||
MODULE_ID("$Id: cursesf.cc,v 1.28 2025/01/25 21:20:17 tom Exp $")
|
||||
|
||||
NCursesFormField::~NCursesFormField () THROWS(NCursesException)
|
||||
{
|
||||
@@ -50,33 +50,39 @@ NCursesFormField::~NCursesFormField () THROWS(NCursesException)
|
||||
FIELD**
|
||||
NCursesForm::mapFields(NCursesFormField* nfields[])
|
||||
{
|
||||
int fieldCount = 0,lcv;
|
||||
int fieldCount = 0, lcv;
|
||||
FIELD** old_fields;
|
||||
|
||||
assert(nfields != 0);
|
||||
assert(nfields != NULL);
|
||||
|
||||
for (lcv=0; nfields[lcv]->field; ++lcv)
|
||||
++fieldCount;
|
||||
|
||||
FIELD** fields = new FIELD*[fieldCount + 1];
|
||||
try {
|
||||
FIELD** fields = new FIELD*[fieldCount + 1];
|
||||
|
||||
for (lcv=0;nfields[lcv]->field;++lcv) {
|
||||
fields[lcv] = nfields[lcv]->field;
|
||||
for (lcv=0;nfields[lcv]->field;++lcv) {
|
||||
fields[lcv] = nfields[lcv]->field;
|
||||
}
|
||||
fields[lcv] = NULL;
|
||||
|
||||
my_fields = nfields;
|
||||
|
||||
if (form && (old_fields = ::form_fields(form))) {
|
||||
::set_form_fields(form, static_cast<FIELD**>(0));
|
||||
delete[] old_fields;
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
fields[lcv] = NULL;
|
||||
|
||||
my_fields = nfields;
|
||||
|
||||
if (form && (old_fields = ::form_fields(form))) {
|
||||
::set_form_fields(form, static_cast<FIELD**>(0));
|
||||
delete[] old_fields;
|
||||
catch (std::bad_alloc const&) {
|
||||
OnError (E_SYSTEM_ERROR);
|
||||
}
|
||||
return fields;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void NCursesForm::setDefaultAttributes()
|
||||
{
|
||||
NCursesApplication* S = NCursesApplication::getApplication();
|
||||
const NCursesApplication* S = NCursesApplication::getApplication();
|
||||
|
||||
int n = count();
|
||||
if (n > 0) {
|
||||
@@ -108,46 +114,51 @@ NCursesForm::InitForm(NCursesFormField* nfields[],
|
||||
bool with_frame,
|
||||
bool autoDelete_Fields)
|
||||
{
|
||||
int mrows, mcols;
|
||||
try {
|
||||
int mrows, mcols;
|
||||
|
||||
keypad(TRUE);
|
||||
meta(TRUE);
|
||||
keypad(TRUE);
|
||||
meta(TRUE);
|
||||
|
||||
b_framed = with_frame;
|
||||
b_autoDelete = autoDelete_Fields;
|
||||
b_framed = with_frame;
|
||||
b_autoDelete = autoDelete_Fields;
|
||||
|
||||
form = static_cast<FORM*>(0);
|
||||
form = ::new_form(mapFields(nfields));
|
||||
if (!form)
|
||||
form = static_cast<FORM*>(0);
|
||||
form = ::new_form(mapFields(nfields));
|
||||
if (!form)
|
||||
OnError (E_SYSTEM_ERROR);
|
||||
|
||||
UserHook* hook = new UserHook;
|
||||
hook->m_user = NULL;
|
||||
hook->m_back = this;
|
||||
hook->m_owner = form;
|
||||
::set_form_userptr(form, reinterpret_cast<void*>(hook));
|
||||
|
||||
::set_form_init (form, _nc_xx_frm_init);
|
||||
::set_form_term (form, _nc_xx_frm_term);
|
||||
::set_field_init (form, _nc_xx_fld_init);
|
||||
::set_field_term (form, _nc_xx_fld_term);
|
||||
|
||||
scale(mrows, mcols);
|
||||
::set_form_win(form, w);
|
||||
|
||||
if (with_frame) {
|
||||
if ((mrows > height()-2) || (mcols > width()-2))
|
||||
OnError(E_NO_ROOM);
|
||||
sub = new NCursesWindow(*this,mrows,mcols,1,1,'r');
|
||||
::set_form_sub(form, sub->w);
|
||||
b_sub_owner = TRUE;
|
||||
}
|
||||
else {
|
||||
sub = static_cast<NCursesWindow*>(NULL);
|
||||
b_sub_owner = FALSE;
|
||||
}
|
||||
options_on(O_NL_OVERLOAD);
|
||||
setDefaultAttributes();
|
||||
}
|
||||
catch (std::bad_alloc const&) {
|
||||
OnError (E_SYSTEM_ERROR);
|
||||
|
||||
UserHook* hook = new UserHook;
|
||||
hook->m_user = NULL;
|
||||
hook->m_back = this;
|
||||
hook->m_owner = form;
|
||||
::set_form_userptr(form, reinterpret_cast<void*>(hook));
|
||||
|
||||
::set_form_init (form, _nc_xx_frm_init);
|
||||
::set_form_term (form, _nc_xx_frm_term);
|
||||
::set_field_init (form, _nc_xx_fld_init);
|
||||
::set_field_term (form, _nc_xx_fld_term);
|
||||
|
||||
scale(mrows, mcols);
|
||||
::set_form_win(form, w);
|
||||
|
||||
if (with_frame) {
|
||||
if ((mrows > height()-2) || (mcols > width()-2))
|
||||
OnError(E_NO_ROOM);
|
||||
sub = new NCursesWindow(*this,mrows,mcols,1,1,'r');
|
||||
::set_form_sub(form, sub->w);
|
||||
b_sub_owner = TRUE;
|
||||
}
|
||||
else {
|
||||
sub = static_cast<NCursesWindow*>(0);
|
||||
b_sub_owner = FALSE;
|
||||
}
|
||||
options_on(O_NL_OVERLOAD);
|
||||
setDefaultAttributes();
|
||||
}
|
||||
|
||||
NCursesForm::~NCursesForm() THROWS(NCursesException)
|
||||
@@ -156,13 +167,13 @@ NCursesForm::~NCursesForm() THROWS(NCursesException)
|
||||
delete hook;
|
||||
if (b_sub_owner) {
|
||||
delete sub;
|
||||
::set_form_sub(form, static_cast<WINDOW *>(0));
|
||||
::set_form_sub(form, static_cast<WINDOW *>(NULL));
|
||||
}
|
||||
if (form) {
|
||||
FIELD** fields = ::form_fields(form);
|
||||
int cnt = count();
|
||||
|
||||
OnError(::set_form_fields(form, static_cast<FIELD**>(0)));
|
||||
OnError(::set_form_fields(form, static_cast<FIELD**>(NULL)));
|
||||
|
||||
if (b_autoDelete) {
|
||||
if (cnt>0) {
|
||||
@@ -381,19 +392,19 @@ bool _nc_xx_fld_fcheck(FIELD *f, const void *u)
|
||||
{
|
||||
(void) f;
|
||||
NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
|
||||
assert(F != 0);
|
||||
assert(F != NULL);
|
||||
UserDefinedFieldType* udf = reinterpret_cast<UserDefinedFieldType*>(F->fieldtype());
|
||||
assert(udf != 0);
|
||||
assert(udf != NULL);
|
||||
return udf->field_check(*F);
|
||||
}
|
||||
|
||||
bool _nc_xx_fld_ccheck(int c, const void *u)
|
||||
{
|
||||
NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
|
||||
assert(F != 0);
|
||||
assert(F != NULL);
|
||||
UserDefinedFieldType* udf =
|
||||
reinterpret_cast<UserDefinedFieldType*>(F->fieldtype());
|
||||
assert(udf != 0);
|
||||
assert(udf != NULL);
|
||||
return udf->char_check(c);
|
||||
}
|
||||
|
||||
@@ -423,10 +434,10 @@ bool _nc_xx_next_choice(FIELD *f, const void *u)
|
||||
{
|
||||
(void) f;
|
||||
NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
|
||||
assert(F != 0);
|
||||
assert(F != NULL);
|
||||
UserDefinedFieldType_With_Choice* udf =
|
||||
reinterpret_cast<UserDefinedFieldType_With_Choice*>(F->fieldtype());
|
||||
assert(udf != 0);
|
||||
assert(udf != NULL);
|
||||
return udf->next(*F);
|
||||
}
|
||||
|
||||
@@ -434,10 +445,10 @@ bool _nc_xx_prev_choice(FIELD *f, const void *u)
|
||||
{
|
||||
(void) f;
|
||||
NCursesFormField* F = reinterpret_cast<NCursesFormField*>(const_cast<void *>(u));
|
||||
assert(F != 0);
|
||||
assert(F != NULL);
|
||||
UserDefinedFieldType_With_Choice* udf =
|
||||
reinterpret_cast<UserDefinedFieldType_With_Choice*>(F->fieldtype());
|
||||
assert(udf != 0);
|
||||
assert(udf != NULL);
|
||||
return udf->previous(*F);
|
||||
}
|
||||
|
||||
|
||||
+22
-22
@@ -1,7 +1,7 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
// vile:cppmode
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2021,2022 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -33,7 +33,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: cursesf.h,v 1.39 2022/08/20 20:52:15 tom Exp $
|
||||
// $Id: cursesf.h,v 1.41 2025/01/25 21:20:17 tom Exp $
|
||||
|
||||
#ifndef NCURSES_CURSESF_H_incl
|
||||
#define NCURSES_CURSESF_H_incl 1
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
|
||||
public:
|
||||
NCursesFieldType()
|
||||
: fieldtype(STATIC_CAST(FIELDTYPE*)(0))
|
||||
: fieldtype(STATIC_CAST(FIELDTYPE*)(NULL))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ protected:
|
||||
public:
|
||||
// Create a 'Null' field. Can be used to delimit a field list
|
||||
NCursesFormField()
|
||||
: field(STATIC_CAST(FIELD*)(0)),
|
||||
ftype(STATIC_CAST(NCursesFieldType*)(0))
|
||||
: field(STATIC_CAST(FIELD*)(NULL)),
|
||||
ftype(STATIC_CAST(NCursesFieldType*)(NULL))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ public:
|
||||
int first_col = 0,
|
||||
int offscreen_rows = 0,
|
||||
int additional_buffers = 0)
|
||||
: field(0),
|
||||
ftype(STATIC_CAST(NCursesFieldType*)(0))
|
||||
: field(NULL),
|
||||
ftype(STATIC_CAST(NCursesFieldType*)(NULL))
|
||||
{
|
||||
field = ::new_field(rows, ncols, first_row, first_col,
|
||||
offscreen_rows, additional_buffers);
|
||||
@@ -363,7 +363,7 @@ private:
|
||||
// Get the backward pointer to the C++ object from a FORM
|
||||
static inline NCursesForm* getHook(const FORM *f) {
|
||||
UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(f));
|
||||
assert(hook != 0 && hook->m_owner==f);
|
||||
assert(hook != NULL && hook->m_owner==f);
|
||||
return const_cast<NCursesForm*>(hook->m_back);
|
||||
}
|
||||
|
||||
@@ -379,13 +379,13 @@ protected:
|
||||
// internal routines
|
||||
inline void set_user(void *user) {
|
||||
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
|
||||
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
|
||||
assert (uptr != NULL && uptr->m_back==this && uptr->m_owner==form);
|
||||
uptr->m_user = user;
|
||||
}
|
||||
|
||||
inline void *get_user() {
|
||||
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
|
||||
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
|
||||
const UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
|
||||
assert (uptr != NULL && uptr->m_back==this && uptr->m_owner==form);
|
||||
return uptr->m_user;
|
||||
}
|
||||
|
||||
@@ -408,12 +408,12 @@ protected:
|
||||
int begin_y = 0,
|
||||
int begin_x = 0)
|
||||
: NCursesPanel(nlines, ncols, begin_y, begin_x),
|
||||
form (STATIC_CAST(FORM*)(0)),
|
||||
sub(0),
|
||||
form (STATIC_CAST(FORM*)(NULL)),
|
||||
sub(NULL),
|
||||
b_sub_owner(0),
|
||||
b_framed(0),
|
||||
b_autoDelete(0),
|
||||
my_fields(0)
|
||||
my_fields(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -423,12 +423,12 @@ public:
|
||||
bool with_frame=FALSE, // reserve space for a frame?
|
||||
bool autoDelete_Fields=FALSE) // do automatic cleanup?
|
||||
: NCursesPanel(),
|
||||
form(0),
|
||||
sub(0),
|
||||
form(NULL),
|
||||
sub(NULL),
|
||||
b_sub_owner(0),
|
||||
b_framed(0),
|
||||
b_autoDelete(0),
|
||||
my_fields(0)
|
||||
my_fields(NULL)
|
||||
{
|
||||
InitForm(Fields, with_frame, autoDelete_Fields);
|
||||
}
|
||||
@@ -442,12 +442,12 @@ public:
|
||||
bool with_frame=FALSE, // reserve space for a frame?
|
||||
bool autoDelete_Fields=FALSE) // do automatic cleanup?
|
||||
: NCursesPanel(nlines, ncols, begin_y, begin_x),
|
||||
form(0),
|
||||
sub(0),
|
||||
form(NULL),
|
||||
sub(NULL),
|
||||
b_sub_owner(0),
|
||||
b_framed(0),
|
||||
b_autoDelete(0),
|
||||
my_fields(0)
|
||||
my_fields(NULL)
|
||||
{
|
||||
InitForm(Fields, with_frame, autoDelete_Fields);
|
||||
}
|
||||
@@ -681,7 +681,7 @@ protected:
|
||||
|
||||
public:
|
||||
NCursesUserForm (NCursesFormField* Fields[],
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
const T* p_UserData = STATIC_CAST(T*)(NULL),
|
||||
bool with_frame=FALSE,
|
||||
bool autoDelete_Fields=FALSE)
|
||||
: NCursesForm (Fields, with_frame, autoDelete_Fields) {
|
||||
@@ -694,7 +694,7 @@ public:
|
||||
int ncols,
|
||||
int begin_y = 0,
|
||||
int begin_x = 0,
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
const T* p_UserData = STATIC_CAST(T*)(NULL),
|
||||
bool with_frame=FALSE,
|
||||
bool autoDelete_Fields=FALSE)
|
||||
: NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
|
||||
|
||||
+63
-53
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2020,2021 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2011,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "cursesm.h"
|
||||
#include "cursesapp.h"
|
||||
|
||||
MODULE_ID("$Id: cursesm.cc,v 1.27 2021/04/17 18:11:08 tom Exp $")
|
||||
MODULE_ID("$Id: cursesm.cc,v 1.29 2025/01/25 21:20:17 tom Exp $")
|
||||
|
||||
NCursesMenuItem::~NCursesMenuItem() THROWS(NCursesException)
|
||||
{
|
||||
@@ -100,23 +100,28 @@ _nc_xx_itm_term(MENU *m)
|
||||
ITEM**
|
||||
NCursesMenu::mapItems(NCursesMenuItem* nitems[])
|
||||
{
|
||||
int itemCount = 0,lcv;
|
||||
try {
|
||||
int itemCount = 0,lcv;
|
||||
|
||||
for (lcv=0; nitems[lcv]->item; ++lcv)
|
||||
++itemCount;
|
||||
for (lcv=0; nitems[lcv]->item; ++lcv)
|
||||
++itemCount;
|
||||
|
||||
ITEM** itemArray = new ITEM*[itemCount + 1];
|
||||
ITEM** itemArray = new ITEM*[itemCount + 1];
|
||||
|
||||
for (lcv=0;nitems[lcv]->item;++lcv) {
|
||||
itemArray[lcv] = nitems[lcv]->item;
|
||||
for (lcv=0;nitems[lcv]->item;++lcv) {
|
||||
itemArray[lcv] = nitems[lcv]->item;
|
||||
}
|
||||
itemArray[lcv] = NULL;
|
||||
|
||||
my_items = nitems;
|
||||
|
||||
if (menu)
|
||||
delete[] ::menu_items(menu);
|
||||
return itemArray;
|
||||
}
|
||||
itemArray[lcv] = NULL;
|
||||
|
||||
my_items = nitems;
|
||||
|
||||
if (menu)
|
||||
delete[] ::menu_items(menu);
|
||||
return itemArray;
|
||||
catch (std::bad_alloc const&) {
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -124,51 +129,56 @@ NCursesMenu::InitMenu(NCursesMenuItem* nitems[],
|
||||
bool with_frame,
|
||||
bool autoDelete_Items)
|
||||
{
|
||||
int mrows, mcols;
|
||||
try {
|
||||
int mrows, mcols;
|
||||
|
||||
keypad(TRUE);
|
||||
meta(TRUE);
|
||||
keypad(TRUE);
|
||||
meta(TRUE);
|
||||
|
||||
b_framed = with_frame;
|
||||
b_autoDelete = autoDelete_Items;
|
||||
b_framed = with_frame;
|
||||
b_autoDelete = autoDelete_Items;
|
||||
|
||||
menu = static_cast<MENU*>(0);
|
||||
menu = ::new_menu(mapItems(nitems));
|
||||
if (!menu)
|
||||
menu = static_cast<MENU*>(NULL);
|
||||
menu = ::new_menu(mapItems(nitems));
|
||||
if (!menu)
|
||||
OnError (E_SYSTEM_ERROR);
|
||||
|
||||
UserHook* hook = new UserHook;
|
||||
hook->m_user = NULL;
|
||||
hook->m_back = this;
|
||||
hook->m_owner = menu;
|
||||
::set_menu_userptr(menu, static_cast<void*>(hook));
|
||||
|
||||
::set_menu_init (menu, _nc_xx_mnu_init);
|
||||
::set_menu_term (menu, _nc_xx_mnu_term);
|
||||
::set_item_init (menu, _nc_xx_itm_init);
|
||||
::set_item_term (menu, _nc_xx_itm_term);
|
||||
|
||||
scale(mrows, mcols);
|
||||
::set_menu_win(menu, w);
|
||||
|
||||
if (with_frame) {
|
||||
if ((mrows > height()-2) || (mcols > width()-2))
|
||||
OnError(E_NO_ROOM);
|
||||
sub = new NCursesWindow(*this,mrows,mcols,1,1,'r');
|
||||
::set_menu_sub(menu, sub->w);
|
||||
b_sub_owner = TRUE;
|
||||
}
|
||||
else {
|
||||
sub = static_cast<NCursesWindow*>(NULL);
|
||||
b_sub_owner = FALSE;
|
||||
}
|
||||
setDefaultAttributes();
|
||||
}
|
||||
catch (std::bad_alloc const&) {
|
||||
OnError (E_SYSTEM_ERROR);
|
||||
|
||||
UserHook* hook = new UserHook;
|
||||
hook->m_user = NULL;
|
||||
hook->m_back = this;
|
||||
hook->m_owner = menu;
|
||||
::set_menu_userptr(menu, static_cast<void*>(hook));
|
||||
|
||||
::set_menu_init (menu, _nc_xx_mnu_init);
|
||||
::set_menu_term (menu, _nc_xx_mnu_term);
|
||||
::set_item_init (menu, _nc_xx_itm_init);
|
||||
::set_item_term (menu, _nc_xx_itm_term);
|
||||
|
||||
scale(mrows, mcols);
|
||||
::set_menu_win(menu, w);
|
||||
|
||||
if (with_frame) {
|
||||
if ((mrows > height()-2) || (mcols > width()-2))
|
||||
OnError(E_NO_ROOM);
|
||||
sub = new NCursesWindow(*this,mrows,mcols,1,1,'r');
|
||||
::set_menu_sub(menu, sub->w);
|
||||
b_sub_owner = TRUE;
|
||||
}
|
||||
else {
|
||||
sub = static_cast<NCursesWindow*>(0);
|
||||
b_sub_owner = FALSE;
|
||||
}
|
||||
setDefaultAttributes();
|
||||
}
|
||||
|
||||
void
|
||||
NCursesMenu::setDefaultAttributes()
|
||||
{
|
||||
NCursesApplication* S = NCursesApplication::getApplication();
|
||||
const NCursesApplication* S = NCursesApplication::getApplication();
|
||||
if (S) {
|
||||
::set_menu_fore(menu, S->foregrounds());
|
||||
::set_menu_back(menu, S->backgrounds());
|
||||
@@ -181,14 +191,14 @@ NCursesMenu::~NCursesMenu() THROWS(NCursesException)
|
||||
UserHook* hook = reinterpret_cast<UserHook*>(::menu_userptr(menu));
|
||||
delete hook;
|
||||
if (b_sub_owner) {
|
||||
::set_menu_sub(menu, static_cast<WINDOW *>(0));
|
||||
::set_menu_sub(menu, static_cast<WINDOW *>(NULL));
|
||||
delete sub;
|
||||
}
|
||||
if (menu) {
|
||||
ITEM** itms = ::menu_items(menu);
|
||||
int cnt = count();
|
||||
|
||||
OnError(::set_menu_items(menu, static_cast<ITEM**>(0)));
|
||||
OnError(::set_menu_items(menu, static_cast<ITEM**>(NULL)));
|
||||
|
||||
if (b_autoDelete) {
|
||||
if (cnt>0) {
|
||||
@@ -322,7 +332,7 @@ NCursesMenu::operator()(void)
|
||||
if (drvCmnd == CMD_ACTION) {
|
||||
if (options() & O_ONEVALUE) {
|
||||
NCursesMenuItem* itm = current_item();
|
||||
assert(itm != 0);
|
||||
assert(itm != NULL);
|
||||
if (itm->options() & O_SELECTABLE)
|
||||
{
|
||||
b_action = itm->action();
|
||||
|
||||
+22
-22
@@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2020,2022 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -32,7 +32,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: cursesm.h,v 1.35 2022/08/20 20:52:15 tom Exp $
|
||||
// $Id: cursesm.h,v 1.37 2025/01/25 21:20:17 tom Exp $
|
||||
|
||||
#ifndef NCURSES_CURSESM_H_incl
|
||||
#define NCURSES_CURSESM_H_incl 1
|
||||
@@ -62,9 +62,9 @@ protected:
|
||||
public:
|
||||
NCursesMenuItem (const char* p_name = NULL,
|
||||
const char* p_descript = NULL)
|
||||
: item(0)
|
||||
: item(NULL)
|
||||
{
|
||||
item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0);
|
||||
item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(NULL);
|
||||
if (p_name && !item)
|
||||
OnError (E_SYSTEM_ERROR);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
}
|
||||
|
||||
NCursesMenuItem(const NCursesMenuItem& rhs)
|
||||
: item(0)
|
||||
: item(NULL)
|
||||
{
|
||||
(void) rhs;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
|
||||
NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs)
|
||||
: NCursesMenuItem(rhs),
|
||||
p_fct(0)
|
||||
p_fct(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
// Get the backward pointer to the C++ object from a MENU
|
||||
static inline NCursesMenu* getHook(const MENU *m) {
|
||||
UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m));
|
||||
assert(hook != 0 && hook->m_owner==m);
|
||||
assert(hook != NULL && hook->m_owner==m);
|
||||
return const_cast<NCursesMenu*>(hook->m_back);
|
||||
}
|
||||
|
||||
@@ -240,13 +240,13 @@ protected:
|
||||
// internal routines
|
||||
inline void set_user(void *user) {
|
||||
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
|
||||
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
|
||||
assert (uptr != NULL && uptr->m_back==this && uptr->m_owner==menu);
|
||||
uptr->m_user = user;
|
||||
}
|
||||
|
||||
inline void *get_user() {
|
||||
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
|
||||
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
|
||||
const UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
|
||||
assert (uptr != NULL && uptr->m_back==this && uptr->m_owner==menu);
|
||||
return uptr->m_user;
|
||||
}
|
||||
|
||||
@@ -270,11 +270,11 @@ protected:
|
||||
int begin_x = 0)
|
||||
: NCursesPanel(nlines,ncols,begin_y,begin_x),
|
||||
menu (STATIC_CAST(MENU*)(0)),
|
||||
sub(0),
|
||||
sub(NULL),
|
||||
b_sub_owner(0),
|
||||
b_framed(0),
|
||||
b_autoDelete(0),
|
||||
my_items(0)
|
||||
my_items(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -284,12 +284,12 @@ public:
|
||||
bool with_frame=FALSE, // Reserve space for a frame?
|
||||
bool autoDelete_Items=FALSE) // Autocleanup of Items?
|
||||
: NCursesPanel(),
|
||||
menu(0),
|
||||
sub(0),
|
||||
menu(NULL),
|
||||
sub(NULL),
|
||||
b_sub_owner(0),
|
||||
b_framed(0),
|
||||
b_autoDelete(0),
|
||||
my_items(0)
|
||||
my_items(NULL)
|
||||
{
|
||||
InitMenu(Items, with_frame, autoDelete_Items);
|
||||
}
|
||||
@@ -303,12 +303,12 @@ public:
|
||||
bool with_frame=FALSE, // Reserve space for a frame?
|
||||
bool autoDelete_Items=FALSE) // Autocleanup of Items?
|
||||
: NCursesPanel(nlines, ncols, begin_y, begin_x),
|
||||
menu(0),
|
||||
sub(0),
|
||||
menu(NULL),
|
||||
sub(NULL),
|
||||
b_sub_owner(0),
|
||||
b_framed(0),
|
||||
b_autoDelete(0),
|
||||
my_items(0)
|
||||
my_items(NULL)
|
||||
{
|
||||
InitMenu(Items, with_frame, autoDelete_Items);
|
||||
}
|
||||
@@ -601,7 +601,7 @@ template<class T> class NCURSES_CXX_IMPEXP NCursesUserItem : public NCursesMenuI
|
||||
public:
|
||||
NCursesUserItem (const char* p_name,
|
||||
const char* p_descript = NULL,
|
||||
const T* p_UserData = STATIC_CAST(T*)(0))
|
||||
const T* p_UserData = STATIC_CAST(T*)(NULL))
|
||||
: NCursesMenuItem (p_name, p_descript) {
|
||||
if (item)
|
||||
OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void*>(p_UserData))));
|
||||
@@ -630,7 +630,7 @@ protected:
|
||||
int ncols,
|
||||
int begin_y = 0,
|
||||
int begin_x = 0,
|
||||
const T* p_UserData = STATIC_CAST(T*)(0))
|
||||
const T* p_UserData = STATIC_CAST(T*)(NULL))
|
||||
: NCursesMenu(nlines,ncols,begin_y,begin_x) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
@@ -638,7 +638,7 @@ protected:
|
||||
|
||||
public:
|
||||
NCursesUserMenu (NCursesMenuItem* Items[],
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
const T* p_UserData = STATIC_CAST(T*)(NULL),
|
||||
bool with_frame=FALSE,
|
||||
bool autoDelete_Items=FALSE)
|
||||
: NCursesMenu (Items, with_frame, autoDelete_Items) {
|
||||
@@ -651,7 +651,7 @@ public:
|
||||
int ncols,
|
||||
int begin_y = 0,
|
||||
int begin_x = 0,
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
const T* p_UserData = STATIC_CAST(T*)(NULL),
|
||||
bool with_frame=FALSE)
|
||||
: NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
|
||||
if (menu)
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019,2020 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2003,2005 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -35,9 +35,9 @@
|
||||
#include "internal.h"
|
||||
#include "cursesp.h"
|
||||
|
||||
MODULE_ID("$Id: cursesp.cc,v 1.27 2020/02/02 23:34:34 tom Exp $")
|
||||
MODULE_ID("$Id: cursesp.cc,v 1.29 2025/01/25 21:20:17 tom Exp $")
|
||||
|
||||
NCursesPanel* NCursesPanel::dummy = static_cast<NCursesPanel*>(0);
|
||||
NCursesPanel* NCursesPanel::dummy = static_cast<NCursesPanel*>(NULL);
|
||||
|
||||
void NCursesPanel::init()
|
||||
{
|
||||
@@ -55,7 +55,7 @@ void NCursesPanel::init()
|
||||
NCursesPanel::~NCursesPanel() THROWS(NCursesException)
|
||||
{
|
||||
UserHook* hook = UserPointer();
|
||||
assert(hook != 0 && hook->m_back==this && hook->m_owner==p);
|
||||
assert(hook != NULL && hook->m_back==this && hook->m_owner==p);
|
||||
delete hook;
|
||||
::del_panel(p);
|
||||
::update_panels();
|
||||
@@ -64,7 +64,7 @@ NCursesPanel::~NCursesPanel() THROWS(NCursesException)
|
||||
void
|
||||
NCursesPanel::redraw()
|
||||
{
|
||||
PANEL *pan;
|
||||
const PANEL *pan;
|
||||
|
||||
pan = ::panel_above(NULL);
|
||||
while (pan) {
|
||||
|
||||
+8
-8
@@ -1,7 +1,7 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
// vile:cppmode
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2021,2022 Thomas E. Dickey *
|
||||
* Copyright 2019-2022,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -36,7 +36,7 @@
|
||||
#ifndef NCURSES_CURSESP_H_incl
|
||||
#define NCURSES_CURSESP_H_incl 1
|
||||
|
||||
// $Id: cursesp.h,v 1.36 2022/08/20 20:52:15 tom Exp $
|
||||
// $Id: cursesp.h,v 1.37 2025/01/25 21:20:17 tom Exp $
|
||||
|
||||
#include <cursesw.h>
|
||||
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
void set_user(void *user)
|
||||
{
|
||||
UserHook* uptr = UserPointer();
|
||||
if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) {
|
||||
if (uptr != NULL && uptr->m_back==this && uptr->m_owner==p) {
|
||||
uptr->m_user = user;
|
||||
}
|
||||
}
|
||||
@@ -82,8 +82,8 @@ protected:
|
||||
void *get_user()
|
||||
{
|
||||
UserHook* uptr = UserPointer();
|
||||
void *result = 0;
|
||||
if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p)
|
||||
void *result = NULL;
|
||||
if (uptr != NULL && uptr->m_back==this && uptr->m_owner==p)
|
||||
result = uptr->m_user;
|
||||
return result;
|
||||
}
|
||||
@@ -104,14 +104,14 @@ public:
|
||||
int ncols,
|
||||
int begin_y = 0,
|
||||
int begin_x = 0)
|
||||
: NCursesWindow(nlines,ncols,begin_y,begin_x), p(0)
|
||||
: NCursesWindow(nlines,ncols,begin_y,begin_x), p(NULL)
|
||||
{
|
||||
init();
|
||||
}
|
||||
// Create a panel with this size starting at the requested position.
|
||||
|
||||
NCursesPanel()
|
||||
: NCursesWindow(::stdscr), p(0)
|
||||
: NCursesWindow(::stdscr), p(NULL)
|
||||
{
|
||||
init();
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
// This creates an user panel of the requested size with associated
|
||||
// user data pointed to by p_UserData.
|
||||
|
||||
explicit NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel()
|
||||
explicit NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(NULL)) : NCursesPanel()
|
||||
{
|
||||
if (p)
|
||||
set_user(const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
|
||||
|
||||
+12
-12
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2020 Thomas E. Dickey *
|
||||
* Copyright 2020-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1999-2012,2013 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -36,17 +36,17 @@
|
||||
|
||||
#include <cursesw.h>
|
||||
|
||||
MODULE_ID("$Id: cursespad.cc,v 1.18 2020/02/02 23:34:34 tom Exp $")
|
||||
MODULE_ID("$Id: cursespad.cc,v 1.20 2025/01/25 21:21:05 tom Exp $")
|
||||
|
||||
NCursesPad::NCursesPad(int nlines, int ncols)
|
||||
: NCursesWindow(),
|
||||
viewWin(static_cast<NCursesWindow*>(0)),
|
||||
viewSub(static_cast<NCursesWindow*>(0)),
|
||||
viewWin(static_cast<NCursesWindow*>(NULL)),
|
||||
viewSub(static_cast<NCursesWindow*>(NULL)),
|
||||
h_gridsize(0), v_gridsize(0),
|
||||
min_row(0), min_col(0)
|
||||
{
|
||||
w = ::newpad(nlines, ncols);
|
||||
if (static_cast<WINDOW*>(0) == w) {
|
||||
if (static_cast<WINDOW*>(NULL) == w) {
|
||||
count--;
|
||||
err_handler("Cannot construct window");
|
||||
}
|
||||
@@ -85,7 +85,7 @@ void NCursesPad::operator()(void)
|
||||
{
|
||||
NCursesWindow* W = Win();
|
||||
|
||||
if (static_cast<NCursesWindow*>(0) != W) {
|
||||
if (static_cast<NCursesWindow*>(NULL) != W) {
|
||||
int Width = W->width();
|
||||
int Height = W->height();
|
||||
|
||||
@@ -170,7 +170,7 @@ void NCursesPad::operator()(void)
|
||||
int NCursesPad::refresh()
|
||||
{
|
||||
int res = noutrefresh();
|
||||
if (res==OK && (static_cast<NCursesWindow*>(0) != viewWin)) {
|
||||
if (res==OK && (static_cast<NCursesWindow*>(NULL) != viewWin)) {
|
||||
res = (viewWin->refresh());
|
||||
}
|
||||
return(res);
|
||||
@@ -180,7 +180,7 @@ int NCursesPad::noutrefresh()
|
||||
{
|
||||
int res = OK;
|
||||
NCursesWindow* W = Win();
|
||||
if (static_cast<NCursesWindow*>(0) != W) {
|
||||
if (static_cast<NCursesWindow*>(NULL) != W) {
|
||||
int high = W->maxy();
|
||||
int wide = W->maxx();
|
||||
res = copywin(*W, min_row, min_col,
|
||||
@@ -210,9 +210,9 @@ void NCursesPad::setWindow(NCursesWindow& view,
|
||||
|
||||
void NCursesPad::setSubWindow(NCursesWindow& sub)
|
||||
{
|
||||
if (static_cast<NCursesWindow*>(0) == viewWin)
|
||||
if (static_cast<NCursesWindow*>(NULL) == viewWin)
|
||||
err_handler("Pad has no viewport");
|
||||
assert(viewWin != 0);
|
||||
assert(viewWin != NULL);
|
||||
if (!viewWin->isDescendant(sub))
|
||||
THROW(new NCursesException("NCursesFramePad", E_SYSTEM_ERROR));
|
||||
viewSub = ⊂
|
||||
@@ -221,10 +221,10 @@ void NCursesPad::setSubWindow(NCursesWindow& sub)
|
||||
void NCursesFramedPad::OnOperation(int pad_req)
|
||||
{
|
||||
(void) pad_req;
|
||||
NCursesWindow* W = Win();
|
||||
const NCursesWindow* W = Win();
|
||||
NCursesWindow* W2 = getWindow();
|
||||
|
||||
if ((static_cast<NCursesWindow*>(0) != W) && (static_cast<NCursesWindow*>(0) != W2)) {
|
||||
if ((static_cast<NCursesWindow*>(NULL) != W) && (static_cast<NCursesWindow*>(NULL) != W2)) {
|
||||
int Width = W->width();
|
||||
int Height = W->height();
|
||||
int i, row, col, h_len, v_len;
|
||||
|
||||
+21
-21
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019,2020 Thomas E. Dickey *
|
||||
* Copyright 2019-2020,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "internal.h"
|
||||
#include "cursesw.h"
|
||||
|
||||
MODULE_ID("$Id: cursesw.cc,v 1.56 2020/02/02 23:34:34 tom Exp $")
|
||||
MODULE_ID("$Id: cursesw.cc,v 1.57 2025/01/25 21:21:05 tom Exp $")
|
||||
|
||||
#define COLORS_NEED_INITIALIZATION -1
|
||||
#define COLORS_NOT_INITIALIZED 0
|
||||
@@ -188,27 +188,27 @@ NCursesWindow::constructing()
|
||||
}
|
||||
|
||||
NCursesWindow::NCursesWindow()
|
||||
: w(0), alloced(FALSE), par(0), subwins(0), sib(0)
|
||||
: w(NULL), alloced(FALSE), par(NULL), subwins(NULL), sib(NULL)
|
||||
{
|
||||
constructing();
|
||||
|
||||
w = static_cast<WINDOW *>(0);
|
||||
w = static_cast<WINDOW *>(NULL);
|
||||
}
|
||||
|
||||
NCursesWindow::NCursesWindow(int nlines, int ncols, int begin_y, int begin_x)
|
||||
: w(0), alloced(TRUE), par(0), subwins(0), sib(0)
|
||||
: w(NULL), alloced(TRUE), par(NULL), subwins(NULL), sib(NULL)
|
||||
{
|
||||
constructing();
|
||||
|
||||
w = ::newwin(nlines, ncols, begin_y, begin_x);
|
||||
if (w == 0) {
|
||||
if (w == NULL) {
|
||||
err_handler("Cannot construct window");
|
||||
}
|
||||
set_keyboard();
|
||||
}
|
||||
|
||||
NCursesWindow::NCursesWindow(WINDOW* window)
|
||||
: w(0), alloced(FALSE), par(0), subwins(0), sib(0)
|
||||
: w(NULL), alloced(FALSE), par(NULL), subwins(NULL), sib(NULL)
|
||||
{
|
||||
constructing();
|
||||
|
||||
@@ -223,7 +223,7 @@ NCursesWindow::NCursesWindow(WINDOW* window)
|
||||
|
||||
NCursesWindow::NCursesWindow(NCursesWindow& win, int ny, int nx,
|
||||
int begin_y, int begin_x, char absrel)
|
||||
: w(0), alloced(TRUE), par(0), subwins(0), sib(0)
|
||||
: w(NULL), alloced(TRUE), par(NULL), subwins(NULL), sib(NULL)
|
||||
{
|
||||
constructing();
|
||||
if (absrel == 'a') { // absolute origin
|
||||
@@ -234,7 +234,7 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, int ny, int nx,
|
||||
// Link this window into its parent's list of subwindows.
|
||||
// We use derwin(), since this also works for pads.
|
||||
w = ::derwin(win.w, ny, nx, begin_y, begin_x);
|
||||
if (w == 0) {
|
||||
if (w == NULL) {
|
||||
err_handler("Cannot construct subwindow");
|
||||
}
|
||||
|
||||
@@ -245,20 +245,20 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, int ny, int nx,
|
||||
|
||||
NCursesWindow::NCursesWindow(NCursesWindow& win,
|
||||
bool do_box NCURSES_PARAM_INIT(TRUE))
|
||||
: w(0), alloced(TRUE), par(0), subwins(0), sib(0)
|
||||
: w(NULL), alloced(TRUE), par(NULL), subwins(NULL), sib(NULL)
|
||||
{
|
||||
constructing();
|
||||
int myHeight = win.height();
|
||||
int myWidth = win.width();
|
||||
w = :: derwin(win.w, myHeight - 2, myWidth - 2, 1, 1);
|
||||
if (w == 0) {
|
||||
if (w == NULL) {
|
||||
err_handler("Cannot construct subwindow");
|
||||
}
|
||||
|
||||
par = &win;
|
||||
sib = win.subwins;
|
||||
win.subwins = this;
|
||||
subwins = 0;
|
||||
subwins = NULL;
|
||||
|
||||
if (do_box) {
|
||||
win.box();
|
||||
@@ -283,7 +283,7 @@ static int r_init_idx = 0;
|
||||
static RIPOFFINIT* prip = R_INIT;
|
||||
|
||||
NCursesWindow::NCursesWindow(WINDOW *win, int ncols)
|
||||
: w(0), alloced(FALSE), par(0), subwins(0), sib(0)
|
||||
: w(NULL), alloced(FALSE), par(NULL), subwins(NULL), sib(NULL)
|
||||
{
|
||||
(void) ncols;
|
||||
initialize();
|
||||
@@ -331,12 +331,12 @@ NCursesWindow::kill_subwindows()
|
||||
{
|
||||
NCursesWindow* p = subwins;
|
||||
|
||||
subwins = 0;
|
||||
while (p != 0) {
|
||||
subwins = NULL;
|
||||
while (p != NULL) {
|
||||
NCursesWindow* q = p->sib;
|
||||
p->kill_subwindows();
|
||||
if (p->alloced) {
|
||||
if (p->w != 0)
|
||||
if (p->w != NULL)
|
||||
::delwin(p->w);
|
||||
}
|
||||
delete p;
|
||||
@@ -349,13 +349,13 @@ NCursesWindow::~NCursesWindow() THROWS(NCursesException)
|
||||
{
|
||||
kill_subwindows();
|
||||
|
||||
if (par != 0) {
|
||||
if (par != NULL) {
|
||||
// Remove this window from the parent's list of subwindows.
|
||||
NCursesWindow * next = par->subwins;
|
||||
NCursesWindow * prev = 0;
|
||||
while (next != 0) {
|
||||
NCursesWindow * prev = NULL;
|
||||
while (next != NULL) {
|
||||
if (next == this) {
|
||||
if (prev != 0) {
|
||||
if (prev != NULL) {
|
||||
prev->sib = next->sib;
|
||||
} else {
|
||||
par->subwins = next->sib;
|
||||
@@ -367,7 +367,7 @@ NCursesWindow::~NCursesWindow() THROWS(NCursesException)
|
||||
}
|
||||
}
|
||||
|
||||
if (alloced && w != 0)
|
||||
if (alloced && w != NULL)
|
||||
::delwin(w);
|
||||
|
||||
if (alloced) {
|
||||
|
||||
+4
-6
@@ -1,7 +1,7 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
// vile:cppmode
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2021,2022 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -32,11 +32,9 @@
|
||||
#ifndef NCURSES_CURSESW_H_incl
|
||||
#define NCURSES_CURSESW_H_incl 1
|
||||
|
||||
// $Id: cursesw.h,v 1.59 2022/08/20 20:52:15 tom Exp $
|
||||
// $Id: cursesw.h,v 1.62 2025/01/25 21:21:05 tom Exp $
|
||||
|
||||
extern "C" {
|
||||
# include <curses.h>
|
||||
}
|
||||
#include <curses.h>
|
||||
|
||||
#if defined(BUILDING_NCURSES_CXX)
|
||||
# define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
|
||||
@@ -1441,7 +1439,7 @@ protected:
|
||||
|
||||
NCursesWindow* Win(void) const {
|
||||
// Get the window into which the pad should be copied (if any)
|
||||
return (viewSub?viewSub:(viewWin?viewWin:0));
|
||||
return (viewSub?viewSub:(viewWin?viewWin:NULL));
|
||||
}
|
||||
|
||||
NCursesWindow* getWindow(void) const {
|
||||
|
||||
+7
-8
@@ -1,6 +1,6 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2022,2023 Thomas E. Dickey *
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 1998-2005,2012 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -33,13 +33,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "internal.h"
|
||||
#include "cursslk.h"
|
||||
#include "cursesapp.h"
|
||||
|
||||
MODULE_ID("$Id: cursslk.cc,v 1.21 2023/02/25 23:36:06 tom Exp $")
|
||||
MODULE_ID("$Id: cursslk.cc,v 1.23 2024/10/05 19:36:22 tom Exp $")
|
||||
|
||||
Soft_Label_Key_Set::Soft_Label_Key&
|
||||
Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text)
|
||||
Soft_Label_Key_Set::Soft_Label_Key::operator=(const char *text)
|
||||
{
|
||||
delete[] label;
|
||||
size_t need = 1 + ::strlen(text);
|
||||
@@ -112,11 +111,11 @@ int Soft_Label_Key_Set::labels() const {
|
||||
|
||||
void Soft_Label_Key_Set::activate_label(int i, bool bf) {
|
||||
if (!b_attrInit) {
|
||||
NCursesApplication* A = NCursesApplication::getApplication();
|
||||
const NCursesApplication* A = NCursesApplication::getApplication();
|
||||
if (A) attrset(A->labels());
|
||||
b_attrInit = TRUE;
|
||||
}
|
||||
Soft_Label_Key& K = (*this)[i];
|
||||
const Soft_Label_Key& K = (*this)[i];
|
||||
if (ERR==::slk_set(K.num,bf?K.label:"",K.format))
|
||||
Error("slk_set");
|
||||
noutrefresh();
|
||||
@@ -125,12 +124,12 @@ void Soft_Label_Key_Set::activate_label(int i, bool bf) {
|
||||
void Soft_Label_Key_Set::activate_labels(bool bf)
|
||||
{
|
||||
if (!b_attrInit) {
|
||||
NCursesApplication* A = NCursesApplication::getApplication();
|
||||
const NCursesApplication* A = NCursesApplication::getApplication();
|
||||
if (A) attrset(A->labels());
|
||||
b_attrInit = TRUE;
|
||||
}
|
||||
for(int i=1; i <= num_labels; i++) {
|
||||
Soft_Label_Key& K = (*this)[i];
|
||||
const Soft_Label_Key& K = (*this)[i];
|
||||
if (ERR==::slk_set(K.num,bf?K.label:"",K.format))
|
||||
Error("slk_set");
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
// * this is for making emacs happy: -*-Mode: C++;-*-
|
||||
// vile:cppmode
|
||||
/****************************************************************************
|
||||
* Copyright 2019-2020,2021 Thomas E. Dickey *
|
||||
* Copyright 2019-2021,2024 Thomas E. Dickey *
|
||||
* Copyright 1998-2003,2005 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -33,7 +33,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: cursslk.h,v 1.19 2021/04/17 18:11:08 tom Exp $
|
||||
// $Id: cursslk.h,v 1.20 2024/10/05 22:47:12 tom Exp $
|
||||
|
||||
#ifndef NCURSES_CURSSLK_H_incl
|
||||
#define NCURSES_CURSSLK_H_incl
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
public:
|
||||
// Set the text of the Label
|
||||
Soft_Label_Key& operator=(char *text);
|
||||
Soft_Label_Key& operator=(const char *text);
|
||||
|
||||
// Set the Justification of the Label
|
||||
Soft_Label_Key& operator=(Justification just) {
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2018-2021,2023 Thomas E. Dickey *
|
||||
* Copyright 2018-2023,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -36,7 +36,7 @@
|
||||
* Demo code for NCursesMenu and NCursesForm written by
|
||||
* Juergen Pfeifer
|
||||
*
|
||||
* $Id: demo.cc,v 1.52 2023/08/26 19:14:14 tom Exp $
|
||||
* $Id: demo.cc,v 1.53 2025/01/25 21:21:05 tom Exp $
|
||||
*/
|
||||
|
||||
#include "internal.h"
|
||||
@@ -174,7 +174,7 @@ template<class T> class NCURSES_CXX_IMPEXP MyAction : public NCursesUserItem<Use
|
||||
public:
|
||||
MyAction (const char* p_name,
|
||||
const T* p_UserData)
|
||||
: NCursesUserItem<T>(p_name, static_cast<const char*>(0), p_UserData)
|
||||
: NCursesUserItem<T>(p_name, static_cast<const char*>(NULL), p_UserData)
|
||||
{}
|
||||
|
||||
virtual ~MyAction() THROWS(NCursesException) {}
|
||||
@@ -244,10 +244,10 @@ private:
|
||||
public:
|
||||
TestForm()
|
||||
: NCursesForm(13, 51, (lines() - 15)/2, (cols() - 53)/2),
|
||||
F(0),
|
||||
mft(0),
|
||||
ift(0),
|
||||
eft(0)
|
||||
F(NULL),
|
||||
mft(NULL),
|
||||
ift(NULL),
|
||||
eft(NULL)
|
||||
{
|
||||
|
||||
F = new NCursesFormField*[10];
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
}
|
||||
|
||||
TestForm(const TestForm& rhs)
|
||||
: NCursesForm(rhs), F(0), mft(0), ift(0), eft(0)
|
||||
: NCursesForm(rhs), F(NULL), mft(NULL), ift(NULL), eft(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ private:
|
||||
public:
|
||||
MyMenu ()
|
||||
: NCursesMenu (n_items+2, 8, (lines()-10)/2, (cols()-10)/2),
|
||||
P(0), I(0), u(0)
|
||||
P(NULL), I(NULL), u(NULL)
|
||||
{
|
||||
u = new UserData(1);
|
||||
I = new NCursesMenuItem*[1+n_items];
|
||||
@@ -467,7 +467,7 @@ public:
|
||||
}
|
||||
|
||||
MyMenu(const MyMenu& rhs)
|
||||
: NCursesMenu(rhs), P(0), I(0), u(0)
|
||||
: NCursesMenu(rhs), P(NULL), I(NULL), u(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# $Id: edit_cfg.sh,v 1.19 2022/07/16 18:00:59 tom Exp $
|
||||
# $Id: edit_cfg.sh,v 1.20 2025/02/02 00:38:39 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2020,2022 Thomas E. Dickey #
|
||||
# Copyright 2020-2022,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2007,2008 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -46,7 +46,9 @@ for name in \
|
||||
HAVE_BUILTIN_H \
|
||||
HAVE_GPP_BUILTIN_H \
|
||||
HAVE_GXX_BUILTIN_H \
|
||||
HAVE_EXCEPTION \
|
||||
HAVE_IOSTREAM \
|
||||
HAVE_NEW \
|
||||
HAVE_TYPEINFO \
|
||||
HAVE_VALUES_H \
|
||||
IOSTREAM_NAMESPACE
|
||||
|
||||
+32
-9
@@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2018-2021,2022 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -32,7 +32,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: etip.h.in,v 1.50 2022/08/20 20:50:00 tom Exp $
|
||||
// $Id: etip.h.in,v 1.55 2025/02/08 23:39:52 tom Exp $
|
||||
|
||||
#ifndef NCURSES_ETIP_H_incl
|
||||
#define NCURSES_ETIP_H_incl 1
|
||||
@@ -42,6 +42,10 @@
|
||||
#define HAVE_BUILTIN_H 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EXCEPTION
|
||||
#define HAVE_EXCEPTION 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GXX_BUILTIN_H
|
||||
#define HAVE_GXX_BUILTIN_H 0
|
||||
#endif
|
||||
@@ -54,6 +58,10 @@
|
||||
#define HAVE_IOSTREAM 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NEW
|
||||
#define HAVE_NEW 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_TYPEINFO
|
||||
#define HAVE_TYPEINFO 0
|
||||
#endif
|
||||
@@ -94,6 +102,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
|
||||
#if defined(__GNUG__)
|
||||
# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H
|
||||
# if ETIP_NEEDS_MATH_H
|
||||
@@ -118,7 +128,16 @@
|
||||
# include <generic.h>
|
||||
#endif
|
||||
|
||||
#include <curses.h>
|
||||
#if HAVE_EXCEPTION
|
||||
# include <exception>
|
||||
#endif
|
||||
#if HAVE_NEW
|
||||
# include <new>
|
||||
#endif
|
||||
|
||||
// This used to include <curses.h>, but Apple's configuration as of 2024
|
||||
// provides only a broken version of ncurses's header, which interferes
|
||||
// with the configure script.
|
||||
|
||||
extern "C" {
|
||||
#if HAVE_VALUES_H
|
||||
@@ -128,6 +147,10 @@ extern "C" {
|
||||
#include <assert.h>
|
||||
#include <eti.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef HAVE_CONFIG_H
|
||||
int endwin(void); // needed for the configure check
|
||||
#endif
|
||||
}
|
||||
|
||||
// Language features
|
||||
@@ -200,7 +223,7 @@ public:
|
||||
|
||||
NCursesPanelException (const char *msg, int err) :
|
||||
NCursesException (msg, err),
|
||||
p (0)
|
||||
p (NULL)
|
||||
{};
|
||||
|
||||
NCursesPanelException (const NCursesPanel* panel,
|
||||
@@ -212,7 +235,7 @@ public:
|
||||
|
||||
explicit NCursesPanelException (int err) :
|
||||
NCursesException ("panel library error", err),
|
||||
p (0)
|
||||
p (NULL)
|
||||
{};
|
||||
|
||||
NCursesPanelException (const NCursesPanel* panel,
|
||||
@@ -251,7 +274,7 @@ public:
|
||||
|
||||
NCursesMenuException (const char *msg, int err) :
|
||||
NCursesException (msg, err),
|
||||
m (0)
|
||||
m (NULL)
|
||||
{};
|
||||
|
||||
NCursesMenuException (const NCursesMenu* menu,
|
||||
@@ -263,7 +286,7 @@ public:
|
||||
|
||||
explicit NCursesMenuException (int err) :
|
||||
NCursesException ("menu library error", err),
|
||||
m (0)
|
||||
m (NULL)
|
||||
{};
|
||||
|
||||
NCursesMenuException (const NCursesMenu* menu,
|
||||
@@ -302,7 +325,7 @@ public:
|
||||
|
||||
NCursesFormException (const char *msg, int err) :
|
||||
NCursesException (msg, err),
|
||||
f (0)
|
||||
f (NULL)
|
||||
{};
|
||||
|
||||
NCursesFormException (const NCursesForm* form,
|
||||
@@ -314,7 +337,7 @@ public:
|
||||
|
||||
explicit NCursesFormException (int err) :
|
||||
NCursesException ("form library error", err),
|
||||
f (0)
|
||||
f (NULL)
|
||||
{};
|
||||
|
||||
NCursesFormException (const NCursesForm* form,
|
||||
|
||||
+2
-6
@@ -1,6 +1,6 @@
|
||||
// * This makes emacs happy -*-Mode: C++;-*-
|
||||
/****************************************************************************
|
||||
* Copyright 2018,2020 Thomas E. Dickey *
|
||||
* Copyright 2018-2020,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2008,2012 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -32,7 +32,7 @@
|
||||
* Author: Juergen Pfeifer, 1997 *
|
||||
****************************************************************************/
|
||||
|
||||
// $Id: internal.h,v 1.22 2020/08/29 23:06:41 tom Exp $
|
||||
// $Id: internal.h,v 1.23 2025/08/09 10:43:32 tom Exp $
|
||||
|
||||
#ifndef NCURSES_CPLUS_INTERNAL_H
|
||||
#define NCURSES_CPLUS_INTERNAL_H 1
|
||||
@@ -46,11 +46,7 @@
|
||||
#endif
|
||||
|
||||
#if (defined(_WIN32) || defined(_WIN64))
|
||||
#if defined(EXP_WIN32_DRIVER)
|
||||
#include <nc_win32.h>
|
||||
#else
|
||||
#include <nc_mingw.h>
|
||||
#endif
|
||||
#undef KEY_EVENT
|
||||
#endif
|
||||
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
# Program modules
|
||||
# $Id: modules,v 1.12 2020/02/02 23:34:34 tom Exp $
|
||||
# $Id: modules,v 1.13 2024/06/15 21:07:41 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright 2020 Thomas E. Dickey #
|
||||
# Copyright 2020,2024 Thomas E. Dickey #
|
||||
# Copyright 1998-2006,2013 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -33,13 +33,13 @@
|
||||
#
|
||||
|
||||
@ base
|
||||
cursesf c++ $(srcdir) $(internal_h) $(cursesf_h) $(cursesapp_h)
|
||||
cursesm c++ $(srcdir) $(internal_h) $(cursesm_h) $(cursesapp_h)
|
||||
cursesw c++ $(srcdir) $(internal_h) $(cursesw_h)
|
||||
cursespad c++ $(srcdir) $(internal_h) $(cursesw_h)
|
||||
cursesp c++ $(srcdir) $(internal_h) $(cursesp_h)
|
||||
cursslk c++ $(srcdir) $(internal_h) $(cursesapp_h)
|
||||
cursesapp c++ $(srcdir) $(internal_h) $(cursesapp_h)
|
||||
cursesmain c++ $(srcdir) $(internal_h) $(cursesapp_h) $(INCDIR)/nc_alloc.h
|
||||
cursesf c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesf_h) $(cursesapp_h)
|
||||
cursesm c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesm_h) $(cursesapp_h)
|
||||
cursesw c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesw_h)
|
||||
cursespad c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesw_h)
|
||||
cursesp c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesp_h)
|
||||
cursslk c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesapp_h)
|
||||
cursesapp c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesapp_h)
|
||||
cursesmain c++ $(srcdir) $(HEADER_DEPS) $(internal_h) $(cursesapp_h) $(INCDIR)/nc_alloc.h
|
||||
|
||||
# vile:makemode
|
||||
|
||||
Vendored
+16
-10
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright 1992-2023 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2025 Free Software Foundation, Inc.
|
||||
|
||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||
|
||||
timestamp='2023-10-19'
|
||||
timestamp='2025-07-10'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -60,7 +60,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright 1992-2023 Free Software Foundation, Inc.
|
||||
Copyright 1992-2025 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -123,7 +123,7 @@ set_cc_for_build() {
|
||||
dummy=$tmp/dummy
|
||||
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
|
||||
,,) echo "int x;" > "$dummy.c"
|
||||
for driver in cc gcc c89 c99 ; do
|
||||
for driver in cc gcc c17 c99 c89 ; do
|
||||
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD=$driver
|
||||
break
|
||||
@@ -634,7 +634,8 @@ EOF
|
||||
sed 's/^ //' << EOF > "$dummy.c"
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
@@ -718,7 +719,8 @@ EOF
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main ()
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
@@ -1595,8 +1597,11 @@ EOF
|
||||
*:Unleashed:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
|
||||
;;
|
||||
*:Ironclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad
|
||||
x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
|
||||
;;
|
||||
*:[Ii]ronclad:*:*)
|
||||
GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1621,6 +1626,7 @@ cat > "$dummy.c" <<EOF
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
@@ -1805,8 +1811,8 @@ fi
|
||||
exit 1
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "timestamp='"
|
||||
# time-stamp-format: "%:y-%02m-%02d"
|
||||
# time-stamp-format: "%Y-%02m-%02d"
|
||||
# time-stamp-end: "'"
|
||||
# End:
|
||||
|
||||
Vendored
+571
-178
File diff suppressed because it is too large
Load Diff
+178
-140
@@ -1,5 +1,5 @@
|
||||
dnl***************************************************************************
|
||||
dnl Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
dnl Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
dnl Copyright 1998-2017,2018 Free Software Foundation, Inc. *
|
||||
dnl *
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -29,7 +29,7 @@ dnl***************************************************************************
|
||||
dnl
|
||||
dnl Author: Thomas E. Dickey 1995-on
|
||||
dnl
|
||||
dnl $Id: configure.in,v 1.779 2024/04/10 08:04:00 tom Exp $
|
||||
dnl $Id: configure.in,v 1.824 2025/12/27 00:12:13 tom Exp $
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl For additional information, see
|
||||
@@ -38,9 +38,10 @@ dnl https://invisible-island.net/autoconf/my-autoconf.html
|
||||
dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_PREREQ(2.52.20210101)
|
||||
AC_REVISION($Revision: 1.779 $)
|
||||
AC_INIT(ncurses/base/lib_initscr.c)
|
||||
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
|
||||
AC_REVISION($Revision: 1.824 $)
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([ncurses/base/lib_initscr.c])
|
||||
AC_CONFIG_HEADERS([include/ncurses_cfg.h:include/ncurses_cfg.hin])
|
||||
|
||||
AC_DEFUN([AC_PATH_XTRA],[])dnl ignore dependencies on this
|
||||
|
||||
@@ -65,19 +66,7 @@ CF_ABI_DEFAULTS
|
||||
CF_WITH_ABI_ALTERED
|
||||
|
||||
### Checks for programs.
|
||||
AC_ARG_WITH(ada,
|
||||
[ --without-ada suppress check for Ada compiler, don't build demo],
|
||||
[cf_with_ada=$withval],
|
||||
[cf_with_ada=yes])
|
||||
|
||||
if test "x$cf_with_ada" = xyes
|
||||
then
|
||||
cf_prog_cc="gnatgcc gcc cc"
|
||||
else
|
||||
cf_prog_cc="gcc cc"
|
||||
fi
|
||||
CF_PROG_CC($cf_prog_cc)
|
||||
|
||||
CF_WITH_ADA
|
||||
AC_PROG_CPP
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
CF_PROG_CC_C_O(CC,[$CFLAGS $CPPFLAGS])
|
||||
@@ -114,13 +103,13 @@ else
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
eval cf_includedir=${includedir}
|
||||
CPPFLAGS="$CPPFLAGS -I${cf_includedir}"
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
],
|
||||
[
|
||||
printf("Hello world!\n")
|
||||
],
|
||||
])],
|
||||
[cf_cxx_works=yes],
|
||||
[cf_cxx_works=no])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
@@ -268,7 +257,6 @@ fi
|
||||
AC_PROG_MAKE_SET
|
||||
CF_MAKE_PHONY
|
||||
CF_MAKE_TAGS
|
||||
CF_MAKEFLAGS
|
||||
|
||||
dnl These are standard among *NIX systems, but not when cross-compiling
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, ':')
|
||||
@@ -277,20 +265,7 @@ AC_CHECK_TOOL(AR, ar, ar)
|
||||
AC_CHECK_TOOL(NM, nm, nm)
|
||||
CF_AR_FLAGS
|
||||
|
||||
dnl Special option for use by system-builders: the install-prefix is used to
|
||||
dnl adjust the location into which the actual install is done, so that an
|
||||
dnl archive can be built without modifying the host system's configuration.
|
||||
AC_MSG_CHECKING(for an installation directory prefix)
|
||||
AC_ARG_WITH(install-prefix,
|
||||
[ --with-install-prefix=DESTDIR use DESTDIR as installation directory prefix],
|
||||
[case "x$withval" in
|
||||
(xyes|xno)
|
||||
;;
|
||||
(*) DESTDIR="$withval"
|
||||
;;
|
||||
esac])
|
||||
AC_MSG_RESULT([${DESTDIR:-(none)}])
|
||||
AC_SUBST(DESTDIR)
|
||||
CF_INSTALL_PREFIX
|
||||
|
||||
###############################################################################
|
||||
CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
|
||||
@@ -474,13 +449,13 @@ for model in $cf_list_models ; do
|
||||
;;
|
||||
(shared)
|
||||
if test "$CC_SHARED_OPTS" = "unknown"; then
|
||||
AC_ERROR(Shared libraries are not supported in this version)
|
||||
AC_MSG_ERROR(Shared libraries are not supported in this version)
|
||||
fi
|
||||
# workaround for inept transition to PIE vs PIC...
|
||||
AC_MSG_CHECKING(if current CFLAGS link properly)
|
||||
AC_TRY_LINK(
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
||||
[#include <stdio.h>],
|
||||
[printf("Hello work\\n");],
|
||||
[printf("Hello work\\n");])],
|
||||
[cf_cflags_work=yes],
|
||||
[cf_cflags_work=no])
|
||||
AC_MSG_RESULT($cf_cflags_work)
|
||||
@@ -683,42 +658,7 @@ AC_MSG_RESULT($with_xterm_new)
|
||||
WHICH_XTERM=$with_xterm_new
|
||||
AC_SUBST(WHICH_XTERM)
|
||||
|
||||
case $host_os in
|
||||
(*linux-gnu|*cygwin|*mingw32|*msys)
|
||||
want_xterm_kbs=DEL
|
||||
;;
|
||||
(*)
|
||||
want_xterm_kbs=BS
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(if xterm backspace sends BS or DEL)
|
||||
AC_ARG_WITH(xterm-kbs,
|
||||
[[ --with-xterm-kbs[=XXX] specify if xterm backspace sends BS or DEL]],
|
||||
[with_xterm_kbs=$withval],
|
||||
[with_xterm_kbs=auto])
|
||||
case x$with_xterm_kbs in
|
||||
(xyes|xno|xBS|xbs|x8)
|
||||
with_xterm_kbs=BS
|
||||
;;
|
||||
(xDEL|xdel|x127)
|
||||
with_xterm_kbs=DEL
|
||||
;;
|
||||
(xauto)
|
||||
with_xterm_kbs=$want_xterm_kbs
|
||||
;;
|
||||
(*)
|
||||
with_xterm_kbs=$withval
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($with_xterm_kbs)
|
||||
XTERM_KBS=$with_xterm_kbs
|
||||
AC_SUBST(XTERM_KBS)
|
||||
|
||||
if test "x$with_xterm_kbs" != "x$want_xterm_kbs"
|
||||
then
|
||||
AC_MSG_WARN([expected --with-xterm-kbs=$want_xterm_kbs for $host_os, have $with_xterm_kbs])
|
||||
fi
|
||||
CF_WITH_XTERM_KBS
|
||||
|
||||
MAKE_TERMINFO=
|
||||
if test "$use_database" = no ; then
|
||||
@@ -804,14 +744,14 @@ NCURSES_USE_TERMCAP=0
|
||||
if test "x$with_termcap" != "xyes" ; then
|
||||
if test "$use_database" = no ; then
|
||||
if test -z "$with_fallback" ; then
|
||||
AC_ERROR(You have disabled the database w/o specifying fallbacks)
|
||||
AC_MSG_ERROR(You have disabled the database w/o specifying fallbacks)
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE(PURE_TERMINFO,1,[Define to 1 if we should support only terminfo])
|
||||
else
|
||||
|
||||
if test "$with_ticlib" != no ; then
|
||||
AC_ERROR(Options --with-ticlib and --enable-termcap cannot be combined)
|
||||
AC_MSG_ERROR(Options --with-ticlib and --enable-termcap cannot be combined)
|
||||
fi
|
||||
|
||||
NCURSES_USE_TERMCAP=1
|
||||
@@ -852,6 +792,10 @@ AC_ARG_ENABLE(home-terminfo,
|
||||
AC_MSG_RESULT($with_home_terminfo)
|
||||
test "x$with_home_terminfo" = "xyes" && AC_DEFINE(USE_HOME_TERMINFO,1,[Define to 1 if $HOME/.terminfo feature is wanted])
|
||||
|
||||
CF_CHECK_MULTIUSER
|
||||
|
||||
if test "$cf_cv_multiuser" = yes; then
|
||||
|
||||
AC_MSG_CHECKING(if you want to permit root to use ncurses environment variables)
|
||||
AC_ARG_ENABLE(root-environ,
|
||||
[ --disable-root-environ restrict root use of ncurses environment variables],
|
||||
@@ -876,6 +820,14 @@ AC_ARG_ENABLE(setuid-environ,
|
||||
AC_MSG_RESULT($with_setuid_environ)
|
||||
test "x$with_setuid_environ" = xyes && AC_DEFINE(USE_SETUID_ENVIRON,1,[Define to 1 if setuid/setgid application is allowed to use ncurses environment])
|
||||
|
||||
else
|
||||
if test -n "$enable_root_environ$enable_root_access$enable_setuid_environ"
|
||||
then
|
||||
AC_MSG_WARN(ignoring options used only for multiuser systems)
|
||||
fi
|
||||
|
||||
fi # cf_cv_multiuser
|
||||
|
||||
### Use option --enable-symlinks to make tic use symlinks, not hard links
|
||||
### to reduce storage requirements for the terminfo database.
|
||||
CF_LINK_FUNCS
|
||||
@@ -977,7 +929,7 @@ if test "x$with_widec" = xyes ; then
|
||||
|
||||
# with_overwrite=no
|
||||
NCURSES_CH_T=cchar_t
|
||||
AC_CHECK_FUNCS(putwc btowc wctob wmemchr mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
|
||||
AC_CHECK_FUNCS(putwc btowc wctob wmemchr mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs wcwidth)
|
||||
if test "x$ac_cv_func_putwc" != xyes ; then
|
||||
CF_UTF8_LIB
|
||||
if test "$cf_cv_utf8_lib" != no ; then
|
||||
@@ -1097,6 +1049,12 @@ CF_WITH_TYPE(mmask-t,
|
||||
NCURSES_MMASK_T,
|
||||
$cf_dft_mmask_t)
|
||||
|
||||
### option --enable-lp64 can give unexpected results
|
||||
if test "$cf_cv_enable_lp64" = 1 ; then
|
||||
test -n "$with_chtype" && test "$NCURSES_CHTYPE" != unsigned && AC_MSG_WARN(option --enable-lp64 overrides --with-chtype)
|
||||
test -n "$with_mmask_t" && test "$NCURSES_MMASK_T" != unsigned && AC_MSG_WARN(option --enable-lp64 overrides --with-mmask-t)
|
||||
fi
|
||||
|
||||
### use option --with-ccharw-max to override CCHARW_MAX size
|
||||
AC_MSG_CHECKING(for size CCHARW_MAX)
|
||||
AC_ARG_WITH(ccharw-max,
|
||||
@@ -1136,9 +1094,6 @@ AC_ARG_WITH(rcs-ids,
|
||||
AC_MSG_RESULT($with_rcs_ids)
|
||||
test "x$with_rcs_ids" = xyes && AC_DEFINE(USE_RCS_IDS,1,[Define to 1 to compile-in RCS identifiers])
|
||||
|
||||
###############################################################################
|
||||
CF_MAN_PAGES([ captoinfo clear infocmp infotocap reset tabs tic toe tput tset ])
|
||||
|
||||
###############################################################################
|
||||
CF_HELP_MESSAGE(Extensions:)
|
||||
|
||||
@@ -1163,8 +1118,9 @@ if test "x$with_ext_funcs" = xyes ; then
|
||||
AC_DEFINE(HAVE_USE_WINDOW,1,[Define to 1 to enable use_window() function in test-programs])
|
||||
AC_DEFINE(HAVE_WRESIZE,1,[Define to 1 to enable wresize() function in test-programs])
|
||||
GENERATED_EXT_FUNCS=generated
|
||||
test "x$with_ext_funcs" = xyes || cf_dft_ext_spfuncs=no
|
||||
else
|
||||
cf_dft_ext_spfuncs=no
|
||||
cf_dft_ext_colors=no
|
||||
NCURSES_EXT_FUNCS=0
|
||||
GENERATED_EXT_FUNCS=
|
||||
fi
|
||||
@@ -1189,11 +1145,20 @@ fi
|
||||
AC_SUBST(NCURSES_SP_FUNCS)
|
||||
AC_SUBST(GENERATED_SP_FUNCS)
|
||||
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*|*-msvc*)
|
||||
cf_dft_term_driver=yes
|
||||
;;
|
||||
(*)
|
||||
cf_dft_term_driver=no
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(if you want to build with terminal-driver)
|
||||
AC_ARG_ENABLE(term-driver,
|
||||
[ --enable-term-driver enable terminal-driver],
|
||||
[with_term_driver=$enableval],
|
||||
[with_term_driver=no])
|
||||
[with_term_driver=$cf_dft_term_driver])
|
||||
AC_MSG_RESULT($with_term_driver)
|
||||
if test "x$with_term_driver" = xyes ; then
|
||||
AC_DEFINE(USE_TERM_DRIVER,1,[Define to 1 to enable terminal-driver])
|
||||
@@ -1219,13 +1184,14 @@ fi
|
||||
AC_SUBST(NCURSES_CONST)
|
||||
|
||||
### use option --enable-ext-colors to turn on use of colors beyond 16.
|
||||
NCURSES_EXT_COLORS=0
|
||||
NCURSES_RGB_COLORS=0
|
||||
AC_MSG_CHECKING(if you want to use extended colors)
|
||||
AC_ARG_ENABLE(ext-colors,
|
||||
[ --enable-ext-colors compile for 256-color support],
|
||||
[with_ext_colors=$enableval],
|
||||
[with_ext_colors=$cf_dft_ext_colors])
|
||||
AC_MSG_RESULT($with_ext_colors)
|
||||
NCURSES_EXT_COLORS=0
|
||||
if test "x$with_ext_colors" = xyes ; then
|
||||
if test "x$with_widec" != xyes ; then
|
||||
AC_MSG_WARN(This option applies only to wide-character library)
|
||||
@@ -1238,8 +1204,20 @@ if test "x$with_ext_colors" = xyes ; then
|
||||
AC_DEFINE(HAVE_INIT_EXTENDED_COLOR,1,[Define to 1 to enable init_extended_color() function in test-programs])
|
||||
AC_DEFINE(HAVE_RESET_COLOR_PAIRS,1,[Define to 1 to enable reset_color_pairs() function in test-programs])
|
||||
fi
|
||||
### use option --enable-rgb-color to extend support for direct-color
|
||||
AC_MSG_CHECKING(if you want to extend support for direct color)
|
||||
AC_ARG_ENABLE(rgb-color,
|
||||
[ --enable-rgb-color compile for extended direct-color],
|
||||
[with_rgb_color=$enableval],
|
||||
[with_rgb_color=$cf_dft_rgb_color])
|
||||
AC_MSG_RESULT($with_rgb_color)
|
||||
if test "x$with_rgb_color" = xyes ; then
|
||||
NCURSES_RGB_COLORS=1
|
||||
AC_DEFINE(NCURSES_RGB_COLORS,1,[Define to 1 to compile for extended direct-color support])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(NCURSES_EXT_COLORS)
|
||||
AC_SUBST(NCURSES_RGB_COLORS)
|
||||
|
||||
### use option --enable-ext-mouse to modify coding to support 5-button mice
|
||||
AC_MSG_CHECKING(if you want to use extended mouse encoding)
|
||||
@@ -1311,6 +1289,44 @@ if test "x$with_tcap_names" = xyes; then
|
||||
fi
|
||||
AC_SUBST(NCURSES_XNAMES)
|
||||
|
||||
##############################################################################
|
||||
|
||||
USE_NAMED_PIPES=0
|
||||
INTERNALS_HDR=
|
||||
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*|*-msvc*)
|
||||
CF_CHECK_NAMED_PIPES
|
||||
if test "$cf_cv_named_pipes" = yes; then
|
||||
AC_MSG_CHECKING(if you want to use named pipes with -Windows driver)
|
||||
AC_ARG_ENABLE(named-pipes,
|
||||
[ --enable-named-pipes use named pipes with Windows driver],
|
||||
[with_named_pipes=$enableval],
|
||||
[with_named_pipes=no])
|
||||
AC_MSG_RESULT($with_named_pipes)
|
||||
else
|
||||
with_named_pipes=no
|
||||
fi
|
||||
if test "x$with_named_pipes" = xyes
|
||||
then
|
||||
AC_DEFINE(USE_NAMED_PIPES,1,[Define to 1 to use named pipes with win32 driver])
|
||||
USE_NAMED_PIPES=1
|
||||
fi
|
||||
INTERNALS_HDR='../include/nc_win32.h'
|
||||
# MinGW32 sets $WD to its directory.
|
||||
if test -n "$WD"
|
||||
then
|
||||
if test -d "$WD"
|
||||
then
|
||||
AC_DEFINE(USE_DOS_PATHS,1,[Define to 1 to use DOS pathnames internally])
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(USE_NAMED_PIPES)
|
||||
AC_SUBST(INTERNALS_HDR)
|
||||
|
||||
##############################################################################
|
||||
CF_HELP_MESSAGE(Reentrant Code:)
|
||||
CF_WITH_PTHREAD
|
||||
@@ -1588,6 +1604,11 @@ AC_MSG_RESULT($with_scroll_hints)
|
||||
test "x$with_scroll_hints" = xyes && AC_DEFINE(USE_SCROLL_HINTS,1,[Define to 1 to compile without scroll-hints code])
|
||||
fi
|
||||
|
||||
case x$cf_cv_abi_default in
|
||||
(x[[789]])
|
||||
NCURSES_WGETCH_EVENTS=0
|
||||
;;
|
||||
(*)
|
||||
AC_MSG_CHECKING(if you want wgetch-events code)
|
||||
AC_ARG_ENABLE(wgetch-events,
|
||||
[ --enable-wgetch-events compile with wgetch-events code],
|
||||
@@ -1600,33 +1621,16 @@ if test "x$with_wgetch_events" = xyes ; then
|
||||
else
|
||||
NCURSES_WGETCH_EVENTS=0
|
||||
fi
|
||||
esac
|
||||
AC_SUBST(NCURSES_WGETCH_EVENTS)
|
||||
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*|*-msvc*)
|
||||
AC_MSG_CHECKING(if you want experimental-Windows driver)
|
||||
AC_ARG_ENABLE(exp-win32,
|
||||
[ --enable-exp-win32 compile with experimental-Windows driver],
|
||||
[with_exp_win32=$enableval],
|
||||
[with_exp_win32=no])
|
||||
AC_MSG_RESULT($with_exp_win32)
|
||||
if test "x$with_exp_win32" = xyes
|
||||
then
|
||||
AC_DEFINE(EXP_WIN32_DRIVER,1,[Define to 1 to compile with experimental win32 driver])
|
||||
EXP_WIN32_DRIVER=1
|
||||
INTERNALS_HDR='[$](INCDIR)/nc_win32.h'
|
||||
else
|
||||
INTERNALS_HDR='[$](INCDIR)/nc_mingw.h'
|
||||
EXP_WIN32_DRIVER=0
|
||||
fi
|
||||
;;
|
||||
(*)
|
||||
EXP_WIN32_DRIVER=0
|
||||
INTERNALS_HDR=
|
||||
[ --enable-exp-win32 obsolete option for Windows driver],
|
||||
[AC_MSG_WARN(The --enable-exp-win32 option is obsolete)])
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(EXP_WIN32_DRIVER)
|
||||
AC_SUBST(INTERNALS_HDR)
|
||||
|
||||
###############################################################################
|
||||
CF_HELP_MESSAGE(Testing/development Options:)
|
||||
@@ -1721,7 +1725,7 @@ AC_MSG_RESULT($cf_with_trace)
|
||||
if test "x$cf_with_trace" = xyes ; then
|
||||
LIB_TRACING=all
|
||||
ADA_TRACE=TRUE
|
||||
CF_ADD_CFLAGS(-DTRACE)
|
||||
AC_DEFINE(TRACE,1,[Define to 1 if we have support trace functions])
|
||||
AC_DEFINE(HAVE__TRACEF,1,[Define to 1 if we have _tracef function])
|
||||
else
|
||||
LIB_TRACING=DEBUG
|
||||
@@ -1736,7 +1740,7 @@ CF_DISABLE_GNAT_PROJECTS
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*)
|
||||
# Note: WINVER may be a problem with Windows 10
|
||||
if test "x$with_exp_win32" = xyes ; then
|
||||
if test "x$with_named_pipes" = xyes ; then
|
||||
CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -DWIN32_LEAN_AND_MEAN"
|
||||
else
|
||||
CPPFLAGS="$CPPFLAGS -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN"
|
||||
@@ -1756,13 +1760,16 @@ CF_REGEX
|
||||
|
||||
dnl These are some other potentially nonportable headers.
|
||||
AC_CHECK_HEADERS( \
|
||||
alloca.h \
|
||||
fcntl.h \
|
||||
getopt.h \
|
||||
limits.h \
|
||||
locale.h \
|
||||
malloc.h \
|
||||
math.h \
|
||||
poll.h \
|
||||
sys/auxv.h \
|
||||
sys/fsuid.h \
|
||||
sys/ioctl.h \
|
||||
sys/param.h \
|
||||
sys/poll.h \
|
||||
@@ -1786,7 +1793,7 @@ fi
|
||||
CF_SYS_TIME_SELECT
|
||||
|
||||
### checks for compiler characteristics
|
||||
AC_LANG_C
|
||||
AC_LANG([C])
|
||||
AC_C_CONST
|
||||
CF_C_INLINE(NCURSES_INLINE,1200)
|
||||
CF_SIG_ATOMIC_T
|
||||
@@ -1893,8 +1900,12 @@ CF_FUNC_MEMMOVE
|
||||
CF_FUNC_POLL
|
||||
CF_MB_LEN_MAX
|
||||
CF_VA_COPY
|
||||
AC_FUNC_VFORK
|
||||
AC_FUNC_FORK([])
|
||||
CF_FOPEN_BIN_R
|
||||
CF_CHECK_TYPE2(cc_t,termios.h)
|
||||
CF_CHECK_TYPE2(speed_t,termios.h)
|
||||
CF_CHECK_TYPE2(tcflag_t,termios.h)
|
||||
CF_CHECK_TYPE2(sigset_t,signal.h)
|
||||
|
||||
# special check for test/ditto.c
|
||||
CF_FUNC_OPENPTY
|
||||
@@ -1921,10 +1932,18 @@ fi
|
||||
|
||||
# Just in case, check if the C compiler has a bool type.
|
||||
CF_BOOL_DECL(cf_cv_cc_bool_type)
|
||||
if test "$cf_cv_cc_bool_type" = yes; then
|
||||
USE_BUILTIN_BOOL=1
|
||||
else
|
||||
USE_BUILTIN_BOOL=0
|
||||
fi
|
||||
AC_SUBST(USE_BUILTIN_BOOL)
|
||||
|
||||
test "$cf_cv_header_stdbool_h" = yes && AC_DEFINE(USE_STDBOOL_H,1,[Define to 1 if we can include stdbool.h])
|
||||
|
||||
# Check for C++ compiler characteristics (and ensure that it's there!)
|
||||
if test -n "$CXX" ; then
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_LANG([C++])
|
||||
CF_STDCPP_LIBRARY
|
||||
CF_PROG_CC_C_O(CXX,[$CXXFLAGS $CPPFLAGS])
|
||||
|
||||
@@ -1940,7 +1959,7 @@ if test -n "$CXX" ; then
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_HEADERS(typeinfo)
|
||||
AC_CHECK_HEADERS(new exception typeinfo)
|
||||
CF_CXX_IOSTREAM_NAMESPACE
|
||||
CF_BOOL_DECL
|
||||
CF_BOOL_SIZE
|
||||
@@ -1951,7 +1970,7 @@ if test -n "$CXX" ; then
|
||||
CF_CXX_AR_FLAGS
|
||||
else
|
||||
cf_cxx_library=no
|
||||
cf_cv_builtin_bool=1
|
||||
cf_cv_builtin_bool=yes
|
||||
|
||||
# Just because we are not configuring against C++ right now does not
|
||||
# mean that a user will not want to use C++. Some distributors disable
|
||||
@@ -1964,18 +1983,9 @@ else
|
||||
|
||||
if test "$NCURSES_BOOL" != auto ; then
|
||||
cf_cv_type_of_bool=$NCURSES_BOOL
|
||||
cf_cv_header_stdbool_h=0
|
||||
USE_STDBOOL_H=0
|
||||
else
|
||||
if test "$cf_cv_header_stdbool_h" = 1 ; then
|
||||
CF_BOOL_SIZE
|
||||
else
|
||||
AC_MSG_CHECKING(for fallback type of bool)
|
||||
case "$host_cpu" in
|
||||
(i?86) cf_cv_type_of_bool=char ;;
|
||||
(*) cf_cv_type_of_bool=int ;;
|
||||
esac
|
||||
AC_MSG_RESULT($cf_cv_type_of_bool)
|
||||
fi
|
||||
CF_BOOL_SIZE
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CXXLIBS)
|
||||
@@ -1986,11 +1996,11 @@ AC_SUBST(CXXLIBS)
|
||||
# specify the type of bool in a configure-script option and postpone
|
||||
# integration with the C++ compiler provided that the types are compatible.
|
||||
USE_CXX_BOOL=1
|
||||
if test "$cf_cv_cc_bool_type" = 1
|
||||
if test "$USE_BUILTIN_BOOL" = 1
|
||||
then
|
||||
# oops: C has a bool. Unlikely, but C++ could differ.
|
||||
USE_CXX_BOOL=0
|
||||
elif test "$cf_cv_builtin_bool" = 0
|
||||
elif test "$cf_cv_builtin_bool" = no
|
||||
then
|
||||
# C++ has no bool
|
||||
USE_CXX_BOOL=0
|
||||
@@ -2019,7 +2029,6 @@ dnl libtool -TD 20070714
|
||||
dnl Check for availability of GNU Ada Translator (GNAT).
|
||||
dnl At the moment we support no other Ada compiler.
|
||||
if test "$cf_with_ada" != "no" ; then
|
||||
CF_PROG_GNAT
|
||||
if test "x$cf_cv_prog_gnat_correct" = xyes; then
|
||||
CF_ADD_ADAFLAGS(-gnatpn)
|
||||
CF_FIXUP_ADAFLAGS
|
||||
@@ -2101,18 +2110,21 @@ if test "$with_term_driver" != no ; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+port_drivers"
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*)
|
||||
if test "x$with_exp_win32" = xyes ; then
|
||||
if test "x$with_named_pipes" = xyes ; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32"
|
||||
else
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con"
|
||||
fi
|
||||
CPPFLAGS="$CPPFLAGS -DUSE_WIN32CON_DRIVER"
|
||||
;;
|
||||
(*msys*|*cygwin*)
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_msys2"
|
||||
;;
|
||||
(*)
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo"
|
||||
;;
|
||||
esac
|
||||
elif test "x$with_exp_win32" = xyes ; then
|
||||
elif test "x$with_named_pipes" = xyes ; then
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*)
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+port_win32"
|
||||
@@ -2180,7 +2192,7 @@ if test "x$with_dlsym" = xyes ; then
|
||||
fi
|
||||
|
||||
USE_ARG_SUFFIX="${DFT_ARG_SUFFIX}${EXTRA_SUFFIX}"
|
||||
USE_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}"
|
||||
ABI_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}"
|
||||
USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}${cf_cv_abi_version}
|
||||
if test -n "$EXTRA_SUFFIX" && test "x$EXTRA_SUFFIX" != "x${cf_cv_abi_version}"
|
||||
then
|
||||
@@ -2188,13 +2200,13 @@ then
|
||||
fi
|
||||
AC_SUBST(USE_ARG_SUFFIX)
|
||||
AC_SUBST(USE_CFG_SUFFIX)
|
||||
AC_SUBST(USE_LIB_SUFFIX)
|
||||
AC_SUBST(ABI_SUFFIX)
|
||||
|
||||
if test "$with_ticlib" != no ; then
|
||||
|
||||
if test "x$with_ticlib" != xyes ; then
|
||||
TICS_NAME=$with_ticlib
|
||||
TICS_SUFFIX="`echo "${DFT_LIB_SUFFIX}" |sed -e "s/^${USE_LIB_SUFFIX}//"`"
|
||||
TICS_SUFFIX="`echo "${DFT_LIB_SUFFIX}" |sed -e "s/^${ABI_SUFFIX}//"`"
|
||||
TICS_ARG_SUFFIX="${with_ticlib}`echo "${USE_ARG_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
|
||||
TICS_DEP_SUFFIX="${with_ticlib}`echo "${DFT_DEP_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
|
||||
TICS_LIB_SUFFIX="${with_ticlib}"
|
||||
@@ -2202,7 +2214,7 @@ if test "$with_ticlib" != no ; then
|
||||
TICS_SUFFIX=${DFT_LIB_SUFFIX}
|
||||
TICS_ARG_SUFFIX="${TICS_NAME}${USE_ARG_SUFFIX}"
|
||||
TICS_DEP_SUFFIX="${TICS_NAME}${DFT_DEP_SUFFIX}"
|
||||
TICS_LIB_SUFFIX="${TICS_NAME}${USE_LIB_SUFFIX}"
|
||||
TICS_LIB_SUFFIX="${TICS_NAME}${ABI_SUFFIX}"
|
||||
fi
|
||||
TICS_LDFLAGS="-L${LIB_DIR}"
|
||||
TICS_LIBS="-l${TICS_ARG_SUFFIX}"
|
||||
@@ -2221,7 +2233,7 @@ if test "$with_termlib" != no ; then
|
||||
|
||||
if test "x$with_termlib" != xyes ; then
|
||||
TINFO_NAME=$with_termlib
|
||||
TINFO_SUFFIX="`echo "${DFT_LIB_SUFFIX}" |sed -e "s/^${USE_LIB_SUFFIX}//"`"
|
||||
TINFO_SUFFIX="`echo "${DFT_LIB_SUFFIX}" |sed -e "s/^${ABI_SUFFIX}//"`"
|
||||
TINFO_ARG_SUFFIX="${with_termlib}`echo "${USE_ARG_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
|
||||
TINFO_DEP_SUFFIX="${with_termlib}`echo "${DFT_DEP_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
|
||||
TINFO_LIB_SUFFIX="${with_termlib}"
|
||||
@@ -2229,7 +2241,7 @@ if test "$with_termlib" != no ; then
|
||||
TINFO_SUFFIX=${DFT_LIB_SUFFIX}
|
||||
TINFO_ARG_SUFFIX="${TINFO_NAME}${USE_ARG_SUFFIX}"
|
||||
TINFO_DEP_SUFFIX="${TINFO_NAME}${DFT_DEP_SUFFIX}"
|
||||
TINFO_LIB_SUFFIX="${TINFO_NAME}${USE_LIB_SUFFIX}"
|
||||
TINFO_LIB_SUFFIX="${TINFO_NAME}${ABI_SUFFIX}"
|
||||
fi
|
||||
|
||||
TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
|
||||
@@ -2310,7 +2322,7 @@ if test "$with_overwrite" = no && \
|
||||
{ test "x$includedir" = 'x${prefix}/include' || \
|
||||
test "x$includedir" = "x${prefix}/include"; }
|
||||
then
|
||||
includesubdir="/ncurses${USE_LIB_SUFFIX}"
|
||||
includesubdir="/ncurses${ABI_SUFFIX}"
|
||||
fi
|
||||
AC_MSG_RESULT(${includedir}${includesubdir})
|
||||
|
||||
@@ -2373,11 +2385,29 @@ AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as
|
||||
AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}",[Define to 1 if machine has ample memory for tic])
|
||||
|
||||
### Define substitutions for header files to avoid name-pollution
|
||||
CF_SUBST_IF(["x$cf_cv_have_tcgetattr" = xyes], HAVE_TCGETATTR, 1, 0)
|
||||
CF_SUBST_IF(["x$ac_cv_header_stdint_h" = xyes], HAVE_STDINT_H, 1, 0)
|
||||
CF_SUBST_IF(["x$ac_cv_header_termio_h" = xyes], HAVE_TERMIO_H, 1, 0)
|
||||
CF_SUBST_IF(["x$cf_cv_have_tcgetattr" = xyes], HAVE_TCGETATTR, 1, 0)
|
||||
CF_SUBST_IF(["x$ac_cv_header_stdint_h" = xyes], HAVE_STDINT_H, 1, 0)
|
||||
CF_SUBST_IF(["x$ac_cv_header_sgtty_h" = xyes], HAVE_SGTTY_H, 1, 0)
|
||||
CF_SUBST_IF(["x$ac_cv_header_termio_h" = xyes], HAVE_TERMIO_H, 1, 0)
|
||||
CF_SUBST_IF(["x$ac_cv_header_termios_h" = xyes], HAVE_TERMIOS_H, 1, 0)
|
||||
|
||||
case "x${ac_cv_header_termios_h}${ac_cv_header_termio_h}${ac_cv_header_sgtty_h}${cf_cv_have_tcgetattr}" in
|
||||
(*yes*)
|
||||
;;
|
||||
(*)
|
||||
case "$cf_cv_system_name" in
|
||||
(*mingw32*|*mingw64*|*-msvc*)
|
||||
;;
|
||||
(*)
|
||||
AC_MSG_ERROR(No termio/termios/sgtty found)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
###############################################################################
|
||||
CF_MAN_PAGES([ captoinfo clear infocmp infotocap reset tabs tic toe tput tset ])
|
||||
|
||||
################################################################################
|
||||
test "x$use_database" = xyes && \
|
||||
SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
|
||||
@@ -2443,6 +2473,7 @@ do
|
||||
done
|
||||
AC_MSG_RESULT($PKG_CFLAGS)
|
||||
AC_SUBST(PKG_CFLAGS)
|
||||
CF_GLOB_FULLPATH
|
||||
|
||||
# AC_CHECK_SIZEOF demands a literal parameter, no variables. So we do this.
|
||||
case "x$NCURSES_OSPEED" in
|
||||
@@ -2532,15 +2563,18 @@ AC_SUBST(PRIVATE_LIBS)
|
||||
# This is used for the *-config script and *.pc data files.
|
||||
CF_LD_SEARCHPATH
|
||||
|
||||
AC_OUTPUT( \
|
||||
AC_CONFIG_FILES([\
|
||||
include/MKterm.h.awk \
|
||||
include/curses.head:include/curses.h.in \
|
||||
include/ncurses_dll.h \
|
||||
include/nc_win32.h \
|
||||
include/termcap.h \
|
||||
include/unctrl.h \
|
||||
man/MKterminfo.tmp:man/MKterminfo.sh \
|
||||
man/man_db.renames \
|
||||
$SUB_MAKEFILES \
|
||||
Makefile,[
|
||||
Makefile])
|
||||
AC_CONFIG_COMMANDS([default],[
|
||||
if test "x$cf_with_tests" != xno ; then
|
||||
CF_PRG_RULES(["$srcdir/test/mk-test.awk" INSTALL=no ECHO_LINK="$ECHO_LD"], test)
|
||||
fi
|
||||
@@ -2564,6 +2598,8 @@ DFT_LWR_MODEL="$DFT_LWR_MODEL"
|
||||
ECHO_LD="$ECHO_LD"
|
||||
EXTRA_SUFFIX="$EXTRA_SUFFIX"
|
||||
FORM_NAME="$FORM_NAME"
|
||||
GLOB_FULLPATH_OTHER="$GLOB_FULLPATH_OTHER"
|
||||
GLOB_FULLPATH_POSIX="$GLOB_FULLPATH_POSIX"
|
||||
LDCONFIG="$LDCONFIG"
|
||||
LIBTOOL_VERSION="$LIBTOOL_VERSION"
|
||||
LIB_NAME="$LIB_NAME"
|
||||
@@ -2594,7 +2630,7 @@ TINFO_SUFFIX="$TINFO_SUFFIX"
|
||||
UNALTERED_SYMS="$UNALTERED_SYMS"
|
||||
USE_ARG_SUFFIX="$USE_ARG_SUFFIX"
|
||||
USE_CFG_SUFFIX="$USE_CFG_SUFFIX"
|
||||
USE_LIB_SUFFIX="$USE_LIB_SUFFIX"
|
||||
ABI_SUFFIX="$ABI_SUFFIX"
|
||||
USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
|
||||
WILDCARD_SYMS="$WILDCARD_SYMS"
|
||||
WITH_CURSES_H="$with_curses_h"
|
||||
@@ -2631,5 +2667,7 @@ target="$target"
|
||||
verbose="$verbose"
|
||||
with_shared_cxx="$with_shared_cxx"
|
||||
|
||||
],cat)dnl
|
||||
])
|
||||
AC_SETUP_DEFS([cat])
|
||||
AC_OUTPUT
|
||||
${MAKE:-make} preinstall
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
diff --git a/config.sub b/config.sub
|
||||
index e4c4e09..6dc3666 100644
|
||||
--- a/config.sub
|
||||
+++ b/config.sub
|
||||
@@ -1768,7 +1768,7 @@ case $os in
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||
- | fiwix* | mlibc* | cos* | mbr* | ironclad* )
|
||||
+ | fiwix* | mlibc* | cos* | mbr* | ironclad* | ohos* )
|
||||
;;
|
||||
# This one is extra strict with allowed versions
|
||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
||||
@@ -1866,6 +1866,8 @@ case $kernel-$os-$obj in
|
||||
;;
|
||||
*-eabi*- | *-gnueabi*-)
|
||||
;;
|
||||
+ *-ohos*-)
|
||||
+ ;;
|
||||
none--*)
|
||||
# None (no kernel, i.e. freestanding / bare metal),
|
||||
# can be paired with an machine code file format
|
||||
diff --git a/configure b/configure
|
||||
index 488d93f..55ff910 100644
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -17042,6 +17042,10 @@ else
|
||||
INSTALL_OPT_S=
|
||||
fi
|
||||
|
||||
+if test "${with_strip_program+set}" = set; then
|
||||
+ INSTALL_OPT_S="$INSTALL_OPT_S --strip-program=$with_strip_program"
|
||||
+fi
|
||||
+
|
||||
: "${INSTALL:=install}"
|
||||
echo "$as_me:17046: checking if install accepts -p option" >&5
|
||||
echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
|
||||
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright 2018-2023,2024 Thomas E. Dickey #
|
||||
# Copyright 2018-2024,2025 Thomas E. Dickey #
|
||||
# Copyright 1998-2017,2018 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
@@ -26,7 +26,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.1610 2024/04/27 13:55:54 tom Exp $
|
||||
# $Id: dist.mk,v 1.1709 2025/12/30 20:31:32 tom Exp $
|
||||
# Makefile for creating ncurses distributions.
|
||||
#
|
||||
# This only needs to be used directly as a makefile by developers, but
|
||||
@@ -37,8 +37,8 @@ SHELL = /bin/sh
|
||||
|
||||
# These define the major/minor/patch versions of ncurses.
|
||||
NCURSES_MAJOR = 6
|
||||
NCURSES_MINOR = 5
|
||||
NCURSES_PATCH = 20240427
|
||||
NCURSES_MINOR = 6
|
||||
NCURSES_PATCH = 20251230
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
@@ -93,11 +93,11 @@ doc/hackguide.doc: doc/html/hackguide.html
|
||||
# The distributed html files are formatted using
|
||||
# configure --without-manpage-renames
|
||||
#
|
||||
# The edit_man.sed script is built as a side-effect of installing the manpages.
|
||||
# The edit_man.sed script is built as a side effect of installing the man pages.
|
||||
# If that conflicts with the --without-manpage-renames, you can install those
|
||||
# in a different location using the --with-install-prefix option of the
|
||||
# configure script.
|
||||
MANPROG = tbl | nroff -mandoc -rHY=0 -rLL=78n -rLT=78n -Tascii
|
||||
MANPROG = tbl | nroff -c -mandoc -rHY=0 -rLL=78n -rLT=78n -Tascii
|
||||
|
||||
manhtml:
|
||||
@for f in doc/html/man/*.html; do \
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
$Id: Ada95.html,v 1.18 2022/03/05 16:09:29 tom Exp $
|
||||
$Id: Ada95.html,v 1.20 2025/07/13 09:08:38 tom Exp $
|
||||
****************************************************************************
|
||||
* Copyright 2019-2021,2022 Thomas E. Dickey *
|
||||
* Copyright 2019-2022,2025 Thomas E. Dickey *
|
||||
* Copyright 2000-2010,2013 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -57,7 +57,7 @@
|
||||
ncurses package, a clone of the SVr4 curses model.<br>
|
||||
I did the development on an Intel box running the latest stable
|
||||
release of <a href="http://www.linux.org">Linux</a>, ncurses
|
||||
and the most recent released <a href="https://ftp.gnu.org/gnu/gcc/">GNU
|
||||
and the most recent released <a href="https://ftp.gnu.org/gnu/gcc/">GNU
|
||||
Ada Translator</a> gnat versions. For any older versions of
|
||||
ncurses and gnat it is not guaranteed to work.</li>
|
||||
|
||||
|
||||
+2089
-1937
File diff suppressed because it is too large
Load Diff
@@ -20,8 +20,8 @@
|
||||
<li><a href="../terminal_interface-curses-termcap__adb.htm#ref_90_16" target="main">tgetnum</a>
|
||||
<li><a href="../terminal_interface-curses-termcap__adb.htm#ref_109_16" target="main">tgetstr - terminal_interface-curses-termcap.adb:109</a>
|
||||
<li><a href="../terminal_interface-curses-termcap__adb.htm#ref_130_16" target="main">tgetstr - terminal_interface-curses-termcap.adb:130</a>
|
||||
<li><a href="../terminal_interface-curses-termcap__ads.htm#ref_54_13" target="main">TGoto</a>
|
||||
<li><a href="../terminal_interface-curses-termcap__adb.htm#ref_152_16" target="main">tgoto</a>
|
||||
<li><a href="../terminal_interface-curses-termcap__ads.htm#ref_54_13" target="main">TGoto</a>
|
||||
<li><a href="../terminal_interface-curses-terminfo__adb.htm#ref_70_16" target="main">tigetflag</a>
|
||||
<li><a href="../terminal_interface-curses-terminfo__adb.htm#ref_88_16" target="main">tigetstr - terminal_interface-curses-terminfo.adb:88</a>
|
||||
<li><a href="../terminal_interface-curses-terminfo__adb.htm#ref_109_16" target="main">tigetstr - terminal_interface-curses-terminfo.adb:109</a>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<span class="comment"><em>-- B O D Y --</em></span>
|
||||
<span class="comment"><em>-- --</em></span>
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<span class="comment"><em>-- Copyright 2020 Thomas E. Dickey --</em></span>
|
||||
<span class="comment"><em>-- Copyright 2020,2025 Thomas E. Dickey --</em></span>
|
||||
<span class="comment"><em>-- Copyright 1999-2011,2014 Free Software Foundation, Inc. --</em></span>
|
||||
<span class="comment"><em>-- --</em></span>
|
||||
<span class="comment"><em>-- Permission is hereby granted, free of charge, to any person obtaining a --</em></span>
|
||||
@@ -53,8 +53,8 @@
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<span class="comment"><em>-- Author: Juergen Pfeifer, 1996</em></span>
|
||||
<span class="comment"><em>-- Version Control:</em></span>
|
||||
<span class="comment"><em>-- @Revision: 1.33 @</em></span>
|
||||
<span class="comment"><em>-- @Date: 2020/02/02 23:34:34 @</em></span>
|
||||
<span class="comment"><em>-- @Revision: 1.34 @</em></span>
|
||||
<span class="comment"><em>-- @Date: 2025/01/24 20:39:23 @</em></span>
|
||||
<span class="comment"><em>-- Binding Version 01.00</em></span>
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<b>with</b> Ada.Unchecked_Deallocation;
|
||||
@@ -1023,7 +1023,7 @@
|
||||
(Field_Array, <a href="terminal_interface-curses-forms__ads.htm#ref_136_9">Field_Array_Access</a>);
|
||||
<b>begin</b>
|
||||
<b>if</b> <a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a> /= <b>null</b> <b>and</b> <b>then</b> <a href="terminal_interface-curses-forms__ads.htm#ref_139_20">Free_Fields</a> <b>then</b>
|
||||
<b>for</b> <span class="symbol"><a name="ref_1009_14">I</a></span> <b>in</b> <a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a>'First .. (<a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a>'Last - 1) <b>loop</b>
|
||||
<b>for</b> <span class="symbol"><a name="ref_1009_14">I</a></span> <b>in</b> <a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a>'First .. <a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a>'Last - 1 <b>loop</b>
|
||||
<b>if</b> <a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a>.<b>all</b> (<a href="terminal_interface-curses-forms__adb.htm#ref_1009_14">I</a>) /= <a href="terminal_interface-curses-forms__ads.htm#ref_55_4">Null_Field</a> <b>then</b>
|
||||
<a href="terminal_interface-curses-forms__ads.htm#ref_317_14">Delete</a> (<a href="terminal_interface-curses-forms__ads.htm#ref_138_20">FA</a>.<b>all</b> (<a href="terminal_interface-curses-forms__adb.htm#ref_1009_14">I</a>));
|
||||
<b>end</b> <b>if</b>;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<span class="comment"><em>-- B O D Y --</em></span>
|
||||
<span class="comment"><em>-- --</em></span>
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<span class="comment"><em>-- Copyright 2018,2020 Thomas E. Dickey --</em></span>
|
||||
<span class="comment"><em>-- Copyright 2018-2020,2025 Thomas E. Dickey --</em></span>
|
||||
<span class="comment"><em>-- Copyright 1999-2011,2014 Free Software Foundation, Inc. --</em></span>
|
||||
<span class="comment"><em>-- --</em></span>
|
||||
<span class="comment"><em>-- Permission is hereby granted, free of charge, to any person obtaining a --</em></span>
|
||||
@@ -53,8 +53,8 @@
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<span class="comment"><em>-- Author: Juergen Pfeifer, 1996</em></span>
|
||||
<span class="comment"><em>-- Version Control:</em></span>
|
||||
<span class="comment"><em>-- @Revision: 1.34 @</em></span>
|
||||
<span class="comment"><em>-- @Date: 2020/02/02 23:34:34 @</em></span>
|
||||
<span class="comment"><em>-- @Revision: 1.35 @</em></span>
|
||||
<span class="comment"><em>-- @Date: 2025/01/24 20:39:23 @</em></span>
|
||||
<span class="comment"><em>-- Binding Version 01.00</em></span>
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<b>with</b> Ada.Unchecked_Deallocation;
|
||||
@@ -895,7 +895,7 @@
|
||||
(Item_Array, <a href="terminal_interface-curses-menus__ads.htm#ref_177_9">Item_Array_Access</a>);
|
||||
<b>begin</b>
|
||||
<b>if</b> <a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a> /= <b>null</b> <b>and</b> <b>then</b> <a href="terminal_interface-curses-menus__ads.htm#ref_180_20">Free_Items</a> <b>then</b>
|
||||
<b>for</b> <span class="symbol"><a name="ref_881_14">I</a></span> <b>in</b> <a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a>'First .. (<a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a>'Last - 1) <b>loop</b>
|
||||
<b>for</b> <span class="symbol"><a name="ref_881_14">I</a></span> <b>in</b> <a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a>'First .. <a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a>'Last - 1 <b>loop</b>
|
||||
<b>if</b> <a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a>.<b>all</b> (<a href="terminal_interface-curses-menus__adb.htm#ref_881_14">I</a>) /= <a href="terminal_interface-curses-menus__ads.htm#ref_58_4">Null_Item</a> <b>then</b>
|
||||
<a href="terminal_interface-curses-menus__ads.htm#ref_202_14">Delete</a> (<a href="terminal_interface-curses-menus__ads.htm#ref_179_20">IA</a>.<b>all</b> (<a href="terminal_interface-curses-menus__adb.htm#ref_881_14">I</a>));
|
||||
<b>end</b> <b>if</b>;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<span class="comment"><em>-- B O D Y --</em></span>
|
||||
<span class="comment"><em>-- --</em></span>
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<span class="comment"><em>-- Copyright 2020 Thomas E. Dickey --</em></span>
|
||||
<span class="comment"><em>-- Copyright 2020,2025 Thomas E. Dickey --</em></span>
|
||||
<span class="comment"><em>-- Copyright 1999-2003,2009 Free Software Foundation, Inc. --</em></span>
|
||||
<span class="comment"><em>-- --</em></span>
|
||||
<span class="comment"><em>-- Permission is hereby granted, free of charge, to any person obtaining a --</em></span>
|
||||
@@ -53,7 +53,7 @@
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<span class="comment"><em>-- Author: Juergen Pfeifer, 1996</em></span>
|
||||
<span class="comment"><em>-- Version Control:</em></span>
|
||||
<span class="comment"><em>-- @Revision: 1.13 @</em></span>
|
||||
<span class="comment"><em>-- @Revision: 1.14 @</em></span>
|
||||
<span class="comment"><em>-- Binding Version 01.00</em></span>
|
||||
<span class="comment"><em>------------------------------------------------------------------------------</em></span>
|
||||
<b>with</b> <a href="interfac__ads.htm#ref_38_9">Interfaces</a>.C;
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
<span class="comment"><em>-- Version of the ncurses library from extensions(3NCURSES)</em></span>
|
||||
|
||||
<span class="symbol"><a name="ref_21_4">NCURSES_VERSION_MAJOR</a></span> : <b>constant</b> := 6;
|
||||
<span class="symbol"><a name="ref_22_4">NCURSES_VERSION_MINOR</a></span> : <b>constant</b> := 5;
|
||||
<span class="symbol"><a name="ref_23_4">Version</a></span> : <b>constant</b> String := "6.5";
|
||||
<span class="symbol"><a name="ref_22_4">NCURSES_VERSION_MINOR</a></span> : <b>constant</b> := 6;
|
||||
<span class="symbol"><a name="ref_23_4">Version</a></span> : <b>constant</b> String := "6.6";
|
||||
|
||||
<span class="comment"><em>-- Character non-color attributes from attr(3NCURSES)</em></span>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<span class="symbol"><a name="ref_93_4">E_INVALID_FIELD</a></span> : <b>constant</b> := -13;
|
||||
<span class="symbol"><a name="ref_94_4">E_CURRENT</a></span> : <b>constant</b> := -14;
|
||||
|
||||
<span class="comment"><em>-- Input key codes not defined in any ncurses manpage</em></span>
|
||||
<span class="comment"><em>-- Input key codes not defined in any ncurses man page</em></span>
|
||||
|
||||
<span class="symbol"><a name="ref_98_4">KEY_MIN</a></span> : <b>constant</b> := 257;
|
||||
<span class="symbol"><a name="ref_99_4">KEY_MAX</a></span> : <b>constant</b> := 511;
|
||||
|
||||
+638
-518
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2010-2014,2016 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: MKada_config.in,v 1.35 2024/04/20 21:13:27 tom Exp @
|
||||
* @Id: MKada_config.in,v 1.37 2025/04/05 22:26:08 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>adacursesw6\-config 1 2024-04-20 ncurses 6.5 User commands</TITLE>
|
||||
<TITLE>adacursesw6\-config 1 2025-04-05 ncurses 6.6 User commands</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">adacursesw6\-config 1 2024-04-20 ncurses 6.5 User commands</H1>
|
||||
<H1 class="no-header">adacursesw6\-config 1 2025-04-05 ncurses 6.6 User commands</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="adacursesw6-config.1.html">adacursesw6-config(1)</A></STRONG> User commands <STRONG><A HREF="adacursesw6-config.1.html">adacursesw6-config(1)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>adacursesw6-config</STRONG> - configuration helper for <EM>AdaCurses</EM> libraries
|
||||
|
||||
@@ -69,8 +67,8 @@
|
||||
|
||||
<STRONG>--libs</STRONG> reports the GNAT libraries needed to link with <EM>AdaCurses</EM>.
|
||||
|
||||
<STRONG>--version</STRONG> reports the release and patch date information of the
|
||||
<EM>ncurses</EM> libraries used to configure and build <EM>AdaCurses</EM> and
|
||||
<STRONG>--version</STRONG> reports the release and patch date information of the
|
||||
<EM>ncurses</EM> libraries used to configure and build <EM>AdaCurses</EM> and
|
||||
exits successfully.
|
||||
|
||||
<STRONG>--help</STRONG> issues a usage message and exits successfully.
|
||||
@@ -112,7 +110,6 @@
|
||||
end loop;
|
||||
|
||||
End_Windows;
|
||||
|
||||
end Hello;
|
||||
|
||||
Then, using
|
||||
@@ -126,9 +123,7 @@
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="adacursesw6-config.1.html">adacursesw6-config(1)</A></STRONG>
|
||||
ncurses 6.6 2025-04-05 <STRONG><A HREF="adacursesw6-config.1.html">adacursesw6-config(1)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2010,2016 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,25 +28,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: captoinfo.1m,v 1.63 2024/03/23 20:37:25 tom Exp @
|
||||
* @Id: captoinfo.1m,v 1.77 2025/11/12 01:03:56 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>captoinfo 1m 2024-03-23 ncurses 6.5 User commands</TITLE>
|
||||
<TITLE>captoinfo 1m 2025-11-11 ncurses 6.6 User commands</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">captoinfo 1m 2024-03-23 ncurses 6.5 User commands</H1>
|
||||
<H1 class="no-header">captoinfo 1m 2025-11-11 ncurses 6.6 User commands</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG> User commands <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>captoinfo</STRONG> - convert a <EM>termcap</EM> description into a <EM>terminfo</EM> description
|
||||
|
||||
@@ -63,10 +61,10 @@
|
||||
equivalent <EM>terminfo</EM> description to the standard output stream. <EM>termcap</EM>
|
||||
<STRONG>tc</STRONG> capabilities translate to <EM>terminfo</EM> "<STRONG>use</STRONG>" capabilities.
|
||||
|
||||
If no <EM>file</EM>s are specified, <STRONG>captoinfo</STRONG> interprets the content of the
|
||||
environment variable <EM>TERMCAP</EM> as a file name, and extracts only the
|
||||
entry for the terminal named in the environment variable <EM>TERM</EM> from it.
|
||||
If the environment variable <EM>TERMCAP</EM> is not set, <STRONG>captoinfo</STRONG> reads
|
||||
If no <EM>file</EM>s are specified, <STRONG>captoinfo</STRONG> interprets the content of the
|
||||
environment variable <EM>TERMCAP</EM> as a file name, and extracts only the
|
||||
entry for the terminal type named in the environment variable <EM>TERM</EM> from
|
||||
it. If the environment variable <EM>TERMCAP</EM> is not set, <STRONG>captoinfo</STRONG> reads
|
||||
<EM>/etc/termcap</EM>.
|
||||
|
||||
This utility is implemented as a link to <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, with the latter's <STRONG>-I</STRONG>
|
||||
@@ -77,12 +75,11 @@
|
||||
|
||||
</PRE><H3><a name="h3-Translations-from-Nonstandard-Capabilities">Translations from Nonstandard Capabilities</a></H3><PRE>
|
||||
<STRONG>captoinfo</STRONG> translates some obsolete, nonstandard capabilities into
|
||||
standard (SVr4/XSI Curses) <EM>terminfo</EM> capabilities. It issues a
|
||||
diagnostic to the standard error stream for each, inviting the user to
|
||||
check that it has not mistakenly translated an unknown or mistyped
|
||||
capability name.
|
||||
standard <EM>terminfo</EM> capabilities. It issues a diagnostic to the standard
|
||||
error stream for each, inviting the user to check that it has not
|
||||
mistakenly translated an unknown or mistyped capability name.
|
||||
|
||||
<STRONG>Name</STRONG>
|
||||
<STRONG><EM>termcap</EM></STRONG> <STRONG>Code</STRONG>
|
||||
<STRONG>Obsolete</STRONG> <STRONG>Standard</STRONG> <STRONG>Origin</STRONG> <STRONG><EM>terminfo</EM></STRONG> <STRONG>capability</STRONG>
|
||||
---------------------------------------------------------
|
||||
<STRONG>BO</STRONG> <STRONG>mr</STRONG> AT&T <STRONG>enter_reverse_mode</STRONG>
|
||||
@@ -111,14 +108,13 @@
|
||||
<STRONG>KE</STRONG> <STRONG>F4</STRONG> Tektronix <STRONG>key_f14</STRONG>
|
||||
<STRONG>KF</STRONG> <STRONG>F5</STRONG> Tektronix <STRONG>key_f15</STRONG>
|
||||
<STRONG>BC</STRONG> <STRONG>Sb</STRONG> Tektronix <STRONG>set_background</STRONG>
|
||||
|
||||
<STRONG>FC</STRONG> <STRONG>Sf</STRONG> Tektronix <STRONG>set_foreground</STRONG>
|
||||
<STRONG>HS</STRONG> <STRONG>mh</STRONG> IRIX <STRONG>enter_dim_mode</STRONG>
|
||||
|
||||
XENIX <EM>termcap</EM> had a set of extension capabilities, corresponding to box
|
||||
drawing characters of CCSID ("code page") 437, as follows.
|
||||
|
||||
<STRONG><EM>termcap</EM></STRONG> <STRONG>Name</STRONG> <STRONG>Graphic</STRONG>
|
||||
<STRONG><EM>termcap</EM></STRONG> <STRONG>Code</STRONG> <STRONG>Graphic</STRONG>
|
||||
-----------------------------------------
|
||||
<STRONG>G2</STRONG> upper left corner
|
||||
<STRONG>G3</STRONG> lower left corner
|
||||
@@ -144,27 +140,28 @@
|
||||
<STRONG>Gc</STRONG> double intersection
|
||||
<STRONG>GG</STRONG> ACS magic cookie count
|
||||
|
||||
<STRONG>captoinfo</STRONG> composes single-line capabilities into an <STRONG>acsc</STRONG> string, and
|
||||
discards <STRONG>GG</STRONG> and double-line capabilities with a warning diagnostic.
|
||||
<STRONG>captoinfo</STRONG> composes single-line box-drawing capabilities into a <EM>terminfo</EM>
|
||||
<STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>) string capability, and discards <STRONG>GG</STRONG> and double-line
|
||||
capabilities with a warning diagnostic.
|
||||
|
||||
IBM's AIX has a <EM>terminfo</EM> facility descended from SVr1 <EM>terminfo</EM>, but
|
||||
which is incompatible with the SVr4 format. <STRONG>captoinfo</STRONG> translates the
|
||||
following AIX extensions.
|
||||
AIX has a <EM>terminfo</EM> facility descended from SVr2 <EM>terminfo</EM>, but which is
|
||||
incompatible with the SVr4 format. <STRONG>captoinfo</STRONG> translates the following
|
||||
AIX extensions.
|
||||
|
||||
<STRONG>IBM</STRONG> <STRONG>XSI</STRONG>
|
||||
-------------
|
||||
ksel kslt
|
||||
kbtab kcbt
|
||||
font0 s0ds
|
||||
font1 s1ds
|
||||
font2 s2ds
|
||||
font3 s3ds
|
||||
<STRONG>IBM</STRONG> <STRONG>X/Open</STRONG>
|
||||
---------------
|
||||
ksel kslt
|
||||
kbtab kcbt
|
||||
font0 s0ds
|
||||
font1 s1ds
|
||||
font2 s2ds
|
||||
font3 s3ds
|
||||
|
||||
Additionally, this program translates the AIX <STRONG>box1</STRONG> capability to an
|
||||
<STRONG>acsc</STRONG> string.
|
||||
It furthermore translates the AIX <STRONG>box1</STRONG> capability to an <STRONG>acs_chars</STRONG>
|
||||
(<STRONG>acsc</STRONG>) string capability.
|
||||
|
||||
The HP-UX <EM>terminfo</EM> library supports two nonstandard <EM>terminfo</EM>
|
||||
capabilities, <STRONG>meml</STRONG> (memory lock) and <STRONG>memu</STRONG> (memory unlock). <STRONG>captoinfo</STRONG>
|
||||
The HP-UX <EM>terminfo</EM> library supports two nonstandard <EM>terminfo</EM>
|
||||
capabilities: <STRONG>memory_lock</STRONG> (<STRONG>meml</STRONG>) and <STRONG>memory_unlock</STRONG> (<STRONG>memu</STRONG>). <STRONG>captoinfo</STRONG>
|
||||
discards these with a warning message.
|
||||
|
||||
|
||||
@@ -173,12 +170,15 @@
|
||||
default <EM>termcap</EM> terminal capability database
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 7 (2009) describes <STRONG>tic</STRONG> briefly, but omits this
|
||||
program.
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
This command is an SVr4 <EM>curses</EM> and <EM>ncurses</EM> extension.
|
||||
|
||||
SVr4 systems provide <STRONG>captoinfo</STRONG> as a separate application from <STRONG>tic</STRONG>. Its
|
||||
<STRONG>-v</STRONG> option does not accept a trace level argument <EM>n</EM>; repeat <STRONG>-v</STRONG> <EM>n</EM> times
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses Issue 7 (2009) does not specify this command.
|
||||
|
||||
SVr4 systems provide <EM>captoinfo</EM> as a separate application from <EM>tic</EM>. Its
|
||||
<STRONG>-v</STRONG> option does not accept a trace level argument <EM>n</EM>; repeat <STRONG>-v</STRONG> <EM>n</EM> times
|
||||
instead.
|
||||
|
||||
NetBSD does not provide this application.
|
||||
@@ -192,9 +192,7 @@
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-03-23 <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
|
||||
ncurses 6.6 2025-11-11 <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -206,6 +204,7 @@ ncurses 6.5 2024-03-23 <STRONG><A HREF
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-FILES">FILES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-AUTHORS">AUTHORS</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
|
||||
+10
-14
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: clear.1,v 1.48 2024/03/16 15:35:01 tom Exp @
|
||||
* @Id: clear.1,v 1.53 2025/04/05 21:56:26 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>clear 1 2024-03-16 ncurses 6.5 User commands</TITLE>
|
||||
<TITLE>clear 1 2025-04-05 ncurses 6.6 User commands</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">clear 1 2024-03-16 ncurses 6.5 User commands</H1>
|
||||
<H1 class="no-header">clear 1 2025-04-05 ncurses 6.6 User commands</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG> User commands <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>clear</STRONG> - clear the terminal screen
|
||||
|
||||
@@ -84,7 +82,7 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7
|
||||
Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7
|
||||
(POSIX.1-2008) nor X/Open Curses Issue 7 documents <STRONG>clear</STRONG>.
|
||||
|
||||
The latter documents <STRONG>tput</STRONG>, which could be used to replace this utility
|
||||
@@ -96,14 +94,14 @@
|
||||
A <STRONG>clear</STRONG> command using the <EM>termcap</EM> database and library appeared in 2BSD
|
||||
(1979). Eighth Edition Unix (1985) later included it.
|
||||
|
||||
The commercial Unix arm of AT&T adapted a different BSD program (<STRONG>tset</STRONG>)
|
||||
to make a new command, <STRONG>tput</STRONG>, and replaced the <STRONG>clear</STRONG> program with a
|
||||
The commercial Unix arm of AT&T adapted a different BSD program (<STRONG>tset</STRONG>)
|
||||
to make a new command, <STRONG>tput</STRONG>, and replaced the <STRONG>clear</STRONG> program with a
|
||||
shell script that called "<STRONG>tput</STRONG> <STRONG>clear</STRONG>".
|
||||
|
||||
/usr/bin/tput ${1:+-T$1} clear 2> /dev/null
|
||||
exit
|
||||
|
||||
In 1989, when Keith Bostic revised the BSD <STRONG>tput</STRONG> command to make it
|
||||
In 1989, when Keith Bostic revised the BSD <STRONG>tput</STRONG> command to make it
|
||||
similar to AT&T's <STRONG>tput</STRONG>, he added a <STRONG>clear</STRONG> shell script as well.
|
||||
|
||||
exec tput clear
|
||||
@@ -139,16 +137,14 @@
|
||||
to incorporate this extension.
|
||||
|
||||
<STRONG>o</STRONG> In 2013, the <STRONG>E3</STRONG> capability was not exercised by "<STRONG>tput</STRONG> <STRONG>clear</STRONG>". That
|
||||
oversight was addressed in 2016 by reorganizing <STRONG>tput</STRONG> to share its
|
||||
oversight was addressed in 2016 by reorganizing <STRONG>tput</STRONG> to share its
|
||||
logic with <STRONG>clear</STRONG> and <STRONG>tset</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG>xterm(1)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-03-16 <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
|
||||
ncurses 6.6 2025-04-05 <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
|
||||
+321
-182
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2001-2015,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,162 +28,280 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_add_wch.3x,v 1.62 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_add_wch.3x,v 1.125 2025/11/12 01:06:36 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_add_wch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_add_wch 3x 2025-11-11 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_add_wch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_add_wch 3x 2025-11-11 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, <STRONG>echo_wchar</STRONG>, <STRONG>wecho_wchar</STRONG> - add
|
||||
a <EM>curses</EM> complex character to a window and advance the cursor
|
||||
a <EM>curses</EM> complex character to a window, possibly advancing the cursor
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>add_wch(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wadd_wch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvadd_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwadd_wch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>add_wch(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wadd_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvadd_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwadd_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>echo_wchar(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wecho_wchar(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>echo_wchar(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wecho_wchar(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
|
||||
<EM>/*</EM> <EM>(integer)</EM> <EM>constants</EM> <EM>*/</EM>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BLOCK;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BOARD;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BULLET;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_CKBOARD;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_DARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_DEGREE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_DIAMOND;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_HLINE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LANTERN;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LLCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LRCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_PLMINUS;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_PLUS;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_RARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_RTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S1;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S9;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_TTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_UARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_ULCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_URCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_VLINE;</STRONG>
|
||||
<EM>/*</EM> <EM>extensions</EM> <EM>*/</EM>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_GEQUAL;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LEQUAL;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_NEQUAL;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_PI;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S3;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S7;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_STERLING;</STRONG>
|
||||
<EM>/*</EM> <EM>extensions</EM> <EM>for</EM> <EM>thick</EM> <EM>lines</EM> <EM>*/</EM>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_BTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_HLINE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_LLCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_LRCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_LTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_PLUS;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_RTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_TTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_ULCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_URCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_VLINE;</STRONG>
|
||||
<EM>/*</EM> <EM>extensions</EM> <EM>for</EM> <EM>double</EM> <EM>lines</EM> <EM>*/</EM>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_BTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_HLINE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_LLCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_LRCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_LTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_PLUS;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_RTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_TTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_ULCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_URCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_VLINE;</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
|
||||
</PRE><H3><a name="h3-add_wch">add_wch</a></H3><PRE>
|
||||
The <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, and <STRONG>mvwadd_wch</STRONG> functions put the
|
||||
complex character <EM>wch</EM> into the given window at its current position,
|
||||
which is then advanced. These functions perform wrapping and special-
|
||||
character processing as follows:
|
||||
</PRE><H3><a name="h3-wadd_wch">wadd_wch</a></H3><PRE>
|
||||
<STRONG>wadd_wch</STRONG> writes the <EM>curses</EM> complex character <EM>wch</EM> to the window <EM>win</EM>,
|
||||
then may advance the cursor position, analogously to the standard C
|
||||
library's <STRONG>putwchar(3)</STRONG>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this
|
||||
function.
|
||||
|
||||
<STRONG>o</STRONG> If <EM>wch</EM> refers to a spacing character, then any previous character
|
||||
at that location is removed. A new character specified by <EM>wch</EM> is
|
||||
placed at that location with rendition specified by <EM>wch</EM>. The
|
||||
cursor then advances after this spacing character, to prepare for
|
||||
writing the next character on the screen.
|
||||
Construct a <EM>curses</EM> complex character from a <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> with <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG>.
|
||||
A <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> can be copied from place to place using <STRONG><A HREF="curs_in_wch.3x.html">win_wch(3x)</A></STRONG> and
|
||||
<STRONG>wadd_wch</STRONG>. <EM>curses</EM> defines constants to aid the manipulation of
|
||||
character attributes; see <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>. A complex character whose
|
||||
only character component is a wide space, and whose only attribute is
|
||||
<STRONG>WA_NORMAL</STRONG>, is a <EM>blank</EM> <EM>character</EM>, and therefore combines with the
|
||||
window's background character; see <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>.
|
||||
|
||||
The newly added spacing character is the base of the active complex
|
||||
character. Subsequent non-spacing characters can be combined with
|
||||
this base until another spacing character is written to the screen,
|
||||
or the cursor is moved, e.g., using <STRONG>wmove</STRONG>.
|
||||
Much behavior depends on whether the wide characters in <EM>wch</EM> are spacing
|
||||
or non-spacing; see subsection "Complex Characters" below.
|
||||
|
||||
<STRONG>o</STRONG> If <EM>wch</EM> refers to a non-spacing character, it is appended to the
|
||||
active complex character, retaining the previous characters at that
|
||||
location. The rendition specified by <EM>wch</EM> is ignored.
|
||||
<STRONG>o</STRONG> If <EM>wch</EM> contains a spacing character, then any character at the
|
||||
cursor is first removed. The complex character <EM>wch</EM>, with its
|
||||
attributes and color pair identifier, becomes the <EM>base</EM> of the
|
||||
<EM>active</EM> <EM>complex</EM> <EM>character</EM>.
|
||||
|
||||
The cursor is not advanced after adding a non-spacing character.
|
||||
Subsequent calls to add non-spacing characters will update the same
|
||||
position.
|
||||
<STRONG>o</STRONG> If <EM>wch</EM> contains only non-spacing characters, they are combined with
|
||||
the active complex character. <EM>curses</EM> ignores its attributes and
|
||||
color pair identifier, and does not advance the cursor.
|
||||
|
||||
<STRONG>o</STRONG> If the character part of <EM>wch</EM> is a tab, newline, backspace or other
|
||||
control character, the window is updated and the cursor moves as if
|
||||
<STRONG>addch</STRONG> were called.
|
||||
Further non-spacing characters added with <STRONG>wadd_wch</STRONG> are not written at
|
||||
the new cursor position but combine with the active complex character
|
||||
until another spacing character is written to the window or the cursor
|
||||
is moved.
|
||||
|
||||
If <EM>wch</EM> is a backspace, carriage return, line feed, or tab, the cursor
|
||||
moves appropriately within the window.
|
||||
|
||||
<STRONG>o</STRONG> Backspace moves the cursor one character left; at the left margin
|
||||
of a window, it does nothing.
|
||||
|
||||
<STRONG>o</STRONG> Carriage return moves the cursor to the left margin on the same
|
||||
line of the window.
|
||||
|
||||
<STRONG>o</STRONG> Line feed does a <STRONG><A HREF="curs_clear.3x.html">clrtoeol(3x)</A></STRONG>, then advances as if from the right
|
||||
margin.
|
||||
|
||||
<STRONG>o</STRONG> Tab advances the cursor to the next tab stop (possibly on the next
|
||||
line); these are placed at every eighth column by default.
|
||||
|
||||
Alter the tab interval with the <STRONG>TABSIZE</STRONG> extension; see
|
||||
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
|
||||
|
||||
If <EM>wch</EM> is any other nonprintable character, <EM>curses</EM> draws it in
|
||||
printable form using the same convention as <STRONG><A HREF="curs_util.3x.html">wunctrl(3x)</A></STRONG>. Calling
|
||||
<STRONG><A HREF="curs_in_wch.3x.html">win_wch(3x)</A></STRONG> on the location of a nonprintable character does not
|
||||
retrieve the character itself, but its <STRONG><A HREF="curs_util.3x.html">wunctrl(3x)</A></STRONG> representation.
|
||||
|
||||
Adding spacing characters with <STRONG>wadd_wch</STRONG> causes it to wrap at the right
|
||||
margin of the window:
|
||||
|
||||
<STRONG>o</STRONG> If the cursor is not at the bottom of the scrolling region and
|
||||
advancement occurs at the right margin, the cursor automatically
|
||||
wraps to the beginning of the next line.
|
||||
|
||||
<STRONG>o</STRONG> If the cursor is at the bottom of the scrolling region when
|
||||
advancement occurs at the right margin, and <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> is enabled
|
||||
for <EM>win</EM>, the scrolling region scrolls up one line and the cursor
|
||||
wraps as above. Otherwise, advancement and scrolling do not occur,
|
||||
and <STRONG>wadd_wch</STRONG> returns <STRONG>ERR</STRONG>.
|
||||
|
||||
A window's margins may coincide with the screen boundaries. This may
|
||||
be a problem when <EM>ncurses</EM> updates the screen to match the curses
|
||||
window. When their right and bottom margins coincide, <EM>ncurses</EM> uses
|
||||
different strategies to handle the variations of scrolling and wrapping
|
||||
at the lower-right corner by depending on the terminal capabilities:
|
||||
|
||||
<STRONG>o</STRONG> If the terminal does not automatically wrap as characters are added
|
||||
at the right margin (i.e., auto right margins), <EM>ncurses</EM> writes the
|
||||
character directly.
|
||||
|
||||
<STRONG>o</STRONG> If the terminal has auto right margins, but also has capabilities
|
||||
for turning auto margins off and on, <EM>ncurses</EM> turns the auto margin
|
||||
feature off temporarily when writing to the lower-right corner.
|
||||
|
||||
<STRONG>o</STRONG> If the terminal has an insertion mode which can be turned off and
|
||||
on, <EM>ncurses</EM> writes the character just before the lower-right
|
||||
corner, and then inserts a character to push the update into the
|
||||
corner.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-echo_wchar">echo_wchar</a></H3><PRE>
|
||||
The <STRONG>echo_wchar</STRONG> function is functionally equivalent to a call to <STRONG>add_wch</STRONG>
|
||||
followed by a call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>. Similarly, the <STRONG>wecho_wchar</STRONG> is
|
||||
functionally equivalent to a call to <STRONG>wadd_wch</STRONG> followed by a call to
|
||||
<STRONG>wrefresh</STRONG>. The knowledge that only a single character is being output
|
||||
is taken into consideration and, for non-control characters, a
|
||||
considerable performance gain might be seen by using the *<STRONG>echo</STRONG>*
|
||||
functions instead of their equivalents.
|
||||
</PRE><H3><a name="h3-wecho_wchar">wecho_wchar</a></H3><PRE>
|
||||
<STRONG>echo_wchar</STRONG> and <STRONG>wecho_wchar</STRONG> are equivalent to calling (<STRONG>w</STRONG>)<STRONG>add_wch</STRONG>
|
||||
followed by (<STRONG>w</STRONG>)<STRONG>refresh</STRONG> on <STRONG>stdscr</STRONG> or the specified window. <EM>curses</EM>
|
||||
interprets these functions as a hint that only a single (complex)
|
||||
character is being output; for non-control characters, a considerable
|
||||
performance gain may be enjoyed by employing them.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Line-Graphics">Line Graphics</a></H3><PRE>
|
||||
Like <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>, <STRONG>addch_wch</STRONG> accepts symbols which make it simple to draw
|
||||
lines and other frequently used special characters. These symbols
|
||||
correspond to the same VT100 line-drawing set as <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>.
|
||||
</PRE><H3><a name="h3-Forms-Drawing-Characters">Forms-Drawing Characters</a></H3><PRE>
|
||||
<EM>curses</EM> defines macros starting with <STRONG>WACS_</STRONG> that can be used with
|
||||
<STRONG>wadd_wch</STRONG> to write line-drawing and other symbols to the screen.
|
||||
<EM>ncurses</EM> terms these <EM>forms-drawing</EM> <EM>characters.</EM> <EM>curses</EM> uses the ACS
|
||||
default listed below if the terminal type lacks the <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>)
|
||||
capability; that capability does not define a replacement for the
|
||||
character; or if the terminal type and locale configuration require
|
||||
Unicode to access these characters, but the library is unable to use
|
||||
Unicode. The "acsc char" column corresponds to how the characters are
|
||||
specified in the <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>) string capability, and the characters
|
||||
in it may appear on the screen if the terminal type's database entry
|
||||
incorrectly advertises ACS support. The name "ACS" originates in the
|
||||
Alternate Character Set feature of the DEC VT100 terminal.
|
||||
|
||||
<STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG>
|
||||
|
||||
|
||||
<STRONG>ACS</STRONG> <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>Char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
|
||||
<STRONG>Unicode</STRONG> <STRONG>ACS</STRONG> <STRONG>acsc</STRONG>
|
||||
<STRONG>Symbol</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
|
||||
------------------------------------------------------------------------
|
||||
<STRONG>WACS_BLOCK</STRONG> 0x25ae # 0 solid square block
|
||||
<STRONG>WACS_BOARD</STRONG> 0x2592 # h board of squares
|
||||
<STRONG>WACS_BTEE</STRONG> 0x2534 + v bottom tee
|
||||
<STRONG>WACS_BULLET</STRONG> 0x00b7 o ~ bullet
|
||||
<STRONG>WACS_CKBOARD</STRONG> 0x2592 : a checker board (stipple)
|
||||
<STRONG>WACS_DARROW</STRONG> 0x2193 v . arrow pointing down
|
||||
<STRONG>WACS_DEGREE</STRONG> 0x00b0 ' f degree symbol
|
||||
<STRONG>WACS_DIAMOND</STRONG> 0x25c6 + ` diamond
|
||||
<STRONG>WACS_GEQUAL</STRONG> 0x2265 > > greater-than-or-equal-to
|
||||
<STRONG>WACS_HLINE</STRONG> 0x2500 - q horizontal line
|
||||
<STRONG>WACS_LANTERN</STRONG> 0x2603 # i lantern symbol
|
||||
<STRONG>WACS_LARROW</STRONG> 0x2190 < , arrow pointing left
|
||||
<STRONG>WACS_LEQUAL</STRONG> 0x2264 < y less-than-or-equal-to
|
||||
<STRONG>WACS_LLCORNER</STRONG> 0x2514 + m lower left-hand corner
|
||||
<STRONG>WACS_LRCORNER</STRONG> 0x2518 + j lower right-hand corner
|
||||
<STRONG>WACS_LTEE</STRONG> 0x2524 + t left tee
|
||||
<STRONG>WACS_NEQUAL</STRONG> 0x2260 ! | not-equal
|
||||
<STRONG>WACS_PI</STRONG> 0x03c0 * { greek pi
|
||||
<STRONG>WACS_PLMINUS</STRONG> 0x00b1 # g plus/minus
|
||||
<STRONG>WACS_PLUS</STRONG> 0x253c + n plus
|
||||
<STRONG>WACS_RARROW</STRONG> 0x2192 > + arrow pointing right
|
||||
<STRONG>WACS_RTEE</STRONG> 0x251c + u right tee
|
||||
<STRONG>WACS_S1</STRONG> 0x23ba - o scan line 1
|
||||
<STRONG>WACS_S3</STRONG> 0x23bb - p scan line 3
|
||||
<STRONG>WACS_S7</STRONG> 0x23bc - r scan line 7
|
||||
<STRONG>WACS_S9</STRONG> 0x23bd _ s scan line 9
|
||||
<STRONG>WACS_STERLING</STRONG> 0x00a3 f } pound-sterling symbol
|
||||
<STRONG>WACS_TTEE</STRONG> 0x252c + w top tee
|
||||
<STRONG>WACS_UARROW</STRONG> 0x2191 ^ - arrow pointing up
|
||||
<STRONG>WACS_ULCORNER</STRONG> 0x250c + l upper left-hand corner
|
||||
<STRONG>WACS_URCORNER</STRONG> 0x2510 + k upper right-hand corner
|
||||
<STRONG>WACS_VLINE</STRONG> 0x2502 | x vertical line
|
||||
<STRONG>WACS_BLOCK</STRONG> U+25ae # 0 solid square block
|
||||
<STRONG>WACS_BOARD</STRONG> U+2592 # h board of squares
|
||||
<STRONG>WACS_BTEE</STRONG> U+2534 + v bottom tee
|
||||
<STRONG>WACS_BULLET</STRONG> U+00b7 o ~ bullet
|
||||
<STRONG>WACS_CKBOARD</STRONG> U+2592 : a checker board (stipple)
|
||||
<STRONG>WACS_DARROW</STRONG> U+2193 v . arrow pointing down
|
||||
<STRONG>WACS_DEGREE</STRONG> U+00b0 ' f degree symbol
|
||||
<STRONG>WACS_DIAMOND</STRONG> U+25c6 + ` diamond
|
||||
<STRONG>WACS_GEQUAL</STRONG> U+2265 > > greater-than-or-equal-to
|
||||
<STRONG>WACS_HLINE</STRONG> U+2500 - q horizontal line
|
||||
<STRONG>WACS_LANTERN</STRONG> U+2603 # i lantern symbol
|
||||
<STRONG>WACS_LARROW</STRONG> U+2190 < , arrow pointing left
|
||||
<STRONG>WACS_LEQUAL</STRONG> U+2264 < y less-than-or-equal-to
|
||||
<STRONG>WACS_LLCORNER</STRONG> U+2514 + m lower left-hand corner
|
||||
<STRONG>WACS_LRCORNER</STRONG> U+2518 + j lower right-hand corner
|
||||
<STRONG>WACS_LTEE</STRONG> U+2524 + t left tee
|
||||
<STRONG>WACS_NEQUAL</STRONG> U+2260 ! | not-equal
|
||||
<STRONG>WACS_PI</STRONG> U+03c0 * { greek pi
|
||||
<STRONG>WACS_PLMINUS</STRONG> U+00b1 # g plus/minus
|
||||
<STRONG>WACS_PLUS</STRONG> U+253c + n plus
|
||||
<STRONG>WACS_RARROW</STRONG> U+2192 > + arrow pointing right
|
||||
<STRONG>WACS_RTEE</STRONG> U+251c + u right tee
|
||||
<STRONG>WACS_S1</STRONG> U+23ba - o scan line 1
|
||||
<STRONG>WACS_S3</STRONG> U+23bb - p scan line 3
|
||||
<STRONG>WACS_S7</STRONG> U+23bc - r scan line 7
|
||||
<STRONG>WACS_S9</STRONG> U+23bd _ s scan line 9
|
||||
<STRONG>WACS_STERLING</STRONG> U+00a3 f } pound-sterling symbol
|
||||
<STRONG>WACS_TTEE</STRONG> U+252c + w top tee
|
||||
<STRONG>WACS_UARROW</STRONG> U+2191 ^ - arrow pointing up
|
||||
<STRONG>WACS_ULCORNER</STRONG> U+250c + l upper left-hand corner
|
||||
<STRONG>WACS_URCORNER</STRONG> U+2510 + k upper right-hand corner
|
||||
<STRONG>WACS_VLINE</STRONG> U+2502 | x vertical line
|
||||
|
||||
The wide-character configuration of <EM>ncurses</EM> also defines symbols for
|
||||
thick lines (<STRONG>acsc</STRONG> "J" to "V"):
|
||||
The <EM>ncurses</EM> wide API also defines symbols for thick lines (<STRONG>acsc</STRONG> "J"
|
||||
through "N", "T" through "X", and "Q"):
|
||||
|
||||
<STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG>
|
||||
<STRONG>ACS</STRONG> <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>Char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
|
||||
------------------------------------------------------------------------
|
||||
<STRONG>WACS_T_BTEE</STRONG> 0x253b + V thick tee pointing up
|
||||
<STRONG>WACS_T_HLINE</STRONG> 0x2501 - Q thick horizontal line
|
||||
<STRONG>WACS_T_LLCORNER</STRONG> 0x2517 + M thick lower left corner
|
||||
<STRONG>WACS_T_LRCORNER</STRONG> 0x251b + J thick lower right corner
|
||||
<STRONG>WACS_T_LTEE</STRONG> 0x252b + T thick tee pointing right
|
||||
<STRONG>WACS_T_PLUS</STRONG> 0x254b + N thick large plus
|
||||
<STRONG>WACS_T_RTEE</STRONG> 0x2523 + U thick tee pointing left
|
||||
<STRONG>WACS_T_TTEE</STRONG> 0x2533 + W thick tee pointing down
|
||||
<STRONG>WACS_T_ULCORNER</STRONG> 0x250f + L thick upper left corner
|
||||
<STRONG>WACS_T_URCORNER</STRONG> 0x2513 + K thick upper right corner
|
||||
<STRONG>WACS_T_VLINE</STRONG> 0x2503 | X thick vertical line
|
||||
<STRONG>WACS_T_BTEE</STRONG> U+253b + V thick tee pointing up
|
||||
<STRONG>WACS_T_HLINE</STRONG> U+2501 - Q thick horizontal line
|
||||
<STRONG>WACS_T_LLCORNER</STRONG> U+2517 + M thick lower left corner
|
||||
<STRONG>WACS_T_LRCORNER</STRONG> U+251b + J thick lower right corner
|
||||
<STRONG>WACS_T_LTEE</STRONG> U+252b + T thick tee pointing right
|
||||
<STRONG>WACS_T_PLUS</STRONG> U+254b + N thick large plus
|
||||
<STRONG>WACS_T_RTEE</STRONG> U+2523 + U thick tee pointing left
|
||||
<STRONG>WACS_T_TTEE</STRONG> U+2533 + W thick tee pointing down
|
||||
<STRONG>WACS_T_ULCORNER</STRONG> U+250f + L thick upper left corner
|
||||
<STRONG>WACS_T_URCORNER</STRONG> U+2513 + K thick upper right corner
|
||||
<STRONG>WACS_T_VLINE</STRONG> U+2503 | X thick vertical line
|
||||
|
||||
and for double-lines (<STRONG>acsc</STRONG> "A" to "I"):
|
||||
and for double lines (<STRONG>acsc</STRONG> "A" through "I", plus "R" and "Y"):
|
||||
|
||||
<STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG>
|
||||
<STRONG>ACS</STRONG> <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>Char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
|
||||
------------------------------------------------------------------------
|
||||
<STRONG>WACS_D_BTEE</STRONG> 0x2569 + H double tee pointing up
|
||||
<STRONG>WACS_D_HLINE</STRONG> 0x2550 - R double horizontal line
|
||||
<STRONG>WACS_D_LLCORNER</STRONG> 0x255a + D double lower left corner
|
||||
<STRONG>WACS_D_LRCORNER</STRONG> 0x255d + A double lower right corner
|
||||
<STRONG>WACS_D_LTEE</STRONG> 0x2560 + F double tee pointing right
|
||||
<STRONG>WACS_D_PLUS</STRONG> 0x256c + E double large plus
|
||||
<STRONG>WACS_D_RTEE</STRONG> 0x2563 + G double tee pointing left
|
||||
|
||||
<STRONG>WACS_D_TTEE</STRONG> 0x2566 + I double tee pointing down
|
||||
<STRONG>WACS_D_ULCORNER</STRONG> 0x2554 + C double upper left corner
|
||||
<STRONG>WACS_D_URCORNER</STRONG> 0x2557 + B double upper right corner
|
||||
<STRONG>WACS_D_VLINE</STRONG> 0x2551 | Y double vertical line
|
||||
<STRONG>WACS_D_BTEE</STRONG> U+2569 + H double tee pointing up
|
||||
<STRONG>WACS_D_HLINE</STRONG> U+2550 - R double horizontal line
|
||||
<STRONG>WACS_D_LLCORNER</STRONG> U+255a + D double lower left corner
|
||||
<STRONG>WACS_D_LRCORNER</STRONG> U+255d + A double lower right corner
|
||||
<STRONG>WACS_D_LTEE</STRONG> U+2560 + F double tee pointing right
|
||||
<STRONG>WACS_D_PLUS</STRONG> U+256c + E double large plus
|
||||
<STRONG>WACS_D_RTEE</STRONG> U+2563 + G double tee pointing left
|
||||
<STRONG>WACS_D_TTEE</STRONG> U+2566 + I double tee pointing down
|
||||
<STRONG>WACS_D_ULCORNER</STRONG> U+2554 + C double upper left corner
|
||||
<STRONG>WACS_D_URCORNER</STRONG> U+2557 + B double upper right corner
|
||||
<STRONG>WACS_D_VLINE</STRONG> U+2551 | Y double vertical line
|
||||
|
||||
Unicode's descriptions for these characters differs slightly from
|
||||
<EM>ncurses</EM>, by introducing the term "light" (along with less important
|
||||
@@ -198,75 +316,85 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions. This
|
||||
implementation returns an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the window pointer is null or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if it is not possible to add a complete character in the window.
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer,
|
||||
|
||||
The latter may be due to different causes:
|
||||
<STRONG>o</STRONG> wrapping to a new line is impossible because <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> has not
|
||||
been called on <EM>win</EM> (or <STRONG>stdscr</STRONG>, as applicable) when writing to its
|
||||
bottom right location is attempted, or
|
||||
|
||||
<STRONG>o</STRONG> If <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> is not enabled, writing a character at the lower
|
||||
right margin succeeds. However, an error is returned because it is
|
||||
not possible to wrap to a new line.
|
||||
<STRONG>o</STRONG> it is not possible to add a complete character at the cursor
|
||||
position.
|
||||
|
||||
<STRONG>o</STRONG> If an error is detected when converting a multibyte character to a
|
||||
sequence of bytes, or if it is not possible to add all of the
|
||||
resulting bytes in the window, an error is returned.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Note that <STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, and <STRONG>echo_wchar</STRONG> may be macros.
|
||||
<STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, and <STRONG>echo_wchar</STRONG> may be implemented as
|
||||
macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
The symbols <EM>WACS</EM><STRONG>_</STRONG><EM>S3</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>S7</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>LEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>GEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>PI</EM>,
|
||||
<EM>WACS</EM><STRONG>_</STRONG><EM>NEQUAL</EM>, and <EM>WACS</EM><STRONG>_</STRONG><EM>STERLING</EM> are not standard. However, many
|
||||
publicly available <EM>terminfo</EM> entries include <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>)
|
||||
capabilities in which their key characters (<STRONG>pryz{|}</STRONG>) are embedded, and
|
||||
a second-hand list of their character descriptions has come to light.
|
||||
The <EM>ncurses</EM> developers invented WACS-prefixed names for them.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4. The defaults
|
||||
specified for line-drawing characters apply in the POSIX locale.
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
These functions are described in X/Open Curses Issue 4. It specifies
|
||||
no error conditions for them.
|
||||
|
||||
</PRE><H3><a name="h3-WACS-Symbols">WACS Symbols</a></H3><PRE>
|
||||
X/Open Curses makes it clear that the WACS_ symbols should be defined
|
||||
as a pointer to <STRONG>cchar_t</STRONG> data, e.g., in the discussion of <STRONG>border_set</STRONG>. A
|
||||
few implementations are problematic:
|
||||
The defaults specified for forms-drawing characters apply in the POSIX
|
||||
locale. X/Open Curses makes it clear that the WACS_ symbols should be
|
||||
defined as a pointer to <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> data, e.g., in the discussion of
|
||||
<EM>border</EM><STRONG>_</STRONG><EM>set</EM>. A few implementations are problematic:
|
||||
|
||||
<STRONG>o</STRONG> NetBSD curses defines the symbols as a <STRONG>wchar_t</STRONG> within a <STRONG>cchar_t</STRONG>.
|
||||
<STRONG>o</STRONG> NetBSD <EM>curses</EM> defines the symbols as a <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> within a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
<STRONG>o</STRONG> HP-UX curses equates some of the <STRONG>ACS_</STRONG> symbols to the analogous
|
||||
<STRONG>WACS_</STRONG> symbols as if the <STRONG>ACS_</STRONG> symbols were wide characters. The
|
||||
<STRONG>o</STRONG> HP-UX <EM>curses</EM> equates some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the analogous
|
||||
<EM>WACS</EM><STRONG>_</STRONG> symbols as if the <EM>ACS</EM><STRONG>_</STRONG> symbols were wide characters. The
|
||||
misdefined symbols are the arrows and other symbols which are not
|
||||
used for line-drawing.
|
||||
|
||||
X/Open Curses does not specify symbols for thick- or double-lines.
|
||||
SVr4 curses implementations defined their line-drawing symbols in terms
|
||||
of intermediate symbols. This implementation extends those symbols,
|
||||
providing new definitions which are not in the SVr4 implementations.
|
||||
SVr4 <EM>curses</EM> implementations defined their line-drawing symbols in terms
|
||||
of intermediate symbols. <EM>ncurses</EM> extends those symbols, providing new
|
||||
definitions not found in SVr4 implementations.
|
||||
|
||||
Not all Unicode-capable terminals provide support for VT100-style
|
||||
alternate character sets (i.e., the <STRONG>acsc</STRONG> capability), with their
|
||||
corresponding line-drawing characters. X/Open Curses did not address
|
||||
the aspect of integrating Unicode with line-drawing characters.
|
||||
Existing implementations of Unix curses (AIX, HP-UX, Solaris) use only
|
||||
the <STRONG>acsc</STRONG> character-mapping to provide this feature. As a result, those
|
||||
implementations can only use single-byte line-drawing characters.
|
||||
<EM>ncurses</EM> 5.3 (2002) provided a table of Unicode values to solve these
|
||||
problems. NetBSD curses incorporated that table in 2010.
|
||||
Not all Unicode-capable terminals provide support for VT100-style
|
||||
alternate character sets (i.e., the <EM>acsc</EM><STRONG>_</STRONG><EM>chars</EM> (<STRONG>acsc</STRONG>) capability), with
|
||||
their corresponding line-drawing characters. X/Open Curses did not
|
||||
address the aspect of integrating Unicode with line-drawing characters.
|
||||
Existing implementations of System V <EM>curses</EM> (AIX, HP-UX, Solaris) use
|
||||
only the <EM>acsc</EM><STRONG>_</STRONG><EM>chars</EM> (<STRONG>acsc</STRONG>) character-mapping to provide this feature.
|
||||
As a result, those implementations can use only single-byte line-
|
||||
drawing characters. <EM>ncurses</EM> 5.3 (2002) provided a table of Unicode
|
||||
values to solve these problems. NetBSD <EM>curses</EM> incorporated that table
|
||||
in 2010.
|
||||
|
||||
In this implementation, the Unicode values are used instead of the
|
||||
terminal description's <STRONG>acsc</STRONG> mapping as discussed in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> for the
|
||||
environment variable <EM>NCURSES</EM><STRONG>_</STRONG><EM>NO</EM><STRONG>_</STRONG><EM>UTF8</EM><STRONG>_</STRONG><EM>ACS</EM>. In contrast, for the same
|
||||
cases, the line-drawing characters described in <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG> will use only
|
||||
the ASCII default values.
|
||||
<EM>ncurses</EM> uses the Unicode values instead of the terminal type
|
||||
description's <EM>acsc</EM><STRONG>_</STRONG><EM>chars</EM> (<STRONG>acsc</STRONG>) mapping as discussed in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> for
|
||||
the environment variable <EM>NCURSES</EM><STRONG>_</STRONG><EM>NO</EM><STRONG>_</STRONG><EM>UTF8</EM><STRONG>_</STRONG><EM>ACS</EM>. In contrast, for the
|
||||
same cases, the line-drawing characters described in <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG> will use
|
||||
only the ASCII default values.
|
||||
|
||||
Having Unicode available does not solve all of the problems with line-
|
||||
drawing for curses:
|
||||
drawing for <EM>curses</EM>:
|
||||
|
||||
<STRONG>o</STRONG> The closest Unicode equivalents to the VT100 graphics <EM>S1</EM>, <EM>S3</EM>, <EM>S7</EM>
|
||||
<STRONG>o</STRONG> The closest Unicode equivalents to the VT100 graphics <EM>S1</EM>, <EM>S3</EM>, <EM>S7</EM>,
|
||||
and <EM>S9</EM> frequently are not displayed at the regular intervals which
|
||||
the terminal used.
|
||||
|
||||
@@ -277,45 +405,58 @@
|
||||
Lacking documentation, most readers assume that a <EM>storm</EM> <EM>lantern</EM> was
|
||||
intended. But there are several possibilities, all with problems.
|
||||
|
||||
Unicode 6.0 (2010) does provide two lantern symbols: U+1F383 and
|
||||
U+1F3EE. Those were not available in 2002, and are irrelevant
|
||||
since they lie outside the BMP and as a result are not generally
|
||||
available in terminals. They are not storm lanterns, in any case.
|
||||
Unicode 6.0 (2010) does provide two lantern symbols: U+1F383 and
|
||||
U+1F3EE. Those were not available in 2002, and are irrelevant
|
||||
since they lie outside the Basic Multilingual Plane and as a result
|
||||
are unavailable on many terminals. They are not storm lanterns, in
|
||||
any case.
|
||||
|
||||
Most <EM>storm</EM> <EM>lanterns</EM> have a tapering glass chimney (to guard against
|
||||
tipping); some have a wire grid protecting the chimney.
|
||||
|
||||
For the tapering appearance, U+2603 was adequate. In use on a
|
||||
For the tapering appearance, U+2603 was adequate. In use on a
|
||||
terminal, no one can tell what the image represents. Unicode calls
|
||||
it a snowman.
|
||||
|
||||
Others have suggested these alternatives: <section> U+00A7 (section
|
||||
mark), <Theta> U+0398 (theta), <Phi> U+03A6 (phi), <delta> U+03B4
|
||||
mark), <Theta> U+0398 (theta), <Phi> U+03A6 (phi), <delta> U+03B4
|
||||
(delta), U+2327 (x in a rectangle), U+256C (forms double vertical
|
||||
and horizontal), and U+2612 (ballot box with x).
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Complex-Characters">Complex Characters</a></H3><PRE>
|
||||
The complex character type <STRONG>cchar_t</STRONG> can store more than one wide
|
||||
character (<STRONG>wchar_t</STRONG>). The X/Open Curses description does not mention
|
||||
this possibility, describing only the cases where <EM>wch</EM> is a spacing
|
||||
character or a non-spacing character.
|
||||
The complex character type <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> can store more than one wide
|
||||
character (<EM>wchar</EM><STRONG>_</STRONG><EM>t</EM>). X/Open Curses does not mention this possibility,
|
||||
specifying behavior only where <EM>wch</EM> is a single character, either
|
||||
spacing or non-spacing.
|
||||
|
||||
This implementation assumes that <EM>wch</EM> is constructed using <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG>,
|
||||
and in turn that the result
|
||||
<EM>ncurses</EM> assumes that <EM>wch</EM> is constructed using <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG>, and in turn
|
||||
that the result
|
||||
|
||||
<STRONG>o</STRONG> contains at most one spacing character in the beginning of its list
|
||||
of wide characters, and zero or more non-spacing characters or
|
||||
<STRONG>o</STRONG> contains at most one spacing character at the beginning of its list
|
||||
of wide characters, and zero or more non-spacing characters, or
|
||||
|
||||
<STRONG>o</STRONG> may hold one non-spacing character.
|
||||
<STRONG>o</STRONG> holds one non-spacing character.
|
||||
|
||||
In the latter case, <EM>ncurses</EM> adds the non-spacing character to the
|
||||
active (base) spacing character.
|
||||
active complex character.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-TABSIZE">TABSIZE</a></H3><PRE>
|
||||
The <STRONG>TABSIZE</STRONG> variable is implemented in SVr4 and other versions of
|
||||
<EM>curses</EM>, but is not specified by X/Open Curses (see <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>).
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition (SVID) Version 4 of the same year
|
||||
specified functions named <EM>waddwch</EM> (and the usual variants), <EM>echowchar</EM>,
|
||||
and <EM>wechowchar</EM>. These were later additions to SVr4.<EM>x</EM>, not appearing in
|
||||
the first SVr4 (1989). They differed from X/Open's later <EM>wadd</EM><STRONG>_</STRONG><EM>wch</EM> and
|
||||
<EM>wecho</EM><STRONG>_</STRONG><EM>wchar</EM> in that they each took an argument of type <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> instead
|
||||
of <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>. SVID defined no <EM>WACS</EM><STRONG>_</STRONG> symbols.
|
||||
|
||||
X/Open Curses Issue 4 also defined many of the <EM>WACS</EM><STRONG>_</STRONG> constants,
|
||||
excepting <EM>WACS</EM><STRONG>_</STRONG><EM>GEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>LEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>NEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>PI</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>S3</EM>,
|
||||
<EM>WACS</EM><STRONG>_</STRONG><EM>S7</EM>, and <EM>WACS</EM><STRONG>_</STRONG><EM>STERLING</EM>; and those for drawing thick and double
|
||||
lines.
|
||||
|
||||
<EM>ncurses</EM> 5.3 (2002) furnished the remaining <EM>WACS</EM><STRONG>_</STRONG> constants.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
@@ -323,12 +464,10 @@
|
||||
its non-wide-character configuration.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>putwc(3)</STRONG>
|
||||
<STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>putwc(3)</STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-11-11 <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -336,20 +475,20 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="c
|
||||
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
|
||||
<ul>
|
||||
<li><a href="#h3-add_wch">add_wch</a></li>
|
||||
<li><a href="#h3-echo_wchar">echo_wchar</a></li>
|
||||
<li><a href="#h3-Line-Graphics">Line Graphics</a></li>
|
||||
<li><a href="#h3-wadd_wch">wadd_wch</a></li>
|
||||
<li><a href="#h3-wecho_wchar">wecho_wchar</a></li>
|
||||
<li><a href="#h3-Forms-Drawing-Characters">Forms-Drawing Characters</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a>
|
||||
<ul>
|
||||
<li><a href="#h3-WACS-Symbols">WACS Symbols</a></li>
|
||||
<li><a href="#h3-Complex-Characters">Complex Characters</a></li>
|
||||
<li><a href="#h3-TABSIZE">TABSIZE</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,93 +27,101 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_add_wchstr.3x,v 1.39 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_add_wchstr.3x,v 1.61 2025/10/21 00:06:34 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_add_wchstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_add_wchstr 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_add_wchstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_add_wchstr 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>add_wchstr</STRONG>, <STRONG>add_wchnstr</STRONG>, <STRONG>wadd_wchstr</STRONG>, <STRONG>wadd_wchnstr</STRONG>, <STRONG>mvadd_wchstr</STRONG>,
|
||||
<STRONG>mvadd_wchnstr</STRONG>, <STRONG>mvwadd_wchstr</STRONG>, <STRONG>mvwadd_wchnstr</STRONG> - add a <EM>curses</EM> complex
|
||||
<STRONG>add_wchstr</STRONG>, <STRONG>wadd_wchstr</STRONG>, <STRONG>mvadd_wchstr</STRONG>, <STRONG>mvwadd_wchstr</STRONG>, <STRONG>add_wchnstr</STRONG>,
|
||||
<STRONG>wadd_wchnstr</STRONG>, <STRONG>mvadd_wchnstr</STRONG>, <STRONG>mvwadd_wchnstr</STRONG> - add a <EM>curses</EM> complex
|
||||
character string to a window
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>add_wchstr(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wadd_wchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvadd_wchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwadd_wchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>add_wchstr(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wadd_wchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvadd_wchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwadd_wchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>add_wchnstr(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wadd_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvadd_wchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwadd_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>add_wchnstr(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wadd_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvadd_wchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwadd_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These functions copy the (null-terminated) array of complex characters
|
||||
<EM>wchstr</EM> into the window image structure starting at the current cursor
|
||||
position.
|
||||
<STRONG>wadd_wchstr</STRONG> copies the string of complex characters <EM>wchstr</EM> to the
|
||||
window <EM>win</EM>. A null complex character terminates the string. If a
|
||||
complex character does not completely fit at the end of the line,
|
||||
<EM>curses</EM> fills its remaining cells with the window's background
|
||||
character; see <STRONG><A HREF="curs_bkgrnd.3x.html">bkgrnd(3x)</A></STRONG>. <STRONG>wadd_wchnstr</STRONG> does the same, but copies at
|
||||
most <EM>n</EM> characters, or as many as possible if <EM>n</EM> is <STRONG>-1</STRONG>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>
|
||||
describes the variants of these functions.
|
||||
|
||||
The four functions with <EM>n</EM> as the last argument copy at most <EM>n</EM> elements,
|
||||
but no more than will fit on the line. If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the whole array is
|
||||
copied, to the maximum number of characters that will fit on the line.
|
||||
Because these functions do not call <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> internally, they are
|
||||
faster than <STRONG><A HREF="curs_addwstr.3x.html">waddwstr(3x)</A></STRONG> and <STRONG><A HREF="curs_addwstr.3x.html">waddnwstr(3x)</A></STRONG>. On the other hand, they
|
||||
|
||||
The window cursor is <EM>not</EM> advanced. These functions are faster than
|
||||
<STRONG>waddnstr</STRONG>. On the other hand:
|
||||
<STRONG>o</STRONG> do not treat the backspace, carriage return, or line feed
|
||||
characters specially;
|
||||
|
||||
<STRONG>o</STRONG> they do not perform checking (such as for the newline, backspace,
|
||||
or carriage return characters),
|
||||
<STRONG>o</STRONG> do not represent unprintable characters with <STRONG><A HREF="curs_util.3x.html">wunctrl(3x)</A></STRONG>;
|
||||
|
||||
<STRONG>o</STRONG> they do not advance the current cursor position,
|
||||
<STRONG>o</STRONG> do not update the cursor position to follow the last character
|
||||
written; and
|
||||
|
||||
<STRONG>o</STRONG> they do not expand other control characters to ^-escapes, and
|
||||
|
||||
<STRONG>o</STRONG> they truncate the string if it crosses the right margin, rather
|
||||
than wrapping it around to the new line.
|
||||
|
||||
These functions end successfully on encountering a null <STRONG>cchar_t</STRONG>, or
|
||||
when they have filled the current line. If a complex character cannot
|
||||
completely fit at the end of the current line, the remaining columns
|
||||
are filled with the background character and rendition.
|
||||
<STRONG>o</STRONG> truncate the string at the window's right margin, rather than
|
||||
wrapping it to the next line and potentially scrolling.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions. This
|
||||
implementation returns an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>win</EM> parameter is null or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>wchstr</EM> parameter is null.
|
||||
<STRONG>o</STRONG> <EM>wchstr</EM> is a null pointer, or
|
||||
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
All functions except <STRONG>wadd_wchnstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>wadd_wchnstr</STRONG> may be implemented as
|
||||
macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition Version 4 of the same year specified
|
||||
functions named <EM>waddwchstr</EM> and <EM>waddwchnstr</EM> (and the usual variants).
|
||||
These were later additions to SVr4.<EM>x</EM>, not appearing in the first SVr4
|
||||
(1989). They differed from X/Open's later <EM>wadd</EM><STRONG>_</STRONG><EM>wchstr</EM> and <EM>wadd</EM><STRONG>_</STRONG><EM>wchnstr</EM>
|
||||
in that they each took an argument of type <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> instead of <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
@@ -122,9 +130,7 @@
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -134,6 +140,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="curs
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+251
-123
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2015,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,25 +28,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_addch.3x,v 1.85 2024/04/20 19:03:47 tom Exp @
|
||||
* @Id: curs_addch.3x,v 1.144 2025/11/12 01:04:12 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_addch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_addch 3x 2025-11-11 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_addch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_addch 3x 2025-11-11 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>addch</STRONG>, <STRONG>waddch</STRONG>, <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, <STRONG>echochar</STRONG>, <STRONG>wechochar</STRONG> - add a <EM>curses</EM>
|
||||
character to a window and advance the cursor
|
||||
@@ -56,28 +54,68 @@
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addch(const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>echochar(const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wechochar(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wechochar(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG>
|
||||
|
||||
<EM>/*</EM> <EM>(integer)</EM> <EM>constants</EM> <EM>*/</EM>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_BLOCK;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_BOARD;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_BTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_BULLET;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_CKBOARD;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_DARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_DEGREE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_DIAMOND;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_HLINE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_LANTERN;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_LARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_LLCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_LRCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_LTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_PLMINUS;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_PLUS;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_RARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_RTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_S1;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_S9;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_TTEE;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_UARROW;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_ULCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_URCORNER;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_VLINE;</STRONG>
|
||||
<EM>/*</EM> <EM>extensions</EM> <EM>*/</EM>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_GEQUAL;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_LEQUAL;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_NEQUAL;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_PI;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_S3;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_S7;</STRONG>
|
||||
/* <EM>...</EM> <EM>*/</EM> <STRONG>ACS_STERLING;</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
|
||||
</PRE><H3><a name="h3-Adding-Characters">Adding Characters</a></H3><PRE>
|
||||
<STRONG>waddch</STRONG> puts the character <EM>ch</EM> at the cursor position of window <EM>win</EM>, then
|
||||
advances the cursor position, analogously to the standard C library's
|
||||
</PRE><H3><a name="h3-waddch">waddch</a></H3><PRE>
|
||||
<STRONG>waddch</STRONG> writes the <EM>curses</EM> character <EM>ch</EM> to the window <EM>win</EM>, then advances
|
||||
the cursor position, analogously to the standard C library's
|
||||
<STRONG>putchar(3)</STRONG>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this function.
|
||||
|
||||
If advancement occurs at the right margin,
|
||||
Construct a <EM>curses</EM> character from a <EM>char</EM> by assignment or typecast.
|
||||
Subsection "Video Attributes" of <STRONG><A HREF="curs_attr.3x.html">attron(3x)</A></STRONG> describes how to manipulate
|
||||
its attributes and color pair. (A color pair selection is not honored
|
||||
unless initialized; see <STRONG><A HREF="curs_color.3x.html">start_color(3x)</A></STRONG>.)
|
||||
|
||||
<STRONG>o</STRONG> the cursor automatically wraps to the beginning of the next line;
|
||||
and
|
||||
|
||||
<STRONG>o</STRONG> at the bottom of the current scrolling region, and if <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG>
|
||||
is enabled for <EM>win</EM>, the scrolling region scrolls up one line.
|
||||
The object or expression <EM>ch</EM> may contain attributes and/or a color pair
|
||||
identifier. (A <EM>chtype</EM> can be copied from place to place using
|
||||
<STRONG><A HREF="curs_inch.3x.html">winch(3x)</A></STRONG> and <STRONG>waddch</STRONG>.) <EM>curses</EM> defines constants to aid the
|
||||
manipulation of character attributes; see <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>. A <EM>ch</EM> whose
|
||||
character component is a space, and whose only attribute is <STRONG>A_NORMAL</STRONG>,
|
||||
is a <EM>blank</EM> <EM>character</EM>, and therefore combines with the window's
|
||||
background character; see <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>.
|
||||
|
||||
If <EM>ch</EM> is a backspace, carriage return, line feed, or tab, the cursor
|
||||
moves appropriately within the window.
|
||||
@@ -85,52 +123,78 @@
|
||||
<STRONG>o</STRONG> Backspace moves the cursor one character left; at the left margin
|
||||
of a window, it does nothing.
|
||||
|
||||
<STRONG>o</STRONG> Carriage return moves the cursor to the left margin on the current
|
||||
<STRONG>o</STRONG> Carriage return moves the cursor to the left margin on the same
|
||||
line of the window.
|
||||
|
||||
<STRONG>o</STRONG> Line feed does a <STRONG><A HREF="curs_clear.3x.html">clrtoeol(3x)</A></STRONG>, then moves the cursor to the left
|
||||
margin on the next line of the window, and if <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> is
|
||||
enabled for <EM>win</EM>, scrolls the window if the cursor was already on
|
||||
the last line.
|
||||
<STRONG>o</STRONG> Line feed does a <STRONG><A HREF="curs_clear.3x.html">clrtoeol(3x)</A></STRONG>, then advances as if from the right
|
||||
margin.
|
||||
|
||||
<STRONG>o</STRONG> Tab advances the cursor to the next tab stop (possibly on the next
|
||||
line); these are placed at every eighth column by default. Alter
|
||||
the tab interval with the <STRONG>TABSIZE</STRONG> extension; see
|
||||
line); these are placed at every eighth column by default.
|
||||
|
||||
Alter the tab interval with the <STRONG>TABSIZE</STRONG> extension; see
|
||||
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
|
||||
|
||||
If <EM>ch</EM> is any other nonprintable character, it is drawn in printable
|
||||
form, using the same convention as <STRONG><A HREF="unctrl.3x.html">unctrl(3x)</A></STRONG>.
|
||||
If <EM>ch</EM> is any other nonprintable character, <EM>curses</EM> draws it in printable
|
||||
form using the same convention as <STRONG><A HREF="unctrl.3x.html">unctrl(3x)</A></STRONG>. Calling <STRONG><A HREF="curs_inch.3x.html">winch(3x)</A></STRONG> on the
|
||||
location of a nonprintable character does not return the character
|
||||
itself, but its <STRONG><A HREF="unctrl.3x.html">unctrl(3x)</A></STRONG> representation.
|
||||
|
||||
Calling <STRONG><A HREF="curs_inch.3x.html">winch(3x)</A></STRONG> on the location of a nonprintable character does not
|
||||
return the character itself, but its <STRONG><A HREF="unctrl.3x.html">unctrl(3x)</A></STRONG> representation.
|
||||
Adding printable characters with <STRONG>waddch</STRONG> causes it to wrap at the right
|
||||
margin of the window:
|
||||
|
||||
<EM>ch</EM> may contain rendering and/or color attributes, and others can be
|
||||
combined with the parameter by logically "or"ing with it. (A character
|
||||
with its attributes can be copied from place to place using <STRONG><A HREF="curs_inch.3x.html">winch(3x)</A></STRONG>
|
||||
and <STRONG>waddch</STRONG>.) See <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> for values of predefined video
|
||||
attribute constants that can be usefully "or"ed with characters.
|
||||
<STRONG>o</STRONG> If the cursor is not at the bottom of the scrolling region and
|
||||
advancement occurs at the right margin, the cursor automatically
|
||||
wraps to the beginning of the next line.
|
||||
|
||||
<STRONG>o</STRONG> If the cursor is at the bottom of the scrolling region when
|
||||
advancement occurs at the right margin, and <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> is enabled
|
||||
for <EM>win</EM>, the scrolling region scrolls up one line and the cursor
|
||||
wraps as above. Otherwise, advancement and scrolling do not occur,
|
||||
and <STRONG>waddch</STRONG> returns <STRONG>ERR</STRONG>.
|
||||
|
||||
A window's margins may coincide with the screen boundaries. This may
|
||||
be a problem when <EM>ncurses</EM> updates the screen to match the curses
|
||||
window. When their right and bottom margins coincide, <EM>ncurses</EM> uses
|
||||
different strategies to handle the variations of scrolling and wrapping
|
||||
at the lower-right corner by depending on the terminal capabilities:
|
||||
|
||||
<STRONG>o</STRONG> If the terminal does not automatically wrap as characters are added
|
||||
at the right margin (i.e., auto right margins), <EM>ncurses</EM> writes the
|
||||
character directly.
|
||||
|
||||
<STRONG>o</STRONG> If the terminal has auto right margins, but also has capabilities
|
||||
for turning auto margins off and on, <EM>ncurses</EM> turns the auto margin
|
||||
feature off temporarily when writing to the lower-right corner.
|
||||
|
||||
<STRONG>o</STRONG> If the terminal has an insertion mode which can be turned off and
|
||||
on, <EM>ncurses</EM> writes the character just before the lower-right
|
||||
corner, and then inserts a character to push the update into the
|
||||
corner.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Echoing-Characters">Echoing Characters</a></H3><PRE>
|
||||
</PRE><H3><a name="h3-wechochar">wechochar</a></H3><PRE>
|
||||
<STRONG>echochar</STRONG> and <STRONG>wechochar</STRONG> are equivalent to calling (<STRONG>w</STRONG>)<STRONG>addch</STRONG> followed by
|
||||
(<STRONG>w</STRONG>)<STRONG>refresh</STRONG>. <EM>curses</EM> interprets these functions as a hint that only a
|
||||
single character is being output; for non-control characters, a
|
||||
considerable performance gain may be enjoyed by employing them.
|
||||
(<STRONG>w</STRONG>)<STRONG>refresh</STRONG> on <STRONG>stdscr</STRONG> or the specified window. <EM>curses</EM> interprets these
|
||||
functions as a hint to its optimizer that only a single character cell
|
||||
in the window is being altered between refreshes; for non-control
|
||||
characters, a considerable performance gain may be enjoyed by employing
|
||||
them.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Forms-Drawing-Characters">Forms-Drawing Characters</a></H3><PRE>
|
||||
<EM>curses</EM> defines macros starting with <STRONG>ACS_</STRONG> that can be used with <STRONG>waddch</STRONG>
|
||||
to write line-drawing and other special characters to the screen.
|
||||
<EM>ncurses</EM> terms these <EM>forms-drawing</EM> <EM>characters.</EM> The ACS default listed
|
||||
below is used if the <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>) <EM>terminfo</EM> capability does not
|
||||
define a terminal-specific replacement for it, or if the terminal and
|
||||
locale configuration requires Unicode to access these characters but
|
||||
the library is unable to use Unicode. The "acsc char" column
|
||||
corresponds to how the characters are specified in the <STRONG>acs_chars</STRONG> string
|
||||
capability, and the characters in it may appear on the screen if the
|
||||
terminal's database entry incorrectly advertises ACS support. The name
|
||||
"ACS" originates in the Alternate Character Set feature of the DEC
|
||||
VT100 terminal.
|
||||
<EM>curses</EM> defines macros starting with <STRONG>ACS_</STRONG> that can be used with <STRONG>waddch</STRONG>
|
||||
to write line-drawing and other symbols to the screen. <EM>ncurses</EM> terms
|
||||
these <EM>forms-drawing</EM> <EM>characters.</EM> <EM>curses</EM> uses the ACS default listed
|
||||
below if the terminal type lacks the <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>) capability; that
|
||||
capability does not define a replacement for the character; or if the
|
||||
terminal type and locale configuration require Unicode to access these
|
||||
characters, but the library is unable to use Unicode. The "acsc char"
|
||||
column corresponds to how the characters are specified in the <STRONG>acs_chars</STRONG>
|
||||
(<STRONG>acsc</STRONG>) string capability, and the characters in it may appear on the
|
||||
screen if the terminal type's database entry incorrectly advertises ACS
|
||||
support. The name "ACS" originates in the Alternate Character Set
|
||||
feature of the DEC VT100 terminal.
|
||||
|
||||
<STRONG>ACS</STRONG> <STRONG>acsc</STRONG>
|
||||
<STRONG>Symbol</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
|
||||
@@ -172,16 +236,29 @@
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
In <EM>ncurses</EM>, <STRONG>waddch</STRONG> returns <STRONG>ERR</STRONG> if it is not possible to add a complete
|
||||
character at the cursor position, as when conversion of a multibyte
|
||||
character to a byte sequence fails, or at least one of the resulting
|
||||
bytes cannot be added to the window. See section "PORTABILITY" below
|
||||
regarding the use of <STRONG>waddch</STRONG> with multibyte characters.
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>waddch</STRONG> can successfully write a character at the bottom right location
|
||||
of the window. However, <EM>ncurses</EM> returns <STRONG>ERR</STRONG> if <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> is not
|
||||
enabled in that event, because it is not possible to wrap to a new
|
||||
line.
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer,
|
||||
|
||||
<STRONG>o</STRONG> wrapping to a new line is impossible because <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> has not
|
||||
been called on <EM>win</EM> (or <STRONG>stdscr</STRONG>, as applicable) when a write to its
|
||||
bottom right location is attempted, or
|
||||
|
||||
<STRONG>o</STRONG> it is not possible to add a complete character at the cursor
|
||||
position.
|
||||
|
||||
The last may be due to different causes:
|
||||
|
||||
<STRONG>o</STRONG> conversion of a wide character to a multibyte character sequence
|
||||
can fail, or
|
||||
|
||||
<STRONG>o</STRONG> at least one of the bytes resulting from wide character conversion
|
||||
to a multibyte character sequence cannot be added to the window.
|
||||
See section "PORTABILITY" below regarding the use of <STRONG>waddch</STRONG> with
|
||||
wide characters.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
@@ -191,36 +268,92 @@
|
||||
<STRONG>addch</STRONG>, <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, and <STRONG>echochar</STRONG> may be implemented as macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
The symbols <EM>ACS</EM><STRONG>_</STRONG><EM>S3</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>S7</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>LEQUAL</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>GEQUAL</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>PI</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>NEQUAL</EM>,
|
||||
and <EM>ACS</EM><STRONG>_</STRONG><EM>STERLING</EM> were not documented in any publicly released System V
|
||||
and are not standard. However, many publicly available <EM>terminfo</EM>
|
||||
entries include <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>) capabilities in which their key
|
||||
characters (<STRONG>pryz{|}</STRONG>) are embedded, and a second-hand list of their
|
||||
character descriptions has come to light, which identifies them as
|
||||
VT100 special characters.
|
||||
|
||||
The DEC Special Character and Line Drawing Set (VT100) is indexed by an
|
||||
ASCII character in the range 96 (`) to 126 (~). That index character
|
||||
is part of the definition for the curses <STRONG>ACS_</STRONG> symbols. The VT100
|
||||
special characters can be categorized in three groups:
|
||||
|
||||
<STRONG>o</STRONG> useful graphic symbols with a standard <STRONG>ACS_</STRONG> symbol, (e.g., the
|
||||
line-drawing symbols),
|
||||
|
||||
<STRONG>o</STRONG> possibly useful characters (these non-standard symbols),
|
||||
|
||||
<STRONG>o</STRONG> representations of control characters (e.g., newline and vertical
|
||||
tabulation).
|
||||
|
||||
A few <STRONG>ACS_</STRONG> symbols do not fit into DEC's VT100 scheme. The AT&T
|
||||
Teletype 5410v1 arrow symbols and <STRONG>ACS_BLOCK</STRONG> use indices outside the
|
||||
range 96 to 126. Two of the Teletype symbols use indices in that
|
||||
range, with different meaning versus the VT100:
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>ACS_BOARD</STRONG> corresponds to the VT100 symbol for newline
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>ACS_LANTERN</STRONG> corresponds to the VT100 symbol for vertical tabulation
|
||||
|
||||
AT&T defined <STRONG>ACS_</STRONG> names for the most useful graphic symbols, as well as
|
||||
for its own. Its header file commented:
|
||||
|
||||
/*
|
||||
* Standard alternate character set. The current ACS world is
|
||||
* evolving, so we support only a widely available subset: the
|
||||
* line drawing characters from the VT100, plus a few from the
|
||||
* Teletype 5410v1. Eventually there may be support of more
|
||||
* sophisticated ACS line drawing, such as that in the Teletype
|
||||
* 5410, the HP line drawing set, and the like. There may be
|
||||
* support for some non line oriented characters as well.
|
||||
*
|
||||
* Line drawing ACS names are of the form ACS_trbl, where t is
|
||||
* the top, r is the right, b is the bottom, and l is the left.
|
||||
* t, r, b, and l might be B (blank), S (single), D (double), or
|
||||
* T (thick). The subset defined here only uses B and S.
|
||||
*/
|
||||
|
||||
Although these less-useful graphic symbols were not given names, they
|
||||
were used in <EM>terminfo</EM> entries. The <EM>ncurses</EM> developers invented ACS-
|
||||
prefixed names for them.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 4 describes these functions. It specifies no
|
||||
error conditions for them.
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
SVr4 <EM>curses</EM> describes a successful return value only as "an integer
|
||||
value other than <STRONG>ERR</STRONG>".
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
The defaults specified for forms-drawing characters apply in the POSIX
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
The defaults specified for forms-drawing characters apply in the POSIX
|
||||
locale.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-ACS-Symbols">ACS Symbols</a></H3><PRE>
|
||||
X/Open Curses states that the <STRONG>ACS_</STRONG> definitions are <EM>char</EM> constants.
|
||||
|
||||
X/Open Curses states that the <EM>ACS</EM><STRONG>_</STRONG> definitions are <EM>char</EM> constants.
|
||||
Some implementations are problematic.
|
||||
|
||||
<STRONG>o</STRONG> Solaris <EM>curses</EM>, for example, define the ACS symbols as constants;
|
||||
<STRONG>o</STRONG> Solaris <EM>curses</EM>, for example, defines the ACS symbols as constants;
|
||||
others define them as elements of an array.
|
||||
|
||||
This implementation uses an array, <STRONG>acs_map</STRONG>, as did SVr4 <EM>curses</EM>.
|
||||
NetBSD also uses an array, actually named <STRONG>_acs_char</STRONG>, with a <STRONG>#define</STRONG>
|
||||
for compatibility.
|
||||
SVr4 used an array, <EM>acs</EM><STRONG>_</STRONG><EM>map</EM>, as does <EM>ncurses</EM>. NetBSD <EM>curses</EM> also
|
||||
uses an array, actually named <STRONG>_</STRONG><EM>acs</EM><STRONG>_</STRONG><EM>char</EM>, with a "#define" for
|
||||
compatibility.
|
||||
|
||||
<STRONG>o</STRONG> HP-UX <EM>curses</EM> equates some of the <STRONG>ACS_</STRONG> symbols to the analogous
|
||||
<STRONG>WACS_</STRONG> symbols as if the <STRONG>ACS_</STRONG> symbols were wide characters (see
|
||||
<STRONG>o</STRONG> HP-UX <EM>curses</EM> equates some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the analogous
|
||||
<EM>WACS</EM><STRONG>_</STRONG> symbols as if the <EM>ACS</EM><STRONG>_</STRONG> symbols were wide characters (see
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>). The misdefined symbols are the arrows and
|
||||
others that are not used for line drawing.
|
||||
|
||||
<STRONG>o</STRONG> X/Open Curses (Issues 2 through 7) has a typographical error for
|
||||
the <STRONG>ACS_LANTERN</STRONG> symbol, equating its "VT100+ Character" to "I"
|
||||
the <EM>ACS</EM><STRONG>_</STRONG><EM>LANTERN</EM> symbol, equating its "VT100+ Character" to "I"
|
||||
(capital I), while the header files for SVr4 <EM>curses</EM> and other
|
||||
implementations use "i" (small i).
|
||||
|
||||
@@ -230,17 +363,9 @@
|
||||
other hand, its <STRONG>gs6300</STRONG> (AT&T PC6300 with EMOTS Terminal Emulator)
|
||||
description uses lowercase i.
|
||||
|
||||
Some ACS symbols (<STRONG>ACS_S3</STRONG>, <STRONG>ACS_S7</STRONG>, <STRONG>ACS_LEQUAL</STRONG>, <STRONG>ACS_GEQUAL</STRONG>, <STRONG>ACS_PI</STRONG>,
|
||||
<STRONG>ACS_NEQUAL</STRONG>, and <STRONG>ACS_STERLING</STRONG>) were not documented in any publicly
|
||||
released System V. However, many publicly available <EM>terminfo</EM> entries
|
||||
include <STRONG>acsc</STRONG> strings in which their key characters <STRONG>(</STRONG>pryz{|}<STRONG>)</STRONG> are
|
||||
embedded, and a second-hand list of their character descriptions has
|
||||
come to light. The <EM>ncurses</EM> developers invented ACS-prefixed names for
|
||||
them.
|
||||
The <EM>displayed</EM> values of <EM>ACS</EM><STRONG>_</STRONG> constants depend on
|
||||
|
||||
The <EM>displayed</EM> values of <STRONG>ACS_</STRONG> constants depend on
|
||||
|
||||
<STRONG>o</STRONG> the <EM>ncurses</EM> ABI--for example, wide-character versus non-wide-
|
||||
<STRONG>o</STRONG> the <EM>ncurses</EM> ABI -- for example, wide-character versus non-wide-
|
||||
character configurations (the former is capable of displaying
|
||||
Unicode while the latter is not), and
|
||||
|
||||
@@ -248,59 +373,61 @@
|
||||
|
||||
In certain cases, the terminal is unable to display forms-drawing
|
||||
characters <EM>except</EM> by using UTF-8; see the discussion of the
|
||||
<EM>NCURSES</EM><STRONG>_</STRONG><EM>NO</EM><STRONG>_</STRONG><EM>UTF8</EM><STRONG>_</STRONG><EM>ACS</EM> environment variable in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>).
|
||||
<EM>NCURSES</EM><STRONG>_</STRONG><EM>NO</EM><STRONG>_</STRONG><EM>UTF8</EM><STRONG>_</STRONG><EM>ACS</EM> environment variable in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Character-Set">Character Set</a></H3><PRE>
|
||||
X/Open Curses assumes that the parameter passed to <STRONG>waddch</STRONG> contains a
|
||||
single character. As discussed in <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, that character may
|
||||
have been more than eight bits wide in an SVr3 or SVr4 implementation,
|
||||
but in the X/Open Curses model, the details are not given. The
|
||||
important distinction between SVr4 <EM>curses</EM> and X/Open Curses is that the
|
||||
latter separates non-character information (attributes and color) from
|
||||
the character code, which SVr4 packs into a <EM>chtype</EM> for passage to
|
||||
<STRONG>waddch</STRONG>.
|
||||
X/Open Curses assumes that the parameter passed to <EM>waddch</EM> contains a
|
||||
single character. That character may have been more than eight bits
|
||||
wide in an SVr3 or SVr4 implementation, but X/Open Curses leaves the
|
||||
width of a non-wide character code unspecified. The standard further
|
||||
does not specify the internal structure of a <EM>chtype</EM>, though the use of
|
||||
bitwise operators to combine the character code with attributes and a
|
||||
color pair identifier into a <EM>chtype</EM> for passage to <EM>waddch</EM> is common. A
|
||||
portable application uses only the macros discussed in <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> to
|
||||
manipulate a <EM>chtype</EM>.
|
||||
|
||||
In <EM>ncurses</EM>, <EM>chtype</EM> holds an eight-bit character. But the library
|
||||
allows a multibyte character to be passed in a succession of calls to
|
||||
<STRONG>waddch</STRONG>. Other implementations do not; a <STRONG>waddch</STRONG> call transmits exactly
|
||||
one character, which may be rendered in one or more screen locations
|
||||
depending on whether it is printable.
|
||||
In <EM>ncurses</EM>, <EM>chtype</EM> holds an eight-bit character, but the library allows
|
||||
a multibyte character sequence to be passed via a succession of calls
|
||||
to <EM>waddch</EM>. Other implementations do not; a <EM>waddch</EM> call transmits
|
||||
exactly one character, which may be rendered in one or more screen
|
||||
locations depending on whether it is printable (see <STRONG><A HREF="unctrl.3x.html">unctrl(3x)</A></STRONG>).
|
||||
Depending on the locale, <EM>ncurses</EM> inspects the byte passed in each
|
||||
<EM>waddch</EM> call and checks whether the latest call continues a multibyte
|
||||
character. When a character is <EM>complete</EM>, <EM>ncurses</EM> displays the
|
||||
character and advances the cursor. If the calling application
|
||||
interrupts the succession of bytes in a multibyte character sequence by
|
||||
changing the current location -- for example, with <STRONG><A HREF="curs_move.3x.html">wmove(3x)</A></STRONG> -- <EM>ncurses</EM>
|
||||
discards the incomplete character.
|
||||
|
||||
Depending on the locale settings, <EM>ncurses</EM> inspects the byte passed in
|
||||
each <STRONG>waddch</STRONG> call, and checks whether the latest call continues a
|
||||
multibyte sequence. When a character is <EM>complete</EM>, <EM>ncurses</EM> displays the
|
||||
character and advances the cursor.
|
||||
For portability to other implementations, do not rely upon the
|
||||
foregoing behavior. Check whether a character can be represented as a
|
||||
single byte in the current locale.
|
||||
|
||||
If the calling application interrupts the succession of bytes in a
|
||||
multibyte character sequence by changing the current location--for
|
||||
example, with <STRONG><A HREF="curs_move.3x.html">wmove(3x)</A></STRONG>--<EM>ncurses</EM> discards the incomplete character.
|
||||
<STRONG>o</STRONG> If it can, call either <EM>waddch</EM> or <EM>wadd</EM><STRONG>_</STRONG><EM>wch</EM>.
|
||||
|
||||
For portability to other implementations, do not rely upon this
|
||||
behavior. Check whether a character can be represented as a single
|
||||
byte in the current locale.
|
||||
|
||||
<STRONG>o</STRONG> If it can, call either <STRONG>waddch</STRONG> or <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> If it cannot, use only <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG>.
|
||||
<STRONG>o</STRONG> If it cannot, use only <EM>wadd</EM><STRONG>_</STRONG><EM>wch</EM>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-TABSIZE">TABSIZE</a></H3><PRE>
|
||||
SVr4 and other versions of <EM>curses</EM> implement the <STRONG>TABSIZE</STRONG> variable, but
|
||||
X/Open Curses does not specify it (see <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>).
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>waddch</EM> and its variants.
|
||||
|
||||
SVr3 (1987) added the <EM>echochar</EM> and <EM>wechochar</EM> functions and most of the
|
||||
<EM>ACS</EM><STRONG>_</STRONG> constants, except for <EM>ACS</EM><STRONG>_</STRONG><EM>GEQUAL</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>LEQUAL</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>NEQUAL</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>PI</EM>,
|
||||
<EM>ACS</EM><STRONG>_</STRONG><EM>S3</EM>, <EM>ACS</EM><STRONG>_</STRONG><EM>S7</EM>, and <EM>ACS</EM><STRONG>_</STRONG><EM>STERLING</EM>.
|
||||
|
||||
<EM>ncurses</EM> 1.9.6 (1995) furnished the remaining <EM>ACS</EM><STRONG>_</STRONG> constants.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
in its wide-character configuration (<EM>ncursesw</EM>).
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>putchar(3)</STRONG>
|
||||
<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>putchar(3)</STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-11-11 <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -308,20 +435,21 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF=
|
||||
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
|
||||
<ul>
|
||||
<li><a href="#h3-Adding-Characters">Adding Characters</a></li>
|
||||
<li><a href="#h3-Echoing-Characters">Echoing Characters</a></li>
|
||||
<li><a href="#h3-waddch">waddch</a></li>
|
||||
<li><a href="#h3-wechochar">wechochar</a></li>
|
||||
<li><a href="#h3-Forms-Drawing-Characters">Forms-Drawing Characters</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a>
|
||||
<ul>
|
||||
<li><a href="#h3-ACS-Symbols">ACS Symbols</a></li>
|
||||
<li><a href="#h3-Character-Set">Character Set</a></li>
|
||||
<li><a href="#h3-TABSIZE">TABSIZE</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,86 +27,95 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_addchstr.3x,v 1.45 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_addchstr.3x,v 1.64 2025/08/16 19:56:13 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_addchstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_addchstr 3x 2025-08-16 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_addchstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_addchstr 3x 2025-08-16 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>addchstr</STRONG>, <STRONG>addchnstr</STRONG>, <STRONG>waddchstr</STRONG>, <STRONG>waddchnstr</STRONG>, <STRONG>mvaddchstr</STRONG>, <STRONG>mvaddchnstr</STRONG>,
|
||||
<STRONG>mvwaddchstr</STRONG>, <STRONG>mvwaddchnstr</STRONG> - add a <EM>curses</EM> character string to a window
|
||||
<STRONG>addchstr</STRONG>, <STRONG>waddchstr</STRONG>, <STRONG>mvaddchstr</STRONG>, <STRONG>mvwaddchstr</STRONG>, <STRONG>addchnstr</STRONG>, <STRONG>waddchnstr</STRONG>,
|
||||
<STRONG>mvaddchnstr</STRONG>, <STRONG>mvwaddchnstr</STRONG> - add a <EM>curses</EM> character string to a window
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addchstr(const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>addchstr(const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addchnstr(const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>addchnstr(const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These functions copy the (null-terminated) <EM>chstr</EM> array into the window
|
||||
image structure starting at the current cursor position.
|
||||
<STRONG>waddchstr</STRONG> copies the string of <EM>curses</EM> characters <EM>chstr</EM> to the window
|
||||
<EM>win</EM>. A null <EM>curses</EM> character terminates the string. <STRONG>waddchnstr</STRONG> does
|
||||
the same, but copies at most <EM>n</EM> characters, or as many as possible if <EM>n</EM>
|
||||
is <STRONG>-1</STRONG>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
|
||||
The four functions with <EM>n</EM> as the last argument copy at most <EM>n</EM> elements,
|
||||
but no more than will fit on the line. If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the whole array is
|
||||
copied, to the maximum number of characters that will fit on the line.
|
||||
Because these functions do not call <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> internally, they are
|
||||
faster than <STRONG><A HREF="curs_addstr.3x.html">waddstr(3x)</A></STRONG> and <STRONG><A HREF="curs_addstr.3x.html">waddnstr(3x)</A></STRONG>. On the other hand, they
|
||||
|
||||
The window cursor is <EM>not</EM> advanced. These functions are faster than
|
||||
<STRONG>waddnstr</STRONG>. On the other hand:
|
||||
<STRONG>o</STRONG> do not treat the backspace, carriage return, or line feed
|
||||
characters specially;
|
||||
|
||||
<STRONG>o</STRONG> they do not perform checking (such as for the newline, backspace,
|
||||
or carriage return characters),
|
||||
<STRONG>o</STRONG> do not represent unprintable characters with <STRONG><A HREF="unctrl.3x.html">unctrl(3x)</A></STRONG>;
|
||||
|
||||
<STRONG>o</STRONG> they do not advance the current cursor position,
|
||||
<STRONG>o</STRONG> do not update the cursor position to follow the last character
|
||||
written; and
|
||||
|
||||
<STRONG>o</STRONG> they do not expand other control characters to ^-escapes, and
|
||||
|
||||
<STRONG>o</STRONG> they truncate the string if it crosses the right margin, rather
|
||||
than wrapping it around to the new line.
|
||||
<STRONG>o</STRONG> truncate the string at the window's right margin, rather than
|
||||
wrapping it to the next line and potentially scrolling.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions. This
|
||||
implementation returns an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>win</EM> parameter is null or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>wchstr</EM> parameter is null.
|
||||
<STRONG>o</STRONG> <EM>chstr</EM> is a null pointer, or
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
All functions except <STRONG>waddchnstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>waddchnstr</STRONG> may be implemented as macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
SVr3.1 (1987) introduced these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
@@ -115,9 +124,7 @@
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-08-16 <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -127,6 +134,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="cu
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,78 +27,86 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_addstr.3x,v 1.45 2024/04/20 19:18:18 tom Exp @
|
||||
* @Id: curs_addstr.3x,v 1.71 2025/10/21 00:09:34 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_addstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_addstr 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_addstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_addstr 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>addstr</STRONG>, <STRONG>addnstr</STRONG>, <STRONG>waddstr</STRONG>, <STRONG>waddnstr</STRONG>, <STRONG>mvaddstr</STRONG>, <STRONG>mvaddnstr</STRONG>, <STRONG>mvwaddstr</STRONG>,
|
||||
<STRONG>addstr</STRONG>, <STRONG>waddstr</STRONG>, <STRONG>mvaddstr</STRONG>, <STRONG>mvwaddstr</STRONG>, <STRONG>addnstr</STRONG>, <STRONG>waddnstr</STRONG>, <STRONG>mvaddnstr</STRONG>,
|
||||
<STRONG>mvwaddnstr</STRONG> - add a string to a <EM>curses</EM> window and advance the cursor
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addstr(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>addstr(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addnstr(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>addnstr(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
<STRONG>waddstr</STRONG> writes the characters of the (null-terminated) string <EM>str</EM> to
|
||||
the window <EM>win</EM>. Its process is similar to calling <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> for each
|
||||
<EM>char</EM> in <EM>str</EM>. Control characters are processed as in <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>waddnstr</STRONG> writes at most <EM>n</EM> characters, or until a terminating null
|
||||
character occurs in <EM>str</EM>. If <EM>n</EM> is -1, <STRONG>waddnstr</STRONG> writes the entire
|
||||
string.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
the window <EM>win</EM>, as if by calling <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> for each <EM>char</EM> in <EM>str</EM>.
|
||||
<STRONG>waddnstr</STRONG> is similar, but writes at most <EM>n</EM> characters. If <EM>n</EM> is -1,
|
||||
<STRONG>waddnstr</STRONG> writes the entire string. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants
|
||||
of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions. <EM>ncurses</EM> returns
|
||||
an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the window pointer is <STRONG>NULL</STRONG>,
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the string pointer is <STRONG>NULL</STRONG>, or
|
||||
<STRONG>o</STRONG> <EM>str</EM> is a null pointer,
|
||||
|
||||
<STRONG>o</STRONG> if an internal <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> call returns an error.
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer, or
|
||||
|
||||
<STRONG>o</STRONG> an internal <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> call returns <STRONG>ERR</STRONG>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
All of these functions except <STRONG>waddnstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>waddnstr</STRONG> may be implemented as macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 4 describes these functions.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>waddstr</EM> along with its variants, the latter
|
||||
defined as macros.
|
||||
|
||||
SVr3.1 (1987) added <EM>waddnstr</EM> (and its variants) redefining <EM>waddstr</EM> as a
|
||||
macro wrapping it.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
@@ -107,9 +115,7 @@
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -119,6 +125,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,74 +27,68 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_addwstr.3x,v 1.37 2024/04/20 19:18:18 tom Exp @
|
||||
* @Id: curs_addwstr.3x,v 1.60 2025/03/15 20:41:04 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_addwstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_addwstr 3x 2025-03-15 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_addwstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_addwstr 3x 2025-03-15 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>addwstr</STRONG>, <STRONG>addnwstr</STRONG>, <STRONG>waddwstr</STRONG>, <STRONG>waddnwstr</STRONG>, <STRONG>mvaddwstr</STRONG>, <STRONG>mvaddnwstr</STRONG>,
|
||||
<STRONG>mvwaddwstr</STRONG>, <STRONG>mvwaddnwstr</STRONG> - add a wide-character string to a <EM>curses</EM>
|
||||
<STRONG>addwstr</STRONG>, <STRONG>waddwstr</STRONG>, <STRONG>mvaddwstr</STRONG>, <STRONG>mvwaddwstr</STRONG>, <STRONG>addnwstr</STRONG>, <STRONG>waddnwstr</STRONG>,
|
||||
<STRONG>mvaddnwstr</STRONG>, <STRONG>mvwaddnwstr</STRONG> - add a wide-character string to a <EM>curses</EM>
|
||||
window and advance the cursor
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addwstr(const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddwstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddwstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddwstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>addwstr(const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddwstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddwstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddwstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>addnwstr(const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddnwstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddnwstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddnwstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>addnwstr(const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>waddnwstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvaddnwstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwaddnwstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
<STRONG>waddwstr</STRONG> writes the characters of the (wide-null-terminated) wide-
|
||||
character string <EM>wstr</EM> to the window <EM>win</EM>. Its process is similar to
|
||||
constructing a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> for each <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> in <EM>wstr</EM>, then calling
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> with the resulting <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
<STRONG>o</STRONG> Spacing and non-spacing characters in the string are processed one
|
||||
at a time, and
|
||||
|
||||
<STRONG>o</STRONG> control characters are processed as in <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>waddnwstr</STRONG> writes at most <EM>n</EM> wide characters, or until a terminating wide
|
||||
null character occurs in <EM>wstr</EM>. If <EM>n</EM> is -1, <STRONG>waddnwstr</STRONG> writes the entire
|
||||
wide string.
|
||||
|
||||
character string <EM>wstr</EM> to the window <EM>win</EM>, as if by constructing a
|
||||
<EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> for each <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> in <EM>wstr</EM>, then calling <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> with the
|
||||
resulting <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>. <EM>curses</EM> processes spacing and non-spacing characters
|
||||
in <EM>wstr</EM> one at a time. <STRONG>waddnwstr</STRONG> is similar, but writes at most <EM>n</EM> wide
|
||||
characters. If <EM>n</EM> is -1, <STRONG>waddnwstr</STRONG> writes the entire wide string.
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions. <EM>ncurses</EM> returns
|
||||
an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the window pointer is <STRONG>NULL</STRONG>,
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the string pointer is <STRONG>NULL</STRONG>, or
|
||||
<STRONG>o</STRONG> <EM>wstr</EM> is a null pointer,
|
||||
|
||||
<STRONG>o</STRONG> if an internal <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> call returns an error.
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer, or
|
||||
|
||||
<STRONG>o</STRONG> an internal <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> call returns <STRONG>ERR</STRONG>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
@@ -105,18 +99,26 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 4 describes these functions.
|
||||
X/Open Curses Issue 4 describes these functions.
|
||||
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition Version 4 of the same year specified
|
||||
functions named <EM>waddwstr</EM> and <EM>waddnwstr</EM> (and the usual variants). These
|
||||
were later additions to SVr4.<EM>x</EM>, not appearing in the first SVr4 (1989).
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
in its non-wide-character configuration.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-03-15 <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -126,6 +128,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="c
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+154
-162
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,25 +28,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_attr.3x,v 1.105 2024/04/27 17:54:42 tom Exp @
|
||||
* @Id: curs_attr.3x,v 1.142 2025/11/12 01:05:49 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_attr 3x 2024-04-27 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_attr 3x 2025-11-11 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_attr 3x 2024-04-27 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_attr 3x 2025-11-11 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>attr_get</STRONG>, <STRONG>wattr_get</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_set</STRONG>, <STRONG>attr_off</STRONG>, <STRONG>wattr_off</STRONG>, <STRONG>attr_on</STRONG>,
|
||||
<STRONG>wattr_on</STRONG>, <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, <STRONG>chgat</STRONG>,
|
||||
@@ -121,24 +119,25 @@
|
||||
Use <STRONG>wattr_get</STRONG> to retrieve attributes for the given window.
|
||||
|
||||
Use <STRONG>attr_on</STRONG> and <STRONG>wattr_on</STRONG> to turn on window attributes, i.e., values
|
||||
OR'd together in <EM>attr</EM>, without affecting other attributes. Use
|
||||
<STRONG>attr_off</STRONG> and <STRONG>wattr_off</STRONG> to turn off window attributes, again values OR'd
|
||||
together in <EM>attr</EM>, without affecting other attributes.
|
||||
logically "or"-ed together in <EM>attr</EM>, without affecting other attributes.
|
||||
Use <STRONG>attr_off</STRONG> and <STRONG>wattr_off</STRONG> to turn off window attributes, again values
|
||||
logically "or"-ed together in <EM>attr</EM>, without affecting other attributes.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Legacy-Window-Attributes">Legacy Window Attributes</a></H3><PRE>
|
||||
The X/Open window attribute routines which <EM>set</EM> or <EM>get</EM>, turn <EM>on</EM> or <EM>off</EM>
|
||||
are extensions of older routines which assume that color pairs are OR'd
|
||||
into the attribute parameter. These newer routines use similar names,
|
||||
because X/Open simply added an underscore (<STRONG>_</STRONG>) for the newer names.
|
||||
The X/Open window attribute routines which <EM>set</EM> or <EM>get</EM>, turn <EM>on</EM> or <EM>off</EM>
|
||||
are extensions of older routines which assume that color pairs are
|
||||
logically "or"-ed into the attribute parameter. These newer routines
|
||||
use similar names, because X/Open simply added an underscore (<STRONG>_</STRONG>) for
|
||||
the newer names.
|
||||
|
||||
The <STRONG>int</STRONG> datatype used in the legacy routines is treated as if it is the
|
||||
same size as <STRONG>chtype</STRONG> (used by <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>). It holds the common video
|
||||
attributes (such as bold, reverse), as well as a few bits for color.
|
||||
Those bits correspond to the <STRONG>A_COLOR</STRONG> symbol. The <STRONG>COLOR_PAIR</STRONG> macro
|
||||
provides a value which can be OR'd into the attribute parameter. For
|
||||
example, as long as that value fits into the <STRONG>A_COLOR</STRONG> mask, then these
|
||||
calls produce similar results:
|
||||
The <EM>int</EM> datatype used in the legacy routines is treated as if it is the
|
||||
same size as <EM>chtype</EM> (used by <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>). It holds the common video
|
||||
attributes (such as bold, reverse), as well as a few bits for color.
|
||||
Those bits correspond to the <STRONG>A_COLOR</STRONG> symbol. The <STRONG>COLOR_PAIR</STRONG> macro
|
||||
provides a value which can be logically "or"-ed into the attribute
|
||||
parameter. For example, as long as that value fits into the <STRONG>A_COLOR</STRONG>
|
||||
mask, then these calls produce similar results:
|
||||
|
||||
attrset(A_BOLD | COLOR_PAIR(<EM>pair</EM>));
|
||||
attr_set(A_BOLD, <EM>pair</EM>, NULL);
|
||||
@@ -148,28 +147,28 @@
|
||||
(8) bits, then <STRONG>COLOR_PAIR(</STRONG><EM>259</EM><STRONG>)</STRONG> is 4 (i.e., 259 is 4 more than the limit
|
||||
255).
|
||||
|
||||
The <STRONG>PAIR_NUMBER</STRONG> macro extracts a pair number from an <STRONG>int</STRONG> (or <STRONG>chtype</STRONG>).
|
||||
For example, the <EM>input</EM> and <EM>output</EM> values in these statements would be
|
||||
The <STRONG>PAIR_NUMBER</STRONG> macro extracts a pair number from an <EM>int</EM> (or <EM>chtype</EM>).
|
||||
For example, the <EM>input</EM> and <EM>output</EM> values in these statements would be
|
||||
the same:
|
||||
|
||||
int value = A_BOLD | COLOR_PAIR(<EM>input</EM>);
|
||||
int <EM>output</EM> = PAIR_NUMBER(value);
|
||||
|
||||
The <STRONG>attrset</STRONG> routine is a legacy feature predating SVr4 curses but kept
|
||||
in X/Open Curses for the same reason that SVr4 curses kept it:
|
||||
The <STRONG>attrset</STRONG> routine is a legacy feature predating SVr4 <EM>curses</EM> but kept
|
||||
in X/Open Curses for the same reason that SVr4 <EM>curses</EM> kept it:
|
||||
compatibility.
|
||||
|
||||
The remaining <STRONG>attr</STRONG>* functions operate exactly like the corresponding
|
||||
<STRONG>attr_</STRONG>* functions, except that they take arguments of type <STRONG>int</STRONG> rather
|
||||
than <STRONG>attr_t</STRONG>.
|
||||
The remaining <STRONG>attr</STRONG>* functions operate exactly like the corresponding
|
||||
<STRONG>attr_</STRONG>* functions, except that they take arguments of type <EM>int</EM> rather
|
||||
than <EM>attr</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
There is no corresponding <STRONG>attrget</STRONG> function as such in X/Open Curses,
|
||||
There is no corresponding <STRONG>attrget</STRONG> function as such in X/Open Curses,
|
||||
although <EM>ncurses</EM> provides <STRONG>getattrs</STRONG> (see <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>).
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Change-Character-Rendition">Change Character Rendition</a></H3><PRE>
|
||||
The routine <STRONG>chgat</STRONG> changes the attributes of a given number of
|
||||
characters starting at the current cursor location of <STRONG>stdscr</STRONG>. It does
|
||||
characters starting at the current cursor location of <STRONG>stdscr</STRONG>. It does
|
||||
not update the cursor and does not perform wrapping. A character count
|
||||
of -1 or greater than the remaining window width means to change
|
||||
attributes all the way to the end of the current line. The <STRONG>wchgat</STRONG>
|
||||
@@ -182,32 +181,32 @@
|
||||
|
||||
</PRE><H3><a name="h3-Change-Window-Color">Change Window Color</a></H3><PRE>
|
||||
The routine <STRONG>color_set</STRONG> sets the current color of the given window to the
|
||||
foreground/background combination described by the color <EM>pair</EM>
|
||||
foreground/background combination described by the color <EM>pair</EM>
|
||||
parameter.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Standout">Standout</a></H3><PRE>
|
||||
The routine <STRONG>standout</STRONG> is the same as <STRONG>attron(A_STANDOUT)</STRONG>. The routine
|
||||
<STRONG>standend</STRONG> is the same as <STRONG>attrset(A_NORMAL)</STRONG> or <STRONG>attrset(0)</STRONG>, that is, it
|
||||
The routine <STRONG>standout</STRONG> is the same as <STRONG>attron(A_STANDOUT)</STRONG>. The routine
|
||||
<STRONG>standend</STRONG> is the same as <STRONG>attrset(A_NORMAL)</STRONG> or <STRONG>attrset(0)</STRONG>, that is, it
|
||||
turns off all attributes.
|
||||
|
||||
X/Open Curses does not mark these "restricted", because
|
||||
|
||||
<STRONG>o</STRONG> they have well established legacy use, and
|
||||
|
||||
<STRONG>o</STRONG> there is no ambiguity about the way the attributes might be
|
||||
<STRONG>o</STRONG> there is no ambiguity about the way the attributes might be
|
||||
combined with a color pair.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Video-Attributes">Video Attributes</a></H3><PRE>
|
||||
The following video attributes, defined in <STRONG><curses.h></STRONG>, can be passed to
|
||||
the routines <STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, and <STRONG>attrset</STRONG>, or OR'd with the characters
|
||||
passed to <STRONG>addch</STRONG> (see <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>).
|
||||
The following video attributes, defined in <EM>curses.h</EM>, can be passed to
|
||||
<STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, <STRONG>attrset</STRONG>, and logically "or"-ed with characters passed
|
||||
to <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>Name</STRONG> <STRONG>Description</STRONG>
|
||||
-----------------------------------------------------------------
|
||||
<STRONG>A_NORMAL</STRONG> Normal display (no highlight)
|
||||
<STRONG>A_STANDOUT</STRONG> Best highlighting mode of the terminal
|
||||
<STRONG>A_STANDOUT</STRONG> Best highlighting mode available
|
||||
<STRONG>A_UNDERLINE</STRONG> Underlining
|
||||
<STRONG>A_REVERSE</STRONG> Reverse video
|
||||
<STRONG>A_BLINK</STRONG> Blinking
|
||||
@@ -217,11 +216,12 @@
|
||||
<STRONG>A_INVIS</STRONG> Invisible or blank mode
|
||||
<STRONG>A_ALTCHARSET</STRONG> Alternate character set
|
||||
<STRONG>A_ITALIC</STRONG> Italics (non-X/Open extension)
|
||||
<STRONG>A_CHARTEXT</STRONG> Bit-mask to extract a character
|
||||
<STRONG>A_COLOR</STRONG> Bit-mask to extract a color (legacy routines)
|
||||
<STRONG>A_ATTRIBUTES</STRONG> Mask to extract character code
|
||||
<STRONG>A_CHARTEXT</STRONG> Mask to extract attributes
|
||||
<STRONG>A_COLOR</STRONG> Mask to extract color pair identifier
|
||||
|
||||
These video attributes are supported by <STRONG>attr_on</STRONG> and related functions
|
||||
(which also support the attributes recognized by <STRONG>attron</STRONG>, etc.):
|
||||
<STRONG>attr_on</STRONG>, <STRONG>attr_off</STRONG>, and <STRONG>attr_set</STRONG> support the foregoing as well as the
|
||||
following additional attributes.
|
||||
|
||||
<STRONG>Name</STRONG> <STRONG>Description</STRONG>
|
||||
-----------------------------------------------------------------
|
||||
@@ -232,42 +232,33 @@
|
||||
<STRONG>WA_TOP</STRONG> Top highlight
|
||||
<STRONG>WA_VERTICAL</STRONG> Vertical highlight
|
||||
|
||||
The return values of many of these routines are not meaningful (they
|
||||
are implemented as macro-expanded assignments and simply return their
|
||||
argument). The SVr4 manual page claims (falsely) that these routines
|
||||
always return <STRONG>1</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All routines return the integer <STRONG>OK</STRONG> on success, or <STRONG>ERR</STRONG> on failure.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions.
|
||||
In <EM>ncurses</EM>, they return <STRONG>ERR</STRONG> if <EM>win</EM> is <EM>NULL</EM>.
|
||||
|
||||
This implementation
|
||||
<STRONG>wcolor_set</STRONG> returns <STRONG>ERR</STRONG> if <EM>pair</EM> is outside the range <STRONG>0</STRONG>..<STRONG>COLOR_PAIRS-1</STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> returns an error if the window pointer is null.
|
||||
|
||||
<STRONG>o</STRONG> returns an error if the color pair parameter for <STRONG>wcolor_set</STRONG> is
|
||||
outside the range 0..COLOR_PAIRS-1.
|
||||
|
||||
<STRONG>o</STRONG> does not return an error if either of the parameters of <STRONG>wattr_get</STRONG>
|
||||
used for retrieving attribute or color pair values is <STRONG>NULL</STRONG>.
|
||||
<STRONG>wattr_get</STRONG> does <EM>not</EM> fail if its <EM>attrs</EM> or <EM>pair</EM> parameter is <EM>NULL</EM>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
These functions may be macros:
|
||||
<STRONG>attr_on</STRONG>, <STRONG>attr_off</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_set</STRONG>, <STRONG>chgat</STRONG>, <STRONG>mvchgat</STRONG>, <STRONG>mvwchgat</STRONG>,
|
||||
<STRONG>wchgat</STRONG>, and <STRONG>color_set</STRONG> are part of <EM>ncurses</EM>'s wide-character API, and are
|
||||
not available in its non-wide-character configuration.
|
||||
|
||||
<STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, <STRONG>standend</STRONG>
|
||||
and <STRONG>standout</STRONG>.
|
||||
<STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, <STRONG>standout</STRONG>, and
|
||||
<STRONG>standend</STRONG> may be implemented as macros.
|
||||
|
||||
Color pair values can only be OR'd with attributes if the pair number
|
||||
is less than 256. The alternate functions such as <STRONG>color_set</STRONG> can pass a
|
||||
color pair value directly. However, <EM>ncurses</EM> ABI 4 and 5 simply OR this
|
||||
value within the alternate functions. You must use <EM>ncurses</EM> ABI 6 to
|
||||
support more than 256 color pairs.
|
||||
Color pair values may be logically "or"-ed with attributes if the pair
|
||||
number is less than 256. The alternate functions such as <STRONG>color_set</STRONG> can
|
||||
pass a color pair value directly. However, <EM>ncurses</EM> ABI 4 and 5 simply
|
||||
logically "or" this value within the alternate functions. You must use
|
||||
<EM>ncurses</EM> ABI 6 to support more than 256 color pairs.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
@@ -280,28 +271,33 @@
|
||||
|
||||
Each of the functions added by XSI Curses has a parameter <EM>opts</EM>, which
|
||||
X/Open Curses still (after more than twenty years) documents as
|
||||
reserved for future use, saying that it should be <STRONG>NULL</STRONG>. This
|
||||
reserved for future use, saying that it should be <EM>NULL</EM>. This
|
||||
implementation uses that parameter in ABI 6 for the functions which
|
||||
have a color pair parameter to support <EM>extended</EM> <EM>color</EM> <EM>pairs</EM>:
|
||||
|
||||
<STRONG>o</STRONG> For functions which modify the color, e.g., <STRONG>wattr_set</STRONG> and <STRONG>wattr_on</STRONG>,
|
||||
if <EM>opts</EM> is set it is treated as a pointer to <STRONG>int</STRONG>, and used to set
|
||||
the color pair instead of the <STRONG>short</STRONG> <EM>pair</EM> parameter.
|
||||
if <EM>opts</EM> is set it is treated as a pointer to <EM>int</EM>, and used to set
|
||||
the color pair instead of the <EM>short</EM> <EM>pair</EM> parameter.
|
||||
|
||||
<STRONG>o</STRONG> For functions which retrieve the color, e.g., <STRONG>wattr_get</STRONG>, if <EM>opts</EM> is
|
||||
set it is treated as a pointer to <STRONG>int</STRONG>, and used to retrieve the
|
||||
color pair as an <STRONG>int</STRONG> value, in addition to retrieving it via the
|
||||
standard pointer to <STRONG>short</STRONG> parameter.
|
||||
set it is treated as a pointer to <EM>int</EM>, and used to retrieve the
|
||||
color pair as an <EM>int</EM> value, in addition to retrieving it via the
|
||||
standard pointer to <EM>short</EM> parameter.
|
||||
|
||||
<STRONG>o</STRONG> For functions which turn attributes off, e.g., <STRONG>wattr_off</STRONG>, the <EM>opts</EM>
|
||||
parameter is ignored except except to check that it is <STRONG>NULL</STRONG>.
|
||||
parameter is ignored except to check that it is <EM>NULL</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4. The standard
|
||||
defined the dedicated type for highlights, <STRONG>attr_t</STRONG>, which was not
|
||||
defined in SVr4 curses. The functions taking <STRONG>attr_t</STRONG> arguments were not
|
||||
supported under SVr4.
|
||||
These functions are described in X/Open Curses Issue 4. It specifies
|
||||
no error conditions for them.
|
||||
|
||||
The standard defined the dedicated type for highlights, <EM>attr</EM><STRONG>_</STRONG><EM>t</EM>, which
|
||||
was not defined in SVr4 <EM>curses</EM>. The functions taking <EM>attr</EM><STRONG>_</STRONG><EM>t</EM> arguments
|
||||
were not supported under SVr4.
|
||||
|
||||
SVr4 describes the functions not taking <EM>attr</EM><STRONG>_</STRONG><EM>t</EM> or <EM>pair</EM> arguments as
|
||||
always returning <STRONG>1</STRONG>.
|
||||
|
||||
Very old versions of this library did not force an update of the screen
|
||||
when changing the attributes. Use <STRONG>touchwin</STRONG> to force the screen to
|
||||
@@ -310,7 +306,7 @@
|
||||
X/Open Curses states that whether the traditional functions
|
||||
<STRONG>attron</STRONG>/<STRONG>attroff</STRONG>/<STRONG>attrset</STRONG> can manipulate attributes other than <STRONG>A_BLINK</STRONG>,
|
||||
<STRONG>A_BOLD</STRONG>, <STRONG>A_DIM</STRONG>, <STRONG>A_REVERSE</STRONG>, <STRONG>A_STANDOUT</STRONG>, or <STRONG>A_UNDERLINE</STRONG> is "unspecified".
|
||||
Under this implementation as well as SVr4 curses, these functions
|
||||
Under this implementation as well as SVr4 <EM>curses</EM>, these functions
|
||||
correctly manipulate all other highlights (specifically, <STRONG>A_ALTCHARSET</STRONG>,
|
||||
<STRONG>A_PROTECT</STRONG>, and <STRONG>A_INVIS</STRONG>).
|
||||
|
||||
@@ -324,102 +320,99 @@
|
||||
the newer set of names:
|
||||
|
||||
<STRONG>Name</STRONG> <STRONG>Description</STRONG>
|
||||
-----------------------------------------------------------------
|
||||
-------------------------------------------------
|
||||
<STRONG>WA_NORMAL</STRONG> Normal display (no highlight)
|
||||
<STRONG>WA_STANDOUT</STRONG> Best highlighting mode of the terminal
|
||||
<STRONG>WA_STANDOUT</STRONG> Best highlighting mode available
|
||||
<STRONG>WA_UNDERLINE</STRONG> Underlining
|
||||
<STRONG>WA_REVERSE</STRONG> Reverse video
|
||||
<STRONG>WA_BLINK</STRONG> Blinking
|
||||
<STRONG>WA_DIM</STRONG> Half bright
|
||||
<STRONG>WA_BOLD</STRONG> Extra bright or bold
|
||||
|
||||
<STRONG>WA_ALTCHARSET</STRONG> Alternate character set
|
||||
|
||||
X/Open Curses does not assign values to these symbols, nor does it
|
||||
state whether or not they are related to the similarly-named A_NORMAL,
|
||||
X/Open Curses does not assign values to these symbols, nor does it
|
||||
state whether or not they are related to the similarly-named A_NORMAL,
|
||||
etc.:
|
||||
|
||||
<STRONG>o</STRONG> X/Open Curses specifies that each pair of corresponding <STRONG>A_</STRONG> and
|
||||
<STRONG>WA_</STRONG>-using functions operates on the same current-highlight
|
||||
<STRONG>o</STRONG> X/Open Curses specifies that each pair of corresponding <STRONG>A_</STRONG> and
|
||||
<STRONG>WA_</STRONG>-using functions operates on the same current-highlight
|
||||
information.
|
||||
|
||||
<STRONG>o</STRONG> However, in some implementations, those symbols have unrelated
|
||||
<STRONG>o</STRONG> However, in some implementations, those symbols have unrelated
|
||||
values.
|
||||
|
||||
For example, the Solaris <EM>xpg4</EM> (X/Open) curses declares <STRONG>attr_t</STRONG> to be
|
||||
an unsigned short integer (16-bits), while <STRONG>chtype</STRONG> is a unsigned
|
||||
For example, the Solaris <EM>xpg4</EM> (X/Open) <EM>curses</EM> declares <EM>attr</EM><STRONG>_</STRONG><EM>t</EM> to be
|
||||
an unsigned short integer (16-bits), while <EM>chtype</EM> is a unsigned
|
||||
integer (32-bits). The <STRONG>WA_</STRONG> symbols in this case are different from
|
||||
the <STRONG>A_</STRONG> symbols because they are used for a smaller datatype which
|
||||
the <STRONG>A_</STRONG> symbols because they are used for a smaller datatype which
|
||||
does not represent <STRONG>A_CHARTEXT</STRONG> or <STRONG>A_COLOR</STRONG>.
|
||||
|
||||
In this implementation (as in many others), the values happen to be
|
||||
the same because it simplifies copying information between <STRONG>chtype</STRONG>
|
||||
and <STRONG>cchar_t</STRONG> variables.
|
||||
the same because it simplifies copying information between <EM>chtype</EM>
|
||||
and <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> variables.
|
||||
|
||||
<STRONG>o</STRONG> Because <EM>ncurses</EM>'s <STRONG>attr_t</STRONG> can hold a color pair (in the <STRONG>A_COLOR</STRONG>
|
||||
<STRONG>o</STRONG> Because <EM>ncurses</EM>'s <EM>attr</EM><STRONG>_</STRONG><EM>t</EM> can hold a color pair (in the <STRONG>A_COLOR</STRONG>
|
||||
field), a call to <STRONG>wattr_on</STRONG>, <STRONG>wattr_off</STRONG>, or <STRONG>wattr_set</STRONG> may alter the
|
||||
window's color. If the color pair information in the attribute
|
||||
parameter is zero, no change is made to the window's color.
|
||||
|
||||
This is consistent with SVr4 curses; X/Open Curses does not specify
|
||||
This is consistent with SVr4 <EM>curses</EM>; X/Open Curses does not specify
|
||||
this.
|
||||
|
||||
The X/Open Curses extended conformance level adds new highlights
|
||||
<STRONG>A_HORIZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>, <STRONG>A_VERTICAL</STRONG> (and
|
||||
corresponding <STRONG>WA_</STRONG> macros for each). As of August 2013, no known
|
||||
The X/Open Curses extended conformance level adds new highlights
|
||||
<STRONG>A_HORIZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>, <STRONG>A_VERTICAL</STRONG> (and
|
||||
corresponding <STRONG>WA_</STRONG> macros for each). As of August 2013, no known
|
||||
terminal provides these highlights (i.e., via the <STRONG>sgr1</STRONG> capability).
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses is largely based on SVr4 curses, adding support for
|
||||
"wide-characters" (not specific to Unicode). Some of the X/Open
|
||||
differences from SVr4 curses address the way video attributes can be
|
||||
applied to wide-characters. But aside from that, <STRONG>attrset</STRONG> and <STRONG>attr_set</STRONG>
|
||||
are similar. SVr4 curses provided the basic features for manipulating
|
||||
video attributes. However, earlier versions of curses provided a part
|
||||
of these features.
|
||||
4BSD (1980) used a <EM>char</EM> to represent each cell of the terminal screen.
|
||||
It assumed 7-bit character codes, employing the eighth bit of a byte to
|
||||
represent a <EM>standout</EM> attribute (often implemented as bold and/or
|
||||
reverse video). It introduced <EM>standout</EM>, <EM>standend</EM>, <EM>wstandout</EM>, and
|
||||
<EM>wstandend</EM> functions to manipulate this bit. Despite their
|
||||
inflexibility, they carried over into System V <EM>curses</EM> and ultimately
|
||||
X/Open Curses due to their pervasive use in legacy applications. While
|
||||
some 1980s terminals supported a variety of video attributes, BSD
|
||||
<EM>curses</EM> could do nothing with them.
|
||||
|
||||
As seen in 2.8BSD, curses assumed 7-bit characters, using the eighth
|
||||
bit of a byte to represent the <EM>standout</EM> feature (often implemented as
|
||||
bold and/or reverse video). The BSD curses library provided functions
|
||||
<STRONG>standout</STRONG> and <STRONG>standend</STRONG> which were carried along into X/Open Curses due
|
||||
to their pervasive use in legacy applications.
|
||||
SVr2 (1984) provided an improved <EM>curses</EM> library, introducing <EM>chtype</EM> to
|
||||
create the abstract notion of a <EM>curses</EM> character; this was by default
|
||||
an <EM>unsigned</EM> <EM>short</EM>, with a provision for compile-time redefinition to
|
||||
other integral types (a freedom not necessarily available to users of
|
||||
shared libraries, and in any event a source license was necessary to
|
||||
exercise it). It added the functions <EM>attron</EM>, <EM>attroff</EM>, <EM>attrset</EM>,
|
||||
<EM>wattron</EM>, <EM>wattroff</EM>, and <EM>wattrset</EM>, and defined the <EM>A</EM><STRONG>_</STRONG> macros listed above
|
||||
(except for <EM>A</EM><STRONG>_</STRONG><EM>ITALIC</EM> and <EM>A</EM><STRONG>_</STRONG><EM>COLOR</EM>) for use by applications to manipulate
|
||||
other attributes. The values of these macros were not necessarily the
|
||||
same in different systems, even among those certified as System V.
|
||||
|
||||
Some terminals in the 1980s could support a variety of video
|
||||
attributes, although the BSD curses library could do nothing with
|
||||
those. System V (1983) provided an improved curses library. It
|
||||
defined the <STRONG>A_</STRONG> symbols for use by applications to manipulate the other
|
||||
attributes. There are few useful references for the chronology.
|
||||
SVr3.2 (1988) added the <EM>A</EM><STRONG>_</STRONG><EM>COLOR</EM> macro along with a color system; see
|
||||
<STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>.
|
||||
|
||||
Goodheart's book <EM>UNIX</EM> <EM>Curses</EM> <EM>Explained</EM> (1991) describes SVr3 (1987),
|
||||
commenting on several functions:
|
||||
X/Open Curses Issue 4 (1995) is largely based on SVr4 <EM>curses</EM>, but
|
||||
recognized that the <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> type of ISO C95 was intended to house only
|
||||
a single character code, not a sequence of codes combining with a base
|
||||
character, let alone could it reliably offer room for a color pair
|
||||
identifier and a set of attribute bits with a potential for further
|
||||
growth -- thus the standard invented the <EM>curses</EM> complex character type
|
||||
<EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> and a separate type <EM>attr</EM><STRONG>_</STRONG><EM>t</EM> for storage of attribute bits. The
|
||||
new types brought along several new functions to manipulate them, some
|
||||
corresponding to existing <EM>chtype</EM>-based functions (<EM>attr</EM><STRONG>_</STRONG><EM>on</EM>, <EM>attr</EM><STRONG>_</STRONG><EM>off</EM>,
|
||||
<EM>attr</EM><STRONG>_</STRONG><EM>set</EM>, <EM>wattr</EM><STRONG>_</STRONG><EM>on</EM>, <EM>wattr</EM><STRONG>_</STRONG><EM>off</EM>, and <EM>wattr</EM><STRONG>_</STRONG><EM>set</EM>), and some new (<EM>chgat</EM> and
|
||||
its variants, <EM>color</EM><STRONG>_</STRONG><EM>set</EM>, and <EM>wcolor</EM><STRONG>_</STRONG><EM>set</EM>).
|
||||
|
||||
<STRONG>o</STRONG> the <STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, <STRONG>attrset</STRONG> functions (and most of the functions
|
||||
found in SVr4 but not in BSD curses) were introduced by System V,
|
||||
Different Unix systems used differently sized bit fields in <EM>chtype</EM> for
|
||||
the character code and the color pair identifier, and took into account
|
||||
platforms' different integer sizes (32- versus 64-bit).
|
||||
|
||||
<STRONG>o</STRONG> the alternate character set feature with <STRONG>A_ALTCHARSET</STRONG> was added in
|
||||
SVr2 and improved in SVr3 (by adding <STRONG>acs_map[]</STRONG>),
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>start_color</STRONG> and related color-functions were introduced by System
|
||||
V.3.2,
|
||||
|
||||
<STRONG>o</STRONG> pads, soft-keys were added in SVr3, and
|
||||
|
||||
Goodheart did not mention the background character or the <STRONG>cchar_t</STRONG> type.
|
||||
Those are respectively SVr4 and X/Open features. He did mention the <STRONG>A_</STRONG>
|
||||
constants, but did not indicate their values. Those were not the same
|
||||
in different systems, even for those marked as System V.
|
||||
|
||||
Different Unix systems used different sizes for the bit-fields in
|
||||
<STRONG>chtype</STRONG> for <EM>characters</EM> and <EM>colors</EM>, and took into account the different
|
||||
integer sizes (32-bit versus 64-bit).
|
||||
|
||||
This table showing the number of bits for <STRONG>A_COLOR</STRONG> and <STRONG>A_CHARTEXT</STRONG> was
|
||||
gleaned from the curses header files for various operating systems and
|
||||
architectures. The inferred architecture and notes reflect the format
|
||||
and size of the defined constants as well as clues such as the
|
||||
alternate character set implementation. A 32-bit library can be used
|
||||
on a 64-bit system, but not necessarily the reverse.
|
||||
The following table showing the number of bits for <EM>A</EM><STRONG>_</STRONG><EM>COLOR</EM> and
|
||||
<EM>A</EM><STRONG>_</STRONG><EM>CHARTEXT</EM> was gleaned from the <EM>curses</EM> header files for various
|
||||
operating systems and architectures. The inferred architecture and
|
||||
notes reflect the format and size of the defined constants as well as
|
||||
clues such as the alternate character set implementation. A 32-bit
|
||||
library can be used on a 64-bit system, but not necessarily the
|
||||
converse.
|
||||
|
||||
<STRONG>Bits</STRONG>
|
||||
<STRONG>Year</STRONG> <STRONG>System</STRONG> <STRONG>Arch</STRONG> <STRONG>Color</STRONG> <STRONG>Char</STRONG> <STRONG>Notes</STRONG>
|
||||
@@ -434,7 +427,7 @@
|
||||
1996 AIX 4.2 32 7 16 X/Open <EM>curses</EM>
|
||||
1996 OSF/1 r4 32 6 16 X/Open <EM>curses</EM>
|
||||
1997 HP-UX 11.00 32 6 8 X/Open <EM>curses</EM>
|
||||
2000 U/Win 32/64 7/31 16 uses <EM>chtype</EM>
|
||||
2000 UWIN 32/64 7/31 16 uses <EM>chtype</EM>
|
||||
|
||||
Notes:
|
||||
|
||||
@@ -444,60 +437,59 @@
|
||||
in 1996.
|
||||
|
||||
<STRONG>o</STRONG> HP-UX 10.30 (1997) marked "curses_colr" obsolete. That version
|
||||
of curses was dropped with HP-UX 11.30 in 2006.
|
||||
of <EM>curses</EM> was dropped with HP-UX 11.30 in 2006.
|
||||
|
||||
Regarding OSF/1 (and Tru64),
|
||||
|
||||
<STRONG>o</STRONG> These used 64-bit hardware. Like <EM>ncurses</EM>, the OSF/1 curses
|
||||
<STRONG>o</STRONG> These used 64-bit hardware. Like <EM>ncurses</EM>, the OSF/1 <EM>curses</EM>
|
||||
interface is not customized for 32-bit and 64-bit versions.
|
||||
|
||||
<STRONG>o</STRONG> Unlike other systems which evolved from AT&T code, OSF/1
|
||||
provided a new implementation for X/Open curses.
|
||||
provided a new implementation for X/Open Curses.
|
||||
|
||||
Regarding Solaris,
|
||||
|
||||
<STRONG>o</STRONG> The initial release of Solaris was in 1992.
|
||||
|
||||
<STRONG>o</STRONG> The <EM>xpg4</EM> (X/Open) curses was developed by MKS from 1990 to 1995.
|
||||
Sun's copyright began in 1996.
|
||||
<STRONG>o</STRONG> Its XPG4 (X/Open Curses-conforming) <EM>xcurses</EM> library was
|
||||
developed by Mortice Kern Systems from 1990 to 1995. Sun's
|
||||
copyright began in 1996.
|
||||
|
||||
<STRONG>o</STRONG> Sun updated the X/Open curses interface after 64-bit support was
|
||||
introduced in 1997, but did not modify the SVr4 curses
|
||||
<STRONG>o</STRONG> Sun updated the X/Open Curses interface after 64-bit support was
|
||||
introduced in 1997, but did not modify the SVr4 <EM>curses</EM>
|
||||
interface.
|
||||
|
||||
Regarding U/Win,
|
||||
Regarding UWIN,
|
||||
|
||||
<STRONG>o</STRONG> Development of the curses library began in 1991, stopped in
|
||||
<STRONG>o</STRONG> Development of the <EM>curses</EM> library began in 1991, stopped in
|
||||
2000.
|
||||
|
||||
<STRONG>o</STRONG> Color support was added in 1998.
|
||||
|
||||
<STRONG>o</STRONG> The library uses only <STRONG>chtype</STRONG> (no <STRONG>cchar_t</STRONG>).
|
||||
<STRONG>o</STRONG> The library uses only <EM>chtype</EM> (not <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>).
|
||||
|
||||
Once X/Open curses was adopted in the mid-1990s, the constraint of a
|
||||
32-bit interface with many colors and wide-characters for <STRONG>chtype</STRONG> became
|
||||
a moot point. The <STRONG>cchar_t</STRONG> structure (whose size and members are not
|
||||
Once X/Open Curses was adopted in the mid-1990s, the constraint of a
|
||||
32-bit interface with many colors and wide-characters for <EM>chtype</EM> became
|
||||
a moot point. The <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> structure (whose size and members are not
|
||||
specified in X/Open Curses) could be extended as needed.
|
||||
|
||||
Other interfaces are rarely used now:
|
||||
Other interfaces are rarely used now.
|
||||
|
||||
<STRONG>o</STRONG> BSD curses was improved slightly in 1993/1994 using Keith Bostic's
|
||||
modification to make the library 8-bit clean for <STRONG>nvi(1)</STRONG>. He moved
|
||||
<EM>standout</EM> attribute to a structure member.
|
||||
<STRONG>o</STRONG> BSD <EM>curses</EM> was improved slightly in 1993/1994 using Keith Bostic's
|
||||
modification to make the library 8-bit clean for <STRONG>nvi(1)</STRONG>. He moved
|
||||
the <EM>standout</EM> attribute to a structure member. The resulting 4.4BSD
|
||||
<EM>curses</EM> was replaced by <EM>ncurses</EM> over the next ten years.
|
||||
|
||||
The resulting 4.4BSD curses was replaced by <EM>ncurses</EM> over the next
|
||||
ten years.
|
||||
<STRONG>o</STRONG> UWIN has been defunct since 2012.
|
||||
|
||||
<STRONG>o</STRONG> U/Win is rarely used now.
|
||||
<EM>ncurses</EM> 6.0 (2015) added the <EM>A</EM><STRONG>_</STRONG><EM>ITALIC</EM> macro.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>, <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-27 <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-11-11 <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2005,2010 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_beep.3x,v 1.29 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_beep.3x,v 1.42 2025/02/01 23:46:11 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_beep 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_beep 3x 2025-02-01 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_beep 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_beep 3x 2025-02-01 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>beep</STRONG>, <STRONG>flash</STRONG> - ring the (visual) bell of the terminal with <EM>curses</EM>
|
||||
|
||||
@@ -58,35 +56,45 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <STRONG>beep</STRONG> and <STRONG>flash</STRONG> routines are used to alert the terminal user. The
|
||||
routine <STRONG>beep</STRONG> sounds an audible alarm on the terminal, if possible;
|
||||
otherwise it flashes the screen (visible bell). The routine <STRONG>flash</STRONG>
|
||||
flashes the screen, and if that is not possible, sounds the alert. If
|
||||
neither alert is possible, nothing happens. Nearly all terminals have
|
||||
an audible alert (bell or beep), but only some can flash the screen.
|
||||
<STRONG>beep</STRONG> and <STRONG>flash</STRONG> alert the terminal user: the former by sounding the
|
||||
terminal's audible alarm, and the latter by visibly attracting
|
||||
attention. Commonly, a terminal implements a visual bell by
|
||||
momentarily reversing the character foreground and background colors on
|
||||
the entire display; even a monochrome device can do this. These
|
||||
functions each attempt the other alert type if the one requested is
|
||||
unavailable. If neither is available, <EM>curses</EM> performs no action.
|
||||
Nearly all terminals have an audible alert mechanism such as a bell or
|
||||
piezoelectric buzzer, but only some can flash the screen.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These routines return <STRONG>OK</STRONG> if they succeed in beeping or flashing, <STRONG>ERR</STRONG>
|
||||
otherwise.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
In <EM>ncurses</EM>, <STRONG>beep</STRONG> and <STRONG>flash</STRONG> return <STRONG>OK</STRONG> if the terminal type supports the
|
||||
corresponding capability: <STRONG>bell</STRONG> (<STRONG>bel</STRONG>) for <STRONG>beep</STRONG> and <STRONG>flash_screen</STRONG> (<STRONG>flash</STRONG>)
|
||||
for <STRONG>flash</STRONG>. Otherwise they return <STRONG>ERR</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
SVr4's beep and flash routines always returned <STRONG>OK</STRONG>, so it was not
|
||||
possible to tell when the beep or flash failed.
|
||||
In <EM>ncurses</EM>, these functions can return <STRONG>ERR</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4. Like SVr4, it
|
||||
specifies that they always return <STRONG>OK</STRONG>.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
On SVr4 <EM>curses</EM>, they always return <EM>OK</EM>, and X/Open Curses specifies them
|
||||
as doing so.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
SVr2 (1984) introduced <EM>beep</EM> and <EM>flash</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-02-01 <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -96,6 +104,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2015,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_bkgd.3x,v 1.61 2024/04/20 18:54:36 tom Exp @
|
||||
* @Id: curs_bkgd.3x,v 1.76 2025/08/23 22:39:20 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_bkgd 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_bkgd 3x 2025-08-23 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_bkgd 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_bkgd 3x 2025-08-23 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>bkgdset</STRONG>, <STRONG>wbkgdset</STRONG>, <STRONG>bkgd</STRONG>, <STRONG>wbkgd</STRONG>, <STRONG>getbkgd</STRONG> - manipulate background of a
|
||||
<EM>curses</EM> window of characters
|
||||
@@ -64,24 +62,29 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <EM>background</EM> of a <EM>curses</EM> window (in the library's non-"wide"
|
||||
configuration) is a <EM>chtype</EM> combining a set of attributes (see
|
||||
<STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>) with a character called the <EM>blank</EM> <EM>character.</EM>
|
||||
Every <EM>curses</EM> window has a <EM>background</EM> <EM>character</EM> property: in the
|
||||
library's non-wide-character configuration, it is a <EM>curses</EM> character
|
||||
(<EM>chtype</EM>) that combines a set of attributes (and, if colors are enabled,
|
||||
a color pair identifier) with a character code. When erasing (parts
|
||||
of) a window, <EM>curses</EM> replaces the erased cells with the background
|
||||
character.
|
||||
|
||||
The blank character is a spacing character that populates a window's
|
||||
character cells when their contents are erased without replacement.
|
||||
The background's attributes are combined with all non-blank characters
|
||||
written to the window, as with the <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> and <STRONG><A HREF="curs_insch.3x.html">winsch(3x)</A></STRONG> families
|
||||
of functions.
|
||||
<EM>curses</EM> also uses the background character when writing characters to a
|
||||
populated window.
|
||||
|
||||
The blank character and attributes of the background combine with
|
||||
characters written to the window as described below. The background
|
||||
becomes a property of the character and moves with it through any
|
||||
scrolling and insert/delete line/character operations.
|
||||
<STRONG>o</STRONG> The attribute part of the background character combines with all
|
||||
non-blank character cells in the window, as populated by the
|
||||
<STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> and <STRONG><A HREF="curs_insch.3x.html">winsch(3x)</A></STRONG> families of functions (and those that
|
||||
call them).
|
||||
|
||||
To the extent possible on a given terminal, the attribute part of the
|
||||
background is displayed as the graphic rendition of the character put
|
||||
on the screen.
|
||||
<STRONG>o</STRONG> Both the character code and attributes of the background character
|
||||
combine with blank character cells in the window.
|
||||
|
||||
The background character's set of attributes becomes a property of the
|
||||
character cell and move with it through any scrolling and insert/delete
|
||||
line/character operations. To the extent possible on the terminal
|
||||
type, <EM>curses</EM> displays the attributes of the background character as the
|
||||
graphic rendition of a character cell on the display.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-bkgd_wbkgd">bkgd, wbkgd</a></H3><PRE>
|
||||
@@ -95,38 +98,40 @@
|
||||
<STRONG>o</STRONG> Wherever the former background character appears, it changes to the
|
||||
new background character.
|
||||
|
||||
<EM>ncurses</EM> updates the rendition of each character cell by comparing the
|
||||
character, non-color attributes, and colors. The library applies to
|
||||
following procedure to each cell in the window, whether or not it is
|
||||
blank.
|
||||
<EM>ncurses</EM> updates the rendition of each character cell by comparing the
|
||||
character, non-color attributes, and color pair selection. The library
|
||||
applies the following procedure to each cell in the window, whether or
|
||||
not it is blank.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> first compares the cell's character to the previously
|
||||
specified blank character; if they match, <EM>ncurses</EM> writes the new
|
||||
blank character to the cell.
|
||||
specified background character; if they match, <EM>ncurses</EM> writes the
|
||||
new background character to the cell.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> then checks if the cell uses color, that is, its color pair
|
||||
value is nonzero. If not, it simply replaces the attributes and
|
||||
color pair in the cell with those from the new background
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> then checks whether the cell uses color; that is, its color
|
||||
pair value is nonzero. If not, it simply replaces the attributes
|
||||
and color pair in the cell with those from the new background
|
||||
character.
|
||||
|
||||
<STRONG>o</STRONG> If the cell uses color, and its background color matches that of
|
||||
the current window background, <EM>ncurses</EM> removes attributes that may
|
||||
have come from the current background and adds those from the new
|
||||
background. It finishes by setting the cell's background to use
|
||||
<STRONG>o</STRONG> If the cell uses color, and its background color matches that of
|
||||
the current window background, <EM>ncurses</EM> removes attributes that may
|
||||
have come from the current background and adds those from the new
|
||||
background. It finishes by setting the cell's background to use
|
||||
the new window background color.
|
||||
|
||||
<STRONG>o</STRONG> If the cell uses color, and its background color does not match
|
||||
that of the current window background, <EM>ncurses</EM> updates only the
|
||||
non-color attributes, first removing those that may have come from
|
||||
the current background, and then adding attributes from the new
|
||||
<STRONG>o</STRONG> If the cell uses color, and its background color does not match
|
||||
that of the current window background, <EM>ncurses</EM> updates only the
|
||||
non-color attributes, first removing those that may have come from
|
||||
the current background, and then adding attributes from the new
|
||||
background.
|
||||
|
||||
<EM>ncurses</EM> treats a background character value of zero (0) as a blank
|
||||
character.
|
||||
If the new background's character is non-spacing (for example, if it is
|
||||
a control character), <EM>ncurses</EM> retains the existing background
|
||||
character, except for one special case: <EM>ncurses</EM> treats a background
|
||||
character code of zero (0) as a space.
|
||||
|
||||
If the terminal does not support color, or if color has not been
|
||||
initialized with <STRONG><A HREF="curs_color.3x.html">start_color(3x)</A></STRONG>, <EM>ncurses</EM> ignores the new background
|
||||
character's color attribute.
|
||||
character's color pair selection.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-bkgdset_wbkgdset">bkgdset, wbkgdset</a></H3><PRE>
|
||||
@@ -136,19 +141,21 @@
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-getbkgd">getbkgd</a></H3><PRE>
|
||||
<STRONG>getbkgd</STRONG> obtains the given window's background character and attribute
|
||||
combination.
|
||||
<STRONG>getbkgd</STRONG> returns the given window's background character, attributes,
|
||||
and color pair as a <EM>chtype</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
Functions returning an <EM>int</EM> return <STRONG>OK</STRONG> on success. <STRONG>bkgd</STRONG> returns <STRONG>ERR</STRONG> if
|
||||
the library has not been initialized. <STRONG>wbkgd</STRONG> and <STRONG>getbkgd</STRONG> return <STRONG>ERR</STRONG> if
|
||||
a <EM>WINDOW</EM> pointer argument is null.
|
||||
|
||||
<STRONG>bkgdset</STRONG> and <STRONG>wbkgdset</STRONG> do not return a value.
|
||||
|
||||
<STRONG>getbkgd</STRONG> returns a window's background character and attribute
|
||||
combination.
|
||||
Functions returning an <EM>int</EM> return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon success.
|
||||
In <EM>ncurses</EM>, failure occurs if
|
||||
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized, or
|
||||
|
||||
<STRONG>o</STRONG> <EM>win</EM> is <EM>NULL</EM>.
|
||||
|
||||
<STRONG>getbkgd</STRONG>'s return value is as described above.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
@@ -159,37 +166,39 @@
|
||||
|
||||
X/Open Curses mentions that the character part of the background must
|
||||
be a single-byte value. <EM>ncurses</EM>, like SVr4 <EM>curses</EM>, checks to ensure
|
||||
that, and will reuse the old background character if the check fails.
|
||||
that it is, and retains the existing background character if the check
|
||||
fails.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 4 describes these functions. It specifies that
|
||||
<STRONG>bkgd</STRONG>, <STRONG>wbkgd</STRONG>, and <STRONG>getbkgd</STRONG> return <STRONG>ERR</STRONG> on failure (in the case of the
|
||||
last, this value is cast to <EM>chtype</EM>), but describes no failure
|
||||
conditions.
|
||||
X/Open Curses Issue 4 describes these functions. It indicates that
|
||||
<EM>bkgd</EM>, <EM>wbkgd</EM>, and <EM>getbkgd</EM> return <EM>ERR</EM> on failure (in the case of the
|
||||
last, this value is cast to <EM>chtype</EM>), but specifies no error conditions
|
||||
for them.
|
||||
|
||||
The SVr4.0 manual says that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> may return <STRONG>OK</STRONG> "or a non-
|
||||
negative integer if <STRONG>immedok</STRONG> is set", which refers to the return value
|
||||
from <STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG>, used to implement the immediate repainting. SVr4
|
||||
<EM>curses</EM>'s <STRONG>wrefresh</STRONG> returns the number of characters written to the
|
||||
screen during the refresh. <EM>ncurses</EM> does not do that.
|
||||
SVr4 documentation says that <EM>bkgd</EM> and <EM>wbkgd</EM> return <EM>OK</EM> "or a non-
|
||||
negative integer if <EM>immedok()</EM> is set", referring to the return value
|
||||
from <EM>wrefresh</EM>, which in SVr4 returns a count of characters written to
|
||||
the window if its <EM>immedok</EM> property is set; in <EM>ncurses</EM>, it does not.
|
||||
|
||||
Neither X/Open Curses nor the SVr4 manual pages detail how the
|
||||
rendition of characters on the screen updates when <STRONG>bkgd</STRONG> or <STRONG>wbkgd</STRONG>
|
||||
rendition of characters in the window updates when <EM>bkgd</EM> or <EM>wbkgd</EM>
|
||||
changes the background character. <EM>ncurses</EM>, like SVr4 <EM>curses</EM>, does not
|
||||
(in its non-"wide" configuration) store the background and window
|
||||
attribute contributions to each character cell separately.
|
||||
(in its non-wide-character configuration) store the background and
|
||||
window attribute contributions to each character cell separately.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
SVr3.1 (1987) introduced these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG> describes the corresponding functions in the "wide"
|
||||
<STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG> describes the corresponding functions in the wide
|
||||
configuration of <EM>ncurses</EM>.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-08-23 <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -205,6 +214,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2015,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_bkgrnd.3x,v 1.42 2024/04/20 18:54:36 tom Exp @
|
||||
* @Id: curs_bkgrnd.3x,v 1.60 2025/08/23 22:39:20 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_bkgrnd 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_bkgrnd 3x 2025-08-23 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_bkgrnd 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_bkgrnd 3x 2025-08-23 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>bkgrnd</STRONG>, <STRONG>wbkgrnd</STRONG>, <STRONG>bkgrndset</STRONG>, <STRONG>wbkgrndset</STRONG>, <STRONG>getbkgrnd</STRONG>, <STRONG>wgetbkgrnd</STRONG> -
|
||||
manipulate background of a <EM>curses</EM> window of wide characters
|
||||
@@ -65,24 +63,29 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <EM>background</EM> of a <EM>curses</EM> window (in the library's "wide"
|
||||
configuration) is a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> combining a set of attributes (see
|
||||
<STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>) with a complex character called the <EM>blank</EM> <EM>character.</EM>
|
||||
Every <EM>curses</EM> window has a <EM>background</EM> <EM>character</EM> property: in the
|
||||
library's wide configuration, it is a <EM>curses</EM> complex character
|
||||
(<EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>) that combines a set of attributes (and, if colors are
|
||||
enabled, a color pair identifier) with a character code. When erasing
|
||||
(parts of) a window, <EM>curses</EM> replaces the erased cells with the
|
||||
background character.
|
||||
|
||||
The blank character is a spacing character that populates a window's
|
||||
character cells when their contents are erased without replacement.
|
||||
The background's attributes are combined with all non-blank characters
|
||||
written to the window, as with the <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> and <STRONG><A HREF="curs_ins_wch.3x.html">wins_wch(3x)</A></STRONG>
|
||||
families of functions.
|
||||
<EM>curses</EM> also uses the background character when writing characters to a
|
||||
populated window.
|
||||
|
||||
The blank character and attributes of the background combine with
|
||||
characters written to the window as described below. The background
|
||||
becomes a property of the character and moves with it through any
|
||||
scrolling and insert/delete line/character operations.
|
||||
<STRONG>o</STRONG> The attribute part of the background character combines with all
|
||||
non-blank character cells in the window, as populated by the
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG> and <STRONG><A HREF="curs_ins_wch.3x.html">wins_wch(3x)</A></STRONG> families of functions (and those that
|
||||
call them).
|
||||
|
||||
To the extent possible on a given terminal, the attribute part of the
|
||||
background is displayed as the graphic rendition of the character put
|
||||
on the screen.
|
||||
<STRONG>o</STRONG> Both the character code and attributes of the background character
|
||||
combine with blank character cells in the window.
|
||||
|
||||
The background character's set of attributes becomes a property of the
|
||||
character cell and move with it through any scrolling and insert/delete
|
||||
line/character operations. To the extent possible on the terminal
|
||||
type, <EM>curses</EM> displays the attributes of the background character as the
|
||||
graphic rendition of a character cell on the display.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-bkgrnd_wbkgrnd">bkgrnd, wbkgrnd</a></H3><PRE>
|
||||
@@ -90,24 +93,24 @@
|
||||
specified window and then apply this setting to every character cell in
|
||||
that window.
|
||||
|
||||
<STRONG>o</STRONG> The rendition of every character in the window changes to the new
|
||||
<STRONG>o</STRONG> The rendition of every character in the window changes to the new
|
||||
background rendition.
|
||||
|
||||
<STRONG>o</STRONG> Wherever the former background character appears, it changes to the
|
||||
new background character.
|
||||
|
||||
<EM>ncurses</EM> updates the rendition of each character cell by comparing the
|
||||
character, non-color attributes, and colors. The library applies to
|
||||
following procedure to each cell in the window, whether or not it is
|
||||
blank.
|
||||
character, non-color attributes, and color pair selection. The library
|
||||
applies to following procedure to each cell in the window, whether or
|
||||
not it is blank.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> first compares the cell's character to the previously
|
||||
specified blank character; if they match, <EM>ncurses</EM> writes the new
|
||||
blank character to the cell.
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> first compares the cell's character to the previously
|
||||
specified background character; if they match, <EM>ncurses</EM> writes the
|
||||
new background character to the cell.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> then checks if the cell uses color, that is, its color pair
|
||||
value is nonzero. If not, it simply replaces the attributes and
|
||||
color pair in the cell with those from the new background
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> then checks whether the cell uses color; that is, its color
|
||||
pair value is nonzero. If not, it simply replaces the attributes
|
||||
and color pair in the cell with those from the new background
|
||||
character.
|
||||
|
||||
<STRONG>o</STRONG> If the cell uses color, and its background color matches that of
|
||||
@@ -122,12 +125,13 @@
|
||||
the current background, and then adding attributes from the new
|
||||
background.
|
||||
|
||||
<EM>ncurses</EM> treats a background character value of zero (0) as a blank
|
||||
character.
|
||||
If the new background's character is non-spacing, <EM>ncurses</EM> reuses the
|
||||
old background character, except for one special case: <EM>ncurses</EM> treats a
|
||||
background character code of zero (0) as a space.
|
||||
|
||||
If the terminal does not support color, or if color has not been
|
||||
initialized with <STRONG><A HREF="curs_color.3x.html">start_color(3x)</A></STRONG>, <EM>ncurses</EM> ignores the new background
|
||||
character's color attribute.
|
||||
character's color pair selection.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-bkgrndset_wbkgrndset">bkgrndset, wbkgrndset</a></H3><PRE>
|
||||
@@ -137,47 +141,53 @@
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-getbkgrnd_wgetbkgrnd">getbkgrnd, wgetbkgrnd</a></H3><PRE>
|
||||
The <STRONG>getbkgrnd</STRONG> and <STRONG>wgetbkgrnd</STRONG> functions obtain the background character
|
||||
and attribute pair of <STRONG>stdscr</STRONG> or the specified window and store it via
|
||||
the <EM>wch</EM> pointer.
|
||||
<STRONG>getbkgrnd</STRONG> and <STRONG>wgetbkgrnd</STRONG> respectively obtain <STRONG>stdscr</STRONG>'s or the given
|
||||
window's background character, attributes, and color pair, and store it
|
||||
in their <EM>wch</EM> argument.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
<STRONG>bkgrndset</STRONG> and <STRONG>wbkgrndset</STRONG> do not return a value.
|
||||
|
||||
The other functions return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon success. In
|
||||
<EM>ncurses</EM>, failure occurs if
|
||||
Functions returning an <EM>int</EM> return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon success.
|
||||
In <EM>ncurses</EM>, failure occurs if
|
||||
|
||||
<STRONG>o</STRONG> a <EM>WINDOW</EM> pointer <EM>win</EM> is null, or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> pointer <EM>wch</EM> is null.
|
||||
<STRONG>o</STRONG> <EM>win</EM> is <EM>NULL</EM>, or
|
||||
|
||||
<STRONG>o</STRONG> <EM>wch</EM> is <EM>NULL</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
<STRONG>bkgrnd</STRONG>, <STRONG>bkgrndset</STRONG>, and <STRONG>getbkgrnd</STRONG> may be implemented as macros.
|
||||
|
||||
Unlike their counterparts in the non-"wide" configuration of <EM>ncurses</EM>,
|
||||
<STRONG>getbkgrnd</STRONG> and <STRONG>wgetbkgrnd</STRONG> supply the background character and attribute
|
||||
in a modifiable <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> parameter, not as the return value.
|
||||
Unlike their counterparts in the non-wide-character configuration of
|
||||
<EM>ncurses</EM>, <STRONG>getbkgrnd</STRONG> and <STRONG>wgetbkgrnd</STRONG> store the background character in a
|
||||
modifiable <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> parameter, rather than supplying it as the return
|
||||
value.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 4 describes these functions. It specifies no
|
||||
error conditions for them.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
X/Open Curses does not provide details of how the rendition is updated.
|
||||
This implementation follows the approach used in SVr4 <EM>curses</EM>.
|
||||
<EM>ncurses</EM> follows the approach used in SVr4 <EM>curses</EM>'s non-wide functions
|
||||
for manipulating the window background.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> describes the corresponding functions in the non-"wide"
|
||||
configuration of <EM>ncurses</EM>.
|
||||
<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> describes the corresponding functions in the non-wide-
|
||||
character configuration of <EM>ncurses</EM>.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-08-23 <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -193,6 +203,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2007,2010 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_border.3x,v 1.49 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_border.3x,v 1.65 2025/10/20 23:42:24 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_border 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_border 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_border 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_border 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>border</STRONG>, <STRONG>wborder</STRONG>, <STRONG>box</STRONG>, <STRONG>hline</STRONG>, <STRONG>whline</STRONG>, <STRONG>vline</STRONG>, <STRONG>wvline</STRONG>, <STRONG>mvhline</STRONG>, <STRONG>mvwhline</STRONG>,
|
||||
<STRONG>mvvline</STRONG>, <STRONG>mvwvline</STRONG> - draw borders and lines in a <EM>curses</EM> window of
|
||||
@@ -56,29 +54,28 @@
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>border(chtype</STRONG> <EM>ls</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>rs</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ts</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>bs</EM><STRONG>,</STRONG>
|
||||
<STRONG>chtype</STRONG> <EM>tl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>tr</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>bl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>br</EM><STRONG>);</STRONG>
|
||||
<STRONG>chtype</STRONG> <EM>tl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>tr</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>bl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>br</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wborder(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ls</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>rs</EM><STRONG>,</STRONG>
|
||||
<STRONG>chtype</STRONG> <EM>ts</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>bs</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>tl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>tr</EM><STRONG>,</STRONG>
|
||||
<STRONG>chtype</STRONG> <EM>bl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>br</EM><STRONG>);</STRONG>
|
||||
<STRONG>chtype</STRONG> <EM>ts</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>bs</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>tl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>tr</EM><STRONG>,</STRONG>
|
||||
<STRONG>chtype</STRONG> <EM>bl</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>br</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>box(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>verch</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>horch</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>hline(chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>whline(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>vline(chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wvline(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>mvhline(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwhline(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>vline(chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wvline(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvvline(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwvline(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <STRONG>border</STRONG>, <STRONG>wborder</STRONG> and <STRONG>box</STRONG> routines draw a box around the edges of a
|
||||
window. Other than the window, each argument is a character with
|
||||
attributes:
|
||||
|
||||
<STRONG>wborder</STRONG> and <STRONG>border</STRONG> draw a box at the edges of the specified window or
|
||||
<STRONG>stdscr</STRONG>, respectively. Each <EM>chtype</EM> argument corresponds to a geometric
|
||||
component of the border as follows:
|
||||
<EM>ls</EM> - left side,
|
||||
<EM>rs</EM> - right side,
|
||||
<EM>ts</EM> - top side,
|
||||
@@ -88,60 +85,76 @@
|
||||
<EM>bl</EM> - bottom left-hand corner, and
|
||||
<EM>br</EM> - bottom right-hand corner.
|
||||
|
||||
If any of these arguments is zero, then the corresponding default
|
||||
values (defined in <STRONG>curses.h</STRONG>) are used instead:
|
||||
|
||||
If any <EM>chtype</EM> argument is <STRONG>0</STRONG>, then <EM>curses</EM> uses forms-drawing characters
|
||||
(see <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>) in the following correspondence:
|
||||
<STRONG>ACS_VLINE</STRONG>,
|
||||
<STRONG>ACS_VLINE</STRONG>,
|
||||
<STRONG>ACS_HLINE</STRONG>,
|
||||
<STRONG>ACS_HLINE</STRONG>,
|
||||
<STRONG>ACS_ULCORNER</STRONG>,
|
||||
<STRONG>ACS_URCORNER</STRONG>,
|
||||
<STRONG>ACS_LLCORNER</STRONG>,
|
||||
<STRONG>ACS_LLCORNER</STRONG>, and
|
||||
<STRONG>ACS_LRCORNER</STRONG>.
|
||||
|
||||
<STRONG>box(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>)</STRONG> is a shorthand for the following call:
|
||||
<STRONG>wborder(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0)</STRONG>.
|
||||
<STRONG>box(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>)</STRONG> is shorthand for "<STRONG>wborder(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG>
|
||||
<EM>horch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0)</STRONG>".
|
||||
|
||||
The <STRONG>hline</STRONG> and <STRONG>whline</STRONG> functions draw a horizontal (left to right) line
|
||||
using <EM>ch</EM> starting at the current cursor position in the window. The
|
||||
current cursor position is not changed. The line is at most <EM>n</EM>
|
||||
characters long, or as many as fit into the window.
|
||||
|
||||
The <STRONG>vline</STRONG> and <STRONG>wvline</STRONG> functions draw a vertical (top to bottom) line
|
||||
using <EM>ch</EM> starting at the current cursor position in the window. The
|
||||
current cursor position is not changed. The line is at most <EM>n</EM>
|
||||
characters long, or as many as fit into the window.
|
||||
<STRONG>whline</STRONG> draws a horizontal line of <EM>ch</EM> from left to right, and <STRONG>wvline</STRONG> a
|
||||
vertical one from top to bottom, stopping once <EM>n</EM> characters have been
|
||||
drawn or upon reaching the boundary of <EM>win</EM>. These functions do not
|
||||
update the cursor position (beyond any motion directed by their "mv"
|
||||
variants). <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All routines return the integer <STRONG>OK</STRONG>. The SVr4.0 manual says "or a non-
|
||||
negative integer if <STRONG>immedok</STRONG> is set", but this appears to be an error.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses does not specify any error conditions. This
|
||||
implementation returns an error if the window pointer is null.
|
||||
In <EM>ncurses</EM>,
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
<STRONG>o</STRONG> these functions fail if the screen is not initialized; and
|
||||
|
||||
<STRONG>o</STRONG> functions taking a <EM>WINDOW</EM> pointer argument fail if <EM>win</EM> is a null
|
||||
pointer.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
The borders generated by these functions are <EM>inside</EM> borders (this is
|
||||
also true of SVr4 curses, though the fact is not documented).
|
||||
Unusually, there is no <STRONG>wbox</STRONG> function; <STRONG>box</STRONG> behaves as one would expect
|
||||
<STRONG>wbox</STRONG> to, accepting a <EM>WINDOW</EM> pointer argument.
|
||||
|
||||
Note that <STRONG>border</STRONG> and <STRONG>box</STRONG> may be macros.
|
||||
<STRONG>border</STRONG>, <STRONG>box</STRONG>, <STRONG>hline</STRONG>, <STRONG>mvhline</STRONG>, <STRONG>mvwhline</STRONG>, <STRONG>vline</STRONG>, <STRONG>mvvline</STRONG>, and <STRONG>mvwvline</STRONG> may
|
||||
be implemented as macros.
|
||||
|
||||
Borders drawn by these functions are <EM>interior</EM> borders.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
These functions are described in X/Open Curses Issue 4. It specifies
|
||||
no error conditions for them.
|
||||
|
||||
SVr4 documentation says that these functions return <EM>OK</EM> "or a non-
|
||||
negative integer if <EM>immedok()</EM> is set", referring to the return value
|
||||
from <EM>wrefresh</EM>, which in SVr4 returns a count of characters written to
|
||||
the window if its <EM>immedok</EM> property is set; in <EM>ncurses</EM>, it does not.
|
||||
|
||||
BSD <EM>curses</EM> drew boxes with <EM>horch</EM> in <EM>every</EM> character cell of the top and
|
||||
bottom lines of the window, whereas SVr3.1 and later <EM>curses</EM>, because
|
||||
its <EM>box</EM> wrapped <EM>wborder</EM>, used the default corner characters.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>box</EM>, defining it as a function.
|
||||
|
||||
SVr3.1 (1987) added <EM>whline</EM> and <EM>wvline</EM> and their variants, as well as
|
||||
<EM>border</EM> and <EM>wborder</EM>, redefining <EM>box</EM> as a macro wrapping the latter.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -151,6 +164,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2011,2012 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_border_set.3x,v 1.36 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_border_set.3x,v 1.50 2025/10/21 00:10:56 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_border_set 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_border_set 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_border_set 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_border_set 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>border_set</STRONG>, <STRONG>wborder_set</STRONG>, <STRONG>box_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>whline_set</STRONG>, <STRONG>mvhline_set</STRONG>,
|
||||
<STRONG>mvwhline_set</STRONG>, <STRONG>vline_set</STRONG>, <STRONG>wvline_set</STRONG>, <STRONG>mvvline_set</STRONG>, <STRONG>mvwvline_set</STRONG> - draw
|
||||
@@ -55,53 +53,38 @@
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>border_set(</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ls</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>rs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ts</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tr</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>br</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wborder_set(</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ls</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>rs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ts</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tr</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>br</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>box_set(</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>verch</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>horch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>hline_set(</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>whline_set(</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvhline_set(</STRONG>
|
||||
<STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwhline_set(</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>vline_set(</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wvline_set(</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvvline_set(</STRONG>
|
||||
<STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwvline_set(</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>border_set(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ls</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>rs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ts</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tr</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>br</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wborder_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ls</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>rs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>ts</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bs</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>tr</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>bl</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>br</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>box_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>verch</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>horch</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>hline_set(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>whline_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvhline_set(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwhline_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>vline_set(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wvline_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvvline_set(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwvline_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <STRONG>border_set</STRONG> and <STRONG>wborder_set</STRONG> functions draw a border around the edges
|
||||
of the current or specified window. These functions do not change the
|
||||
of the current or specified window. These functions do not change the
|
||||
cursor position, and do not wrap.
|
||||
|
||||
Other than the window, each argument is a complex character with
|
||||
Other than the window, each argument is a complex character with
|
||||
attributes:
|
||||
<EM>ls</EM> - left side,
|
||||
<EM>rs</EM> - right side,
|
||||
@@ -112,7 +95,7 @@
|
||||
<EM>bl</EM> - bottom left-hand corner, and
|
||||
<EM>br</EM> - bottom right-hand corner.
|
||||
|
||||
If any of these arguments is zero, then the corresponding default
|
||||
If any of these arguments is zero, then the corresponding default
|
||||
values (defined in <STRONG>curses.h</STRONG>) are used instead:
|
||||
<STRONG>WACS_VLINE</STRONG>,
|
||||
<STRONG>WACS_VLINE</STRONG>,
|
||||
@@ -128,9 +111,9 @@
|
||||
<STRONG>wborder_set(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG>
|
||||
<EM>horch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <STRONG>NULL,</STRONG> <STRONG>NULL,</STRONG> <STRONG>NULL,</STRONG> <STRONG>NULL);</STRONG>
|
||||
|
||||
The <STRONG>*line_set</STRONG> functions use <EM>wch</EM> to draw a line starting at the current
|
||||
cursor position in the window. The line is at most <EM>n</EM> characters long
|
||||
or as many as fit into the window. The current cursor position is not
|
||||
The <STRONG>*line_set</STRONG> functions use <EM>wch</EM> to draw a line starting at the current
|
||||
cursor position in the window. The line is at most <EM>n</EM> characters long
|
||||
or as many as fit into the window. The current cursor position is not
|
||||
changed.
|
||||
|
||||
The <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvwhline_set</STRONG>, and <STRONG>whline_set</STRONG> functions draw
|
||||
@@ -144,27 +127,30 @@
|
||||
Upon successful completion, these functions return <STRONG>OK</STRONG>. Otherwise, they
|
||||
return <STRONG>ERR</STRONG>.
|
||||
|
||||
Functions using a window parameter return an error if it is null.
|
||||
Functions using a window parameter return <STRONG>ERR</STRONG> if it is null.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Note that <STRONG>border_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvvline_set</STRONG>,
|
||||
<STRONG>mvwhline_set</STRONG>, <STRONG>mvwvline_set</STRONG>, and <STRONG>vline_set</STRONG> may be macros.
|
||||
<STRONG>border_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvvline_set</STRONG>, <STRONG>mvwhline_set</STRONG>,
|
||||
<STRONG>mvwvline_set</STRONG>, and <STRONG>vline_set</STRONG> may be implemented as macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -174,6 +160,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="curs
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2010,2016 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_clear.3x,v 1.48 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_clear.3x,v 1.58 2025/01/19 00:49:39 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_clear 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_clear 3x 2025-01-18 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_clear 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_clear 3x 2025-01-18 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, <STRONG>wclrtobot</STRONG>, <STRONG>clrtoeol</STRONG>, <STRONG>wclrtoeol</STRONG>
|
||||
- clear all or part of a <EM>curses</EM> window
|
||||
@@ -78,8 +76,8 @@
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-clear_wclear">clear, wclear</a></H3><PRE>
|
||||
The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>, but they also
|
||||
call <STRONG><A HREF="curs_outopts.3x.html">clearok(3x)</A></STRONG>, so that the screen is cleared completely on the next
|
||||
The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>, but they also
|
||||
call <STRONG><A HREF="curs_outopts.3x.html">clearok(3x)</A></STRONG>, so that the screen is cleared completely on the next
|
||||
call to <STRONG>wrefresh</STRONG> for that window and repainted from scratch.
|
||||
|
||||
|
||||
@@ -98,34 +96,34 @@
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open defines no error conditions. In this implementation,
|
||||
In this implementation,
|
||||
|
||||
<STRONG>o</STRONG> functions using a window pointer parameter return an error if it is
|
||||
null
|
||||
<STRONG>o</STRONG> functions using a window pointer parameter return <STRONG>ERR</STRONG> if it is null
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>wclrtoeol</STRONG> returns an error if the cursor position is about to wrap.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Note that <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clrtoeol</STRONG> may be
|
||||
macros.
|
||||
<STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clrtoeol</STRONG> may be implemented
|
||||
as macros.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
The SVr4.0 manual says that these functions could return "or a non-
|
||||
negative integer if <STRONG>immedok</STRONG> is set", referring to the return-value of
|
||||
<STRONG>wrefresh</STRONG>. In that implementation, <STRONG>wrefresh</STRONG> would return a count of the
|
||||
number of characters written to the terminal.
|
||||
SVr4 documentation says that these functions return <EM>OK</EM> "or a non-
|
||||
negative integer if <EM>immedok()</EM> is set", referring to the return value
|
||||
from <EM>wrefresh</EM>, which in SVr4 returns a count of characters written to
|
||||
the window if its <EM>immedok</EM> property is set; in <EM>ncurses</EM>, it does not.
|
||||
|
||||
Some historic curses implementations had, as an undocumented feature,
|
||||
Some historic curses implementations had, as an undocumented feature,
|
||||
the ability to do the equivalent of <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying
|
||||
<STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(stdscr)</STRONG>. This will not work under <EM>ncurses</EM>.
|
||||
|
||||
This implementation, and others such as Solaris, sets the current
|
||||
position to 0,0 after erasing via <STRONG>werase</STRONG> and <STRONG>wclear</STRONG>. That fact is not
|
||||
documented in other implementations, and may not be true of
|
||||
This implementation, and others such as Solaris, sets the current
|
||||
position to 0,0 after erasing via <STRONG>werase</STRONG> and <STRONG>wclear</STRONG>. That fact is not
|
||||
documented in other implementations, and may not be true of
|
||||
implementations which were not derived from SVr4 source.
|
||||
|
||||
Not obvious from the description, most implementations clear the screen
|
||||
@@ -136,9 +134,7 @@
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-01-18 <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
|
||||
+204
-190
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,32 +27,30 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_color.3x,v 1.100 2024/04/20 21:24:19 tom Exp @
|
||||
* @Id: curs_color.3x,v 1.126 2025/08/23 22:39:20 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_color 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_color 3x 2025-08-23 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_color 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_color 3x 2025-08-23 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>start_color</STRONG>, <STRONG>has_colors</STRONG>, <STRONG>can_change_color</STRONG>, <STRONG>init_pair</STRONG>, <STRONG>init_color</STRONG>,
|
||||
<STRONG>init_extended_pair</STRONG>, <STRONG>init_extended_color</STRONG>, <STRONG>color_content</STRONG>, <STRONG>pair_content</STRONG>,
|
||||
<STRONG>extended_color_content</STRONG>, <STRONG>extended_pair_content</STRONG>, <STRONG>reset_color_pairs</STRONG>,
|
||||
<STRONG>COLOR_PAIR</STRONG>, <STRONG>PAIR_NUMBER</STRONG>, <STRONG>COLORS</STRONG>, <STRONG>COLOR_PAIRS</STRONG>, <STRONG>COLOR_BLACK</STRONG>, <STRONG>COLOR_RED</STRONG>,
|
||||
<STRONG>COLOR_GREEN</STRONG>, <STRONG>COLOR_YELLOW</STRONG>, <STRONG>COLOR_BLUE</STRONG>, <STRONG>COLOR_MAGENTA</STRONG>, <STRONG>COLOR_CYAN</STRONG>,
|
||||
<STRONG>COLOR_WHITE</STRONG> - manipulate terminal colors with <EM>curses</EM>
|
||||
<STRONG>COLOR_WHITE</STRONG>, <STRONG>A_COLOR</STRONG> - manipulate terminal colors with <EM>curses</EM>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
@@ -82,8 +80,18 @@
|
||||
<EM>/*</EM> <EM>extension</EM> <EM>*/</EM>
|
||||
<STRONG>void</STRONG> <STRONG>reset_color_pairs(void);</STRONG>
|
||||
|
||||
<EM>/*</EM> <EM>macros</EM> <EM>*/</EM>
|
||||
<STRONG>int</STRONG> <STRONG>COLOR_PAIR(int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>PAIR_NUMBER(int</STRONG> <EM>attr</EM><STRONG>);</STRONG>
|
||||
<STRONG>COLOR_BLACK</STRONG>
|
||||
<STRONG>COLOR_RED</STRONG>
|
||||
<STRONG>COLOR_GREEN</STRONG>
|
||||
<STRONG>COLOR_YELLOW</STRONG>
|
||||
<STRONG>COLOR_BLUE</STRONG>
|
||||
<STRONG>COLOR_MAGENTA</STRONG>
|
||||
<STRONG>COLOR_CYAN</STRONG>
|
||||
<STRONG>COLOR_WHITE</STRONG>
|
||||
<STRONG>A_COLOR</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
@@ -99,39 +107,37 @@
|
||||
|
||||
If a terminal has the relevant capability, <STRONG>init_color</STRONG> permits
|
||||
(re)definition of a color. <STRONG>has_colors</STRONG> and <STRONG>can_change_color</STRONG> return <STRONG>TRUE</STRONG>
|
||||
or <STRONG>FALSE</STRONG>, depending on whether the terminal has color capability and
|
||||
whether the programmer can change the colors. <STRONG>color_content</STRONG> permits
|
||||
extraction of the red, green, and blue components of an initialized
|
||||
color. <STRONG>pair_content</STRONG> permits discovery of a color pair's current
|
||||
or <STRONG>FALSE</STRONG>, depending on whether the terminal has color capability and
|
||||
whether the programmer can change the colors. <STRONG>color_content</STRONG> permits
|
||||
extraction of the red, green, and blue components of an initialized
|
||||
color. <STRONG>pair_content</STRONG> permits discovery of a color pair's current
|
||||
definition.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Rendering">Rendering</a></H3><PRE>
|
||||
<EM>curses</EM> combines the following data to render a character cell. Any of
|
||||
<EM>curses</EM> combines the following data to render a character cell. Any of
|
||||
them can include color information.
|
||||
|
||||
<STRONG>o</STRONG> <EM>curses</EM> character attributes, as from <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG> or <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG>
|
||||
|
||||
<STRONG>o</STRONG> window attributes, as from <STRONG><A HREF="curs_attr.3x.html">wattrset(3x)</A></STRONG> or <STRONG><A HREF="curs_attr.3x.html">wattr_set(3x)</A></STRONG>
|
||||
|
||||
<STRONG>o</STRONG> window background character attributes, as from <STRONG><A HREF="curs_bkgd.3x.html">wbkgdset(3x)</A></STRONG> or
|
||||
<STRONG>o</STRONG> window background character attributes, as from <STRONG><A HREF="curs_bkgd.3x.html">wbkgdset(3x)</A></STRONG> or
|
||||
<STRONG><A HREF="curs_bkgrnd.3x.html">wbkgrndset(3x)</A></STRONG>
|
||||
|
||||
Per-character and window attributes are usually set through a function
|
||||
parameter containing attributes including a color pair value. Some
|
||||
Per-character and window attributes are usually set through a function
|
||||
parameter containing attributes including a color pair value. Some
|
||||
functions, such as <STRONG>wattr_set</STRONG>, use a separate color pair number
|
||||
parameter.
|
||||
|
||||
The background character is a special case: it includes a character
|
||||
The background character is a special case: it includes a character
|
||||
code, just as if it were passed to <STRONG>waddch</STRONG>.
|
||||
|
||||
The <EM>curses</EM> library does the actual work of combining these color pairs
|
||||
The <EM>curses</EM> library does the actual work of combining these color pairs
|
||||
in an internal function called from <STRONG>waddch</STRONG>:
|
||||
|
||||
<STRONG>o</STRONG> If the parameter passed to <STRONG>waddch</STRONG> is <EM>blank</EM>, and it uses the special
|
||||
color pair 0,
|
||||
|
||||
<STRONG>o</STRONG> <EM>curses</EM> next checks the window attribute.
|
||||
color pair 0, <EM>curses</EM> next checks the window attribute.
|
||||
|
||||
<STRONG>o</STRONG> If the window attribute does not use color pair 0, <EM>curses</EM> uses
|
||||
the color pair from the window attribute.
|
||||
@@ -149,32 +155,27 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-CONSTANTS">CONSTANTS</a></H2><PRE>
|
||||
In <STRONG><curses.h></STRONG> the following macros are defined. These are the standard
|
||||
colors (ISO-6429). <EM>curses</EM> also assumes that <STRONG>COLOR_BLACK</STRONG> is the default
|
||||
background color for all terminals.
|
||||
ISO 6429 and ECMA-48 define eight standard colors (also known as "ANSI"
|
||||
colors). <EM>curses.h</EM> defines object-like macros <STRONG>COLOR_BLACK</STRONG>, <STRONG>COLOR_RED</STRONG>,
|
||||
<STRONG>COLOR_GREEN</STRONG>, <STRONG>COLOR_YELLOW</STRONG>, <STRONG>COLOR_BLUE</STRONG>, <STRONG>COLOR_MAGENTA</STRONG>, <STRONG>COLOR_CYAN</STRONG>, and
|
||||
<STRONG>COLOR_WHITE</STRONG> accordingly. <EM>curses</EM> assumes that <STRONG>COLOR_BLACK</STRONG> is the
|
||||
default background color for all terminals. <EM>ncurses</EM> offers an
|
||||
extension to override that assumption; see <STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG>.
|
||||
Some terminals support additional colors that lack standard names.
|
||||
|
||||
<STRONG>COLOR_BLACK</STRONG>
|
||||
<STRONG>COLOR_RED</STRONG>
|
||||
<STRONG>COLOR_GREEN</STRONG>
|
||||
<STRONG>COLOR_YELLOW</STRONG>
|
||||
<STRONG>COLOR_BLUE</STRONG>
|
||||
<STRONG>COLOR_MAGENTA</STRONG>
|
||||
<STRONG>COLOR_CYAN</STRONG>
|
||||
<STRONG>COLOR_WHITE</STRONG>
|
||||
|
||||
Some terminals support more than the eight (8) "ANSI" colors. There
|
||||
are no standard names for those additional colors.
|
||||
<STRONG>A_COLOR</STRONG> is a bit mask that, when bitwise "and"-ed with a <EM>chtype</EM>,
|
||||
extracts its color pair identifier.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-VARIABLES">VARIABLES</a></H2><PRE>
|
||||
|
||||
</PRE><H3><a name="h3-COLORS">COLORS</a></H3><PRE>
|
||||
is initialized by <STRONG>start_color</STRONG> to the maximum number of colors the
|
||||
is initialized by <STRONG>start_color</STRONG> to the maximum number of colors the
|
||||
terminal can support.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-COLOR_PAIRS">COLOR_PAIRS</a></H3><PRE>
|
||||
is initialized by <STRONG>start_color</STRONG> to the maximum number of color pairs the
|
||||
is initialized by <STRONG>start_color</STRONG> to the maximum number of color pairs the
|
||||
terminal can support. Often, its value is the product <STRONG>COLORS</STRONG> x <STRONG>COLORS</STRONG>,
|
||||
but this is not always true.
|
||||
|
||||
@@ -197,14 +198,14 @@
|
||||
(respectively defining the maximum number of colors and color pairs
|
||||
the terminal can support).
|
||||
|
||||
<STRONG>o</STRONG> It initializes the special color pair <STRONG>0</STRONG> to the default foreground
|
||||
<STRONG>o</STRONG> It initializes the special color pair <STRONG>0</STRONG> to the default foreground
|
||||
and background colors. No other color pairs are initialized.
|
||||
|
||||
<STRONG>o</STRONG> It restores the colors on the terminal to the values they had when
|
||||
<STRONG>o</STRONG> It restores the colors on the terminal to the values they had when
|
||||
the terminal was just turned on.
|
||||
|
||||
<STRONG>o</STRONG> If the terminal supports the <STRONG>initc</STRONG> (<STRONG>initialize_color</STRONG>) capability,
|
||||
<STRONG>start_color</STRONG> initializes its internal table representing the red,
|
||||
<STRONG>o</STRONG> If the terminal supports the <STRONG>initc</STRONG> (<STRONG>initialize_color</STRONG>) capability,
|
||||
<STRONG>start_color</STRONG> initializes its internal table representing the red,
|
||||
green, and blue components of the color palette.
|
||||
|
||||
The components depend on whether the terminal uses CGA (aka "ANSI")
|
||||
@@ -212,55 +213,65 @@
|
||||
set). The table is initialized first for eight basic colors
|
||||
(black, red, green, yellow, blue, magenta, cyan, and white), using
|
||||
weights that depend upon the CGA/HLS choice. For "ANSI" colors the
|
||||
weights are <STRONG>680</STRONG> or <STRONG>0</STRONG> depending on whether the corresponding red,
|
||||
green, or blue component is used or not. That permits using <STRONG>1000</STRONG>
|
||||
to represent bold/bright colors. After the initial eight colors
|
||||
(if the terminal supports more than eight colors) the components
|
||||
are initialized using the same pattern, but with weights of <STRONG>1000</STRONG>.
|
||||
weights are <STRONG>680</STRONG> or <STRONG>0</STRONG> depending on whether the corresponding red,
|
||||
green, or blue component is used or not. That permits using <STRONG>1000</STRONG>
|
||||
to represent bold/bright colors. After the initial eight colors
|
||||
(if the terminal supports more than eight colors) the components
|
||||
are initialized using the same pattern, but with weights of <STRONG>1000</STRONG>.
|
||||
SVr4 uses a similar scheme, but uses <STRONG>1000</STRONG> for the components of the
|
||||
initial eight colors.
|
||||
|
||||
<STRONG>start_color</STRONG> does not attempt to set the terminal's color palette to
|
||||
match its built-in table. An application may use <STRONG>init_color</STRONG> to
|
||||
match its built-in table. An application may use <STRONG>init_color</STRONG> to
|
||||
alter the internal table along with the terminal's color.
|
||||
|
||||
These limits apply to color values and color pairs. Values outside
|
||||
These limits apply to color values and color pairs. Values outside
|
||||
these limits are not valid, and may result in a runtime error:
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>COLORS</STRONG> corresponds to the terminal database's <STRONG>max_colors</STRONG>
|
||||
<STRONG>o</STRONG> <STRONG>COLORS</STRONG> corresponds to the terminal database's <STRONG>max_colors</STRONG>
|
||||
capability, (see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>).
|
||||
|
||||
<STRONG>o</STRONG> color values are expected to be in the range <STRONG>0</STRONG> to <STRONG>COLORS-1</STRONG>,
|
||||
<STRONG>o</STRONG> color values are expected to be in the range <STRONG>0</STRONG> to <STRONG>COLORS-1</STRONG>,
|
||||
inclusive (including <STRONG>0</STRONG> and <STRONG>COLORS-1</STRONG>).
|
||||
|
||||
<STRONG>o</STRONG> a special color value <STRONG>-1</STRONG> is used in certain extended functions to
|
||||
<STRONG>o</STRONG> a special color value <STRONG>-1</STRONG> is used in certain extended functions to
|
||||
denote the <EM>default</EM> <EM>color</EM> (see <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG>).
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>COLOR_PAIRS</STRONG> corresponds to the terminal database's <STRONG>max_pairs</STRONG>
|
||||
<STRONG>o</STRONG> <STRONG>COLOR_PAIRS</STRONG> corresponds to the terminal database's <STRONG>max_pairs</STRONG>
|
||||
capability, (see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>).
|
||||
|
||||
<STRONG>o</STRONG> valid color pair values are in the range <STRONG>1</STRONG> to <STRONG>COLOR_PAIRS-1</STRONG>,
|
||||
<STRONG>o</STRONG> valid color pair values are in the range <STRONG>1</STRONG> to <STRONG>COLOR_PAIRS-1</STRONG>,
|
||||
inclusive.
|
||||
|
||||
<STRONG>o</STRONG> color pair <STRONG>0</STRONG> is special; it denotes "no color".
|
||||
|
||||
Color pair <STRONG>0</STRONG> is assumed to be white on black, but is actually
|
||||
whatever the terminal implements before color is initialized. It
|
||||
Color pair <STRONG>0</STRONG> is assumed to be white on black, but is actually
|
||||
whatever the terminal implements before color is initialized. It
|
||||
cannot be modified by the application.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-has_colors">has_colors</a></H3><PRE>
|
||||
The <STRONG>has_colors</STRONG> routine requires no arguments. It returns <STRONG>TRUE</STRONG> if the
|
||||
terminal can manipulate colors; otherwise, it returns <STRONG>FALSE</STRONG>. This
|
||||
routine facilitates writing terminal-independent programs. For
|
||||
example, a programmer can use it to decide whether to use color or some
|
||||
other video attribute.
|
||||
<STRONG>has_colors</STRONG> returns <STRONG>TRUE</STRONG> if the terminal supports colors and <STRONG>FALSE</STRONG> if it
|
||||
does not. <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> or <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG> must be called first, but
|
||||
<STRONG>start_color</STRONG> need not be. An application might call <STRONG>has_colors</STRONG> to
|
||||
decide whether to use color or a video attribute like <STRONG>A_BOLD</STRONG> to render
|
||||
text.
|
||||
|
||||
Color support in <EM>curses</EM> requires that the terminal type description
|
||||
support the capabilities <STRONG>max_colors</STRONG> (<STRONG>colors</STRONG>), <STRONG>max_pairs</STRONG> (<STRONG>pairs</STRONG>), and
|
||||
any of
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>set_foreground</STRONG> (<STRONG>setf</STRONG>) and <STRONG>set_background</STRONG> (<STRONG>setb</STRONG>);
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>set_a_foreground</STRONG> (<STRONG>setaf</STRONG>) and <STRONG>set_a_background</STRONG> (<STRONG>setab</STRONG>); or
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>set_color_pair</STRONG> (<STRONG>scp</STRONG>).
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-can_change_color">can_change_color</a></H3><PRE>
|
||||
The <STRONG>can_change_color</STRONG> routine requires no arguments. It returns <STRONG>TRUE</STRONG> if
|
||||
the terminal supports colors and can change their definitions; other,
|
||||
it returns <STRONG>FALSE</STRONG>. This routine facilitates writing terminal-
|
||||
the terminal supports colors and can change their definitions; other,
|
||||
it returns <STRONG>FALSE</STRONG>. This routine facilitates writing terminal-
|
||||
independent programs.
|
||||
|
||||
|
||||
@@ -270,19 +281,19 @@
|
||||
foreground color number, and the background color number. For portable
|
||||
applications:
|
||||
|
||||
<STRONG>o</STRONG> The first argument must be a valid color pair value. If default
|
||||
colors are used (see <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG>) the upper limit is
|
||||
adjusted to allow for extra pairs which use a default color in
|
||||
<STRONG>o</STRONG> The first argument must be a valid color pair value. If default
|
||||
colors are used (see <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG>) the upper limit is
|
||||
adjusted to allow for extra pairs which use a default color in
|
||||
foreground and/or background.
|
||||
|
||||
<STRONG>o</STRONG> The second and third arguments must be valid color values.
|
||||
|
||||
If the color pair was previously initialized, the screen is refreshed
|
||||
and all occurrences of that color pair are changed to the new
|
||||
If the color pair was previously initialized, the screen is refreshed
|
||||
and all occurrences of that color pair are changed to the new
|
||||
definition.
|
||||
|
||||
As an extension, <EM>ncurses</EM> allows you to set color pair <STRONG>0</STRONG> via the
|
||||
<STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG> routine, or to specify the use of default
|
||||
As an extension, <EM>ncurses</EM> allows you to set color pair <STRONG>0</STRONG> via the
|
||||
<STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG> routine, or to specify the use of default
|
||||
colors (color number <STRONG>-1</STRONG>) if you first invoke the <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG>
|
||||
routine.
|
||||
|
||||
@@ -299,22 +310,22 @@
|
||||
four arguments: the number of the color to be changed followed by three
|
||||
RGB values (for the amounts of red, green, and blue components).
|
||||
|
||||
<STRONG>o</STRONG> The first argument must be a valid color value; default colors are
|
||||
not allowed here. (See the section <STRONG>Colors</STRONG> for the default color
|
||||
<STRONG>o</STRONG> The first argument must be a valid color value; default colors are
|
||||
not allowed here. (See the section <STRONG>Colors</STRONG> for the default color
|
||||
index.)
|
||||
|
||||
<STRONG>o</STRONG> Each of the last three arguments must be a value in the range <STRONG>0</STRONG>
|
||||
<STRONG>o</STRONG> Each of the last three arguments must be a value in the range <STRONG>0</STRONG>
|
||||
through <STRONG>1000</STRONG>.
|
||||
|
||||
When <STRONG>init_color</STRONG> is used, all occurrences of that color on the screen
|
||||
When <STRONG>init_color</STRONG> is used, all occurrences of that color on the screen
|
||||
immediately change to the new definition.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-init_extended_color">init_extended_color</a></H3><PRE>
|
||||
Because <STRONG>init_color</STRONG> uses signed <STRONG>short</STRONG>s for its parameters, that limits
|
||||
color-values and their red, green, and blue components to 32767 on
|
||||
modern hardware. The extension <STRONG>init_extended_color</STRONG> uses <STRONG>int</STRONG>s for the
|
||||
color value and for setting the red, green, and blue components,
|
||||
Because <STRONG>init_color</STRONG> uses signed <STRONG>short</STRONG>s for its parameters, that limits
|
||||
color-values and their red, green, and blue components to 32767 on
|
||||
modern hardware. The extension <STRONG>init_extended_color</STRONG> uses <STRONG>int</STRONG>s for the
|
||||
color value and for setting the red, green, and blue components,
|
||||
allowing a larger number of colors to be supported.
|
||||
|
||||
|
||||
@@ -337,13 +348,13 @@
|
||||
Because <STRONG>color_content</STRONG> uses signed <STRONG>short</STRONG>s for its parameters, that
|
||||
limits color-values and their red, green, and blue components to 32767
|
||||
on modern hardware. The extension <STRONG>extended_color_content</STRONG> uses <STRONG>int</STRONG>s for
|
||||
the color value and for returning the red, green, and blue components,
|
||||
the color value and for returning the red, green, and blue components,
|
||||
allowing a larger number of colors to be supported.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-pair_content">pair_content</a></H3><PRE>
|
||||
The <STRONG>pair_content</STRONG> routine allows programmers to find out what colors a
|
||||
given color pair consists of. It requires three arguments: the color
|
||||
The <STRONG>pair_content</STRONG> routine allows programmers to find out what colors a
|
||||
given color pair consists of. It requires three arguments: the color
|
||||
pair number, and two addresses of <STRONG>short</STRONG>s for storing the foreground and
|
||||
the background color numbers.
|
||||
|
||||
@@ -372,174 +383,177 @@
|
||||
|
||||
</PRE><H3><a name="h3-COLOR_PAIR">COLOR_PAIR</a></H3><PRE>
|
||||
<STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG> converts a color pair number to an attribute. Attributes
|
||||
can hold color pairs in the range 0 to 255. If you need a color pair
|
||||
larger than that, you must use functions such as <STRONG>attr_set</STRONG> (which pass
|
||||
the color pair as a separate parameter) rather than the legacy
|
||||
can hold color pairs in the range 0 to 255. If you need a color pair
|
||||
larger than that, you must use functions such as <STRONG>attr_set</STRONG> (which pass
|
||||
the color pair as a separate parameter) rather than the legacy
|
||||
functions such as <STRONG>attrset</STRONG>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-PAIR_NUMBER">PAIR_NUMBER</a></H3><PRE>
|
||||
<STRONG>PAIR_NUMBER(</STRONG><EM>attr</EM>) extracts the color information from its <EM>attr</EM>
|
||||
parameter and returns it as a color pair number; it is the inverse
|
||||
<STRONG>PAIR_NUMBER(</STRONG><EM>attr</EM>) extracts the color information from its <EM>attr</EM>
|
||||
parameter and returns it as a color pair number; it is the inverse
|
||||
operation of <STRONG>COLOR_PAIR</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
The routines <STRONG>can_change_color</STRONG> and <STRONG>has_colors</STRONG> return <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>.
|
||||
<STRONG>can_change_color</STRONG> and <STRONG>has_colors</STRONG> return <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>. The other
|
||||
functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
All other routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG> (SVr4
|
||||
specifies only "an integer value other than <STRONG>ERR</STRONG>") upon successful
|
||||
completion.
|
||||
In <EM>ncurses</EM>, functions returning an <EM>int</EM> recognize several error
|
||||
conditions.
|
||||
|
||||
X/Open defines no error conditions. SVr4 does document some error
|
||||
conditions which apply in general:
|
||||
<STRONG>o</STRONG> All return <STRONG>ERR</STRONG> if the screen has not been initialized; see
|
||||
<STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> or <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> This implementation will return <STRONG>ERR</STRONG> on attempts to use color values
|
||||
outside the range <STRONG>0</STRONG> to <STRONG>COLORS</STRONG>-1 (except for the default colors
|
||||
extension), or use color pairs outside the range <STRONG>0</STRONG> to
|
||||
<STRONG>COLOR_PAIRS-1</STRONG>.
|
||||
<STRONG>o</STRONG> All except <STRONG>start_color</STRONG> return <STRONG>ERR</STRONG> if <STRONG>start_color</STRONG> has not been
|
||||
called, or itself returned <STRONG>ERR</STRONG>.
|
||||
|
||||
Color values used in <STRONG>init_color</STRONG> must be in the range <STRONG>0</STRONG> to <STRONG>1000</STRONG>.
|
||||
<STRONG>o</STRONG> <STRONG>start_color</STRONG> returns <STRONG>ERR</STRONG> if it cannot allocate memory for its color
|
||||
pair table.
|
||||
|
||||
An error is returned from all functions if the terminal has not
|
||||
been initialized.
|
||||
<STRONG>o</STRONG> <STRONG>init_color</STRONG> returns <STRONG>ERR</STRONG> if the terminal type does not support
|
||||
assignable color values; that is, if the <STRONG>initialize_color</STRONG> (<STRONG>initc</STRONG>)
|
||||
capability is absent from its description.
|
||||
|
||||
An error is returned from secondary functions such as <STRONG>init_pair</STRONG> if
|
||||
<STRONG>start_color</STRONG> was not called.
|
||||
<STRONG>o</STRONG> <STRONG>init_color</STRONG> returns <STRONG>ERR</STRONG> if any of its <EM>r</EM>, <EM>g</EM>, <EM>b</EM> arguments is outside
|
||||
the range 0-1000 inclusive.
|
||||
|
||||
<STRONG>o</STRONG> SVr4 does much the same, except that it returns <STRONG>ERR</STRONG> from
|
||||
<STRONG>pair_content</STRONG> if the pair was not initialized using <STRONG>init_pairs</STRONG> and
|
||||
it returns <STRONG>ERR</STRONG> from <STRONG>color_content</STRONG> if the terminal does not support
|
||||
changing colors.
|
||||
<STRONG>o</STRONG> <STRONG>init_pair</STRONG>, <STRONG>init_color</STRONG>, <STRONG>init_extended_pair</STRONG>, <STRONG>init_extended_color</STRONG>,
|
||||
<STRONG>color_content</STRONG>, <STRONG>pair_content</STRONG>, <STRONG>extended_color_content</STRONG>, and
|
||||
<STRONG>extended_pair_content</STRONG> return <STRONG>ERR</STRONG> on attempts to use
|
||||
|
||||
This implementation does not return <STRONG>ERR</STRONG> for either case.
|
||||
<STRONG>o</STRONG> color identifiers outside the range 0-<STRONG>COLORS</STRONG>-1 inclusive, the
|
||||
default colors extension notwithstanding, or
|
||||
|
||||
Specific functions make additional checks:
|
||||
|
||||
<STRONG>init_color</STRONG>
|
||||
returns an error if the terminal does not support this feature,
|
||||
e.g., if the <STRONG>initialize_color</STRONG> capability is absent from the
|
||||
terminal description.
|
||||
|
||||
<STRONG>start_color</STRONG>
|
||||
returns an error if the color table cannot be allocated.
|
||||
<STRONG>o</STRONG> color pair identifiers outside the range 0-<STRONG>COLOR_PAIRS</STRONG>-1
|
||||
inclusive.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
In the <EM>ncurses</EM> implementation, there is a separate color activation
|
||||
flag, color palette, color pairs table, and associated <STRONG>COLORS</STRONG> and
|
||||
<STRONG>COLOR_PAIRS</STRONG> counts for each screen; the <STRONG>start_color</STRONG> function only
|
||||
affects the current screen. The SVr4/XSI interface is not really
|
||||
designed with this in mind, and historical implementations may use a
|
||||
single shared color palette.
|
||||
In <EM>ncurses</EM>, <STRONG>init_pair</STRONG> accepts negative foreground and background color
|
||||
arguments to support its <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG> extension, but only
|
||||
after the latter function has been called.
|
||||
|
||||
Setting an implicit background color via a color pair affects only
|
||||
character cells that a character write operation explicitly touches.
|
||||
To change the background color used when parts of a window are blanked
|
||||
The assumption that <STRONG>COLOR_BLACK</STRONG> is the terminal's default background
|
||||
color can be overridden using <EM>ncurses</EM>'s <STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG>
|
||||
extension.
|
||||
|
||||
In <EM>ncurses</EM>, each pointer passed to <STRONG>color_content</STRONG> and <STRONG>pair_content</STRONG> can
|
||||
be null, in which case the library ignores it, permitting the
|
||||
application to disregard unnecessary information.
|
||||
|
||||
In <EM>ncurses</EM>, each screen has a color activation flag, color palette,
|
||||
color pair table, and associated <STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG> values;
|
||||
<STRONG>start_color</STRONG> affects only the current screen. The SVr4 and X/Open
|
||||
Curses interface was not really designed with this in mind; historical
|
||||
implementations may use a single shared color palette.
|
||||
|
||||
Setting an implicit background color via a color pair affects only
|
||||
character cells that a character write operation explicitly touches.
|
||||
To change the background color used when parts of a window are blanked
|
||||
by erasing or scrolling operations, see <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>.
|
||||
|
||||
Several caveats apply on older x86 machines (e.g., i386, i486) with
|
||||
VGA-compatible graphics:
|
||||
Several caveats apply to IBM PC-compatible machines of the 80486 era
|
||||
and earlier with CGA/EGA/VGA video.
|
||||
|
||||
<STRONG>o</STRONG> COLOR_YELLOW is actually brown. To get yellow, use COLOR_YELLOW
|
||||
combined with the <STRONG>A_BOLD</STRONG> attribute.
|
||||
<STRONG>o</STRONG> <STRONG>COLOR_YELLOW</STRONG> was frequently converted, in the analog domain, to a
|
||||
shade of brown if the intensity bit was not set. To get yellow on
|
||||
such devices, one would combine <STRONG>COLOR_YELLOW</STRONG> with the <STRONG>A_BOLD</STRONG>
|
||||
attribute.
|
||||
|
||||
<STRONG>o</STRONG> The A_BLINK attribute should in theory cause the background to go
|
||||
bright. This often fails to work, and even some cards for which it
|
||||
mostly works (such as the Paradise and compatibles) do the wrong
|
||||
thing when you try to set a bright "yellow" background (you get a
|
||||
blinking yellow foreground instead).
|
||||
<STRONG>o</STRONG> The <STRONG>A_BLINK</STRONG> attribute should in theory make the background bright.
|
||||
This often fails to work, and even VGA controllers for which it
|
||||
mostly works, such as those from Paradise and compatibles, do the
|
||||
wrong thing when you try to set a bright "yellow" background -- you
|
||||
get a blinking yellow foreground instead.
|
||||
|
||||
<STRONG>o</STRONG> Color RGB values are not settable.
|
||||
<STRONG>o</STRONG> Color RGB values are not configurable on these devices (in text
|
||||
mode).
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
The functions marked as extensions were designed for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and
|
||||
are not found in SVr4 <EM>curses</EM>, 4.4BSD <EM>curses</EM>, or any other previous
|
||||
curses implementation.
|
||||
The functions marked as extensions originated in <EM>ncurses</EM>, and are not
|
||||
found in SVr4 <EM>curses</EM>, 4.4BSD <EM>curses</EM>, or any other previous <EM>curses</EM>
|
||||
implementation.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
This implementation satisfies X/Open Curses's minimum maximums for
|
||||
<STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG>.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
The <STRONG>init_pair</STRONG> routine accepts negative values of foreground and
|
||||
background color to support the <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG> extension, but
|
||||
only if that routine has been first invoked.
|
||||
|
||||
The assumption that <STRONG>COLOR_BLACK</STRONG> is the default background color for all
|
||||
terminals can be modified using the <STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG>
|
||||
extension.
|
||||
|
||||
This implementation checks the pointers, e.g., for the values returned
|
||||
by <STRONG>color_content</STRONG> and <STRONG>pair_content</STRONG>, and will treat those as optional
|
||||
parameters when null.
|
||||
<EM>ncurses</EM> satisfies X/Open Curses's minimum maximums for <EM>COLORS</EM> and
|
||||
<EM>COLOR</EM><STRONG>_</STRONG><EM>PAIRS</EM>.
|
||||
|
||||
X/Open Curses does not specify a limit for the number of colors and
|
||||
color pairs which a terminal can support. However, in its use of <STRONG>short</STRONG>
|
||||
for the parameters, it carries over SVr4's implementation detail for
|
||||
the compiled terminfo database, which uses signed 16-bit numbers. This
|
||||
implementation provides extended versions of those functions which use
|
||||
<STRONG>short</STRONG> parameters, allowing applications to use larger color- and pair-
|
||||
numbers.
|
||||
color pairs which a terminal can support. However, in its use of <EM>short</EM>
|
||||
for the parameters, it carries over SVr4's implementation detail for
|
||||
the compiled <EM>terminfo</EM> database, which uses signed 16-bit numbers.
|
||||
<EM>ncurses</EM> provides extended versions of the functions using <EM>short</EM>
|
||||
parameters, allowing applications to use larger color and pair
|
||||
identifiers.
|
||||
|
||||
The <STRONG>reset_color_pairs</STRONG> function is an extension of <EM>ncurses</EM>.
|
||||
SVr4 <EM>curses</EM> returns <EM>ERR</EM> from <EM>pair</EM><STRONG>_</STRONG><EM>content</EM> if its <EM>pair</EM> argument was not
|
||||
initialized using <EM>init</EM><STRONG>_</STRONG><EM>pairs</EM>, and from <EM>color</EM><STRONG>_</STRONG><EM>content</EM> if the terminal
|
||||
does not support changing colors. <EM>ncurses</EM> does neither.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
SVr3.2 introduced color support to curses in 1987.
|
||||
SVr3.2 (1987) introduced color support to <EM>curses</EM> with all of the
|
||||
symbols in the synopsis above except those marked as extensions. It
|
||||
reserved color pair 0 as the terminal's initial, "uncolored" state, and
|
||||
limited the number of possible color pairs to 64, because the color
|
||||
pair datum was encoded in six bits of a <EM>chtype</EM>.
|
||||
|
||||
SVr4 made internal changes, e.g., moving the storage for the color
|
||||
state from <STRONG>SP</STRONG> (the <EM>SCREEN</EM> structure) to <STRONG>cur_term</STRONG> (the <EM>TERMINAL</EM>
|
||||
structure), but provided the same set of library functions.
|
||||
SVr4 made only internal changes, such as moving the storage of color
|
||||
state from the <EM>SCREEN</EM> structure (pointed to by <EM>SP</EM>) to the <EM>TERMINAL</EM>
|
||||
structure (pointed to by <EM>cur</EM><STRONG>_</STRONG><EM>term</EM>).
|
||||
|
||||
SVr4 curses limits the number of color pairs to 64, reserving color
|
||||
pair zero (0) as the terminal's initial uncolored state. This limit
|
||||
arises because the color pair information is a bitfield in the <STRONG>chtype</STRONG>
|
||||
data type (denoted by <STRONG>A_COLOR</STRONG>).
|
||||
Other <EM>curses</EM> implementations impose different limits on the number of
|
||||
colors and color pairs.
|
||||
|
||||
Other implementations of curses had different limits:
|
||||
<STRONG>o</STRONG> <EM>PCCurses</EM> (1987-1990) provided for only 8 colors (and therefore
|
||||
required at most 8x8 = 64 color pairs).
|
||||
|
||||
<STRONG>o</STRONG> PCCurses (1987-1990) provided for only eight (8) colors.
|
||||
<STRONG>o</STRONG> <EM>PDCurses</EM> (1992-present) inherited the 8-color limitation from
|
||||
<EM>PCCurses</EM>, but changed this to 256 in version 2.5 (2001), and
|
||||
widened its <EM>chtype</EM> from 16 to 32 bits.
|
||||
|
||||
<STRONG>o</STRONG> PDCurses (1992-present) inherited the 8-color limitation from
|
||||
PCCurses, but changed this to 256 in version 2.5 (2001), along with
|
||||
changing <STRONG>chtype</STRONG> from 16-bits to 32-bits.
|
||||
<STRONG>o</STRONG> X/Open Curses (1992-present) specified a new structure type,
|
||||
<EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>, to store the character code, attribute flags, and color
|
||||
pair identifier, allowing an increased range of color pairs. It
|
||||
specifies a <EM>short</EM> as storing identifiers for colors and color
|
||||
pairs, limiting portable values to 15 bits; negative values are
|
||||
invalid in System V.
|
||||
|
||||
<STRONG>o</STRONG> X/Open Curses (1992-present) added a new structure <STRONG>cchar_t</STRONG> to store
|
||||
the character, attributes and color pair values, allowing increased
|
||||
range of color pairs. Both color pairs and color-values used a
|
||||
signed <STRONG>short</STRONG>, limiting values to 15 bits.
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> (1992-present), in its non-wide-character configuration,
|
||||
uses 8 bits of <EM>chtype</EM> for the color pair identifier.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> (1992-present) uses eight bits for <STRONG>A_COLOR</STRONG> in <STRONG>chtype</STRONG>
|
||||
values.
|
||||
Version 5.3 (2002) offered a wide-character interface, but encoded
|
||||
the color pair identifier with attributes in the character type.
|
||||
|
||||
Version 5.3 provided a wide-character interface (2002), but left
|
||||
color pairs as part of the attributes-field.
|
||||
Since version 6 (2015), <EM>ncurses</EM> uses a separate <EM>int</EM> for the color
|
||||
pair identifier in a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>, introducing extension functions to
|
||||
manage the wider type. When a color pair value fits in 8 bits,
|
||||
<EM>ncurses</EM> permits color pair data to be manipulated via the functions
|
||||
taking <EM>chtype</EM> arguments, even when a <EM>curses</EM> window uses wide-
|
||||
character cells.
|
||||
|
||||
Since version 6 (2015), ncurses uses a separate <STRONG>int</STRONG> for color pairs
|
||||
in the <STRONG>cchar_t</STRONG> values. When those color pair values fit in 8 bits,
|
||||
ncurses allows color pairs to be manipulated via the functions
|
||||
using <STRONG>chtype</STRONG> values.
|
||||
|
||||
<STRONG>o</STRONG> NetBSD curses used 6 bits from 2000 (when colors were first
|
||||
supported) until 2004. At that point, NetBSD changed to use 10
|
||||
bits. As of 2021, that size is unchanged. Like <EM>ncurses</EM> before
|
||||
version 6, the NetBSD color pair information is stored in the
|
||||
attributes field of <STRONG>cchar_t</STRONG>, limiting the number of color pairs by
|
||||
the size of the bitfield.
|
||||
<STRONG>o</STRONG> NetBSD <EM>curses</EM> used 6 bits for the color pair identifier from 2000
|
||||
(when it first added color support) until 2004. At that point,
|
||||
NetBSD widened the color pair identifier to use 9 bits. As of
|
||||
2025, that size is unchanged. Like <EM>ncurses</EM> before version 6, the
|
||||
NetBSD color pair datum is stored in the attributes field of
|
||||
<EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>, limiting the number of color pairs.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-08-23 <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2006,2010 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_delch.3x,v 1.34 2024/04/20 19:24:14 tom Exp @
|
||||
* @Id: curs_delch.3x,v 1.49 2025/04/05 21:59:53 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_delch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_delch 3x 2025-04-05 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_delch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_delch 3x 2025-04-05 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>delch</STRONG>, <STRONG>wdelch</STRONG>, <STRONG>mvdelch</STRONG>, <STRONG>mvwdelch</STRONG> - delete a character from a <EM>curses</EM>
|
||||
window
|
||||
@@ -55,51 +53,58 @@
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>delch(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wdelch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wdelch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvdelch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwdelch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwdelch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
<STRONG>wdelch</STRONG> deletes the character at the cursor position in <EM>win</EM>.
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this function.
|
||||
|
||||
<STRONG>wdelch</STRONG> moves all characters to the right of the cursor on the same line
|
||||
to the left one position and replaces the contents of the rightmost
|
||||
position on the line with the window's blank character; see <STRONG><A HREF="curs_bkgd.3x.html">bkgd(3x)</A></STRONG>
|
||||
(wide-character API users may consult <STRONG><A HREF="curs_bkgrnd.3x.html">bkgrnd(3x)</A></STRONG> instead). The cursor
|
||||
position does not change (after moving to (<EM>y</EM>, <EM>x</EM>), if specified).
|
||||
<STRONG>wdelch</STRONG> deletes the character at the cursor position in <EM>win</EM>. It moves
|
||||
all characters to the right of the cursor on the same line to the left
|
||||
one position and replaces the contents of the rightmost position on the
|
||||
line with the window's background character; see <STRONG><A HREF="curs_bkgd.3x.html">bkgd(3x)</A></STRONG> (wide-
|
||||
character API users: <STRONG><A HREF="curs_bkgrnd.3x.html">bkgrnd(3x)</A></STRONG>). The cursor position does not change
|
||||
(after moving to (<EM>y</EM>, <EM>x</EM>), if specified). <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the
|
||||
variants of this function.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
Functions taking a <EM>WINDOW</EM> pointer argument fail if the pointer is <STRONG>NULL</STRONG>.
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized, or
|
||||
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
<STRONG>delch</STRONG>, <STRONG>mvdelch</STRONG>, and <STRONG>mvwdelch</STRONG> may be implemented as macros.
|
||||
|
||||
A terminal's <STRONG>delete_character</STRONG> (<STRONG>dch1</STRONG>) capability is not necessarily
|
||||
A terminal's <STRONG>delete_character</STRONG> (<STRONG>dch1</STRONG>) capability is not necessarily
|
||||
employed.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses, Issue 4 describes these functions.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
SVr4 <EM>curses</EM> describes a successful return value only as "an integer
|
||||
value other than <STRONG>ERR</STRONG>".
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
SVr2 (1984) introduced <EM>wdelch</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-04-05 <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -109,6 +114,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF=
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2007,2010 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,27 +27,25 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_deleteln.3x,v 1.38 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_deleteln.3x,v 1.55 2025/07/05 12:46:36 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_deleteln 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_deleteln 3x 2025-07-05 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_deleteln 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_deleteln 3x 2025-07-05 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>deleteln</STRONG>, <STRONG>wdeleteln</STRONG>, <STRONG>insdelln</STRONG>, <STRONG>winsdelln</STRONG>, <STRONG>insertln</STRONG>, <STRONG>winsertln</STRONG> - delete
|
||||
<STRONG>deleteln</STRONG>, <STRONG>wdeleteln</STRONG>, <STRONG>insertln</STRONG>, <STRONG>winsertln</STRONG>, <STRONG>insdelln</STRONG>, <STRONG>winsdelln</STRONG> - delete
|
||||
or insert lines in a <EM>curses</EM> window
|
||||
|
||||
|
||||
@@ -55,61 +53,63 @@
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>deleteln(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wdeleteln(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>insdelln(int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winsdelln(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wdeleteln(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>insertln(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winsertln(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winsertln(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>insdelln(int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winsdelln(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <STRONG>deleteln</STRONG> and <STRONG>wdeleteln</STRONG> routines delete the line under the cursor in
|
||||
the window; all lines below the current line are moved up one line.
|
||||
The bottom line of the window is cleared. The cursor position does not
|
||||
change.
|
||||
<STRONG>wdeleteln</STRONG> deletes the line at the cursor in <EM>win</EM>; all lines below it
|
||||
move up one line. <EM>curses</EM> then fills the bottom line of <EM>win</EM> with the
|
||||
background character configured by <STRONG><A HREF="curs_bkgd.3x.html">wbkgdset(3x)</A></STRONG> (wide-character API
|
||||
users: <STRONG><A HREF="curs_bkgrnd.3x.html">wbkgrndset(3x)</A></STRONG>). The cursor position does not change.
|
||||
|
||||
The <STRONG>insdelln</STRONG> and <STRONG>winsdelln</STRONG> routines, for positive <EM>n</EM>, insert <EM>n</EM> lines
|
||||
into the specified window above the current line. The <EM>n</EM> bottom lines
|
||||
are lost. For negative <EM>n</EM>, delete <EM>n</EM> lines (starting with the one under
|
||||
the cursor), and move the remaining lines up. The bottom <EM>n</EM> lines are
|
||||
cleared. The current cursor position remains the same.
|
||||
<STRONG>winsertln</STRONG> inserts a new, empty line of characters above the line at the
|
||||
cursor in <EM>win</EM>, shifting the existing lines down by one. The content of
|
||||
the window's bottom line is lost; <EM>curses</EM> fills the new line with the
|
||||
background character. The cursor position does not change.
|
||||
|
||||
The <STRONG>insertln</STRONG> and <STRONG>winsertln</STRONG> routines insert a blank line above the
|
||||
current line and the bottom line is lost.
|
||||
<STRONG>winsdelln</STRONG> inserts or deletes <EM>n</EM> lines in <EM>win</EM> as <EM>n</EM> is positive or
|
||||
negative, respectively, as if by repeatedly calling <STRONG>winsertln</STRONG> or
|
||||
<STRONG>wdeleteln</STRONG>. <STRONG>winsdelln(</STRONG>...<STRONG>,</STRONG> <STRONG>0)</STRONG> performs no operation.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG> (SVr4
|
||||
specifies only "an integer value other than <STRONG>ERR</STRONG>") upon successful
|
||||
completion.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open defines no error conditions. In this implementation, if the
|
||||
window parameter is null, an error is returned.
|
||||
In <EM>ncurses</EM>, they fail if <EM>win</EM> is <EM>NULL</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Note that all but <STRONG>winsdelln</STRONG> may be macros.
|
||||
All of these functions except <STRONG>winsdelln</STRONG> may be implemented as macros.
|
||||
|
||||
These routines do not require a hardware line delete or insert feature
|
||||
in the terminal. In fact, they will not use hardware line
|
||||
delete/insert unless <STRONG>idlok(...,</STRONG> <STRONG>TRUE)</STRONG> has been set on the current
|
||||
window.
|
||||
These functions do not require the terminal to possess hardware line
|
||||
deletion or insertion capabilities. Even if available, by default
|
||||
<EM>curses</EM> does not use them; see <STRONG><A HREF="idlok.3x.html">idlok(3x)</A></STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4. The standard
|
||||
specifies that they return <STRONG>ERR</STRONG> on failure, but specifies no error
|
||||
conditions.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>deleteln</EM>, <EM>wdeleteln</EM>, <EM>insertln</EM>, and <EM>winsertln</EM>.
|
||||
|
||||
SVr3.1 (1987) added <EM>insdelln</EM> and <EM>winsdelln</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-07-05 <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -119,6 +119,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="cu
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1999-2010,2016 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,88 +28,94 @@
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* Author: Thomas E. Dickey 1999-on
|
||||
* @Id: curs_extend.3x,v 1.46 2024/03/16 15:35:01 tom Exp @
|
||||
* @Id: curs_extend.3x,v 1.67 2025/11/12 00:46:51 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_extend 3x 2024-03-16 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_extend 3x 2025-11-11 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_extend 3x 2024-03-16 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_extend 3x 2025-11-11 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>curses_version</STRONG>, <STRONG>use_extended_names</STRONG> - miscellaneous <EM>curses</EM> extensions
|
||||
<STRONG>curses_version</STRONG>, <STRONG>use_extended_names</STRONG> - miscellaneous <EM>ncurses</EM> extensions
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>curses_version(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>use_extended_names(bool</STRONG> <EM>enable</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>use_extended_names(bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These functions are extensions to the curses library which do not fit
|
||||
easily into other categories.
|
||||
These <EM>ncurses</EM> extensions to the <EM>curses</EM> library do not fit easily into
|
||||
other functional categories.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-curses_version">curses_version</a></H3><PRE>
|
||||
Use <STRONG>curses_version</STRONG> to get the version number, including patch level of
|
||||
the library, prefixed by "ncurses", e.g.,
|
||||
|
||||
<STRONG>ncurses</STRONG> <STRONG>5.0.19991023</STRONG>
|
||||
<STRONG>curses_version</STRONG> returns a pointer to a string containing the library's
|
||||
name and version number, including its patch level, for example
|
||||
"ncurses 6.5.20240720".
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-use_extended_names">use_extended_names</a></H3><PRE>
|
||||
The <STRONG>use_extended_names</STRONG> function controls whether the calling
|
||||
application is able to use user-defined or nonstandard names which may
|
||||
be compiled into the terminfo description, i.e., via the terminfo or
|
||||
termcap interfaces. Normally these names are available for use, since
|
||||
the essential decision is made by using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG> to compile
|
||||
extended terminal definitions. However you can disable this feature to
|
||||
ensure compatibility with other implementations of curses.
|
||||
<STRONG>use_extended_names</STRONG> configures whether the library recognizes user-
|
||||
defined or nonstandard <EM>terminfo</EM> capability names that may be compiled
|
||||
into terminal type descriptions via the <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> or
|
||||
<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG> interfaces. Normally these names are available for
|
||||
use, since the essential decision is made through use of <STRONG><A HREF="tic.1m.html">tic(1)</A></STRONG>'s <STRONG>-x</STRONG>
|
||||
option to include such extensions in terminal type descriptions.
|
||||
<STRONG>use_extended_names(FALSE)</STRONG> prevents <EM>ncurses</EM> from recognizing these
|
||||
capabilities to ensure compatibility with other implementations of
|
||||
<EM>curses</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
<STRONG>curses_version</STRONG> returns a pointer to static memory; you should not free
|
||||
this in your application.
|
||||
<STRONG>curses_version</STRONG> returns a constant string.
|
||||
|
||||
<STRONG>use_extended_names</STRONG> returns the previous state, allowing you to save
|
||||
this and restore it.
|
||||
<STRONG>use_extended_names</STRONG> returns the previous state of extended capability
|
||||
name recognition, allowing you to save this property and restore it.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
The pointer returned by <STRONG>curses_version</STRONG> corresponds to statically
|
||||
allocated memory; do not attempt to <STRONG>free(3)</STRONG> it.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
These functions are <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> extensions, and are not found in SVr4
|
||||
<EM>curses</EM>, 4.4BSD <EM>curses</EM>, or any other previous curses implementation.
|
||||
These functions are <EM>ncurses</EM> extensions, and are not found in SVr4
|
||||
<EM>curses</EM>, 4.4BSD <EM>curses</EM>, or any other previous <EM>curses</EM> implementation.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
NetBSD 9 added a <EM>curses</EM><STRONG>_</STRONG><EM>version</EM> function that intentionally returns a
|
||||
string devoid of version information.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
|
||||
Thomas Dickey.
|
||||
Thomas Dickey
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>, <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>, <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>, <STRONG><A HREF="keybound.3x.html">keybound(3x)</A></STRONG>, <STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>, <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>
|
||||
<EM>ncurses</EM> offers several other extensions to the X/Open Curses API.
|
||||
|
||||
<STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>, <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>, <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>, <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>, <STRONG><A HREF="keybound.3x.html">keybound(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>, <STRONG><A HREF="new_pair.3x.html">new_pair(3x)</A></STRONG>, <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>, <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>
|
||||
|
||||
|
||||
ncurses 6.5 2024-03-16 <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-11-11 <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -122,6 +128,7 @@ ncurses 6.5 2024-03-16 <STRONG><A HREF="
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-AUTHORS">AUTHORS</a></li>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,37 +27,35 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_get_wch.3x,v 1.40 2024/04/20 19:23:03 tom Exp @
|
||||
* @Id: curs_get_wch.3x,v 1.71 2025/08/16 19:11:47 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_get_wch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_get_wch 3x 2025-08-16 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_get_wch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_get_wch 3x 2025-08-16 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>get_wch</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>mvget_wch</STRONG>, <STRONG>mvwget_wch</STRONG>, <STRONG>unget_wch</STRONG> - get (or push
|
||||
back) a wide character from <EM>curses</EM> terminal keyboard
|
||||
back) a wide character from <EM>curses</EM> terminal keyboard buffer
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>get_wch(wint_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wget_wch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvget_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwget_wch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>get_wch(wint_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wget_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvget_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwget_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>unget_wch(const</STRONG> <STRONG>wchar_t</STRONG> <EM>wc</EM><STRONG>);</STRONG>
|
||||
|
||||
@@ -65,65 +63,80 @@
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
|
||||
</PRE><H3><a name="h3-Reading-Characters">Reading Characters</a></H3><PRE>
|
||||
<STRONG>wget_wch</STRONG> gathers a key stroke <EM>wch</EM> from the terminal keyboard associated
|
||||
with a <EM>curses</EM> window <EM>win</EM>, returning <STRONG>OK</STRONG> if a wide character is read,
|
||||
<STRONG>KEY_CODE_YES</STRONG> if a function key is read, and <STRONG>ERR</STRONG> if no key event is
|
||||
<STRONG>wget_wch</STRONG> gathers a key event from the terminal keyboard associated with
|
||||
a <EM>curses</EM> window <EM>win</EM>, returning <STRONG>OK</STRONG> if a wide character is read,
|
||||
<STRONG>KEY_CODE_YES</STRONG> if a function key is read, and <STRONG>ERR</STRONG> if no key event is
|
||||
available. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this function.
|
||||
|
||||
When input is pending, <STRONG>wget_wch</STRONG> stores an integer identifying the key
|
||||
stroke in <EM>wch</EM>; for alphanumeric and punctuation keys, this value
|
||||
When input is pending, <STRONG>wget_wch</STRONG> stores an integer identifying the key
|
||||
event in <EM>wch</EM>; for alphanumeric and punctuation keys, this value
|
||||
corresponds to the character encoding used by the terminal. Use of the
|
||||
control key as a modifier often results in a distinct code. The
|
||||
behavior of other keys depends on whether <EM>win</EM> is in keypad mode; see
|
||||
subsections "Keypad Mode" and "Predefined Key Codes" in <STRONG><A HREF="curs_getch.3x.html">getch(3x)</A></STRONG>.
|
||||
control key as a modifier, by holding it down while pressing and
|
||||
releasing another key, often results in a distinct code. The behavior
|
||||
of other keys depends on whether <EM>win</EM> is in keypad mode; see subsections
|
||||
"Keypad Mode" and "Key Codes" in <STRONG><A HREF="curs_getch.3x.html">getch(3x)</A></STRONG>.
|
||||
|
||||
If no input is pending, then if the no-delay flag is set in the window
|
||||
(see <STRONG><A HREF="nodelay.3x.html">nodelay(3x)</A></STRONG>), the function returns <STRONG>ERR</STRONG>; otherwise, <EM>curses</EM> waits
|
||||
until the terminal has input. If <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG> has been called, this
|
||||
happens after one character is read. If <STRONG><A HREF="curs_inopts.3x.html">nocbreak(3x)</A></STRONG> has been called,
|
||||
it occurs when the next newline is read. If <STRONG><A HREF="curs_inopts.3x.html">halfdelay(3x)</A></STRONG> has been
|
||||
called, <EM>curses</EM> waits until a character is typed or the specified delay
|
||||
elapses.
|
||||
until the terminal has input. If <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG> or <STRONG><A HREF="curs_inopts.3x.html">raw(3x)</A></STRONG> has been
|
||||
called, this happens after one character is read. If <STRONG><A HREF="curs_inopts.3x.html">nocbreak(3x)</A></STRONG> or
|
||||
<STRONG><A HREF="curs_inopts.3x.html">noraw(3x)</A></STRONG> has been called, it occurs when the next newline is read.
|
||||
(Because the terminal's canonical or "cooked" mode is line-buffered,
|
||||
multiple <STRONG>wget_wch</STRONG> calls may then be necessary to empty the input
|
||||
queue.) If <STRONG><A HREF="curs_inopts.3x.html">halfdelay(3x)</A></STRONG> has been called, <EM>curses</EM> waits until input is
|
||||
available or the specified delay elapses.
|
||||
|
||||
If <STRONG><A HREF="curs_inopts.3x.html">echo(3x)</A></STRONG> has been called, and the window is not a pad, <EM>curses</EM> writes
|
||||
<EM>wch</EM> to the window (at the cursor position) per the following rules.
|
||||
the wide character from the input queue to the window (at the cursor
|
||||
position) per the following rules.
|
||||
|
||||
<STRONG>o</STRONG> If <EM>wch</EM> matches the terminal's erase character, the cursor moves
|
||||
leftward one position and the new position is erased as if
|
||||
<STRONG><A HREF="curs_move.3x.html">wmove(3x)</A></STRONG> and then <STRONG><A HREF="curs_delch.3x.html">wdelch(3x)</A></STRONG> were called. When the window's
|
||||
keypad mode is enabled (see below), <STRONG>KEY_LEFT</STRONG> and <STRONG>KEY_BACKSPACE</STRONG> are
|
||||
handled the same way.
|
||||
<STRONG>o</STRONG> If the wide character matches the terminal's erase character (see
|
||||
<STRONG><A HREF="curs_termattrs.3x.html">erasewchar(3x)</A></STRONG>), the cursor moves leftward one position and the new
|
||||
position is erased as if <STRONG><A HREF="curs_move.3x.html">wmove(3x)</A></STRONG> and then <STRONG><A HREF="curs_delch.3x.html">wdelch(3x)</A></STRONG> were called.
|
||||
When the window's keypad mode is enabled (see below), <STRONG>KEY_LEFT</STRONG> and
|
||||
<STRONG>KEY_BACKSPACE</STRONG> are handled the same way.
|
||||
|
||||
<STRONG>o</STRONG> <EM>curses</EM> writes any other <EM>wch</EM> to the window, as with <STRONG><A HREF="curs_add_wch.3x.html">wecho_wchar(3x)</A></STRONG>.
|
||||
<STRONG>o</STRONG> <EM>curses</EM> writes any other wide character to the window, as with
|
||||
<STRONG><A HREF="curs_add_wch.3x.html">wecho_wchar(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> If the window has been moved or modified since the last call to
|
||||
<STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG>, <EM>curses</EM> calls <STRONG>wrefresh</STRONG>.
|
||||
<STRONG>o</STRONG> If the window <EM>win</EM> has been moved or modified since the last call to
|
||||
<STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG>, <EM>curses</EM> calls <STRONG>wrefresh</STRONG> on it.
|
||||
|
||||
If <EM>wch</EM> is a carriage return and <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG> has been called, <STRONG>wgetch</STRONG> stores
|
||||
the the character code for newline (line feed) in <EM>wch</EM> instead.
|
||||
If the wide character is a carriage return and <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG> has been called,
|
||||
<STRONG>wget_wch</STRONG> stores the wide character code for line feed in <EM>wch</EM> instead.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Ungetting-Characters">Ungetting Characters</a></H3><PRE>
|
||||
<STRONG>unget_wch</STRONG> places <EM>wch</EM> into the input queue to be returned by the next
|
||||
call to <STRONG>wget_wch</STRONG>. A single input queue serves all windows.
|
||||
<STRONG>unget_wch</STRONG> places <EM>wc</EM> into the input queue to be retrieved by the next
|
||||
call to <STRONG>wget_wch</STRONG>. A single input queue serves all windows associated
|
||||
with the screen.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
<STRONG>wget_wch</STRONG> returns <STRONG>OK</STRONG> when it reads a wide character and <STRONG>KEY_CODE_YES</STRONG>
|
||||
when it reads a function key code. It returns <STRONG>ERR</STRONG> if
|
||||
<STRONG>wget_wch</STRONG> returns <STRONG>OK</STRONG> when it reads a wide character, <STRONG>KEY_CODE_YES</STRONG> when
|
||||
it reads a function key code, and <STRONG>ERR</STRONG> on failure. <STRONG>wget_wch</STRONG> fails if
|
||||
its timeout expires without any data arriving, which cannot happen if
|
||||
<STRONG><A HREF="nodelay.3x.html">nodelay(3x)</A></STRONG> is in effect on the window.
|
||||
|
||||
<STRONG>o</STRONG> the <EM>WINDOW</EM> pointer is <STRONG>NULL</STRONG>, or
|
||||
In <EM>ncurses</EM>, <STRONG>wget_wch</STRONG> also fails if
|
||||
|
||||
<STRONG>o</STRONG> its timeout expires without any data arriving, or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> execution was interrupted by a signal, in which case <STRONG>errno</STRONG> is set
|
||||
to <STRONG>EINTR</STRONG>.
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer, or
|
||||
|
||||
<STRONG>o</STRONG> execution was interrupted by a signal, in which case <EM>errno</EM> is set
|
||||
to <EM>EINTR</EM>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
<STRONG>unget_wch</STRONG> returns <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> if there is no more room in the
|
||||
input queue.
|
||||
<STRONG>unget_wch</STRONG> returns <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure. In <EM>ncurses</EM>,
|
||||
<STRONG>unget_wch</STRONG> fails if
|
||||
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized, or
|
||||
|
||||
<STRONG>o</STRONG> there is no more room in the input queue.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
@@ -132,15 +145,13 @@
|
||||
All of these functions except <STRONG>wget_wch</STRONG> and <STRONG>unget_wch</STRONG> may be implemented
|
||||
as macros.
|
||||
|
||||
Unlike <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG>, <STRONG>wget_wch</STRONG> and its variants store the value of the
|
||||
input character in an additional <EM>wch</EM> parameter instead of the return
|
||||
value.
|
||||
Unlike <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG>, <STRONG>wget_wch</STRONG> stores the value of the input character in
|
||||
an additional <EM>wch</EM> parameter instead of the return value.
|
||||
|
||||
Unlike <STRONG>ungetch</STRONG>, <STRONG>unget_wch</STRONG> cannot distinguish function key codes
|
||||
<STRONG>wget_wch</STRONG> from conventional character codes. An application can
|
||||
overcome this limitation by pushing function key codes with <STRONG>ungetch</STRONG> and
|
||||
subsequently checking the return value of <STRONG>wget_wch</STRONG> for a match with
|
||||
<STRONG>KEY_CODE_YES</STRONG>.
|
||||
Unlike <STRONG>ungetch</STRONG>, <STRONG>unget_wch</STRONG> cannot distinguish function key codes from
|
||||
conventional character codes. An application can overcome this
|
||||
limitation by pushing function key codes with <STRONG>ungetch</STRONG> and subsequently
|
||||
checking the return value of <STRONG>wget_wch</STRONG> for a match with <STRONG>KEY_CODE_YES</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
@@ -151,23 +162,32 @@
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
X/Open Curses, Issue 4 describes these functions. It specifies no
|
||||
error conditions for them.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
See the "PORTABILITY" section of <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> regarding the interaction
|
||||
of <STRONG>wget_wch</STRONG> with signal handlers.
|
||||
See the "PORTABILITY" section of <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> regarding the interaction
|
||||
of <EM>wget</EM><STRONG>_</STRONG><EM>wch</EM> with signal handlers.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition Version 4 of the same year specified
|
||||
functions named <EM>wgetwch</EM> (with its variants) <EM>ungetwch</EM>. These were later
|
||||
additions to SVr4.<EM>x</EM>, not appearing in the first SVr4 (1989). They
|
||||
differ from X/Open's later <EM>wget</EM><STRONG>_</STRONG><EM>wch</EM> and <EM>unget</EM><STRONG>_</STRONG><EM>wch</EM> in that <EM>wgetwch</EM> takes
|
||||
no <EM>wch</EM> argument, but returns the (wide) key code as an <EM>int</EM> (with no
|
||||
provision for distinguishing a character code from a function key
|
||||
code); and <EM>ungetwch</EM> takes a non-<EM>const</EM> <EM>int</EM> argument.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library in
|
||||
its non-wide-character configuration.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>, <STRONG><A HREF="curs_move.3x.html">curs_move(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>, <STRONG><A HREF="curs_move.3x.html">curs_move(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-08-16 <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -183,6 +203,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="c
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,158 +27,203 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_get_wstr.3x,v 1.48 2024/04/20 19:18:18 tom Exp @
|
||||
* @Id: curs_get_wstr.3x,v 1.79 2025/10/21 00:08:50 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_get_wstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_get_wstr 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_get_wstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_get_wstr 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_get_wstr.3x.html">curs_get_wstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_get_wstr.3x.html">curs_get_wstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>get_wstr</STRONG>, <STRONG>getn_wstr</STRONG>, <STRONG>wget_wstr</STRONG>, <STRONG>wgetn_wstr</STRONG>, <STRONG>mvget_wstr</STRONG>, <STRONG>mvgetn_wstr</STRONG>,
|
||||
<STRONG>mvwget_wstr</STRONG>, <STRONG>mvwgetn_wstr</STRONG> - get a wide-character string from a <EM>curses</EM>
|
||||
<STRONG>mvwget_wstr</STRONG>, <STRONG>mvwgetn_wstr</STRONG> - read a wide-character string from a <EM>curses</EM>
|
||||
terminal keyboard
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>get_wstr(wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>getn_wstr(wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wget_wstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetn_wstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>get_wstr(wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wget_wstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvget_wstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwget_wstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>mvget_wstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvgetn_wstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwget_wstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetn_wstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG><EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>getn_wstr(wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetn_wstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvgetn_wstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetn_wstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>wint_t</STRONG> <STRONG>*</STRONG> <EM>wstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The function <STRONG>wgetn_wstr</STRONG> is equivalent to a series of calls to
|
||||
<STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG> until a newline or carriage return terminates the series:
|
||||
<STRONG>wget_wstr</STRONG> populates a user-supplied wide-character string buffer <EM>wstr</EM>
|
||||
by repeatedly calling <STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG> with the <EM>win</EM> argument until a line
|
||||
feed or carriage return character is input. The function
|
||||
|
||||
<STRONG>o</STRONG> The terminating character is not included in the returned string.
|
||||
<STRONG>o</STRONG> does not copy the terminating character to <EM>wstr</EM>;
|
||||
|
||||
<STRONG>o</STRONG> An end-of-file condition is represented by <STRONG>WEOF</STRONG>, as defined in
|
||||
<STRONG><wchar.h></STRONG>.
|
||||
<STRONG>o</STRONG> populates <EM>wstr</EM> with <EM>WEOF</EM> (as defined in <EM>wchar.h</EM>) if an end-of-file
|
||||
condition occurs on the input;
|
||||
|
||||
<STRONG>o</STRONG> In all instances, the end of the string is terminated by a null
|
||||
<STRONG>wchar_t</STRONG>.
|
||||
<STRONG>o</STRONG> always terminates the string with a null wide character (after any
|
||||
<EM>WEOF</EM>);
|
||||
|
||||
<STRONG>o</STRONG> The function stores the result in the area pointed to by the <EM>wstr</EM>
|
||||
parameter.
|
||||
<STRONG>o</STRONG> interprets the screen's wide erase and wide kill characters (see
|
||||
<STRONG><A HREF="curs_termattrs.3x.html">erasewchar(3x)</A></STRONG> and <STRONG><A HREF="curs_termattrs.3x.html">killwchar(3x)</A></STRONG>);
|
||||
|
||||
<STRONG>o</STRONG> The function reads at most <EM>n</EM> characters, thus preventing a possible
|
||||
overflow of the input buffer.
|
||||
<STRONG>o</STRONG> recognizes function keys only if the screen's keypad option is
|
||||
enabled (see <STRONG><A HREF="curs_inopts.3x.html">keypad(3x)</A></STRONG>);
|
||||
|
||||
Any attempt to enter more characters (other than the terminating
|
||||
newline or carriage return) causes a beep.
|
||||
<STRONG>o</STRONG> treats the function keys <STRONG>KEY_LEFT</STRONG> and <STRONG>KEY_BACKSPACE</STRONG> the same as the
|
||||
wide erase character; and
|
||||
|
||||
Function keys also cause a beep and are ignored.
|
||||
<STRONG>o</STRONG> discards function key inputs other than those treated as the wide
|
||||
erase or wide kill characters, calling <STRONG><A HREF="curs_beep.3x.html">beep(3x)</A></STRONG>.
|
||||
|
||||
The user's <EM>erase</EM> and <EM>kill</EM> characters are interpreted:
|
||||
The wide erase character replaces the character at the end of the
|
||||
buffer with a null wide character, while the wide kill character does
|
||||
the same for the entire buffer.
|
||||
|
||||
<STRONG>o</STRONG> The <EM>erase</EM> character (e.g., <STRONG>^H</STRONG>) erases the character at the end of
|
||||
the buffer, moving the cursor to the left.
|
||||
If the screen's echo option is enabled (see <STRONG><A HREF="curs_inopts.3x.html">echo(3x)</A></STRONG>), <STRONG>wget_wstr</STRONG>
|
||||
updates <EM>win</EM> with <STRONG><A HREF="curs_add_wch.3x.html">wadd_wch(3x)</A></STRONG>. Further,
|
||||
|
||||
If <EM>keypad</EM> mode is on for the window, <STRONG>KEY_LEFT</STRONG> and <STRONG>KEY_BACKSPACE</STRONG> are
|
||||
both considered equivalent to the user's <EM>erase</EM> character.
|
||||
<STRONG>o</STRONG> the wide erase character and its function key synonyms move the
|
||||
cursor to the left, and
|
||||
|
||||
<STRONG>o</STRONG> The <EM>kill</EM> character (e.g., <STRONG>^U</STRONG>) erases the entire buffer, leaving the
|
||||
cursor at the beginning of the buffer.
|
||||
<STRONG>o</STRONG> the wide kill character returns the cursor to where it was located
|
||||
when <STRONG>wget_wstr</STRONG> was called.
|
||||
|
||||
Characters input are echoed only if <STRONG>echo</STRONG> is currently on. In that
|
||||
case, backspace is echoed as deletion of the previous character
|
||||
(typically a left motion).
|
||||
<STRONG>wgetn_wstr</STRONG> is similar, but reads at most <EM>n</EM> wide characters, aiding the
|
||||
application to avoid overrunning the buffer to which <EM>wstr</EM> points.
|
||||
<EM>curses</EM> ignores an attempt to input more than <EM>n</EM> wide characters (other
|
||||
than the terminating line feed or carriage return), calling <STRONG><A HREF="curs_beep.3x.html">beep(3x)</A></STRONG>.
|
||||
If <EM>n</EM> is negative, <STRONG>wgetn_wstr</STRONG> reads up to <EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM> wide characters (see
|
||||
<STRONG>sysconf(3)</STRONG>).
|
||||
|
||||
The <STRONG>getn_wstr</STRONG>, <STRONG>mvgetn_wstr</STRONG>, <STRONG>mvwgetn_wstr</STRONG>, and <STRONG>wgetn_wstr</STRONG> functions are
|
||||
identical to the <STRONG>get_wstr</STRONG>, <STRONG>mvget_wstr</STRONG>, <STRONG>mvwget_wstr</STRONG>, and <STRONG>wget_wstr</STRONG>
|
||||
functions, respectively, except that the <STRONG>*n_*</STRONG> versions read at most <EM>n</EM>
|
||||
characters, letting the application prevent overflow of the input
|
||||
buffer.
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All of these functions return the integer <STRONG>OK</STRONG> upon successful
|
||||
completion. If unsuccessful, they return <STRONG>ERR</STRONG>.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open defines no error conditions.
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
In this implementation, these functions return an error
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the window pointer is null,
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer,
|
||||
|
||||
<STRONG>o</STRONG> if its timeout expires without having any data, or
|
||||
<STRONG>o</STRONG> <EM>wstr</EM> is a null pointer, or
|
||||
|
||||
<STRONG>o</STRONG> if the associated call to <STRONG>wget_wch</STRONG> failed.
|
||||
<STRONG>o</STRONG> an internal <STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG> call fails.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Any of these functions other than <STRONG>wgetn_wstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>wgetn_wstr</STRONG> may be implemented as macros.
|
||||
|
||||
Using <STRONG>get_wstr</STRONG>, <STRONG>mvget_wstr</STRONG>, <STRONG>mvwget_wstr</STRONG>, or <STRONG>wget_wstr</STRONG> to read a line
|
||||
that overflows the array pointed to by <STRONG>wstr</STRONG> causes undefined results.
|
||||
The use of <STRONG>getn_wstr</STRONG>, <STRONG>mvgetn_wstr</STRONG>, <STRONG>mvwgetn_wstr</STRONG>, or <STRONG>wgetn_wstr</STRONG>,
|
||||
respectively, is recommended.
|
||||
Reading input that overruns the buffer pointed to by <EM>wstr</EM> causes
|
||||
undefined results. Use the <STRONG>n</STRONG>-infixed functions, and allocate
|
||||
sufficient storage for <EM>wstr</EM> -- at least <EM>n</EM>+1 times <STRONG>sizeof(wchar_t)</STRONG>.
|
||||
|
||||
These functions cannot return <STRONG>KEY_</STRONG> values because there is no way to
|
||||
distinguish a <STRONG>KEY_</STRONG> value from a valid <STRONG>wchar_t</STRONG> value.
|
||||
These functions cannot store a <STRONG>KEY_</STRONG> value in <EM>wstr</EM> because there is no
|
||||
way to distinguish it from a valid <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> value.
|
||||
|
||||
While these functions conceptually implement a series of calls to
|
||||
<STRONG>wget_wch</STRONG>, they also temporarily change properties of the <EM>curses</EM> screen
|
||||
to permit simple editing of the input buffer. Each function saves the
|
||||
screen's state, calls <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG>, and, if the screen was in canonical
|
||||
("cooked") mode, <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG>. Before returning, it restores the saved
|
||||
screen state. Other implementations differ in detail, affecting which
|
||||
control characters they can accept in the buffer; see section
|
||||
"PORTABILITY" below.
|
||||
|
||||
Unlike <STRONG><A HREF="curs_getstr.3x.html">getstr(3x)</A></STRONG> and related functions of <EM>ncurses</EM>'s non-wide API,
|
||||
these functions do not return <STRONG>KEY_RESIZE</STRONG> if a <EM>SIGWINCH</EM> event interrupts
|
||||
the function.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
<STRONG>getn_wstr</STRONG>, <STRONG>wgetn_wstr</STRONG>, <STRONG>mvgetn_wstr</STRONG>, and <STRONG>mvwgetn_wstr</STRONG>'s handing of
|
||||
negative <EM>n</EM> values is an <EM>ncurses</EM> extension.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in The Single Unix Specification, Version
|
||||
2. No error conditions are defined.
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
This implementation returns <STRONG>ERR</STRONG> if the window pointer is null, or if
|
||||
the lower-level <STRONG>wget_wch</STRONG> call returns an <STRONG>ERR</STRONG>. In the latter case, an
|
||||
<STRONG>ERR</STRONG> return without other data is treated as an end-of-file condition,
|
||||
and the returned array contains a <STRONG>WEOF</STRONG> followed by a null <STRONG>wchar_t</STRONG>.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
X/Open curses documented these functions to pass an array of <STRONG>wchar_t</STRONG> in
|
||||
1997, but that was an error because of this part of the description:
|
||||
Issue 4 documented these functions as passing an array of <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM>, but
|
||||
that was an error, conflicting with the following language in the
|
||||
standard.
|
||||
|
||||
The effect of <STRONG>get_wstr</STRONG> is as though a series of calls to <STRONG>get_wch</STRONG>
|
||||
were made, until a newline character, end-of-line character, or
|
||||
end-of-file character is processed.
|
||||
The effect of <EM>get</EM><STRONG>_</STRONG><EM>wstr</EM>() is as though a series of calls to
|
||||
<EM>get</EM><STRONG>_</STRONG><EM>wch</EM>() were made, until a newline character, end-of-line
|
||||
character, or end-of-file character is processed.
|
||||
|
||||
The latter function <EM>get</EM><STRONG>_</STRONG><EM>wch</EM> can return a negative value, while <STRONG>wchar_t</STRONG>
|
||||
is a unsigned type. All of the vendors implement this using <STRONG>wint_t</STRONG>,
|
||||
following the standard.
|
||||
<EM>get</EM><STRONG>_</STRONG><EM>wch</EM> can return a negative value (<EM>WEOF</EM>), but <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> is a unsigned
|
||||
type. All of the vendors implement these functions using <EM>wint</EM><STRONG>_</STRONG><EM>t</EM>,
|
||||
following the Issue 7 standard.
|
||||
|
||||
X/Open Curses, Issue 7 (2009) is unclear regarding whether the
|
||||
terminating <EM>null</EM> <STRONG>wchar_t</STRONG> value is counted in the length parameter <EM>n</EM>.
|
||||
X/Open Curses, Issue 7 revised the corresponding description of
|
||||
<STRONG>wgetnstr</STRONG> to address this issue. The unrevised description of
|
||||
<STRONG>wget_nwstr</STRONG> can be interpreted either way. This implementation counts
|
||||
the terminator in the length.
|
||||
X/Open Curses Issue 7 is unclear whether the terminating null wide
|
||||
character counts toward the length parameter <EM>n</EM>. A similar issue
|
||||
affected <EM>wgetnstr</EM> in Issue 4, Version 2; Issue 7 revised that
|
||||
function's description to address the issue, but not that of
|
||||
<EM>wget</EM><STRONG>_</STRONG><EM>nwstr</EM>, leaving it ambiguous. <EM>ncurses</EM> counts the terminator in the
|
||||
length.
|
||||
|
||||
X/Open Curses does not specify what happens if the length <EM>n</EM> is
|
||||
negative.
|
||||
|
||||
<STRONG>o</STRONG> For analogy with <STRONG>wgetnstr</STRONG>, <EM>ncurses</EM> 6.2 uses a limit (based on
|
||||
<STRONG>LINE_MAX</STRONG>).
|
||||
<STRONG>o</STRONG> For consistency with <EM>wgetnstr</EM>, <EM>ncurses</EM> 6.2 uses a limit based on
|
||||
<EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM>.
|
||||
|
||||
<STRONG>o</STRONG> Some other implementations (such as Solaris xcurses) do the same,
|
||||
while others (PDCurses) do not allow this.
|
||||
<STRONG>o</STRONG> Some other implementations (such as Solaris <EM>xcurses</EM>) do the same,
|
||||
while others (<EM>PDCurses</EM>) do not permit a negative <EM>n</EM>.
|
||||
|
||||
<STRONG>o</STRONG> NetBSD 7 curses imitates <EM>ncurses</EM> 6.1 in this regard, treating a <STRONG>-1</STRONG>
|
||||
as an indefinite number of characters.
|
||||
<STRONG>o</STRONG> NetBSD 7 <EM>curses</EM> imitates <EM>ncurses</EM> 6.1 and earlier, treating a
|
||||
negative <EM>n</EM> as an unbounded count of wide characters.
|
||||
|
||||
Implementations vary in their handling of input control characters.
|
||||
|
||||
<STRONG>o</STRONG> While they may enable the screen's echo option, some do not take it
|
||||
out of raw mode, and may take cbreak mode into account when
|
||||
deciding whether to handle echoing within <EM>wgetn</EM><STRONG>_</STRONG><EM>wstr</EM> or to rely on
|
||||
it as a side effect of calling <EM>wget</EM><STRONG>_</STRONG><EM>wch</EM>.
|
||||
|
||||
Since 1995, <EM>ncurses</EM> has provided handlers for <EM>SIGINTR</EM> and <EM>SIGQUIT</EM>
|
||||
events, which are typically generated at the keyboard with <STRONG>^C</STRONG> and
|
||||
<STRONG>^\</STRONG> respectively. In cbreak mode, those handlers catch a signal and
|
||||
stop the program, whereas other implementations write those
|
||||
characters into the buffer.
|
||||
|
||||
<STRONG>o</STRONG> Starting with <EM>ncurses</EM> 6.3 (2021), <EM>wgetn</EM><STRONG>_</STRONG><EM>wstr</EM> preserves raw mode if
|
||||
the screen was already in that state, allowing one to enter the
|
||||
characters the terminal interprets as interrupt and quit events
|
||||
into the buffer, for consistency with SVr4 <EM>curses</EM>'s <EM>wgetnstr</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition Version 4 of the same year specified
|
||||
functions named <EM>wgetwstr</EM> and <EM>wgetnwstr</EM> (and the usual variants). These
|
||||
were later additions to SVr4.<EM>x</EM>, not appearing in the first SVr4 (1989).
|
||||
Except in name, their declarations did not differ from X/Open's later
|
||||
<EM>wget</EM><STRONG>_</STRONG><EM>wstr</EM> and <EM>wgetn</EM><STRONG>_</STRONG><EM>wstr</EM> until X/Open Curses Issue 7 (2009) eventually
|
||||
changed the type of the buffer argument to a pointer to <EM>wint</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
@@ -187,9 +232,7 @@
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_get_wstr.3x.html">curs_get_wstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_get_wstr.3x.html">curs_get_wstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -198,7 +241,9 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="cu
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2019-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2019-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2001-2015,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_getcchar.3x,v 1.49 2024/04/20 18:55:09 tom Exp @
|
||||
* @Id: curs_getcchar.3x,v 1.57 2025/02/23 13:48:31 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_getcchar 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_getcchar 3x 2025-02-23 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_getcchar 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_getcchar 3x 2025-02-23 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>getcchar</STRONG>, <STRONG>setcchar</STRONG> - convert between a wide-character string and a
|
||||
<EM>curses</EM> complex character
|
||||
@@ -54,149 +52,157 @@
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>getcchar(</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG>
|
||||
<STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wc</EM><STRONG>,</STRONG>
|
||||
<STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG>
|
||||
<STRONG>short</STRONG> <STRONG>*</STRONG><EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>setcchar(</STRONG>
|
||||
<STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wc</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG>
|
||||
<STRONG>short</STRONG> <EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>getcchar(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>,</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wc</EM><STRONG>,</STRONG>
|
||||
<STRONG>attr_t</STRONG> <STRONG>*</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG> <EM>opts</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>setcchar(cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG> <EM>wc</EM><STRONG>,</STRONG>
|
||||
<STRONG>const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG> <EM>opts</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <EM>curses</EM> complex character data type <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> is a structure type
|
||||
comprising a wide-character string, a set of attributes, and a color
|
||||
pair identifier. The <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> structure is opaque; do not attempt to
|
||||
access its members directly. The library provides functions to
|
||||
manipulate this type.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-getcchar">getcchar</a></H3><PRE>
|
||||
The <STRONG>getcchar</STRONG> function gets a wide-character string and rendition from a
|
||||
<STRONG>cchar_t</STRONG> argument. When <EM>wc</EM> is not a null pointer, the <STRONG>getcchar</STRONG> function
|
||||
does the following:
|
||||
<STRONG>getcchar</STRONG> destructures a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> into its components.
|
||||
|
||||
<STRONG>o</STRONG> Extracts information from a <STRONG>cchar_t</STRONG> value <EM>wch</EM>
|
||||
If <EM>wc</EM> is not a null pointer, <STRONG>getcchar</STRONG>:
|
||||
|
||||
<STRONG>o</STRONG> Stores the character attributes in the location pointed to by <EM>attrs</EM>
|
||||
<STRONG>o</STRONG> stores the wide-character string in the <EM>curses</EM> complex character
|
||||
<EM>wch</EM> into <EM>wc</EM>;
|
||||
|
||||
<STRONG>o</STRONG> Stores the color pair in the location pointed to by <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
|
||||
<STRONG>o</STRONG> stores the attributes in <EM>attrs</EM>; and
|
||||
|
||||
<STRONG>o</STRONG> Stores the wide-character string, characters referenced by <EM>wch</EM>,
|
||||
into the array pointed to by <EM>wc</EM>.
|
||||
<STRONG>o</STRONG> stores the color pair identifier in <EM>pair</EM>.
|
||||
|
||||
When <EM>wc</EM> is a null pointer, the <STRONG>getcchar</STRONG> function does the following:
|
||||
|
||||
<STRONG>o</STRONG> Obtains the number of wide characters pointed to by <EM>wch</EM>
|
||||
|
||||
<STRONG>o</STRONG> Does not change the data referenced by <EM>attrs</EM> or <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
|
||||
If <EM>wc</EM> is a null pointer, <STRONG>getcchar</STRONG> counts the <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> wide characters in
|
||||
<EM>wch</EM>, returns that value, and leaves <EM>attrs</EM> and <EM>pair</EM> unchanged.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-setcchar">setcchar</a></H3><PRE>
|
||||
The <STRONG>setcchar</STRONG> function initializes the location pointed to by <EM>wch</EM> by
|
||||
using:
|
||||
<STRONG>setcchar</STRONG> constructs a <EM>curses</EM> complex character <EM>wch</EM> from the components
|
||||
<EM>wc</EM>, <EM>attrs</EM>, and <EM>pair</EM>. The wide-character string <EM>wch</EM> must be terminated
|
||||
with a null wide character <STRONG>L'\0'</STRONG> and must contain at most one spacing
|
||||
character, which, if present, must be the first wide character in the
|
||||
string.
|
||||
|
||||
<STRONG>o</STRONG> The character attributes in <EM>attrs</EM>
|
||||
Up to <STRONG>CCHARW_MAX</STRONG> - 1 non-spacing characters may follow (see
|
||||
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>). <EM>ncurses</EM> ignores any additional non-spacing
|
||||
characters.
|
||||
|
||||
<STRONG>o</STRONG> The color pair in <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
|
||||
|
||||
<STRONG>o</STRONG> The wide-character string pointed to by <EM>wc</EM>. The string must be
|
||||
L'\0' terminated, contain at most one spacing character, which must
|
||||
be the first.
|
||||
|
||||
Up to <STRONG>CCHARW_MAX</STRONG>-1 non-spacing characters may follow. Additional
|
||||
non-spacing characters are ignored.
|
||||
|
||||
The string may contain a single control character instead. In that
|
||||
case, no non-spacing characters are allowed.
|
||||
The string may contain a single control character instead. In that
|
||||
case, no non-spacing characters are allowed.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
When <EM>wc</EM> is a null pointer, <STRONG>getcchar</STRONG> returns the number of wide
|
||||
characters referenced by <EM>wch</EM>, including one for a trailing null.
|
||||
If <STRONG>getcchar</STRONG> is passed a null pointer as its <EM>wc</EM> argument, it returns the
|
||||
number of wide characters for a given <EM>wch</EM> that it would store in <EM>wc</EM>,
|
||||
counting a trailing null wide character. If <STRONG>getcchar</STRONG> is not passed a
|
||||
null pointer as its <EM>wc</EM> argument, it returns <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on
|
||||
failure.
|
||||
|
||||
When <EM>wc</EM> is not a null pointer, <STRONG>getcchar</STRONG> returns <STRONG>OK</STRONG> upon successful
|
||||
completion, and <STRONG>ERR</STRONG> otherwise.
|
||||
In <EM>ncurses</EM>, <STRONG>getcchar</STRONG> returns <STRONG>ERR</STRONG> if either <EM>attrs</EM> or <EM>pair</EM> is a null
|
||||
pointer and <EM>wc</EM> is not.
|
||||
|
||||
Upon successful completion, <STRONG>setcchar</STRONG> returns <STRONG>OK</STRONG>. Otherwise, it returns
|
||||
<STRONG>ERR</STRONG>.
|
||||
<STRONG>setcchar</STRONG> returns <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
In <EM>ncurses</EM>, <STRONG>setcchar</STRONG> returns <STRONG>ERR</STRONG> if
|
||||
|
||||
<STRONG>o</STRONG> <EM>wch</EM> is a null pointer,
|
||||
|
||||
<STRONG>o</STRONG> <EM>wc</EM> starts with a (wide) control character and contains any other
|
||||
wide characters, or
|
||||
|
||||
<STRONG>o</STRONG> <EM>pair</EM> has a negative value.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
The <EM>wch</EM> argument may be a value generated by a call to <STRONG>setcchar</STRONG> or by a
|
||||
function that has a <STRONG>cchar_t</STRONG> output argument. If <EM>wch</EM> is constructed by
|
||||
any other means, the effect is unspecified.
|
||||
<EM>wch</EM> may be a value stored by <STRONG>setcchar</STRONG> or another <EM>curses</EM> function with a
|
||||
writable <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> argument. If <EM>wch</EM> is constructed by any other means,
|
||||
the library's behavior is unspecified.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
X/Open Curses documents the <EM>opts</EM> argument as reserved for future use,
|
||||
saying that it must be null. This implementation uses that parameter
|
||||
in ABI 6 for the functions which have a color pair parameter to support
|
||||
extended color pairs:
|
||||
X/Open Curses documents the <EM>opts</EM> argument as reserved for future use,
|
||||
saying that it must be a null pointer. The <EM>ncurses</EM> 6 ABI uses it with
|
||||
functions that have a color pair parameter to support extended color
|
||||
pairs.
|
||||
|
||||
<STRONG>o</STRONG> For functions which modify the color, e.g., <STRONG>setcchar</STRONG>, if <EM>opts</EM> is
|
||||
set it is treated as a pointer to <STRONG>int</STRONG>, and used to set the color
|
||||
pair instead of the <STRONG>short</STRONG> pair parameter.
|
||||
<STRONG>o</STRONG> In functions that assign colors, such as <STRONG>setcchar</STRONG>, if <EM>opts</EM> is not a
|
||||
null pointer, <EM>ncurses</EM> treats it as a pointer to <EM>int</EM>, and interprets
|
||||
it instead of the <EM>short</EM> <EM>pair</EM> parameter as a color pair identifier.
|
||||
|
||||
<STRONG>o</STRONG> For functions which retrieve the color, e.g., <STRONG>getcchar</STRONG>, if <EM>opts</EM> is
|
||||
set it is treated as a pointer to <STRONG>int</STRONG>, and used to retrieve the
|
||||
color pair as an <STRONG>int</STRONG> value, in addition retrieving it via the
|
||||
standard pointer to <STRONG>short</STRONG> parameter.
|
||||
<STRONG>o</STRONG> In functions that retrieve colors, such as <STRONG>getcchar</STRONG>, if <EM>opts</EM> is not
|
||||
a null pointer, <EM>ncurses</EM> treats it as a pointer to <EM>int</EM>, and stores
|
||||
the retrieved color pair identifier there as well as in the <EM>short</EM>
|
||||
<EM>pair</EM> parameter (which may therefore undergo a narrowing
|
||||
conversion).
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
The <STRONG>CCHARW_MAX</STRONG> symbol is specific to <EM>ncurses</EM>. X/Open Curses does not
|
||||
provide details for the layout of the <STRONG>cchar_t</STRONG> structure. It tells what
|
||||
data are stored in it:
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
<STRONG>o</STRONG> a spacing character (<STRONG>wchar_t</STRONG>, i.e., 32-bits).
|
||||
These functions are described in X/Open Curses Issue 4. It specifies
|
||||
no error conditions for them.
|
||||
|
||||
<STRONG>o</STRONG> non-spacing characters (again, <STRONG>wchar_t</STRONG>'s).
|
||||
X/Open Curses does not detail the layout of the <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> structure,
|
||||
describing only its minimal required contents:
|
||||
|
||||
<STRONG>o</STRONG> attributes (at least 16 bits, inferred from the various ACS- and
|
||||
WACS-flags).
|
||||
<STRONG>o</STRONG> a spacing wide character (<EM>wchar</EM><STRONG>_</STRONG><EM>t</EM>),
|
||||
|
||||
<STRONG>o</STRONG> color pair (at least 16 bits, inferred from the <STRONG>unsigned</STRONG> <STRONG>short</STRONG>
|
||||
type).
|
||||
<STRONG>o</STRONG> at least five non-spacing wide characters (<EM>wchar</EM><STRONG>_</STRONG><EM>t</EM>; see below),
|
||||
|
||||
The non-spacing characters are optional, in the sense that zero or more
|
||||
may be stored in a <STRONG>cchar_t</STRONG>. XOpen/Curses specifies a limit:
|
||||
<STRONG>o</STRONG> attributes (at least 15 bits' worth, inferred from the count of
|
||||
specified <EM>WA</EM><STRONG>_</STRONG> constants),
|
||||
|
||||
<STRONG>o</STRONG> a color pair identifier (at least 16 bits, inferred from the <EM>short</EM>
|
||||
type used to encode it).
|
||||
|
||||
Non-spacing characters are optional, in the sense that zero or more may
|
||||
be stored in a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>. XOpen/Curses specifies a limit:
|
||||
|
||||
Implementations may limit the number of non-spacing characters that
|
||||
can be associated with a spacing character, provided any limit is
|
||||
can be associated with a spacing character, provided any limit is
|
||||
at least 5.
|
||||
|
||||
The Unix implementations at the time follow that limit:
|
||||
Then-contemporary Unix implementations adhered to that limit.
|
||||
|
||||
<STRONG>o</STRONG> AIX 4 and OSF1 4 use the same declaration with an array of 5 non-
|
||||
spacing characters <EM>z</EM> and a single spacing character <EM>c</EM>.
|
||||
<STRONG>o</STRONG> AIX 4 and OSF/1 4 used the same declaration with a single spacing
|
||||
wide character <EM>c</EM> and an array of 5 non-spacing wide characters <EM>z</EM>.
|
||||
|
||||
<STRONG>o</STRONG> HP-UX 10 uses an opaque structure with 28 bytes, which is large
|
||||
enough for the 6 <STRONG>wchar_t</STRONG> values.
|
||||
<STRONG>o</STRONG> HP-UX 10 used an opaque structure of 28 bytes, large enough for 6
|
||||
<EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> values.
|
||||
|
||||
<STRONG>o</STRONG> Solaris <EM>xpg4</EM> curses uses a single array of 6 <STRONG>wchar_t</STRONG> values.
|
||||
<STRONG>o</STRONG> Solaris <EM>xcurses</EM> uses a single array of 6 <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> values.
|
||||
|
||||
This implementation's <STRONG>cchar_t</STRONG> was defined in 1995 using <STRONG>5</STRONG> for the total
|
||||
of spacing and non-spacing characters (<STRONG>CCHARW_MAX</STRONG>). That was probably
|
||||
due to a misreading of the AIX 4 header files, because the X/Open
|
||||
Curses document was not generally available at that time. Later (in
|
||||
2002), this detail was overlooked when beginning to implement the
|
||||
functions using the structure.
|
||||
<EM>ncurses</EM> defined its <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> in 1995 using 5 as the <EM>total</EM> of spacing and
|
||||
non-spacing characters (<STRONG>CCHARW_MAX</STRONG>). That was probably due to a
|
||||
misreading of the AIX 4 header files, because the X/Open Curses
|
||||
document was not generally available at that time. Later (in 2002),
|
||||
this detail was overlooked when work began to implement the functions
|
||||
using the structure.
|
||||
|
||||
In practice, even four non-spacing characters may seem enough. X/Open
|
||||
Curses documents possible uses for non-spacing characters, including
|
||||
using them for ligatures between characters (a feature apparently not
|
||||
supported by any curses implementation). Unicode does not limit the
|
||||
(analogous) number of combining characters, so some applications may be
|
||||
affected.
|
||||
In practice, a mere four non-spacing characters may seem adequate.
|
||||
X/Open Curses documents possible applications of non-spacing
|
||||
characters, including their use as ligatures (a feature apparently not
|
||||
supported by any <EM>curses</EM> implementation). Unicode does not limit the
|
||||
(analogous) number of combining characters in a grapheme cluster; some
|
||||
applications may be affected. <EM>ncurses</EM> can be compiled with a different
|
||||
<STRONG>CCHARW_MAX</STRONG> value; doing so alters the library's ABI.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>, <STRONG>wcwidth(3)</STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-02-23 <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -212,6 +218,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="cu
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+173
-135
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,37 +28,35 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_getch.3x,v 1.87 2024/04/20 19:18:18 tom Exp @
|
||||
* @Id: curs_getch.3x,v 1.134 2025/11/12 01:06:36 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_getch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_getch 3x 2025-11-11 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_getch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_getch 3x 2025-11-11 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>getch</STRONG>, <STRONG>wgetch</STRONG>, <STRONG>mvgetch</STRONG>, <STRONG>mvwgetch</STRONG>, <STRONG>ungetch</STRONG>, <STRONG>has_key</STRONG> - get (or push back)
|
||||
characters from <EM>curses</EM> terminal keyboard
|
||||
characters from <EM>curses</EM> terminal keyboard buffer
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>getch(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvgetch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>ungetch(int</STRONG> <EM>c</EM><STRONG>);</STRONG>
|
||||
|
||||
@@ -69,92 +67,114 @@
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
|
||||
</PRE><H3><a name="h3-Reading-Characters">Reading Characters</a></H3><PRE>
|
||||
<STRONG>wgetch</STRONG> gathers a key stroke from the terminal keyboard associated with
|
||||
a <EM>curses</EM> window <EM>win</EM>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this
|
||||
<STRONG>wgetch</STRONG> gathers a key event from the terminal keyboard associated with a
|
||||
<EM>curses</EM> window <EM>win</EM>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this
|
||||
function.
|
||||
|
||||
When input is pending, <STRONG>wgetch</STRONG> returns an integer identifying the key
|
||||
stroke; for alphanumeric and punctuation keys, this value corresponds
|
||||
to the character encoding used by the terminal. Use of the control key
|
||||
as a modifier often results in a distinct code. The behavior of other
|
||||
keys depends on whether <EM>win</EM> is in keypad mode; see subsection "Keypad
|
||||
Mode" below.
|
||||
event; for alphanumeric and punctuation keys, the space bar, and
|
||||
(usually) the Backspace, Tab, Return, and Escape keys, this value
|
||||
corresponds to the character encoding used by the terminal. Use of the
|
||||
control key as a modifier, by holding it down while pressing and
|
||||
releasing another key, often results in a distinct code. The behavior
|
||||
of other keys depends on whether <EM>win</EM> is in keypad mode; see subsection
|
||||
"Keypad Mode" below.
|
||||
|
||||
If no input is pending, then if the no-delay flag is set in the window
|
||||
(see <STRONG><A HREF="nodelay.3x.html">nodelay(3x)</A></STRONG>), the function returns <STRONG>ERR</STRONG>; otherwise, <EM>curses</EM> waits
|
||||
until the terminal has input. If <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG> has been called, this
|
||||
happens after one character is read. If <STRONG><A HREF="curs_inopts.3x.html">nocbreak(3x)</A></STRONG> has been called,
|
||||
it occurs when the next newline is read. If <STRONG><A HREF="curs_inopts.3x.html">halfdelay(3x)</A></STRONG> has been
|
||||
called, <EM>curses</EM> waits until a character is typed or the specified delay
|
||||
elapses.
|
||||
If no input is pending, then if the no-delay flag is set in the window
|
||||
(see <STRONG><A HREF="nodelay.3x.html">nodelay(3x)</A></STRONG>), the function returns <STRONG>ERR</STRONG>; otherwise, <EM>curses</EM> waits
|
||||
until the terminal has input. If <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG> or <STRONG><A HREF="curs_inopts.3x.html">raw(3x)</A></STRONG> has been
|
||||
called, this happens after <EM>curses</EM> reads one key event. If <STRONG><A HREF="curs_inopts.3x.html">nocbreak(3x)</A></STRONG>
|
||||
or <STRONG><A HREF="curs_inopts.3x.html">noraw(3x)</A></STRONG> has been called, it occurs when <EM>curses</EM> reads a newline.
|
||||
(Because the terminal's canonical or "cooked" mode is line-buffered,
|
||||
multiple <STRONG>wgetch</STRONG> calls may then be necessary to empty the input queue.)
|
||||
If <STRONG><A HREF="curs_inopts.3x.html">halfdelay(3x)</A></STRONG> has been called, <EM>curses</EM> waits until input is available
|
||||
or the specified delay elapses.
|
||||
|
||||
If <STRONG><A HREF="curs_inopts.3x.html">echo(3x)</A></STRONG> has been called, and the window is not a pad, <EM>curses</EM> writes
|
||||
the returned character <EM>c</EM> to the window (at the cursor position) per the
|
||||
following rules.
|
||||
|
||||
<STRONG>o</STRONG> If <EM>c</EM> matches the terminal's erase character, the cursor moves
|
||||
leftward one position and the new position is erased as if
|
||||
<STRONG>o</STRONG> If <EM>c</EM> matches the terminal's erase character (see <STRONG><A HREF="curs_termattrs.3x.html">erasechar(3x)</A></STRONG>),
|
||||
and the cursor is not at the window's leftmost column, the cursor
|
||||
moves leftward one position and the new position is erased as if
|
||||
<STRONG><A HREF="curs_move.3x.html">wmove(3x)</A></STRONG> and then <STRONG><A HREF="curs_delch.3x.html">wdelch(3x)</A></STRONG> were called. When the window's
|
||||
keypad mode is enabled (see below), <STRONG>KEY_LEFT</STRONG> and <STRONG>KEY_BACKSPACE</STRONG> are
|
||||
handled the same way.
|
||||
|
||||
<STRONG>o</STRONG> <EM>curses</EM> writes any other <EM>c</EM> to the window, as with <STRONG><A HREF="curs_addch.3x.html">wechochar(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> If the window has been moved or modified since the last call to
|
||||
<STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG>, <EM>curses</EM> calls <STRONG>wrefresh</STRONG>.
|
||||
<STRONG>o</STRONG> If the window <EM>win</EM> has been moved or modified since the last call to
|
||||
<STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG>, <EM>curses</EM> calls <STRONG>wrefresh</STRONG> on it.
|
||||
|
||||
If <EM>c</EM> is a carriage return and <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG> has been called, <STRONG>wgetch</STRONG> returns
|
||||
If <EM>c</EM> is a carriage return and <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG> has been called, <STRONG>wgetch</STRONG> returns
|
||||
the character code for line feed instead.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Keypad-Mode">Keypad Mode</a></H3><PRE>
|
||||
To <EM>curses</EM>, key strokes not from the alphabetic section of the keyboard
|
||||
(those corresponding to the ECMA-6 character set--see
|
||||
<STRONG>ascii(7)</STRONG>--optionally modified by either the control or shift keys) are
|
||||
treated as <EM>function</EM> keys. (In <EM>curses</EM>, the term "function key" includes
|
||||
but is not limited to keycaps engraved with "F1", "PF1", and so on.)
|
||||
If the window is in keypad mode, these produce a numeric code
|
||||
corresponding to the <STRONG>KEY_</STRONG> symbols listed in subsection "Predefined Key
|
||||
Codes" below; otherwise, they transmit a sequence of codes typically
|
||||
starting with the escape character, and which must be collected with
|
||||
multiple <STRONG>wgetch</STRONG> calls.
|
||||
Call <STRONG><A HREF="curs_inopts.3x.html">keypad(3x)</A></STRONG> on a window to configure keypad mode when reading input
|
||||
from it. In <EM>keypad</EM> <EM>mode</EM>, <EM>curses</EM> treats key strokes not from the
|
||||
alphabetic section of the keyboard (those corresponding to the ECMA-6
|
||||
character set -- see <STRONG>ascii(7)</STRONG> -- optionally modified by either the
|
||||
control or shift keys) as <EM>function</EM> keys. (In <EM>curses</EM>, the term
|
||||
"function key" includes but is not limited to keycaps engraved with
|
||||
"F1", "PF1", and so on.) If a window is in keypad mode, <STRONG>wgetch</STRONG>
|
||||
translates these key strokes to a numeric code corresponding to the
|
||||
<STRONG>KEY_</STRONG> symbols listed in subsection "Key Codes" below. If the window is
|
||||
not in keypad mode, the input queue populates with the characters of
|
||||
the function key's escape sequence, which the application must collect
|
||||
individually with multiple <STRONG>wgetch</STRONG> calls.
|
||||
|
||||
<STRONG>o</STRONG> The <EM>curses.h</EM> header file declares many <EM>predefined</EM> <EM>function</EM> <EM>keys</EM>
|
||||
whose names begin with <STRONG>KEY_</STRONG>; these object-like macros have values
|
||||
<STRONG>o</STRONG> The <EM>curses.h</EM> header file declares many <EM>function</EM> <EM>keys</EM> whose names
|
||||
begin with <STRONG>KEY_</STRONG>; these object-like macros have integer values
|
||||
outside the range of eight-bit character codes.
|
||||
|
||||
<STRONG>o</STRONG> In <EM>ncurses</EM>, <EM>user-defined</EM> <EM>function</EM> <EM>keys</EM> are configured with
|
||||
<STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>; they have no names, but are also expected to have
|
||||
values outside the range of eight-bit codes.
|
||||
integer values outside the range of eight-bit character codes.
|
||||
|
||||
A variable intended to hold a function key code must thus be of type
|
||||
<EM>short</EM> or larger.
|
||||
|
||||
Most terminals one encounters follow the ECMA-48 standard insofar as
|
||||
their function keys produce character sequences prefixed with the
|
||||
escape character ESC. This fact implies that <EM>curses</EM> cannot know
|
||||
whether the terminal has sent an ESC key stroke or the beginning of a
|
||||
function key's character sequence without waiting to see if, and how
|
||||
soon, further input arrives. When <EM>curses</EM> reads such an ambiguous
|
||||
character, it sets a timer. If the remainder of the sequence does not
|
||||
arrive within the designated time, <STRONG>wgetch</STRONG> returns the prefix character;
|
||||
otherwise, it returns the function key code corresponding to the unique
|
||||
sequence defined by the terminal. Consequently, a user of a <EM>curses</EM>
|
||||
application may experience a delay after pressing ESC while <EM>curses</EM>
|
||||
disambiguates the input; see section "EXTENSIONS" below. If the window
|
||||
is in "no time-out" mode, the timer does not expire; it is an infinite
|
||||
(or very large) value. See <STRONG><A HREF="notimeout.3x.html">notimeout(3x)</A></STRONG>. Because function key
|
||||
sequences usually begin with an escape character, the terminal may
|
||||
appear to hang in no time-out mode after the user has pressed ESC.
|
||||
Generally, further typing "awakens" <EM>curses</EM>.
|
||||
escape character ESC. This fact implies that <EM>curses</EM> cannot distinguish
|
||||
a user's press of the escape key (assuming it sends ESC) from the
|
||||
beginning of a function key's character sequence without waiting to see
|
||||
if, and how soon, further input arrives.
|
||||
|
||||
<STRONG>o</STRONG> If the escape sequence matches a string capability defining a
|
||||
function key for the terminal type (such as <STRONG>key_home</STRONG> (<STRONG>khome</STRONG>) or
|
||||
<STRONG>key_up</STRONG> (<STRONG>kuu1</STRONG>)), <STRONG>wgetch</STRONG> returns the function key code corresponding
|
||||
to the unique sequence defined by the terminal.
|
||||
|
||||
<STRONG>o</STRONG> If the escape sequence matches no function keys defined for the
|
||||
terminal type, call <STRONG>wgetch</STRONG> repeatedly to obtain the codes of the
|
||||
individual characters of the sequence, in the order they occurred
|
||||
in the input.
|
||||
|
||||
<STRONG>o</STRONG> If <STRONG>wgetch</STRONG> cannot decide the validity of the input as a function key
|
||||
because it has not read enough characters to disambiguate it, the
|
||||
function waits until it has this information or the <EM>escape</EM> <EM>delay</EM>
|
||||
elapses. Configure the escape delay with the global variable
|
||||
<STRONG>ESCDELAY</STRONG>, an extension (see section "EXTENSIONS" below), or the
|
||||
environment variable of the same name (see section "ENVIRONMENT" of
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>), also an extension.
|
||||
|
||||
Consequently, a user of a <EM>curses</EM> application that employs keypad mode
|
||||
may experience a pause or "hang" after pressing the escape key while
|
||||
<EM>curses</EM> collects sufficient characters to disambiguate the input. If
|
||||
the window is in "no time-out" mode, the escape delay is effectively
|
||||
infinite; see <STRONG><A HREF="notimeout.3x.html">notimeout(3x)</A></STRONG>. In the event of such a pause, further
|
||||
typing "awakens" <EM>curses</EM>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Ungetting-Characters">Ungetting Characters</a></H3><PRE>
|
||||
<STRONG>ungetch</STRONG> places <EM>c</EM> into the input queue to be returned by the next call
|
||||
to <STRONG>wgetch</STRONG>. A single input queue serves all windows.
|
||||
to <STRONG>wgetch</STRONG>. A single input queue serves all windows associated with the
|
||||
screen.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Predefined-Key-Codes">Predefined Key Codes</a></H3><PRE>
|
||||
</PRE><H3><a name="h3-Key-Codes">Key Codes</a></H3><PRE>
|
||||
The header file <EM>curses.h</EM> defines the following function key codes.
|
||||
|
||||
<STRONG>o</STRONG> Except for the special case of <STRONG>KEY_RESIZE</STRONG>, a window's keypad mode
|
||||
@@ -180,7 +200,6 @@
|
||||
<STRONG>KEY_BACKSPACE</STRONG> Backspace
|
||||
<STRONG>KEY_F0</STRONG> Function keys; space for 64 keys is reserved
|
||||
<STRONG>KEY_F(</STRONG><EM>n</EM><STRONG>)</STRONG> Function key <EM>n</EM> where 0 <= <EM>n</EM> <= 63
|
||||
|
||||
<STRONG>KEY_DL</STRONG> Delete line
|
||||
<STRONG>KEY_IL</STRONG> Insert line
|
||||
<STRONG>KEY_DC</STRONG> Delete character
|
||||
@@ -246,7 +265,6 @@
|
||||
<STRONG>KEY_SDL</STRONG> Shifted delete line key
|
||||
<STRONG>KEY_SEND</STRONG> Shifted end key
|
||||
<STRONG>KEY_SEOL</STRONG> Shifted clear line key
|
||||
|
||||
<STRONG>KEY_SEXIT</STRONG> Shifted exit key
|
||||
<STRONG>KEY_SFIND</STRONG> Shifted find key
|
||||
<STRONG>KEY_SHELP</STRONG> Shifted help key
|
||||
@@ -269,70 +287,82 @@
|
||||
|
||||
Many keyboards feature a nine-key directional pad.
|
||||
|
||||
+-----+------+-------+
|
||||
| A1 | up | A3 |
|
||||
+-----+------+-------+
|
||||
|left | B2 | right |
|
||||
+-----+------+-------+
|
||||
| C1 | down | C3 |
|
||||
+-----+------+-------+
|
||||
+------+------+-------+
|
||||
| A1 | up | A3 |
|
||||
+------+------+-------+
|
||||
| left | B2 | right |
|
||||
+------+------+-------+
|
||||
| C1 | down | C3 |
|
||||
+------+------+-------+
|
||||
|
||||
Two of the symbols in the list above do <EM>not</EM> correspond to a physical
|
||||
key.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>wgetch</STRONG> returns <STRONG>KEY_RESIZE</STRONG>, even if the window's keypad mode is
|
||||
disabled, when <EM>ncurses</EM> handles a <STRONG>SIGWINCH</STRONG> signal; see <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG>
|
||||
and <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>.
|
||||
disabled, if <EM>ncurses</EM> has handled a <EM>SIGWINCH</EM> signal since <STRONG>wgetch</STRONG> was
|
||||
called; see <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> and <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>wgetch</STRONG> returns <STRONG>KEY_MOUSE</STRONG> to indicate that a mouse event is pending
|
||||
collection; see <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>. Receipt of this code requires a
|
||||
window's keypad mode to be enabled, because to interpret mouse
|
||||
input (as with with <STRONG>xterm(1)</STRONG>'s mouse prototocol), <EM>ncurses</EM> must read
|
||||
an escape sequence, as with a function key.
|
||||
<STRONG>o</STRONG> <STRONG>wgetch</STRONG> returns <STRONG>KEY_MOUSE</STRONG> to indicate that a mouse event is pending
|
||||
collection; see <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>. Receipt of this code requires a
|
||||
window's keypad mode to be enabled, because to interpret mouse
|
||||
input (as with <STRONG>xterm(1)</STRONG>'s mouse protocol), <EM>ncurses</EM> must read an
|
||||
escape sequence, as with a function key.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Testing-Key-Codes">Testing Key Codes</a></H3><PRE>
|
||||
In <EM>ncurses</EM>, <STRONG>has_key</STRONG> returns a Boolean value indicating whether the
|
||||
terminal type recognizes its parameter as a key code value. See also
|
||||
In <EM>ncurses</EM>, <STRONG>has_key</STRONG> returns a Boolean value indicating whether the
|
||||
terminal type recognizes its parameter as a key code value. See also
|
||||
<STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG> and <STRONG><A HREF="key_defined.3x.html">key_defined(3x)</A></STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
Except for <STRONG>has_key</STRONG>, these functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on
|
||||
failure.
|
||||
<STRONG>wgetch</STRONG> returns a key code identifying the key event as described above,
|
||||
which may include <STRONG>KEY_RESIZE</STRONG> or <STRONG>KEY_MOUSE</STRONG> indicating non-key events, or
|
||||
<STRONG>ERR</STRONG> on failure. <STRONG>wgetch</STRONG> fails if its timeout expires without any data
|
||||
arriving, which cannot happen if <STRONG><A HREF="nodelay.3x.html">nodelay(3x)</A></STRONG> is in effect on the
|
||||
window.
|
||||
|
||||
Functions taking a <EM>WINDOW</EM> pointer argument fail if the pointer is <STRONG>NULL</STRONG>.
|
||||
In <EM>ncurses</EM>, <STRONG>wgetch</STRONG> also fails if
|
||||
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer, or
|
||||
|
||||
<STRONG>o</STRONG> execution was interrupted by a signal, in which case the library
|
||||
sets <EM>errno</EM> to <EM>EINTR</EM>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
<STRONG>wgetch</STRONG> also fails if
|
||||
<STRONG>ungetch</STRONG> returns <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure. In <EM>ncurses</EM>, <STRONG>ungetch</STRONG>
|
||||
fails if
|
||||
|
||||
<STRONG>o</STRONG> its timeout expires without any data arriving, or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized, or
|
||||
|
||||
<STRONG>o</STRONG> execution was interrupted by a signal, in which case <STRONG>errno</STRONG> is set
|
||||
to <STRONG>EINTR</STRONG>.
|
||||
|
||||
<STRONG>ungetch</STRONG> fails if there is no more room in the input queue.
|
||||
<STRONG>o</STRONG> there is no more room in the input queue.
|
||||
|
||||
<STRONG>has_key</STRONG> returns <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
<STRONG>getch</STRONG>, <STRONG>mvgetch</STRONG>, and <STRONG>mvwgetch</STRONG> may be implemented as macros.
|
||||
|
||||
<EM>curses</EM> discourages assignment of the ESC key to a discrete function by
|
||||
the programmer because the library requires a delay while it awaits the
|
||||
potential remainder of a terminal escape sequence.
|
||||
|
||||
Some key strokes are indistinguishable from control characters; for
|
||||
example, <STRONG>KEY_ENTER</STRONG> may be the same as <STRONG>^M</STRONG>, and <STRONG>KEY_BACKSPACE</STRONG> may be the
|
||||
same as <STRONG>^H</STRONG> or <STRONG>^?</STRONG>. Consult the terminal's <EM>terminfo</EM> entry to determine
|
||||
whether this is the case; see <STRONG><A HREF="infocmp.1m.html">infocmp(1)</A></STRONG>. Some <EM>curses</EM> implementations,
|
||||
including <EM>ncurses</EM>, honor the <EM>terminfo</EM> key definitions; others treat
|
||||
such control characters specially.
|
||||
Some key strokes are indistinguishable from control characters; for
|
||||
example, <STRONG>KEY_ENTER</STRONG> may be the same as <STRONG>^M</STRONG>, and <STRONG>KEY_BACKSPACE</STRONG> may be the
|
||||
same as <STRONG>^H</STRONG> or <STRONG>^?</STRONG>. Consult the <EM>terminfo</EM> entry for the terminal type to
|
||||
determine whether this is the case; see <STRONG><A HREF="infocmp.1m.html">infocmp(1)</A></STRONG>. Some <EM>curses</EM>
|
||||
implementations, including <EM>ncurses</EM>, honor the <EM>terminfo</EM> key definitions;
|
||||
others treat such control characters specially.
|
||||
|
||||
<EM>curses</EM> distinguishes the Enter keys in the alphabetic and numeric
|
||||
keypad sections of a keyboard because (most) terminals do. <STRONG>KEY_ENTER</STRONG>
|
||||
refers to the key on the numeric keypad and, like other function keys,
|
||||
and is reliably recognized only if the window's keypad mode is enabled.
|
||||
is reliably recognized only if the window's keypad mode is enabled.
|
||||
|
||||
<STRONG>o</STRONG> The <EM>terminfo</EM> <STRONG>key_enter</STRONG> (<STRONG>kent</STRONG>) capability describes the character
|
||||
(sequence) sent by the Enter key of a terminal's numeric (or
|
||||
@@ -346,69 +376,84 @@
|
||||
<STRONG>o</STRONG> It usually produces a control code for carriage return (<STRONG>^M</STRONG>) or line
|
||||
feed (<STRONG>^J</STRONG>).
|
||||
|
||||
<STRONG>o</STRONG> Depending on the terminal mode (raw, cbreak, or "cooked"), and
|
||||
whether <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG> or <STRONG><A HREF="curs_inopts.3x.html">nonl(3x)</A></STRONG> has been called, <STRONG>wgetch</STRONG> may return
|
||||
either a carriage return or line feed upon an Enter or Return key
|
||||
<STRONG>o</STRONG> Depending on the terminal mode (raw, cbreak, or canonical), and
|
||||
whether <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG> or <STRONG><A HREF="curs_inopts.3x.html">nonl(3x)</A></STRONG> has been called, <STRONG>wgetch</STRONG> may return
|
||||
either a carriage return or line feed upon an Enter or Return key
|
||||
stroke.
|
||||
|
||||
Use of <STRONG>wgetch</STRONG> with <STRONG><A HREF="curs_inopts.3x.html">echo(3x)</A></STRONG> and neither <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG> nor <STRONG><A HREF="curs_inopts.3x.html">raw(3x)</A></STRONG> is not
|
||||
Use of <STRONG>wgetch</STRONG> with <STRONG><A HREF="curs_inopts.3x.html">echo(3x)</A></STRONG> and neither <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG> nor <STRONG><A HREF="curs_inopts.3x.html">raw(3x)</A></STRONG> is not
|
||||
well-defined.
|
||||
|
||||
Historically, the list of key code macros above was influenced by the
|
||||
function-key-rich keyboard of the AT&T 7300 (also known variously as
|
||||
the "3B1", "Safari 4", and "UNIX PC"), a 1985 machine. Today's
|
||||
computer keyboards are based that of the IBM PC/AT and tend to have
|
||||
Historically, the list of key code macros above was influenced by the
|
||||
keyboard of the AT&T 7300 (also known variously as the "3B1", "Safari
|
||||
4", and "UNIX PC"), a 1985 machine rich in function keys. Today's
|
||||
computer keyboards are based on that of the IBM PC/AT and tend to have
|
||||
fewer. A <EM>curses</EM> application can expect such a keyboard to transmit key
|
||||
codes <STRONG>KEY_UP</STRONG>, <STRONG>KEY_DOWN</STRONG>, <STRONG>KEY_LEFT</STRONG>, <STRONG>KEY_RIGHT</STRONG>, <STRONG>KEY_HOME</STRONG>, <STRONG>KEY_END</STRONG>,
|
||||
<STRONG>KEY_PPAGE</STRONG> (Page Up), <STRONG>KEY_NPAGE</STRONG> (Page Down), <STRONG>KEY_IC</STRONG> (Insert), <STRONG>KEY_DC</STRONG>
|
||||
(Delete), and <STRONG>KEY_F(</STRONG><EM>n</EM><STRONG>)</STRONG> for 1 <= <EM>n</EM> <= 12.
|
||||
|
||||
<STRONG>getch</STRONG>, <STRONG>mvgetch</STRONG>, and <STRONG>mvwgetch</STRONG> may be implemented as macros.
|
||||
(Delete), <STRONG>KEY_A1</STRONG>, <STRONG>KEY_A3</STRONG>, <STRONG>KEY_B2</STRONG>, <STRONG>KEY_C1</STRONG>, <STRONG>KEY_C3</STRONG>, and <STRONG>KEY_F(</STRONG><EM>n</EM><STRONG>)</STRONG> for 1 <=
|
||||
<EM>n</EM> <= 12.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
In <EM>ncurses</EM>, when a window's "no time-out" mode is <EM>not</EM> set, the <STRONG>ESCDELAY</STRONG>
|
||||
variable configures the duration of the timer used to disambiguate a
|
||||
function key character sequence from a series of key strokes beginning
|
||||
variable configures the duration of the timer used to disambiguate a
|
||||
function key character sequence from a series of key strokes beginning
|
||||
with ESC typed by the user; see <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>has_key</STRONG> was designed for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and is not found in SVr4 <EM>curses</EM>,
|
||||
4.4BSD <EM>curses</EM>, or any other previous curses implementation.
|
||||
<STRONG>has_key</STRONG> is an <EM>ncurses</EM> extension, and is not found in SVr4 <EM>curses</EM>,
|
||||
4.4BSD <EM>curses</EM>, or any other previous <EM>curses</EM> implementation.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
X/Open Curses, Issue 4 describes <STRONG>getch</STRONG>, <STRONG>wgetch</STRONG>, <STRONG>mvgetch</STRONG>, <STRONG>mvwgetch</STRONG>, and
|
||||
<STRONG>ungetch</STRONG>. It specifies no error conditions for them.
|
||||
Except as noted in section "EXTENSIONS" above, X/Open Curses Issue 4
|
||||
describes these functions. It specifies no error conditions for them.
|
||||
|
||||
<STRONG>wgetch</STRONG> reads only single-byte characters.
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
The echo behavior of these functions on input of <STRONG>KEY_</STRONG> or backspace
|
||||
characters was not specified in the SVr4 documentation. This
|
||||
description is adapted from X/Open Curses.
|
||||
<EM>wgetch</EM> reads only single-byte characters.
|
||||
|
||||
The behavior of <STRONG>wgetch</STRONG> in the presence of signal handlers is
|
||||
unspecified in the SVr4 documentation and X/Open Curses. In historical
|
||||
<EM>curses</EM> implementations, it varied depending on whether the operating
|
||||
system's dispatch of a signal to a handler interrupting a <STRONG>read(2)</STRONG> call
|
||||
in progress, and also (in some implementations) whether an input
|
||||
timeout or non-blocking mode has been set. Programmers concerned about
|
||||
portability should be prepared for either of two cases: (a) signal
|
||||
receipt does not interrupt <STRONG>wgetch</STRONG>; or (b) signal receipt interrupts
|
||||
<STRONG>wgetch</STRONG> and causes it to return <STRONG>ERR</STRONG> with <STRONG>errno</STRONG> set to <STRONG>EINTR</STRONG>.
|
||||
The echo behavior of these functions on input of <EM>KEY</EM><STRONG>_</STRONG> or backspace
|
||||
characters is not documented in SVr4 <EM>curses</EM>.
|
||||
|
||||
<STRONG>KEY_MOUSE</STRONG> is mentioned in X/Open Curses, along with a few related <EM>term-</EM>
|
||||
The behavior of <EM>wgetch</EM> in the presence of signal handlers is not
|
||||
documented in SVr4 <EM>curses</EM> and is unspecified by X/Open Curses. In
|
||||
historical <EM>curses</EM> implementations, it varied depending on whether the
|
||||
operating system's dispatch of a signal to a handler interrupted a
|
||||
<STRONG>read(2)</STRONG> call in progress, and also (in some implementations) whether an
|
||||
input timeout or non-blocking mode had been set. A portable <EM>curses</EM>
|
||||
application prepares for two cases: (a) signal receipt does not
|
||||
interrupt <EM>wgetch</EM>; and (b) signal receipt interrupts <EM>wgetch</EM> and causes
|
||||
it to return <EM>ERR</EM> with <EM>errno</EM> set to <EM>EINTR</EM>.
|
||||
|
||||
<EM>KEY</EM><STRONG>_</STRONG><EM>MOUSE</EM> is mentioned in X/Open Curses, along with a few related <EM>term-</EM>
|
||||
<EM>info</EM> capabilities, but no higher-level functions use the feature. The
|
||||
implementation in <EM>ncurses</EM> is an extension.
|
||||
|
||||
<STRONG>KEY_RESIZE</STRONG> and <STRONG>has_key</STRONG> are extensions first implemented for <EM>ncurses</EM>.
|
||||
<EM>KEY</EM><STRONG>_</STRONG><EM>RESIZE</EM> and <EM>has</EM><STRONG>_</STRONG><EM>key</EM> are extensions first implemented for <EM>ncurses</EM>.
|
||||
By 2022, <EM>PDCurses</EM> and NetBSD <EM>curses</EM> had added them along with
|
||||
<STRONG>KEY_MOUSE</STRONG>.
|
||||
<EM>KEY</EM><STRONG>_</STRONG><EM>MOUSE</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>wgetch</EM> and its variants.
|
||||
|
||||
SVr3 (1987) added <EM>ungetch</EM>.
|
||||
|
||||
<EM>ncurses</EM> 1.9.9g (1996) furnished the <EM>has</EM><STRONG>_</STRONG><EM>key</EM> extension.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
ECMA-6 "7-bit coded Character Set" <https://ecma-international.org/
|
||||
publications-and-standards/standards/ecma-6/>
|
||||
|
||||
ECMA-48 "Control Functions for Coded Character Sets" <https://
|
||||
ecma-international.org/publications-and-standards/standards/ecma-48/>
|
||||
|
||||
<STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
in its wide-character configuration (<EM>ncursesw</EM>).
|
||||
|
||||
@@ -416,15 +461,7 @@
|
||||
<STRONG><A HREF="curs_move.3x.html">curs_move(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>, <STRONG>ascii(7)</STRONG>
|
||||
|
||||
ECMA-6 "7-bit coded Character Set" <https://ecma-international.org/
|
||||
publications-and-standards/standards/ecma-6/>
|
||||
|
||||
ECMA-48 "Control Functions for Coded Character Sets" <https://
|
||||
ecma-international.org/publications-and-standards/standards/ecma-48/>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-11-11 <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -435,7 +472,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF=
|
||||
<li><a href="#h3-Reading-Characters">Reading Characters</a></li>
|
||||
<li><a href="#h3-Keypad-Mode">Keypad Mode</a></li>
|
||||
<li><a href="#h3-Ungetting-Characters">Ungetting Characters</a></li>
|
||||
<li><a href="#h3-Predefined-Key-Codes">Predefined Key Codes</a></li>
|
||||
<li><a href="#h3-Key-Codes">Key Codes</a></li>
|
||||
<li><a href="#h3-Testing-Key-Codes">Testing Key Codes</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -443,6 +480,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF=
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+160
-130
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2010,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,222 +27,250 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_getstr.3x,v 1.58 2024/04/20 19:18:18 tom Exp @
|
||||
* @Id: curs_getstr.3x,v 1.94 2025/10/21 00:09:04 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_getstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_getstr 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_getstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_getstr 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>getstr</STRONG>, <STRONG>getnstr</STRONG>, <STRONG>wgetstr</STRONG>, <STRONG>wgetnstr</STRONG>, <STRONG>mvgetstr</STRONG>, <STRONG>mvgetnstr</STRONG>, <STRONG>mvwgetstr</STRONG>,
|
||||
<STRONG>mvwgetnstr</STRONG> - accept character strings from <EM>curses</EM> terminal keyboard
|
||||
<STRONG>mvwgetnstr</STRONG> - read a character string from <EM>curses</EM> terminal keyboard
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>getstr(char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>getnstr(char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>getstr(char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvgetstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>mvgetstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvgetnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>getnstr(char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>wgetnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvgetnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwgetnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The function <STRONG>wgetnstr</STRONG> is equivalent to a series of calls to <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG>,
|
||||
until a newline or carriage return terminates the series:
|
||||
<STRONG>wgetstr</STRONG> populates a user-supplied string buffer <EM>str</EM> by repeatedly
|
||||
calling <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> with the <EM>win</EM> argument until a line feed or carriage
|
||||
return character is input. The function
|
||||
|
||||
<STRONG>o</STRONG> The terminating character is not included in the returned string.
|
||||
<STRONG>o</STRONG> does not copy the terminating character to <EM>str</EM>;
|
||||
|
||||
<STRONG>o</STRONG> In all instances, the end of the string is terminated by a NUL.
|
||||
<STRONG>o</STRONG> always terminates <EM>str</EM> with a null character;
|
||||
|
||||
<STRONG>o</STRONG> The function stores the result in the area pointed to by the <EM>str</EM>
|
||||
parameter.
|
||||
<STRONG>o</STRONG> interprets the screen's erase and kill characters (see
|
||||
<STRONG><A HREF="curs_termattrs.3x.html">erasechar(3x)</A></STRONG> and <STRONG><A HREF="curs_termattrs.3x.html">killchar(3x)</A></STRONG>);
|
||||
|
||||
<STRONG>o</STRONG> The function reads at most <EM>n</EM> characters, thus preventing a possible
|
||||
overflow of the input buffer.
|
||||
<STRONG>o</STRONG> recognizes function keys only if the screen's keypad option is
|
||||
enabled (see <STRONG><A HREF="curs_inopts.3x.html">keypad(3x)</A></STRONG>);
|
||||
|
||||
Any attempt to enter more characters (other than the terminating
|
||||
newline or carriage return) causes a beep.
|
||||
<STRONG>o</STRONG> treats the function keys <STRONG>KEY_LEFT</STRONG> and <STRONG>KEY_BACKSPACE</STRONG> the same as the
|
||||
erase character; and
|
||||
|
||||
Function keys also cause a beep and are ignored.
|
||||
<STRONG>o</STRONG> discards function key inputs other than those treated as the erase
|
||||
or kill characters, calling <STRONG><A HREF="curs_beep.3x.html">beep(3x)</A></STRONG>.
|
||||
|
||||
The user's <EM>erase</EM> and <EM>kill</EM> characters are interpreted:
|
||||
If any characters have been written to the input buffer, the erase
|
||||
character replaces the character at the current position in the buffer
|
||||
with a null character, then decrements the position by one; the kill
|
||||
character does the same repeatedly, backtracking to the beginning of
|
||||
the buffer.
|
||||
|
||||
<STRONG>o</STRONG> The <EM>erase</EM> character (e.g., <STRONG>^H</STRONG>) erases the character at the end of
|
||||
the buffer, moving the cursor to the left.
|
||||
If the screen's echo option is enabled (see <STRONG><A HREF="curs_inopts.3x.html">echo(3x)</A></STRONG>), <STRONG>wgetstr</STRONG> updates
|
||||
<EM>win</EM> with <STRONG><A HREF="curs_addch.3x.html">waddch(3x)</A></STRONG>. Further,
|
||||
|
||||
If <EM>keypad</EM> mode is on for the window, <STRONG>KEY_LEFT</STRONG> and <STRONG>KEY_BACKSPACE</STRONG> are
|
||||
both considered equivalent to the user's <EM>erase</EM> character.
|
||||
<STRONG>o</STRONG> the erase character and its function key synonyms move the cursor
|
||||
to the left (if not already where it was located when <STRONG>wgetstr</STRONG> was
|
||||
called) and
|
||||
|
||||
<STRONG>o</STRONG> The <EM>kill</EM> character (e.g., <STRONG>^U</STRONG>) erases the entire buffer, leaving the
|
||||
cursor at the beginning of the buffer.
|
||||
<STRONG>o</STRONG> the kill character returns the cursor to where it was located when
|
||||
<STRONG>wgetstr</STRONG> was called.
|
||||
|
||||
Characters input are echoed only if <STRONG>echo</STRONG> is currently on. In that
|
||||
case, backspace is echoed as deletion of the previous character
|
||||
(typically a left motion).
|
||||
<STRONG>wgetnstr</STRONG> is similar, but reads at most <EM>n</EM> characters, aiding the
|
||||
application to avoid overrunning the buffer to which <EM>str</EM> points.
|
||||
<EM>curses</EM> ignores an attempt to input more than <EM>n</EM> characters (other than
|
||||
the terminating line feed or carriage return), calling <STRONG><A HREF="curs_beep.3x.html">beep(3x)</A></STRONG>. If <EM>n</EM>
|
||||
is negative, <STRONG>wgetn_wstr</STRONG> reads up to <EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM> characters (see
|
||||
<STRONG>sysconf(3)</STRONG>).
|
||||
|
||||
The <STRONG>getnstr</STRONG>, <STRONG>mvgetnstr</STRONG>, <STRONG>mvwgetnstr</STRONG>, and <STRONG>wgetnstr</STRONG> functions are
|
||||
identical to the <STRONG>getstr</STRONG>, <STRONG>mvgetstr</STRONG>, <STRONG>mvwgetstr</STRONG>, and <STRONG>wgetstr</STRONG> functions,
|
||||
respectively, except that the <STRONG>*n*</STRONG> versions read at most <EM>n</EM> characters,
|
||||
letting the application prevent overflow of the input buffer.
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All of these functions return the integer <STRONG>OK</STRONG> upon successful
|
||||
completion. (SVr4 specifies only "an integer value other than <STRONG>ERR</STRONG>") If
|
||||
unsuccessful, they return <STRONG>ERR</STRONG>.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open defines no error conditions.
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
In this implementation, these functions return an error
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the window pointer is null,
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer,
|
||||
|
||||
<STRONG>o</STRONG> if its timeout expires without having any data, or
|
||||
<STRONG>o</STRONG> <EM>str</EM> is a null pointer, or
|
||||
|
||||
<STRONG>o</STRONG> if the associated call to <STRONG>wgetch</STRONG> failed.
|
||||
<STRONG>o</STRONG> an internal <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> call fails.
|
||||
|
||||
This implementation provides an extension as well. If a <STRONG>SIGWINCH</STRONG>
|
||||
interrupts the function, it will return <STRONG>KEY_RESIZE</STRONG> rather than <STRONG>OK</STRONG> or
|
||||
<STRONG>ERR</STRONG>.
|
||||
Further, in <EM>ncurses</EM>, these functions return <STRONG>KEY_RESIZE</STRONG> if a <EM>SIGWINCH</EM>
|
||||
event interrupts the function.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Any of these functions other than <STRONG>wgetnstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>wgetnstr</STRONG> may be implemented as macros.
|
||||
|
||||
Using <STRONG>getstr</STRONG>, <STRONG>mvgetstr</STRONG>, <STRONG>mvwgetstr</STRONG>, or <STRONG>wgetstr</STRONG> to read a line that
|
||||
overflows the array pointed to by <STRONG>str</STRONG> causes undefined results. The
|
||||
use of <STRONG>getnstr</STRONG>, <STRONG>mvgetnstr</STRONG>, <STRONG>mvwgetnstr</STRONG>, or <STRONG>wgetnstr</STRONG>, respectively, is
|
||||
recommended.
|
||||
Reading input that overruns the buffer pointed to by <EM>str</EM> causes
|
||||
undefined results. Use the <STRONG>n</STRONG>-infixed functions, and allocate
|
||||
sufficient storage for <EM>str</EM> -- at least <EM>n</EM>+1 times <STRONG>sizeof(char)</STRONG>.
|
||||
|
||||
While these functions conceptually implement a series of calls to
|
||||
<STRONG>wgetch</STRONG>, they also temporarily change properties of the <EM>curses</EM> screen to
|
||||
permit simple editing of the input buffer. Each function saves the
|
||||
screen's state, calls <STRONG><A HREF="curs_inopts.3x.html">nl(3x)</A></STRONG>, and, if the screen was in canonical
|
||||
("cooked") mode, <STRONG><A HREF="curs_inopts.3x.html">cbreak(3x)</A></STRONG>. Before returning, it restores the saved
|
||||
screen state. Other implementations differ in detail, affecting which
|
||||
control characters they can accept in the buffer; see section
|
||||
"PORTABILITY" below.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
<STRONG>getnstr</STRONG>, <STRONG>wgetnstr</STRONG>, <STRONG>mvgetnstr</STRONG>, and <STRONG>mvwgetnstr</STRONG>'s handing of negative <EM>n</EM>
|
||||
values is an <EM>ncurses</EM> extension.
|
||||
|
||||
The return value <STRONG>KEY_RESIZE</STRONG> is an <EM>ncurses</EM> extension.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in The Single Unix Specification, Version
|
||||
2. No error conditions are defined.
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
This implementation returns <STRONG>ERR</STRONG> if the window pointer is null, or if
|
||||
the lower-level <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> call returns an <STRONG>ERR</STRONG>.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them, but indicates that <EM>wgetnstr</EM> and its variants read
|
||||
"the entire multi-byte sequence associated with a character" and "fail"
|
||||
if <EM>n</EM> and <EM>str</EM> together do not describe a buffer "large enough to contain
|
||||
any complete characters". In <EM>ncurses</EM>, however, <EM>wgetch</EM> reads only
|
||||
single-byte characters, so this scenario does not arise.
|
||||
|
||||
SVr3 and early SVr4 curses implementations did not reject function
|
||||
keys; the SVr4.0 documentation claimed that "special keys" (such as
|
||||
function keys, "home" key, "clear" key, <EM>etc</EM>.) are "interpreted",
|
||||
without giving details. It lied. In fact, the "character" value
|
||||
appended to the string by those implementations was predictable but not
|
||||
useful (being, in fact, the low-order eight bits of the key's KEY_
|
||||
value).
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
The functions <STRONG>getnstr</STRONG>, <STRONG>mvgetnstr</STRONG>, and <STRONG>mvwgetnstr</STRONG> were present but not
|
||||
documented in SVr4.
|
||||
SVr3 and early SVr4 <EM>curses</EM> implementations did not reject function
|
||||
keys; the SVr4 documentation asserted that, like the screen's erase and
|
||||
kill characters, they were
|
||||
|
||||
X/Open Curses, Issue 5 (2007) stated that these functions "read at most
|
||||
<EM>n</EM> bytes" but did not state whether the terminating NUL is counted in
|
||||
that limit. X/Open Curses, Issue 7 (2009) changed that to say they
|
||||
"read at most <EM>n</EM>-1 bytes" to allow for the terminating NUL. As of 2018,
|
||||
some implementations count it, some do not:
|
||||
interpreted, as well as any special keys (such as function keys,
|
||||
"home" key, "clear" key, <EM>etc.</EM>)
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> 6.1 and PDCurses do not count the NUL in the given limit,
|
||||
while
|
||||
without further detail. It lied. The "character" value appended to
|
||||
the string by those implementations was predictable but not useful --
|
||||
being, in fact, the low-order eight bits of the key code's <EM>KEY</EM><STRONG>_</STRONG>
|
||||
constant value. (The same language, unchanged except for styling,
|
||||
survived into X/Open Curses Issue 4, Version 2 but disappeared from
|
||||
Issue 7.)
|
||||
|
||||
<STRONG>o</STRONG> Solaris SVr4 and NetBSD curses count the NUL as part of the limit.
|
||||
A draft of X/Open Curses Issue 5 (which never saw final release) stated
|
||||
that these functions "read at most <EM>n</EM> bytes" but did not state whether
|
||||
the terminating null character counted toward that limit. X/Open
|
||||
Curses Issue 7 changed that to say they "read at most <EM>n</EM>-1 bytes" to
|
||||
allow for the terminating null character. As of 2018, some
|
||||
implementations count it, some do not.
|
||||
|
||||
<STRONG>o</STRONG> Solaris xcurses provides both: its wide-character <STRONG>wget_nstr</STRONG>
|
||||
reserves a NUL, but its <STRONG>wgetnstr</STRONG> does not count the NUL
|
||||
consistently.
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> 6.1 and <EM>PDCurses</EM> do not count the null character toward the
|
||||
limit, while Solaris and NetBSD <EM>curses</EM> do.
|
||||
|
||||
In SVr4 curses, a negative value of <EM>n</EM> tells <STRONG>wgetnstr</STRONG> to assume that the
|
||||
caller's buffer is large enough to hold the result, i.e., to act like
|
||||
<STRONG>wgetstr</STRONG>. X/Open Curses does not mention this (or anything related to
|
||||
negative or zero values of <EM>n</EM>), however most implementations use the
|
||||
feature, with different limits:
|
||||
<STRONG>o</STRONG> Solaris <EM>xcurses</EM> offers both behaviors: its wide-character
|
||||
<EM>wgetn</EM><STRONG>_</STRONG><EM>wstr</EM> reserves room for a wide null character, but its non-
|
||||
wide <EM>wgetnstr</EM> does not consistently count a null character toward
|
||||
the limit.
|
||||
|
||||
<STRONG>o</STRONG> Solaris SVr4 curses and PDCurses limit the result to 255 bytes.
|
||||
Other Unix systems than Solaris are likely to use the same limit.
|
||||
X/Open Curses does not specify what happens if the length <EM>n</EM> is
|
||||
negative.
|
||||
|
||||
<STRONG>o</STRONG> Solaris xcurses limits the result to <STRONG>LINE_MAX</STRONG> bytes.
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> 6.2 uses <EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM> or a larger (system-dependent) value
|
||||
provided by <STRONG>sysconf(3)</STRONG>. If neither <EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM> nor <EM>sysconf</EM> is
|
||||
available, <EM>ncurses</EM> uses the POSIX minimum value for <EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM>
|
||||
(2048). In either case, it reserves a byte for the terminating
|
||||
null character.
|
||||
|
||||
<STRONG>o</STRONG> NetBSD 7 assumes no particular limit for the result from <STRONG>wgetstr</STRONG>.
|
||||
However, it limits the <STRONG>wgetnstr</STRONG> parameter <EM>n</EM> to ensure that it is
|
||||
greater than zero.
|
||||
<STRONG>o</STRONG> In SVr4 <EM>curses</EM>, a negative <EM>n</EM> tells <EM>wgetnstr</EM> to assume that the
|
||||
caller's buffer is large enough to hold the result; that is, the
|
||||
function then acts like <EM>wgetstr</EM>. X/Open Curses does not mention
|
||||
this behavior (or anything related to nonpositive <EM>n</EM> values),
|
||||
however most <EM>curses</EM> libraries implement it. Most implementations
|
||||
nevertheless enforce an upper limit on the count of bytes they
|
||||
write to the destination buffer <EM>str</EM>.
|
||||
|
||||
A comment in NetBSD's source code states that this is specified in
|
||||
SUSv2.
|
||||
<STRONG>o</STRONG> BSD <EM>curses</EM> lacked <EM>wgetnstr</EM>, and its <EM>wgetstr</EM> wrote to <EM>str</EM>
|
||||
unboundedly, as did that in SVr2.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> (before 6.2) assumes no particular limit for the result
|
||||
from <STRONG>wgetstr</STRONG>, and treats the <EM>n</EM> parameter of <STRONG>wgetnstr</STRONG> like SVr4
|
||||
curses.
|
||||
<STRONG>o</STRONG> <EM>PDCurses</EM>, and SVr3 and later, and Solaris <EM>curses</EM> limit both
|
||||
functions to writing 256 bytes. Other System V-based platforms
|
||||
likely use the same limit.
|
||||
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> 6.2 uses <STRONG>LINE_MAX</STRONG>, or a larger (system-dependent) value
|
||||
which the <STRONG>sysconf</STRONG> function may provide. If neither <STRONG>LINE_MAX</STRONG> or
|
||||
<STRONG>sysconf</STRONG> is available, <EM>ncurses</EM> uses the POSIX value for <STRONG>LINE_MAX</STRONG> (a
|
||||
2048 byte limit). In either case, it reserves a byte for the
|
||||
terminating NUL.
|
||||
<STRONG>o</STRONG> Solaris <EM>xcurses</EM> limits the write to <EM>LINE</EM><STRONG>_</STRONG><EM>MAX</EM> bytes (see
|
||||
<STRONG>sysconf(3)</STRONG>).
|
||||
|
||||
Although <STRONG>getnstr</STRONG> is equivalent to a series of calls to <STRONG>getch</STRONG>, it also
|
||||
makes changes to the curses modes to allow simple editing of the input
|
||||
buffer:
|
||||
<STRONG>o</STRONG> NetBSD 7 <EM>curses</EM> imposes no particular limit on the length of the
|
||||
write, but does validate <EM>n</EM> to ensure that it is greater than zero.
|
||||
A comment in NetBSD's source code asserts that SUSv2 specifies
|
||||
this.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>getnstr</STRONG> saves the current value of the <STRONG>nl</STRONG>, <STRONG>echo</STRONG>, <STRONG>raw</STRONG> and <STRONG>cbreak</STRONG>
|
||||
modes, and sets <STRONG>nl</STRONG>, <STRONG>noecho</STRONG>, <STRONG>noraw</STRONG>, and <STRONG>cbreak</STRONG>.
|
||||
Implementations vary in their handling of input control characters.
|
||||
|
||||
<STRONG>getnstr</STRONG> handles the echoing of characters, rather than relying on
|
||||
the caller to set an appropriate mode.
|
||||
<STRONG>o</STRONG> While they may enable the screen's echo option, some do not take it
|
||||
out of raw mode, and may take cbreak mode into account when
|
||||
deciding whether to handle echoing within <EM>wgetnstr</EM> or to rely on it
|
||||
as a side effect of calling <EM>wgetch</EM>.
|
||||
|
||||
<STRONG>o</STRONG> It also obtains the <EM>erase</EM> and <EM>kill</EM> characters from <STRONG>erasechar</STRONG> and
|
||||
<STRONG>killchar</STRONG>, respectively.
|
||||
<STRONG>o</STRONG> Originally, <EM>ncurses</EM>, like its progenitor <EM>pcurses</EM>, had its <EM>wgetnstr</EM>
|
||||
call <EM>noraw</EM> and <EM>cbreak</EM> before accepting input. That may have been
|
||||
done to make function keys work; it is not necessary with modern
|
||||
<EM>ncurses</EM>.
|
||||
|
||||
<STRONG>o</STRONG> On return, <STRONG>getnstr</STRONG> restores the modes to their previous values.
|
||||
Since 1995, <EM>ncurses</EM> has provided handlers for <EM>SIGINTR</EM> and <EM>SIGQUIT</EM>
|
||||
events, which are typically generated at the keyboard with <STRONG>^C</STRONG> and
|
||||
<STRONG>^\</STRONG> respectively. In cbreak mode, those handlers catch a signal and
|
||||
stop the program, whereas other implementations write those
|
||||
characters into the buffer.
|
||||
|
||||
Other implementations differ in their treatment of special characters:
|
||||
<STRONG>o</STRONG> Starting with <EM>ncurses</EM> 6.3 (2021), <EM>wgetnstr</EM> preserves raw mode if
|
||||
the screen was already in that state, allowing one to enter the
|
||||
characters the terminal interprets as interrupt and quit events
|
||||
into the buffer, for better compatibility with SVr4 <EM>curses</EM>.
|
||||
|
||||
<STRONG>o</STRONG> While they may set the <EM>echo</EM> mode, other implementations do not
|
||||
modify the <EM>raw</EM> mode, They may take the <EM>cbreak</EM> mode set by the
|
||||
caller into account when deciding whether to handle echoing within
|
||||
<STRONG>getnstr</STRONG> or as a side-effect of the <STRONG>getch</STRONG> calls.
|
||||
|
||||
<STRONG>o</STRONG> The original <EM>ncurses</EM> (as <EM>pcurses</EM> in 1986) set <STRONG>noraw</STRONG> and <STRONG>cbreak</STRONG> when
|
||||
accepting input for <STRONG>getnstr</STRONG>. That may have been done to make
|
||||
function- and cursor-keys work; it is not necessary with <EM>ncurses</EM>.
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>wgetstr</EM> along with its variants.
|
||||
|
||||
Since 1995, <EM>ncurses</EM> has provided signal handlers for INTR and QUIT
|
||||
(e.g., <STRONG>^C</STRONG> or <STRONG>^\</STRONG>). With the <STRONG>noraw</STRONG> and <STRONG>cbreak</STRONG> settings, those may
|
||||
catch a signal and stop the program, where other implementations
|
||||
allow one to enter those characters in the buffer.
|
||||
SVr3.1 (1987) added <EM>wgetnstr</EM>, but none of its variants.
|
||||
|
||||
<STRONG>o</STRONG> Starting in 2021 (<EM>ncurses</EM> 6.3), <STRONG>getnstr</STRONG> sets <STRONG>raw</STRONG>, rather than <STRONG>noraw</STRONG>
|
||||
and <STRONG>cbreak</STRONG> for better compatibility with SVr4-curses, e.g.,
|
||||
allowing one to enter a <STRONG>^C</STRONG> into the buffer.
|
||||
X/Open Curses Issue 4 (1995) specified <EM>getnstr</EM>, <EM>mvgetnstr</EM>, and
|
||||
<EM>mvwgetnstr</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_get_wstr.3x.html">curs_get_wstr(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
in its wide-character configuration (<EM>ncursesw</EM>).
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_termattrs.3x.html">curs_termattrs(3x)</A></STRONG>,
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -251,7 +279,9 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2020-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2020-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2007,2010 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_getyx.3x,v 1.44 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_getyx.3x,v 1.55 2025/02/01 22:48:11 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_getyx 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_getyx 3x 2025-02-01 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_getyx 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_getyx 3x 2025-02-01 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>getyx</STRONG>, <STRONG>getparyx</STRONG>, <STRONG>getbegyx</STRONG>, <STRONG>getmaxyx</STRONG> - get <EM>curses</EM> cursor and window
|
||||
coordinates
|
||||
@@ -55,61 +53,66 @@
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>void</STRONG> <STRONG>getyx(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>getparyx(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>getbegyx(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>getmaxyx(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>void</STRONG> <STRONG>getparyx(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
The <STRONG>getyx</STRONG> macro places the current cursor position of the given window
|
||||
in the two integer variables <EM>y</EM> and <EM>x</EM>.
|
||||
These macros obtain the cursor position and bounds information of a
|
||||
<EM>curses</EM> window <EM>win</EM>. <STRONG>getyx</STRONG> stores <EM>win</EM>'s cursor position in the variables
|
||||
<EM>y</EM> and <EM>x</EM>. <STRONG>getmaxyx</STRONG> stores <EM>win</EM>'s maximum valid line and column numbers
|
||||
in <EM>y</EM> and <EM>x</EM>, respectively. <STRONG>getbegyx</STRONG> similarly stores the position of
|
||||
<EM>win</EM>'s origin relative to that of the screen (for <STRONG>stdscr</STRONG>, these
|
||||
coordinates are always <STRONG>0</STRONG>).
|
||||
|
||||
If <EM>win</EM> is a subwindow, the <STRONG>getparyx</STRONG> macro places the beginning
|
||||
coordinates of the subwindow relative to the parent window into two
|
||||
integer variables <EM>y</EM> and <EM>x</EM>. Otherwise, <STRONG>-1</STRONG> is placed into <EM>y</EM> and <EM>x</EM>.
|
||||
|
||||
Like <STRONG>getyx</STRONG>, the <STRONG>getbegyx</STRONG> and <STRONG>getmaxyx</STRONG> macros store the current
|
||||
beginning coordinates and size of the specified window.
|
||||
If <EM>win</EM> is a subwindow (see <STRONG><A HREF="subwin.3x.html">subwin(3x)</A></STRONG>), the <STRONG>getparyx</STRONG> macro places the
|
||||
coordinates of its origin relative to its parent window into <EM>y</EM> and <EM>x</EM>,
|
||||
and <STRONG>-1</STRONG> into both if it is not.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
The return values of these macros are undefined (i.e., they should not
|
||||
be used as the right-hand side of assignment statements).
|
||||
No return values are defined for macros. Do not use them as the right-
|
||||
hand side of assignment statements.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
All of these interfaces are macros. A "&" is not necessary before the
|
||||
variables <EM>y</EM> and <EM>x</EM>.
|
||||
All of these interfaces are implemented as macros. An "&" operator is
|
||||
not necessary before the variables <EM>y</EM> and <EM>x</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
The <STRONG>getyx</STRONG>, <STRONG>getparyx</STRONG>, <STRONG>getbegyx</STRONG> and <STRONG>getmaxyx</STRONG> macros are described in
|
||||
X/Open Curses, Issue 4.
|
||||
These macros are described in X/Open Curses Issue 4.
|
||||
|
||||
This implementation also provides functions <STRONG>getbegx</STRONG>, <STRONG>getbegy</STRONG>, <STRONG>getcurx</STRONG>,
|
||||
<STRONG>getcury</STRONG>, <STRONG>getmaxx</STRONG>, <STRONG>getmaxy</STRONG>, <STRONG>getparx</STRONG> and <STRONG>getpary</STRONG> for compatibility with
|
||||
older versions of <EM>curses</EM>; see <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>.
|
||||
<EM>ncurses</EM> also provides functions <EM>getbegy</EM>, <EM>getbegx</EM>, <EM>getcury</EM>, <EM>getcurx</EM>,
|
||||
<EM>getmaxy</EM>, <EM>getmaxx</EM>, <EM>getpary</EM>, and <EM>getparx</EM> for compatibility with System V
|
||||
<EM>curses</EM> that were not standardized; see <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>.
|
||||
|
||||
Although X/Open Curses does not address this, many implementations
|
||||
provide members of the <STRONG>WINDOW</STRONG> structure containing values corresponding
|
||||
to these macros. For best portability, do not rely on using the data
|
||||
in <STRONG>WINDOW</STRONG>, since some implementations make <STRONG>WINDOW</STRONG> opaque (do not allow
|
||||
direct use of its members).
|
||||
Although X/Open Curses does not address the issue, many implementations
|
||||
expose members of the <EM>WINDOW</EM> structure containing values corresponding
|
||||
to these macros. Do not rely on their availability; some
|
||||
implementations make <EM>WINDOW</EM> opaque (that is, they do not allow direct
|
||||
access to its members).
|
||||
|
||||
Besides the problem of opaque structures, the data stored in like-named
|
||||
members may not have like-values in different implementations. For
|
||||
example, the <STRONG>WINDOW._maxx</STRONG> and <STRONG>WINDOW._maxy</STRONG> values in <EM>ncurses</EM> have (at
|
||||
least since release 1.8.1) differed by one from some other
|
||||
implementations. The difference is hidden by means of the macro
|
||||
<STRONG>getmaxyx</STRONG>.
|
||||
members may not have values of the same meaning across different
|
||||
implementations. For example, the values of <EM>WINDOW.</EM><STRONG>_</STRONG><EM>maxx</EM> and
|
||||
<EM>WINDOW.</EM><STRONG>_</STRONG><EM>maxy</EM> in <EM>ncurses</EM> have long differed by one from some other
|
||||
implementations. The <EM>getmaxyx</EM> macro hides this difference.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>getyx</EM>.
|
||||
|
||||
SVr3 (1987) added <EM>getbegyx</EM> and <EM>getmaxyx</EM>. SVr3.1 later that year
|
||||
supplied <EM>getparyx</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>, <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-02-01 <STRONG><A HREF="curs_getyx.3x.html">curs_getyx(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -119,6 +122,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF=
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2010,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,73 +27,82 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_in_wch.3x,v 1.31 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_in_wch.3x,v 1.44 2025/02/01 22:54:32 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_in_wch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_in_wch 3x 2025-02-01 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_in_wch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_in_wch 3x 2025-02-01 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>in_wch</STRONG>, <STRONG>mvin_wch</STRONG>, <STRONG>mvwin_wch</STRONG>, <STRONG>win_wch</STRONG> - get a <EM>curses</EM> complex character
|
||||
<STRONG>in_wch</STRONG>, <STRONG>win_wch</STRONG>, <STRONG>mvin_wch</STRONG>, <STRONG>mvwin_wch</STRONG> - get a <EM>curses</EM> complex character
|
||||
from a window
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>in_wch(cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>win_wch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>mvin_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwin_wch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>in_wch(cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>win_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvin_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwin_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These functions extract the complex character and rendition from the
|
||||
current position in the named window into the <STRONG>cchar_t</STRONG> object referenced
|
||||
by wch.
|
||||
<STRONG>win_wch</STRONG> copies the <EM>curses</EM> complex character at the cursor position in
|
||||
<EM>win</EM> into <EM>wch</EM>. Use <STRONG><A HREF="curs_getcchar.3x.html">getcchar(3x)</A></STRONG> to extract its character code,
|
||||
attributes, and color pair identifier. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the
|
||||
variants of this function.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
No errors are defined in X/Open Curses. This implementation checks for
|
||||
null pointers, returns <STRONG>ERR</STRONG> in that case. Also, the <EM>mv</EM> routines check
|
||||
for error moving the cursor, returning <STRONG>ERR</STRONG> in that case. Otherwise
|
||||
they return <STRONG>OK</STRONG>.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
In <EM>ncurses</EM>, they return <STRONG>ERR</STRONG> if <EM>win</EM> is <EM>NULL</EM>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Note that all of these routines may be macros.
|
||||
<STRONG>in_wch</STRONG>, <STRONG>mvin_wch</STRONG>, and <STRONG>mvwin_wch</STRONG> may be implemented as macros.
|
||||
|
||||
Unlike <STRONG><A HREF="curs_inch.3x.html">winch(3x)</A></STRONG>, <STRONG>win_wch</STRONG> and its variants store the value of the
|
||||
retrieved character in an additional <EM>wch</EM> parameter instead of the
|
||||
return value.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition Version 4 of the same year specified a
|
||||
function named <EM>winwch</EM> (and the usual variants). This was a later
|
||||
addition to SVr4.<EM>x</EM>, not appearing in the first SVr4 (1989). It
|
||||
differed from X/Open's later <EM>win</EM><STRONG>_</STRONG><EM>wch</EM> in that it returned a value of
|
||||
type <EM>chtype</EM> instead of <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library in
|
||||
<STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library in
|
||||
its non-wide-character configuration.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_inwstr.3x.html">curs_inwstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-02-01 <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -103,6 +112,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 2002-2012,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_in_wchstr.3x,v 1.39 2024/04/20 21:24:19 tom Exp @
|
||||
* @Id: curs_in_wchstr.3x,v 1.56 2025/10/21 00:03:06 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_in_wchstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_in_wchstr 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_in_wchstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_in_wchstr 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_in_wchstr.3x.html">curs_in_wchstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_in_wchstr.3x.html">curs_in_wchstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>in_wchstr</STRONG>, <STRONG>in_wchnstr</STRONG>, <STRONG>win_wchstr</STRONG>, <STRONG>win_wchnstr</STRONG>, <STRONG>mvin_wchstr</STRONG>,
|
||||
<STRONG>mvin_wchnstr</STRONG>, <STRONG>mvwin_wchstr</STRONG>, <STRONG>mvwin_wchnstr</STRONG> - get a <EM>curses</EM> complex
|
||||
@@ -55,70 +53,73 @@
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>in_wchstr(cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>win_wchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvin_wchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwin_wchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>in_wchstr(cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>win_wchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvin_wchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwin_wchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>in_wchnstr(cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>win_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvin_wchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwin_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>in_wchnstr(cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>win_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvin_wchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwin_wchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wchstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>)</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These functions return an array of complex characters in <EM>wchstr</EM>,
|
||||
starting at the current cursor position in the named window.
|
||||
Attributes (rendition) are stored with the characters.
|
||||
|
||||
The four functions with <EM>n</EM> as the last argument return a leading
|
||||
substring at most <EM>n</EM> characters long (exclusive of the trailing zeroed
|
||||
<STRONG>cchar_t</STRONG>. Transfer stops at the end of the current line, or when <EM>n</EM>
|
||||
characters have been stored at the location referenced by <EM>wchstr</EM>.
|
||||
|
||||
Constants defined in <STRONG><curses.h></STRONG> can be used with the <STRONG>&</STRONG> (logical AND)
|
||||
operator to extract the character or the attribute alone from any
|
||||
position in the <EM>wchstr</EM> [see <STRONG><A HREF="curs_getcchar.3x.html">getcchar(3x)</A></STRONG>].
|
||||
<STRONG>win_wchstr</STRONG> extracts a <EM>curses</EM> complex character string from a <EM>curses</EM>
|
||||
window <EM>win</EM>, starting at the cursor and stopping at the end of the line,
|
||||
and stores it in <EM>wchstr</EM>, terminating it with a wide null <EM>curses</EM>
|
||||
character. <STRONG>win_wchnstr</STRONG> does the same, but copies at most <EM>n</EM> <EM>curses</EM>
|
||||
complex characters from <EM>win</EM>. A negative <EM>n</EM> implies no limit;
|
||||
<STRONG>win_wchnstr</STRONG> then works like <STRONG>win_wchstr</STRONG>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the
|
||||
variants of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
Upon successful completion, these functions return <STRONG>OK</STRONG>. Otherwise, they
|
||||
return <STRONG>ERR</STRONG>.
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses defines no error conditions. This implementation returns
|
||||
an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>win</EM> parameter is null or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>wchstr</EM> parameter is null.
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer, or
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
<STRONG>o</STRONG> <EM>wchstr</EM> is a null pointer.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
All routines except <STRONG>win_wchnstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>win_wchnstr</STRONG> may be implemented as macros.
|
||||
|
||||
Reading a line that overflows the array pointed to by <EM>wchstr</EM> with
|
||||
<STRONG>in_wchstr</STRONG>, <STRONG>mvin_wchstr</STRONG>, <STRONG>mvwin_wchstr</STRONG> or <STRONG>win_wchstr</STRONG> causes undefined
|
||||
results. Therefore, the use of <STRONG>in_wchnstr</STRONG>, <STRONG>mvin_wchnstr</STRONG>,
|
||||
<STRONG>mvwin_wchnstr</STRONG>, or <STRONG>win_wchnstr</STRONG> is recommended.
|
||||
Reading a line that overflows the array pointed to by <EM>wchstr</EM> and its
|
||||
variants causes undefined results. Instead, use the <EM>n</EM>-infixed
|
||||
functions with a positive <EM>n</EM> argument no larger than the size of the
|
||||
buffer backing <EM>wchstr</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
X/Open Curses defines no error conditions. This implementation checks
|
||||
for null pointers, returning <STRONG>ERR</STRONG> in that case.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
X/Open Curses Issue 4 (1995) initially specified these functions. The
|
||||
System V Interface Definition Version 4 of the same year specified a
|
||||
function named <EM>winwchstr</EM> (and the usual variants). This was a later
|
||||
addition to SVr4.<EM>x</EM>, not appearing in the first SVr4 (1989). It
|
||||
differed from X/Open's later <EM>win</EM><STRONG>_</STRONG><EM>wchstr</EM> in that it took an argument of
|
||||
type pointer-to-<EM>chtype</EM> instead of pointer-to-<EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
in its non-wide-character configuration.
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_inwstr.3x.html">curs_inwstr(3x)</A></STRONG>, <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_in_wchstr.3x.html">curs_in_wchstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_in_wchstr.3x.html">curs_in_wchstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -128,6 +129,7 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="cur
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2010,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,25 +28,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_inch.3x,v 1.51 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_inch.3x,v 1.70 2025/02/15 19:36:03 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_inch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_inch 3x 2025-02-15 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_inch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_inch 3x 2025-02-15 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>inch</STRONG>, <STRONG>winch</STRONG>, <STRONG>mvinch</STRONG>, <STRONG>mvwinch</STRONG> - get a <EM>curses</EM> character from a window
|
||||
|
||||
@@ -55,92 +53,78 @@
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>chtype</STRONG> <STRONG>inch(void);</STRONG>
|
||||
<STRONG>chtype</STRONG> <STRONG>winch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>chtype</STRONG> <STRONG>winch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>);</STRONG>
|
||||
<STRONG>chtype</STRONG> <STRONG>mvinch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>chtype</STRONG> <STRONG>mvwinch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
<STRONG>chtype</STRONG> <STRONG>mvwinch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These routines return the character, of type <STRONG>chtype</STRONG>, at the current
|
||||
position in the named window. If any attributes are set for that
|
||||
position, their values are OR'ed into the value returned. Constants
|
||||
defined in <STRONG><curses.h></STRONG> can be used with the <STRONG>&</STRONG> (logical AND) operator to
|
||||
extract the character or attributes alone.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Attributes">Attributes</a></H3><PRE>
|
||||
The following bit masks may be AND-ed with characters returned by
|
||||
<STRONG>winch</STRONG>.
|
||||
|
||||
<STRONG>Name</STRONG> <STRONG>Description</STRONG>
|
||||
------------------------------------------------------------------------
|
||||
<STRONG>A_CHARTEXT</STRONG> Extract character
|
||||
<STRONG>A_ATTRIBUTES</STRONG> Extract attributes
|
||||
<STRONG>A_COLOR</STRONG> Extract color pair information
|
||||
<STRONG>winch</STRONG> returns the <EM>curses</EM> character, including its attributes and color
|
||||
pair identifier, at the cursor position in the window <EM>win</EM>. Subsection
|
||||
"Video Attributes" of <STRONG><A HREF="curs_attr.3x.html">attron(3x)</A></STRONG> explains how to extract these data
|
||||
from a <EM>chtype</EM>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this function.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
In <EM>ncurses</EM>, they return <STRONG>ERR</STRONG> if <EM>win</EM> is <EM>NULL</EM>.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
The <STRONG>winch</STRONG> function does not return an error if the window contains
|
||||
characters larger than 8-bits (255). Only the low-order 8 bits of the
|
||||
character are used by <STRONG>winch</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
Note that all of these routines may be macros.
|
||||
<STRONG>inch</STRONG>, <STRONG>mvinch</STRONG>, and <STRONG>mvwinch</STRONG> may be implemented as macros.
|
||||
|
||||
These functions do not fail if the window contains cells of <EM>curses</EM>
|
||||
complex characters; that is, if they contain characters with codes
|
||||
wider than eight bits (or greater than 255 as an unsigned decimal
|
||||
integer). They instead extract only the low-order eight bits of the
|
||||
character code from the cell.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
Very old systems (before standardization) provide a different function
|
||||
with the same name:
|
||||
|
||||
<STRONG>o</STRONG> The <STRONG>winch</STRONG> function was part of the original BSD curses library,
|
||||
which stored a 7-bit character combined with the <EM>standout</EM>
|
||||
attribute.
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
The original <EM>curses</EM> in 4BSD (1980) defined <EM>winch</EM> as a macro accessing
|
||||
the <EM>WINDOW</EM> structure member representing character cell data, at that
|
||||
time a <EM>char</EM>, containing only a 7-bit ASCII character code and a
|
||||
"standout" attribute bit, the only one the library supported.
|
||||
|
||||
In BSD curses, <STRONG>winch</STRONG> returned only the character (as an integer)
|
||||
with the <EM>standout</EM> attribute removed.
|
||||
|
||||
<STRONG>o</STRONG> System V curses added support for several video attributes which
|
||||
could be combined with characters in the window.
|
||||
|
||||
Reflecting this improvement, the function was altered to return the
|
||||
character combined with all video attributes in a <STRONG>chtype</STRONG> value.
|
||||
|
||||
X/Open Curses does not specify the size and layout of attributes, color
|
||||
and character values in <STRONG>chtype</STRONG>; it is implementation-dependent. This
|
||||
implementation uses 8 bits for character values. An application using
|
||||
more bits, e.g., a Unicode value, should use the wide-character
|
||||
equivalents to these functions.
|
||||
SVr2 <EM>curses</EM> (1984) extended this approach, widening the character code
|
||||
to eight bits and permitting several attributes to be combined with it
|
||||
by storing them together in a <EM>chtype</EM>, an alias of <EM>unsigned</EM> <EM>short</EM>.
|
||||
Because a macro was used, its value was not type-checked as a function
|
||||
return value could have been. Goodheart documented SVr3 (1987) <EM>winch</EM>
|
||||
as returning an <EM>int</EM>. SVr3.1's (1987) <EM>chtype</EM> became an alias of
|
||||
<EM>unsigned</EM> <EM>long</EM>, using 16 bits for the character code and widening the
|
||||
type in practical terms to 32 bits, as 64-bit Unix systems were not yet
|
||||
in wide use, and fixed-width integral types would not be standard until
|
||||
ISO C99. SVr3.2 (1988) added a 6-bit color pair identifier alongside
|
||||
the attributes.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
<STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
|
||||
in its wide-character configuration (<EM>ncursesw</EM>).
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_instr.3x.html">curs_instr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-02-15 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
<li><a href="#h2-NAME">NAME</a></li>
|
||||
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
|
||||
<ul>
|
||||
<li><a href="#h3-Attributes">Attributes</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2010,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_inchstr.3x,v 1.45 2024/04/20 21:20:07 tom Exp @
|
||||
* @Id: curs_inchstr.3x,v 1.65 2025/10/21 00:05:02 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_inchstr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_inchstr 3x 2025-10-20 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_inchstr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_inchstr 3x 2025-10-20 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>inchstr</STRONG>, <STRONG>inchnstr</STRONG>, <STRONG>winchstr</STRONG>, <STRONG>winchnstr</STRONG>, <STRONG>mvinchstr</STRONG>, <STRONG>mvinchnstr</STRONG>,
|
||||
<STRONG>mvwinchstr</STRONG>, <STRONG>mvwinchnstr</STRONG> - get a <EM>curses</EM> character string from a window
|
||||
@@ -54,73 +52,85 @@
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>inchstr(chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>inchnstr(chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>inchstr(chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>inchnstr(chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>winchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>mvinchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvinchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwinchstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwinchnstr(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG><EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvinchstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvinchnstr(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwinchstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>mvwinchnstr(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <STRONG>*</STRONG> <EM>chstr</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
These routines return a NULL-terminated array of <STRONG>chtype</STRONG> quantities,
|
||||
starting at the current cursor position in the named window and ending
|
||||
at the right margin of the window.
|
||||
|
||||
The four functions with <EM>n</EM> as the last argument, return a leading
|
||||
substring at most <EM>n</EM> characters long (exclusive of the trailing
|
||||
(chtype)0). Transfer stops at the end of the current line, or when <EM>n</EM>
|
||||
characters have been stored at the location referenced by <EM>chstr</EM>.
|
||||
|
||||
Constants defined in <STRONG><curses.h></STRONG> can be used with the <STRONG>&</STRONG> (logical AND)
|
||||
operator to extract the character or the attribute alone from any
|
||||
position in the <EM>chstr</EM> [see <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>].
|
||||
<STRONG>winchstr</STRONG> extracts a <EM>curses</EM> character string from a <EM>curses</EM> window <EM>win</EM>,
|
||||
starting at the cursor and stopping at the end of the line, and stores
|
||||
it in <EM>chstr</EM>, terminating it with a null <EM>curses</EM> character. <STRONG>winchnstr</STRONG>
|
||||
does the same, but copies at most <EM>n</EM> <EM>curses</EM> characters from <EM>win</EM>. A
|
||||
negative <EM>n</EM> implies no limit; <STRONG>winchnstr</STRONG> then works like <STRONG>winchstr</STRONG>.
|
||||
<STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All routines return the integer <STRONG>ERR</STRONG> upon failure and an integer value
|
||||
other than <STRONG>ERR</STRONG> upon successful completion (the number of characters
|
||||
retrieved, exclusive of the trailing 0).
|
||||
These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
X/Open Curses defines no error conditions. This implementation returns
|
||||
an error
|
||||
In <EM>ncurses</EM>, these functions fail if
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>win</EM> parameter is null or
|
||||
<STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
|
||||
|
||||
<STRONG>o</STRONG> if the <EM>chstr</EM> parameter is null.
|
||||
<STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
|
||||
pointer, or
|
||||
|
||||
<STRONG>o</STRONG> <EM>chstr</EM> is a null pointer.
|
||||
|
||||
Functions prefixed with "mv" first perform cursor movement and fail if
|
||||
the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
All routines except <STRONG>winchnstr</STRONG> may be macros.
|
||||
All of these functions except <STRONG>winchnstr</STRONG> may be implemented as macros.
|
||||
|
||||
SVr4 does not document whether the result string is zero-terminated; it
|
||||
does not document whether a length limit argument includes any trailing
|
||||
0; and it does not document the meaning of the return value.
|
||||
Reading a line that overflows the array pointed to by <EM>chstr</EM> and its
|
||||
variants causes undefined results. Instead, use the <EM>n</EM>-infixed
|
||||
functions with a positive <EM>n</EM> argument no larger than the size of the
|
||||
buffer backing <EM>chstr</EM>.
|
||||
|
||||
Reading a line that overflows the array pointed to by <EM>chstr</EM> with
|
||||
<STRONG>inchstr</STRONG>, <STRONG>mvinchstr</STRONG>, <STRONG>mvwinchstr</STRONG> or <STRONG>winchstr</STRONG> causes undefined results.
|
||||
Therefore, the use of <STRONG>inchnstr</STRONG>, <STRONG>mvinchnstr</STRONG>, <STRONG>mvwinchnstr</STRONG>, or <STRONG>winchnstr</STRONG>
|
||||
is recommended.
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
<STRONG>inchnstr</STRONG>, <STRONG>winchnstr</STRONG>, <STRONG>mvinchnstr</STRONG>, and <STRONG>mvwinchnstr</STRONG>'s acceptance of
|
||||
negative <EM>n</EM> values is an <EM>ncurses</EM> extension.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions are described in X/Open Curses, Issue 4. It is no more
|
||||
specific than the SVr4 documentation on the trailing 0. It does
|
||||
specify that the successful return of the functions is <STRONG>OK</STRONG>.
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them. It characterizes the strings stored by these
|
||||
functions as containing "at most <EM>n</EM> elements" from a window, but does
|
||||
not specify whether the string stored by these functions is null-
|
||||
terminated.
|
||||
|
||||
SVr4 does not document whether it null-terminates the <EM>curses</EM> character
|
||||
string it stores in <EM>chstr</EM>, and does not document whether a trailing
|
||||
null <EM>curses</EM> character counts toward the length limit <EM>n</EM>.
|
||||
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
SVr3.1 (1987) introduced these functions.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>, <STRONG><A HREF="curs_inwstr.3x.html">curs_inwstr(3x)</A></STRONG>, <STRONG><A HREF="curs_in_wchstr.3x.html">curs_in_wchstr(3x)</A></STRONG>
|
||||
<STRONG><A HREF="curs_in_wchstr.3x.html">curs_in_wchstr(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM>
|
||||
library in its wide-character configuration (<EM>ncursesw</EM>).
|
||||
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>, <STRONG><A HREF="curs_inwstr.3x.html">curs_inwstr(3x)</A></STRONG>
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-20 <STRONG><A HREF="curs_inchstr.3x.html">curs_inchstr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -129,7 +139,9 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="c
|
||||
<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+200
-154
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -27,25 +27,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_initscr.3x,v 1.69 2024/04/20 21:24:19 tom Exp @
|
||||
* @Id: curs_initscr.3x,v 1.112 2025/08/23 22:41:44 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_initscr 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_initscr 3x 2025-08-23 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_initscr 3x 2024-04-20 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_initscr 3x 2025-08-23 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>initscr</STRONG>, <STRONG>newterm</STRONG>, <STRONG>endwin</STRONG>, <STRONG>isendwin</STRONG>, <STRONG>set_term</STRONG>, <STRONG>delscreen</STRONG> - initialize,
|
||||
manipulate, or tear down <EM>curses</EM> terminal interface
|
||||
@@ -54,252 +52,297 @@
|
||||
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
|
||||
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
|
||||
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*initscr(void);</STRONG>
|
||||
<STRONG>WINDOW</STRONG> <STRONG>*</STRONG> <STRONG>initscr(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>endwin(void);</STRONG>
|
||||
|
||||
<STRONG>bool</STRONG> <STRONG>isendwin(void);</STRONG>
|
||||
|
||||
<STRONG>SCREEN</STRONG> <STRONG>*newterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>type</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG><EM>outf</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG><EM>inf</EM><STRONG>);</STRONG>
|
||||
<STRONG>SCREEN</STRONG> <STRONG>*set_term(SCREEN</STRONG> <STRONG>*</STRONG><EM>new</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>delscreen(SCREEN*</STRONG> <EM>sp</EM><STRONG>);</STRONG>
|
||||
<STRONG>SCREEN</STRONG> <STRONG>*</STRONG> <STRONG>newterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <EM>type</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG> <EM>outf</EM><STRONG>,</STRONG> <STRONG>FILE</STRONG> <STRONG>*</STRONG> <EM>inf</EM><STRONG>);</STRONG>
|
||||
<STRONG>SCREEN</STRONG> <STRONG>*</STRONG> <STRONG>set_term(SCREEN</STRONG> <STRONG>*</STRONG> <EM>new</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>delscreen(SCREEN</STRONG> <STRONG>*</STRONG> <EM>sp</EM><STRONG>);</STRONG>
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
|
||||
</PRE><H3><a name="h3-initscr">initscr</a></H3><PRE>
|
||||
<STRONG>initscr</STRONG> is normally the first <STRONG>curses</STRONG> routine to call when initializing
|
||||
a program. A few special routines sometimes need to be called before
|
||||
it; these are <STRONG><A HREF="curs_slk.3x.html">slk_init(3x)</A></STRONG>, <STRONG>filter</STRONG>, <STRONG>ripoffline</STRONG>, <STRONG>use_env</STRONG>. For multiple-
|
||||
terminal applications, <STRONG>newterm</STRONG> may be called before <STRONG>initscr</STRONG>.
|
||||
<STRONG>initscr</STRONG> determines the terminal type and initializes the library's
|
||||
<EM>SCREEN</EM>, <EM>WINDOW</EM>, and other data structures. It is normally the first
|
||||
<EM>curses</EM> function call a program performs. However, an application with
|
||||
unusual needs might employ a few other <EM>curses</EM> functions beforehand:
|
||||
|
||||
The initscr code determines the terminal type and initializes all
|
||||
<STRONG>curses</STRONG> data structures. <STRONG>initscr</STRONG> also causes the first call to
|
||||
<STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> to clear the screen. If errors occur, <STRONG>initscr</STRONG> writes an
|
||||
appropriate error message to standard error and exits; otherwise, a
|
||||
pointer is returned to <STRONG>stdscr</STRONG>.
|
||||
<STRONG>o</STRONG> <STRONG><A HREF="curs_slk.3x.html">slk_init(3x)</A></STRONG> to set up soft-label keys;
|
||||
|
||||
<STRONG>o</STRONG> <STRONG><A HREF="curs_util.3x.html">filter(3x)</A></STRONG> if the program is designed to operate in a process
|
||||
pipeline;
|
||||
|
||||
<STRONG>o</STRONG> <STRONG><A HREF="curs_kernel.3x.html">ripoffline(3x)</A></STRONG> to reserve up to five lines at the top and/or bottom
|
||||
of the screen from management by <STRONG>stdscr</STRONG>, the standard <EM>curses</EM>
|
||||
window; and
|
||||
|
||||
<STRONG>o</STRONG> <STRONG><A HREF="curs_util.3x.html">use_env(3x)</A></STRONG> and/or <STRONG><A HREF="curs_util.3x.html">use_tioctl(3x)</A></STRONG> to configure use of the process
|
||||
environment and operating system's terminal driver, respectively,
|
||||
when determining the dimensions of the terminal display.
|
||||
|
||||
Further, a <EM>curses</EM> program might call <STRONG>newterm</STRONG> prior to or instead of
|
||||
<STRONG>initscr</STRONG> in two specialized cases described in its subsection below.
|
||||
|
||||
<STRONG>initscr</STRONG> causes the first <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> call to clear the screen. If
|
||||
errors occur, <STRONG>initscr</STRONG> writes an appropriate diagnostic message to the
|
||||
standard error stream and exits; otherwise, it returns a pointer to
|
||||
<STRONG>stdscr</STRONG>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-newterm">newterm</a></H3><PRE>
|
||||
A program that outputs to more than one terminal should use the <STRONG>newterm</STRONG>
|
||||
routine for each terminal instead of <STRONG>initscr</STRONG>. A program that needs to
|
||||
inspect capabilities, so it can continue to run in a line-oriented mode
|
||||
if the terminal cannot support a screen-oriented program, would also
|
||||
use <STRONG>newterm</STRONG>.
|
||||
An application that manages multiple terminals should call <STRONG>newterm</STRONG> once
|
||||
for each such device <EM>instead</EM> of <STRONG>initscr</STRONG>. <STRONG>newterm</STRONG>'s arguments are
|
||||
|
||||
The routine <STRONG>newterm</STRONG> should be called once for each terminal. It
|
||||
returns a variable of type <EM>SCREEN</EM> <EM>*</EM> which should be saved as a
|
||||
reference to that terminal. <STRONG>newterm</STRONG>'s arguments are
|
||||
<STRONG>o</STRONG> the <EM>type</EM> of the associated terminal, or a null pointer to use the
|
||||
<EM>TERM</EM> environment variable;
|
||||
|
||||
<STRONG>o</STRONG> the <EM>type</EM> of the terminal to be used in place of <STRONG>$TERM</STRONG>,
|
||||
<STRONG>o</STRONG> an output stream <EM>outf</EM> connected to the terminal; and
|
||||
|
||||
<STRONG>o</STRONG> an output stream connected to the terminal, and
|
||||
<STRONG>o</STRONG> an input stream <EM>inf</EM> connected to the terminal.
|
||||
|
||||
<STRONG>o</STRONG> an input stream connected to the terminal
|
||||
<STRONG>newterm</STRONG> returns a variable of pointer-to-<EM>SCREEN</EM> type, which should be
|
||||
saved for later use with <STRONG>set_term</STRONG> and <STRONG>delscreen</STRONG>.
|
||||
|
||||
If the <EM>type</EM> parameter is <STRONG>NULL</STRONG>, <STRONG>$TERM</STRONG> will be used.
|
||||
<STRONG>newterm</STRONG> passes the file descriptor of the output stream to the <EM>terminfo</EM>
|
||||
function <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>, which returns a pointer to a <EM>TERMINAL</EM> structure
|
||||
that <STRONG>newterm</STRONG> stores in the <EM>SCREEN</EM> it returns to the application.
|
||||
|
||||
The file descriptor of the output stream is passed to <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>,
|
||||
which returns a pointer to a <EM>TERMINAL</EM> structure. <STRONG>newterm</STRONG>'s return
|
||||
value holds a pointer to the <EM>TERMINAL</EM> structure.
|
||||
An application that needs to inspect a terminal type's capabilities, so
|
||||
that it can continue to run in a line-oriented mode if the terminal
|
||||
type does not support capabilities the application demands, would also
|
||||
use <STRONG>newterm</STRONG>. If at most one terminal connection is needed, the
|
||||
programmer could perform such a capability test, decide the mode in
|
||||
which to operate, then call <STRONG>delscreen</STRONG> on the pointer returned by
|
||||
<STRONG>newterm</STRONG>, and proceed with either <STRONG>initscr</STRONG> or a non-<EM>curses</EM> interface.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-endwin">endwin</a></H3><PRE>
|
||||
The program must also call <STRONG>endwin</STRONG> for each terminal being used before
|
||||
exiting from <STRONG>curses</STRONG>. If <STRONG>newterm</STRONG> is called more than once for the same
|
||||
The program must also call <STRONG>endwin</STRONG> for each terminal being used before
|
||||
exiting from <EM>curses</EM>. If <STRONG>newterm</STRONG> is called more than once for the same
|
||||
terminal, the first terminal referred to must be the last one for which
|
||||
<STRONG>endwin</STRONG> is called.
|
||||
|
||||
A program should always call <STRONG>endwin</STRONG> before exiting or escaping from
|
||||
<STRONG>curses</STRONG> mode temporarily. This routine
|
||||
A program should always call <STRONG>endwin</STRONG> before exiting the application or
|
||||
temporarily suspending <EM>curses</EM>'s management of the terminal. <STRONG>endwin</STRONG>:
|
||||
|
||||
<STRONG>o</STRONG> resets colors to correspond with the default color pair 0,
|
||||
<STRONG>o</STRONG> (if <STRONG><A HREF="curs_color.3x.html">start_color(3x)</A></STRONG> has been called) resets the terminal's
|
||||
foreground and background colors to correspond with those of color
|
||||
pair 0 (the default pair),
|
||||
|
||||
<STRONG>o</STRONG> moves the cursor to the lower left-hand corner of the screen,
|
||||
|
||||
<STRONG>o</STRONG> clears the remainder of the line so that it uses the default
|
||||
colors,
|
||||
<STRONG>o</STRONG> (if <STRONG><A HREF="curs_color.3x.html">start_color(3x)</A></STRONG> has been called) restores the default color
|
||||
pair,
|
||||
|
||||
<STRONG>o</STRONG> clears the line,
|
||||
|
||||
<STRONG>o</STRONG> sets the cursor to normal visibility (see <STRONG><A HREF="curs_kernel.3x.html">curs_set(3x)</A></STRONG>),
|
||||
|
||||
<STRONG>o</STRONG> stops cursor-addressing mode using the <EM>exit</EM><STRONG>_</STRONG><EM>ca</EM><STRONG>_</STRONG><EM>mode</EM> terminal
|
||||
capability,
|
||||
<STRONG>o</STRONG> if applicable, stops cursor-addressing mode using the <STRONG>exit_ca_mode</STRONG>
|
||||
(<STRONG>rmcup</STRONG>) terminal capability, and
|
||||
|
||||
<STRONG>o</STRONG> restores tty modes (see <STRONG><A HREF="curs_kernel.3x.html">reset_shell_mode(3x)</A></STRONG>).
|
||||
<STRONG>o</STRONG> restores terminal modes (see <STRONG><A HREF="curs_kernel.3x.html">reset_shell_mode(3x)</A></STRONG>).
|
||||
|
||||
Calling <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> or <STRONG><A HREF="curs_refresh.3x.html">doupdate(3x)</A></STRONG> after a temporary escape causes the
|
||||
program to resume visual mode.
|
||||
Calling <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> or <STRONG><A HREF="curs_refresh.3x.html">doupdate(3x)</A></STRONG> after a temporary suspension causes
|
||||
<EM>curses</EM> to resume managing the terminal.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-isendwin">isendwin</a></H3><PRE>
|
||||
The <STRONG>isendwin</STRONG> routine returns <STRONG>TRUE</STRONG> if <STRONG>endwin</STRONG> has been called without any
|
||||
subsequent calls to <STRONG>wrefresh</STRONG>, and <STRONG>FALSE</STRONG> otherwise.
|
||||
<STRONG>isendwin</STRONG> returns <STRONG>TRUE</STRONG> if <STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG> has not been called since the
|
||||
most recent <STRONG>endwin</STRONG> call, and <STRONG>FALSE</STRONG> otherwise.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-set_term">set_term</a></H3><PRE>
|
||||
The <STRONG>set_term</STRONG> routine is used to switch between different terminals.
|
||||
The screen reference <EM>new</EM> becomes the new current terminal. The
|
||||
previous terminal is returned by the routine. This is the only routine
|
||||
which manipulates <EM>SCREEN</EM> pointers; all other routines affect only the
|
||||
current terminal.
|
||||
<STRONG>set_term</STRONG> re-orients the <EM>curses</EM> library's operations to another terminal
|
||||
when the application has arranged to manage more than one with <STRONG>newterm</STRONG>.
|
||||
<STRONG>set_term</STRONG> expects a <EM>SCREEN</EM> pointer previously returned by <STRONG>newterm</STRONG> as an
|
||||
argument, and returns the previous one. <STRONG>set_term</STRONG> is the only standard
|
||||
<EM>curses</EM> API function that manipulates <EM>SCREEN</EM> pointers; all others affect
|
||||
only the current terminal (but see <STRONG><A HREF="curs_sp_funcs.3x.html">curs_sp_funcs(3x)</A></STRONG>).
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-delscreen">delscreen</a></H3><PRE>
|
||||
The <STRONG>delscreen</STRONG> routine frees storage associated with the <EM>SCREEN</EM> data
|
||||
structure. The <STRONG>endwin</STRONG> routine does not do this, so <STRONG>delscreen</STRONG> should be
|
||||
called after <STRONG>endwin</STRONG> if a particular <EM>SCREEN</EM> is no longer needed.
|
||||
<STRONG>delscreen</STRONG> frees the storage backing the supplied <EM>SCREEN</EM> pointer
|
||||
argument. <STRONG>endwin</STRONG> does not, so that an application can resume managing
|
||||
a terminal with <EM>curses</EM> after a (possibly conditional or temporary)
|
||||
suspension; see <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>. Use <STRONG>delscreen</STRONG> after <STRONG>endwin</STRONG> when the
|
||||
application has no more need of a terminal device but will not soon
|
||||
exit.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
<STRONG>endwin</STRONG> returns the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon successful
|
||||
completion.
|
||||
<STRONG>delscreen</STRONG> returns no value. <STRONG>endwin</STRONG> returns <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on
|
||||
failure. <STRONG>isendwin</STRONG> returns <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG> as described above.
|
||||
|
||||
Routines that return pointers always return <STRONG>NULL</STRONG> on error.
|
||||
In <EM>ncurses</EM>,
|
||||
|
||||
X/Open defines no error conditions. In this implementation
|
||||
<STRONG>o</STRONG> <STRONG>endwin</STRONG> returns <STRONG>ERR</STRONG> if
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>endwin</STRONG> returns an error if
|
||||
<STRONG>o</STRONG> the terminal was not initialized,
|
||||
|
||||
<STRONG>o</STRONG> the terminal was not initialized, or
|
||||
<STRONG>o</STRONG> it is called more than once without updating the screen, or
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>endwin</STRONG> is called more than once without updating the screen, or
|
||||
<STRONG>o</STRONG> its call of <STRONG><A HREF="curs_kernel.3x.html">reset_shell_mode(3x)</A></STRONG> returns <STRONG>ERR</STRONG>; and
|
||||
|
||||
<STRONG>o</STRONG> <STRONG><A HREF="curs_kernel.3x.html">reset_shell_mode(3x)</A></STRONG> returns an error.
|
||||
<STRONG>o</STRONG> <STRONG>newterm</STRONG> returns <STRONG>ERR</STRONG> if it cannot allocate storage for the <EM>SCREEN</EM>
|
||||
structure or the <EM>WINDOW</EM> structures automatically associated with
|
||||
it: <STRONG>curscr</STRONG>, <STRONG>newscr</STRONG>, and <STRONG>stdscr</STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>newterm</STRONG> returns an error if it cannot allocate the data structures
|
||||
for the screen, or for the top-level windows within the screen,
|
||||
i.e., <STRONG>curscr</STRONG>, <STRONG>newscr</STRONG>, or <STRONG>stdscr</STRONG>.
|
||||
Functions that return pointers return null pointers on error. In
|
||||
<EM>ncurses</EM>, <STRONG>set_term</STRONG> does not fail, and <STRONG>initscr</STRONG> exits the application if
|
||||
it does not operate successfully.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>set_term</STRONG> returns no error.
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
<EM>ncurses</EM> establishes signal handlers when a function that initializes a
|
||||
<EM>SCREEN</EM>, either <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>, is first called. Applications that
|
||||
wish to handle the following signals themselves should set up their
|
||||
corresponding handlers <EM>after</EM> initializing the screen.
|
||||
|
||||
<EM>SIGINT</EM> <EM>ncurses</EM>'s handler <EM>attempts</EM> to clean up the screen on exit.
|
||||
Although it <EM>usually</EM> works as expected, there are limitations.
|
||||
|
||||
<STRONG>o</STRONG> Walking the <EM>SCREEN</EM> list is unsafe, since all list management
|
||||
is done without any signal blocking.
|
||||
|
||||
<STRONG>o</STRONG> When an application has been built with the <STRONG>_</STRONG><EM>REENTRANT</EM> macro
|
||||
defined (and corresponding system support), <STRONG>set_term</STRONG> uses
|
||||
functions that could deadlock or misbehave in other ways.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>endwin</STRONG> calls other functions, many of which use <STRONG>stdio(3)</STRONG> or
|
||||
other library functions that are clearly unsafe.
|
||||
|
||||
<EM>SIGTERM</EM>
|
||||
<EM>ncurses</EM> uses the same handler as for <EM>SIGINT</EM>, with the same
|
||||
limitations. It is not mentioned in X/Open Curses, but is more
|
||||
suitable for this purpose than <EM>SIGQUIT</EM> (which is used in
|
||||
debugging).
|
||||
|
||||
<EM>SIGTSTP</EM>
|
||||
<EM>ncurses</EM>'s handler manages the terminal-generated stop signal,
|
||||
used in job control. When resuming the process, <EM>ncurses</EM>
|
||||
discards pending input with <STRONG><A HREF="curs_util.3x.html">flushinp(3x)</A></STRONG> and repaints the
|
||||
screen, assuming that it has been completely altered. It also
|
||||
updates the saved terminal modes with <STRONG><A HREF="curs_kernel.3x.html">def_shell_mode(3x)</A></STRONG>.
|
||||
|
||||
<EM>SIGWINCH</EM>
|
||||
<EM>ncurses</EM> handles changes to the terminal's window size, a
|
||||
phenomenon ignored in standardization efforts. It sets a
|
||||
(signal-safe) variable that is later tested by <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> and
|
||||
<STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>wgetch</STRONG> returns the key code <STRONG>KEY_RESIZE</STRONG>.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>wget_wch</STRONG> returns <STRONG>KEY_CODE_YES</STRONG> and sets its <EM>wch</EM> parameter to
|
||||
<STRONG>KEY_RESIZE</STRONG>.
|
||||
|
||||
At the same time, <EM>ncurses</EM> calls <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG> to adjust the
|
||||
standard screen <STRONG>stdscr</STRONG> and update global variables such as <STRONG>LINES</STRONG>
|
||||
and <STRONG>COLS</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
These functions were described in X/Open Curses, Issue 4. As of 2015,
|
||||
the current document is X/Open Curses, Issue 7.
|
||||
X/Open Curses Issue 4 describes these functions. It specifies no error
|
||||
conditions for them.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Differences">Differences</a></H3><PRE>
|
||||
X/Open Curses specifies that portable applications must not call
|
||||
<STRONG>initscr</STRONG> more than once:
|
||||
X/Open Curses specifies that portable applications must not call
|
||||
<EM>initscr</EM> more than once.
|
||||
|
||||
<STRONG>o</STRONG> The portable way to use <STRONG>initscr</STRONG> is once only, using <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> to
|
||||
restore the screen after <STRONG>endwin</STRONG>.
|
||||
<STRONG>o</STRONG> The portable way to use <EM>initscr</EM> is once only, using <EM>refresh</EM> to
|
||||
restore the screen after <EM>endwin</EM>.
|
||||
|
||||
<STRONG>o</STRONG> This implementation allows using <STRONG>initscr</STRONG> after <STRONG>endwin</STRONG>.
|
||||
<STRONG>o</STRONG> <EM>ncurses</EM> permits use of <EM>initscr</EM> after <EM>endwin</EM>.
|
||||
|
||||
Old versions of curses, e.g., BSD 4.4, would return a null pointer from
|
||||
<STRONG>initscr</STRONG> when an error is detected, rather than exiting. It is safe but
|
||||
redundant to check the return value of <STRONG>initscr</STRONG> in X/Open Curses.
|
||||
<EM>initscr</EM> in BSD, from its inception (1980) through the Net/2 release
|
||||
(1991) returned <EM>ERR</EM> cast to a <EM>WINDOW</EM> pointer when detecting an error.
|
||||
4.4BSD (1995) instead returned a null pointer. Neither exited the
|
||||
application. It is safe but redundant to check the return value of
|
||||
<EM>initscr</EM> in X/Open Curses.
|
||||
|
||||
Calling <STRONG>endwin</STRONG> does not dispose of the memory allocated in <STRONG>initscr</STRONG> or
|
||||
<STRONG>newterm</STRONG>. Deleting a <EM>SCREEN</EM> provides a way to do this:
|
||||
Calling <EM>endwin</EM> does not dispose of the memory allocated by <EM>initscr</EM> or
|
||||
<EM>newterm</EM>. Deleting a <EM>SCREEN</EM> provides a way to do this.
|
||||
|
||||
<STRONG>o</STRONG> X/Open Curses does not say what happens to <EM>WINDOW</EM>s when <STRONG>delscreen</STRONG>
|
||||
"frees storage associated with the <EM>SCREEN</EM>" nor does the SVr4
|
||||
documentation help, adding that it should be called after <STRONG>endwin</STRONG> if
|
||||
<STRONG>o</STRONG> X/Open Curses does not say what happens to <EM>WINDOW</EM>s when <EM>delscreen</EM>
|
||||
"frees storage associated with the <EM>SCREEN</EM>" nor does the SVr4
|
||||
documentation help, adding that it should be called after <EM>endwin</EM> if
|
||||
a <EM>SCREEN</EM> is no longer needed.
|
||||
|
||||
<STRONG>o</STRONG> However, <EM>WINDOW</EM>s are implicitly associated with a <EM>SCREEN</EM>. so that
|
||||
it is reasonable to expect <STRONG>delscreen</STRONG> to deal with these.
|
||||
<STRONG>o</STRONG> However, every <EM>WINDOW</EM> is implicitly associated with a <EM>SCREEN</EM>, so it
|
||||
is reasonable to expect <EM>delscreen</EM> to dispose of them.
|
||||
|
||||
<STRONG>o</STRONG> SVr4 curses deletes the standard <EM>WINDOW</EM> structures <STRONG>stdscr</STRONG> and
|
||||
<STRONG>curscr</STRONG> as well as a work area <STRONG>newscr</STRONG>. SVr4 curses ignores other
|
||||
windows.
|
||||
<STRONG>o</STRONG> SVr4 deletes the standard <EM>WINDOW</EM> structures <EM>stdscr</EM> and <EM>curscr</EM> as
|
||||
well as a work area <EM>newscr</EM>. It ignores other windows.
|
||||
|
||||
<STRONG>o</STRONG> Since version 4.0 (1996), <EM>ncurses</EM> has maintained a list of all
|
||||
windows for each screen, using that information to delete those
|
||||
windows when <STRONG>delscreen</STRONG> is called.
|
||||
windows when <EM>delscreen</EM> is called.
|
||||
|
||||
<STRONG>o</STRONG> NetBSD copied this feature of <EM>ncurses</EM> in 2001. PDCurses follows
|
||||
the SVr4 model, deleting only the standard <EM>WINDOW</EM> structures.
|
||||
<STRONG>o</STRONG> NetBSD copied this feature of <EM>ncurses</EM> in 2001. <EM>PDCurses</EM> follows
|
||||
the SVr4 model, deleting only the standard <EM>WINDOW</EM> structures and
|
||||
<EM>newscr</EM>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-High-level-versus-Low-level">High-level versus Low-level</a></H3><PRE>
|
||||
Different implementations may disagree regarding the level of some
|
||||
functions. For example, <EM>SCREEN</EM> (returned by <STRONG>newterm</STRONG>) and <EM>TERMINAL</EM>
|
||||
(returned by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>) hold file descriptors for the output
|
||||
stream. If an application switches screens using <STRONG>set_term</STRONG>, or switches
|
||||
terminals using <STRONG><A HREF="curs_terminfo.3x.html">set_curterm(3x)</A></STRONG>, applications which use the output file
|
||||
descriptor can have different behavior depending on which structure
|
||||
holds the corresponding descriptor.
|
||||
</PRE><H3><a name="h3-High-level-versus-Low-level-Functions">High-level versus Low-level Functions</a></H3><PRE>
|
||||
Implementations disagree regarding the level of abstraction applicable
|
||||
to a function or property. For example, <EM>SCREEN</EM> (returned by <EM>newterm</EM>)
|
||||
and <EM>TERMINAL</EM> (returned by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>) hold file descriptors for the
|
||||
output stream. If an application switches screens using <EM>set</EM><STRONG>_</STRONG><EM>term</EM>, or
|
||||
switches terminals using <STRONG><A HREF="curs_terminfo.3x.html">set_curterm(3x)</A></STRONG>, applications using the output
|
||||
file descriptor can behave differently depending on the structure
|
||||
holding the corresponding descriptor.
|
||||
|
||||
For example
|
||||
|
||||
<STRONG>o</STRONG> NetBSD's <STRONG><A HREF="curs_termattrs.3x.html">baudrate(3x)</A></STRONG> function uses the descriptor in <EM>TERMINAL</EM>.
|
||||
<STRONG>o</STRONG> NetBSD's <EM>baudrate</EM> function uses the descriptor in <EM>TERMINAL</EM>.
|
||||
<EM>ncurses</EM> and SVr4 use the descriptor in <EM>SCREEN</EM>.
|
||||
|
||||
<STRONG>o</STRONG> NetBSD and <EM>ncurses</EM> use the descriptor in <EM>TERMINAL</EM> for terminal I/O
|
||||
modes, e.g., <STRONG><A HREF="curs_kernel.3x.html">def_shell_mode(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">def_prog_mode(3x)</A></STRONG>. SVr4 curses
|
||||
uses the descriptor in <EM>SCREEN</EM>.
|
||||
modes, e.g., <STRONG><A HREF="curs_kernel.3x.html">def_shell_mode(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">def_prog_mode(3x)</A></STRONG>. SVr4 uses the
|
||||
descriptor in <EM>SCREEN</EM>.
|
||||
|
||||
<STRONG>Unset</STRONG> <EM>TERM</EM> <STRONG>Variable</STRONG>
|
||||
If the <EM>TERM</EM> variable is missing or empty, <STRONG>initscr</STRONG> uses the value
|
||||
"unknown", which normally corresponds to a terminal entry with the
|
||||
<EM>generic</EM> (<EM>gn</EM>) capability. Generic entries are detected by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>
|
||||
and cannot be used for full-screen operation. Other implementations
|
||||
may handle a missing/empty <EM>TERM</EM> variable differently.
|
||||
|
||||
</PRE><H3><a name="h3-Unset-TERM-Environment-Variable">Unset TERM Environment Variable</a></H3><PRE>
|
||||
If the <EM>TERM</EM> variable is not set in the environment or has an empty
|
||||
value, <EM>initscr</EM> uses the value "unknown", which normally corresponds to
|
||||
a terminal entry with the <STRONG>generic</STRONG> (<STRONG>gn</STRONG>) capability. Generic entries are
|
||||
detected by <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG> and cannot be used for full-screen operation.
|
||||
Other implementations may handle a missing or empty <EM>TERM</EM> variable
|
||||
differently.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-Signal-Handlers">Signal Handlers</a></H3><PRE>
|
||||
Quoting from X/Open Curses Issue 7, section 3.1.1:
|
||||
Quoting X/Open Curses Issue 7, section 3.1.1:
|
||||
|
||||
Curses implementations may provide for special handling of the
|
||||
SIGINT, SIGQUIT, and SIGTSTP signals if their disposition is
|
||||
SIG_DFL at the time <EM>initscr</EM> is called...
|
||||
Curses implementations may provide for special handling of the
|
||||
SIGINT, SIGQUIT, and SIGTSTP signals if their disposition is
|
||||
SIG_DFL at the time <EM>initscr</EM>() is called...
|
||||
|
||||
Any special handling for these signals may remain in effect for
|
||||
Any special handling for these signals may remain in effect for
|
||||
the life of the process or until the process changes the
|
||||
disposition of the signal.
|
||||
|
||||
None of the Curses functions are required to be safe with respect
|
||||
None of the Curses functions are required to be safe with respect
|
||||
to signals...
|
||||
|
||||
This implementation establishes signal handlers during initialization,
|
||||
e.g., <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>. Applications which must handle these signals
|
||||
should set up the corresponding handlers <EM>after</EM> initializing the
|
||||
library:
|
||||
Section "NOTES" above discusses <EM>ncurses</EM>'s signal handlers.
|
||||
|
||||
<STRONG>SIGINT</STRONG>
|
||||
The handler <EM>attempts</EM> to clean up the screen on exit. Although it
|
||||
<EM>usually</EM> works as expected, there are limitations:
|
||||
|
||||
<STRONG>o</STRONG> Walking the <EM>SCREEN</EM> list is unsafe, since all list management
|
||||
is done without any signal blocking.
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
4BSD (1980) introduced <EM>initscr</EM> and <EM>endwin</EM>.
|
||||
|
||||
<STRONG>o</STRONG> On systems which have <STRONG>REENTRANT</STRONG> turned on, <STRONG>set_term</STRONG> uses
|
||||
functions which could deadlock or misbehave in other ways.
|
||||
SVr2 (1984) added <EM>newterm</EM> and <EM>set</EM><STRONG>_</STRONG><EM>term</EM>.
|
||||
|
||||
<STRONG>o</STRONG> <STRONG>endwin</STRONG> calls other functions, many of which use <STRONG>stdio(3)</STRONG> or
|
||||
other library functions which are clearly unsafe.
|
||||
|
||||
<STRONG>SIGTERM</STRONG>
|
||||
This uses the same handler as <STRONG>SIGINT</STRONG>, with the same limitations.
|
||||
It is not mentioned in X/Open Curses, but is more suitable for
|
||||
this purpose than <STRONG>SIGQUIT</STRONG> (which is used in debugging).
|
||||
|
||||
<STRONG>SIGTSTP</STRONG>
|
||||
This handles the <EM>stop</EM> signal, used in job control. When resuming
|
||||
the process, this implementation discards pending input with
|
||||
<STRONG><A HREF="curs_util.3x.html">flushinp(3x)</A></STRONG>, and repaints the screen assuming that it has been
|
||||
completely altered. It also updates the saved terminal modes with
|
||||
<STRONG><A HREF="curs_kernel.3x.html">def_shell_mode(3x)</A></STRONG>.
|
||||
|
||||
<STRONG>SIGWINCH</STRONG>
|
||||
This handles the window-size changes which were ignored in the
|
||||
standardization efforts. The handler sets a (signal-safe)
|
||||
variable which is later tested in <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG>. If <STRONG>keypad</STRONG> has been
|
||||
enabled for the corresponding window, <STRONG>wgetch</STRONG> returns the key
|
||||
symbol <STRONG>KEY_RESIZE</STRONG>. At the same time, <STRONG>wgetch</STRONG> calls <STRONG>resizeterm</STRONG> to
|
||||
adjust the standard screen <STRONG>stdscr</STRONG>, and update other data such as
|
||||
<STRONG>LINES</STRONG> and <STRONG>COLS</STRONG>.
|
||||
SVr3.1 (1987) supplied <EM>delscreen</EM> and <EM>isendwin</EM>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-08-23 <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -316,13 +359,16 @@ ncurses 6.5 2024-04-20 <STRONG><A HREF="c
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
|
||||
<li><a href="#h2-NOTES">NOTES</a></li>
|
||||
<li><a href="#h2-PORTABILITY">PORTABILITY</a>
|
||||
<ul>
|
||||
<li><a href="#h3-Differences">Differences</a></li>
|
||||
<li><a href="#h3-High-level-versus-Low-level">High-level versus Low-level</a></li>
|
||||
<li><a href="#h3-High-level-versus-Low-level-Functions">High-level versus Low-level Functions</a></li>
|
||||
<li><a href="#h3-Unset-TERM-Environment-Variable">Unset TERM Environment Variable</a></li>
|
||||
<li><a href="#h3-Signal-Handlers">Signal Handlers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#h2-HISTORY">HISTORY</a></li>
|
||||
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+250
-187
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* t
|
||||
****************************************************************************
|
||||
* Copyright 2018-2023,2024 Thomas E. Dickey *
|
||||
* Copyright 2018-2024,2025 Thomas E. Dickey *
|
||||
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
@@ -28,25 +28,23 @@
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
* @Id: curs_inopts.3x,v 1.66 2024/04/13 22:20:29 tom Exp @
|
||||
* @Id: curs_inopts.3x,v 1.116 2025/10/04 20:15:02 tom Exp @
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
|
||||
<TITLE>curs_inopts 3x 2024-04-13 ncurses 6.5 Library calls</TITLE>
|
||||
<TITLE>curs_inopts 3x 2025-10-04 ncurses 6.6 Library calls</TITLE>
|
||||
<link rel="author" href="mailto:bug-ncurses@gnu.org">
|
||||
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 class="no-header">curs_inopts 3x 2024-04-13 ncurses 6.5 Library calls</H1>
|
||||
<H1 class="no-header">curs_inopts 3x 2025-10-04 ncurses 6.6 Library calls</H1>
|
||||
<PRE>
|
||||
<STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
|
||||
<STRONG>cbreak</STRONG>, <STRONG>echo</STRONG>, <STRONG>halfdelay</STRONG>, <STRONG>intrflush</STRONG>, <STRONG>is_cbreak</STRONG>, <STRONG>is_echo</STRONG>, <STRONG>is_nl</STRONG>, <STRONG>is_raw</STRONG>,
|
||||
<STRONG>keypad</STRONG>, <STRONG>meta</STRONG>, <STRONG>nl</STRONG>, <STRONG>nocbreak</STRONG>, <STRONG>nodelay</STRONG>, <STRONG>noecho</STRONG>, <STRONG>nonl</STRONG>, <STRONG>noqiflush</STRONG>, <STRONG>noraw</STRONG>,
|
||||
@@ -63,24 +61,24 @@
|
||||
<STRONG>int</STRONG> <STRONG>echo(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>noecho(void);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>intrflush(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>keypad(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>meta(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>nodelay(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>notimeout(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>intrflush(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM> <EM>/*</EM> <EM>ignored</EM> <EM>*/</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>keypad(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>meta(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM> <EM>/*</EM> <EM>ignored</EM> <EM>*/</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>nodelay(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>notimeout(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>nl(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>nonl(void);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>raw(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>noraw(void);</STRONG>
|
||||
|
||||
<STRONG>void</STRONG> <STRONG>qiflush(void);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>noqiflush(void);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>raw(void);</STRONG>
|
||||
<STRONG>int</STRONG> <STRONG>noraw(void);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>halfdelay(int</STRONG> <EM>tenths</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>timeout(int</STRONG> <EM>delay</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>wtimeout(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>delay</EM><STRONG>);</STRONG>
|
||||
<STRONG>void</STRONG> <STRONG>wtimeout(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>delay</EM><STRONG>);</STRONG>
|
||||
|
||||
<STRONG>int</STRONG> <STRONG>typeahead(int</STRONG> <EM>fd</EM><STRONG>);</STRONG>
|
||||
|
||||
@@ -92,174 +90,225 @@
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
|
||||
<EM>ncurses</EM> provides several functions that let an application change the
|
||||
way input from the terminal is handled. Some are global, applying to
|
||||
all windows. Others apply only to a specific window. Window-specific
|
||||
settings are not automatically applied to new or derived windows. An
|
||||
application must apply these to each window if the same behavior is
|
||||
desired.
|
||||
<EM>curses</EM> offers configurable parameters permitting an application to
|
||||
control the handling of input from the terminal. Some, such as those
|
||||
affecting the terminal's <EM>mode</EM> or line discipline, are global, applying
|
||||
to all windows; others apply only to a specific window. The library
|
||||
does not automatically apply such parameters to new or derived windows;
|
||||
an application must configure each window for the desired behavior.
|
||||
|
||||
Some descriptions below make reference to an <EM>input</EM> <EM>character</EM> <EM>reading</EM>
|
||||
<EM>function</EM>: this is <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> in the non-wide character <EM>curses</EM> API and
|
||||
<STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG> in the wide character API. In addition to the variant
|
||||
forms of these described in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, the <EM>curses</EM> functions
|
||||
<STRONG><A HREF="curs_getstr.3x.html">wgetstr(3x)</A></STRONG> and <STRONG><A HREF="curs_get_wstr.3x.html">wget_wstr(3x)</A></STRONG> and their own variants call the
|
||||
appropriate input character reading function.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-cbreak_nocbreak">cbreak, nocbreak</a></H3><PRE>
|
||||
Normally, the terminal driver buffers typed characters until a newline
|
||||
or carriage return is typed. The <STRONG>cbreak</STRONG> routine disables line
|
||||
buffering and erase/kill character-processing (interrupt and flow
|
||||
control characters are unaffected), making characters typed by the user
|
||||
immediately available to the program. The <STRONG>nocbreak</STRONG> routine returns the
|
||||
terminal to normal (cooked) mode.
|
||||
Normally, the terminal driver buffers typed characters, not delivering
|
||||
them to an application until a line feed or carriage return is typed.
|
||||
This canonical ("cooked") line discipline also supports software flow
|
||||
control, simple line editing functions (character and word erase, and
|
||||
whole-line erasure or "kill"), and job control. <STRONG>cbreak</STRONG> configures the
|
||||
terminal in <EM>cbreak</EM> <EM>mode</EM>, which disables line buffering and erase and
|
||||
kill character processing -- the interrupt, quit, suspend, and flow
|
||||
control characters are unaffected -- and makes characters typed by the
|
||||
user immediately available to the program. <STRONG>nocbreak</STRONG> restores canonical
|
||||
("cooked") mode.
|
||||
|
||||
Initially the terminal may or may not be in <STRONG>cbreak</STRONG> mode, as the mode is
|
||||
inherited; therefore, a program should call <STRONG>cbreak</STRONG> or <STRONG>nocbreak</STRONG>
|
||||
explicitly. Most interactive programs using <EM>curses</EM> set the <STRONG>cbreak</STRONG>
|
||||
mode. Note that <STRONG>cbreak</STRONG> overrides <STRONG>raw</STRONG>. [See <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG> for a
|
||||
discussion of how these routines interact with <STRONG>echo</STRONG> and <STRONG>noecho</STRONG>.]
|
||||
The state of the terminal is unknown to a <EM>curses</EM> application when it
|
||||
starts; therefore, a program should call <STRONG>cbreak</STRONG> or <STRONG>nocbreak</STRONG> explicitly.
|
||||
Most interactive programs using <EM>curses</EM> set cbreak mode. Calling <STRONG>cbreak</STRONG>
|
||||
overrides <STRONG>raw</STRONG>. The man page for the input character reading function
|
||||
discusses how <STRONG>cbreak</STRONG> and <STRONG>nocbreak</STRONG> interact with <STRONG>echo</STRONG> and <STRONG>noecho</STRONG>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-echo_noecho">echo, noecho</a></H3><PRE>
|
||||
The <STRONG>echo</STRONG> and <STRONG>noecho</STRONG> routines control whether characters typed by the
|
||||
user are echoed by <STRONG><A HREF="curs_getch.3x.html">getch(3x)</A></STRONG> as they are typed. Echoing by the
|
||||
terminal driver is always disabled, but initially <STRONG>getch</STRONG> is in echo
|
||||
mode, so characters typed are echoed. Authors of most interactive
|
||||
programs prefer to do their own echoing in a controlled area of the
|
||||
screen, or not to echo at all, so they disable echoing by calling
|
||||
<STRONG>noecho</STRONG>. [See <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG> for a discussion of how these routines
|
||||
interact with <STRONG>cbreak</STRONG> and <STRONG>nocbreak</STRONG>.]
|
||||
<STRONG>echo</STRONG> and <STRONG>noecho</STRONG> determine whether characters typed by the user are
|
||||
written to the <EM>curses</EM> window by the input character reading function as
|
||||
they are typed. <EM>curses</EM> always disables the terminal driver's own
|
||||
echoing. By default, a <EM>curses</EM> screen's echo option is set. Authors of
|
||||
most interactive programs prefer to do their own echoing in a
|
||||
controlled area of the screen, or not to echo at all, so they call
|
||||
<STRONG>noecho</STRONG>. The man page for the input character reading function
|
||||
discusses how <STRONG>echo</STRONG> and <STRONG>noecho</STRONG> interact with <STRONG>cbreak</STRONG> and <STRONG>nocbreak</STRONG>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-halfdelay">halfdelay</a></H3><PRE>
|
||||
The <STRONG>halfdelay</STRONG> routine is used for half-delay mode, which is similar to
|
||||
<STRONG>cbreak</STRONG> mode in that characters typed by the user are immediately
|
||||
available to the program. However, after blocking for <EM>tenths</EM> tenths of
|
||||
seconds, <STRONG>ERR</STRONG> is returned if nothing has been typed. The value of
|
||||
<EM>tenths</EM> must be a number between 1 and 255. Use <STRONG>nocbreak</STRONG> to leave half-
|
||||
<STRONG>halfdelay</STRONG> configures <EM>half-delay</EM> <EM>mode</EM>, which is similar to cbreak mode
|
||||
in that characters typed by the user are immediately available to the
|
||||
program. However, after blocking for <EM>tenths</EM> tenth-seconds, an input
|
||||
character reading function returns <STRONG>ERR</STRONG> if no input is pending. The
|
||||
value of <EM>tenths</EM> must be between 1 and 255. Use <STRONG>nocbreak</STRONG> to leave half-
|
||||
delay mode.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-intrflush">intrflush</a></H3><PRE>
|
||||
If the <STRONG>intrflush</STRONG> option is enabled (<EM>bf</EM> is <STRONG>TRUE</STRONG>), and an interrupt key
|
||||
is pressed on the keyboard (interrupt, break, quit), all output in the
|
||||
terminal driver queue is flushed, giving the effect of faster response
|
||||
to the interrupt, but causing <EM>curses</EM> to have the wrong idea of what is
|
||||
on the screen. Disabling the option (<EM>bf</EM> is <STRONG>FALSE</STRONG>), prevents the flush.
|
||||
The default for the option is inherited from the terminal driver
|
||||
settings. The <EM>win</EM> argument is ignored.
|
||||
<STRONG>intrflush</STRONG> calls <STRONG>qiflush</STRONG> (see below) if <EM>bf</EM> is <STRONG>TRUE</STRONG>, and <STRONG>noqiflush</STRONG> if <EM>bf</EM>
|
||||
is <STRONG>FALSE</STRONG>. It ignores its <EM>win</EM> argument.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-keypad">keypad</a></H3><PRE>
|
||||
The <STRONG>keypad</STRONG> option enables the keypad of the user's terminal. If
|
||||
enabled (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the user can press a function key (such as an
|
||||
arrow key) and <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> returns a single value representing the
|
||||
function key, as in <STRONG>KEY_LEFT</STRONG>. If disabled (<EM>bf</EM> is <STRONG>FALSE</STRONG>), <EM>curses</EM> does
|
||||
not treat function keys specially and the program has to interpret the
|
||||
escape sequences itself. If the keypad in the terminal can be turned
|
||||
on (made to transmit) and off (made to work locally), turning on this
|
||||
option causes the terminal keypad to be turned on when <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> is
|
||||
called. The default value for keypad is <STRONG>FALSE</STRONG>.
|
||||
<STRONG>keypad</STRONG> enables recognition of a terminal's function keys. If enabled
|
||||
(<EM>bf</EM> is <STRONG>TRUE</STRONG>) then when an input character reading function reads ESC,
|
||||
it waits for further input corresponding to an escape sequence defined
|
||||
by the terminal type description. If a valid sequence populates the
|
||||
input stream, the input character reading function returns a value
|
||||
representing the function key, such as <STRONG>KEY_LEFT</STRONG>. (Wide-character API
|
||||
users: <STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG> returns <STRONG>KEY_CODE_YES</STRONG> to indicate the availability
|
||||
of a function key code in its <EM>wch</EM> parameter.) If the sequence is
|
||||
invalid, the input character reading function returns only its last
|
||||
character. If disabled (<EM>bf</EM> is <STRONG>FALSE</STRONG>), <EM>curses</EM> does not treat function
|
||||
keys specially and the program has to interpret escape sequences
|
||||
itself. If the terminal type description defines the <STRONG>keypad_local</STRONG>
|
||||
(<STRONG>rmkx</STRONG>) and <STRONG>keypad_xmit</STRONG> (<STRONG>smkx</STRONG>) capabilities, enabling a window's keypad
|
||||
mode sets the terminal's keypad to transmit, and disabling keypad mode
|
||||
sets the terminal's keypad to work locally. By default, a window's
|
||||
keypad mode is off.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-meta">meta</a></H3><PRE>
|
||||
Initially, whether the terminal returns 7 or 8 significant bits on
|
||||
input depends on the control mode of the terminal driver [see
|
||||
<STRONG>termios(3)</STRONG>]. To force 8 bits to be returned, invoke <STRONG>meta</STRONG>(<EM>win</EM>, <STRONG>TRUE</STRONG>);
|
||||
this is equivalent, under POSIX, to setting the CS8 flag on the
|
||||
terminal. To force 7 bits to be returned, invoke <STRONG>meta</STRONG>(<EM>win</EM>, <STRONG>FALSE</STRONG>);
|
||||
this is equivalent, under POSIX, to setting the CS7 flag on the
|
||||
terminal. The window argument, <EM>win</EM>, is always ignored. If the
|
||||
terminfo capabilities <STRONG>smm</STRONG> (meta_on) and <STRONG>rmm</STRONG> (meta_off) are defined for
|
||||
the terminal, <STRONG>smm</STRONG> is sent to the terminal when <STRONG>meta</STRONG>(<EM>win</EM>, <STRONG>TRUE</STRONG>) is
|
||||
called and <STRONG>rmm</STRONG> is sent when <STRONG>meta</STRONG>(<EM>win</EM>, <STRONG>FALSE</STRONG>) is called.
|
||||
Initially, whether the terminal returns 7- or 8-bit character codes on
|
||||
input depends on the configuration of the terminal driver; on POSIX
|
||||
systems, see <STRONG>termios(3)</STRONG>. To force 8 bits to be returned, call
|
||||
<STRONG>meta(</STRONG>...<STRONG>,</STRONG> <STRONG>TRUE)</STRONG>; this is equivalent, on POSIX systems, to setting the
|
||||
CS8 flag on the terminal. To force 7 bits to be returned, call
|
||||
<STRONG>meta(</STRONG>...<STRONG>,</STRONG> <STRONG>FALSE)</STRONG>; this is equivalent, on POSIX systems, to setting the
|
||||
CS7 flag on the terminal. <EM>curses</EM> ignores the window argument <EM>win</EM>. If
|
||||
the <EM>terminfo</EM> string capabilities <STRONG>meta_on</STRONG> (<STRONG>smm</STRONG>) and <STRONG>meta_off</STRONG> (<STRONG>rmm</STRONG>) are
|
||||
defined for the terminal type, enabling meta mode sends <STRONG>smm</STRONG>'s value to
|
||||
the terminal and disabling it sends that of <STRONG>rmm</STRONG> to the terminal.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-nl_nonl">nl, nonl</a></H3><PRE>
|
||||
The <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> routines control whether the underlying display device
|
||||
translates the return key into newline on input.
|
||||
Initially, whether the terminal reports a carriage return using the
|
||||
character code for a line feed in cbreak or raw modes depends on the
|
||||
configuration of the terminal driver; see <STRONG>termios(3)</STRONG>. <STRONG>nl</STRONG> configures
|
||||
the terminal to perform this translation. <STRONG>nonl</STRONG> disables it. Under its
|
||||
canonical ("cooked") line discipline, the terminal driver always
|
||||
translates carriage returns to line feeds.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-nodelay">nodelay</a></H3><PRE>
|
||||
The <STRONG>nodelay</STRONG> option causes <STRONG>getch</STRONG> to be a non-blocking call. If no input
|
||||
is ready, <STRONG>getch</STRONG> returns <STRONG>ERR</STRONG>. If disabled (<EM>bf</EM> is <STRONG>FALSE</STRONG>), <STRONG>getch</STRONG> waits
|
||||
until a key is pressed.
|
||||
<STRONG>nodelay</STRONG> configures the input character reading function to be non-
|
||||
blocking for window <EM>win</EM>. If no input is ready, the reading function
|
||||
returns <STRONG>ERR</STRONG>. If disabled (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the reading function does not
|
||||
return until it has input.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-notimeout">notimeout</a></H3><PRE>
|
||||
When interpreting an escape sequence, <STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> sets a timer while
|
||||
waiting for the next character. If <STRONG>notimeout(</STRONG><EM>win</EM>, <STRONG>TRUE</STRONG>) is called,
|
||||
then <STRONG>wgetch</STRONG> does not set a timer. The purpose of the timeout is to
|
||||
distinguish sequences produced by a function key from those typed by a
|
||||
user.
|
||||
When <STRONG>keypad</STRONG> has been called on a window and the input character reading
|
||||
function reads an ESC character from it, <EM>curses</EM> sets a timer while
|
||||
waiting for the next character. If the timer elapses, <EM>curses</EM>
|
||||
interprets the ESC as an explicit press of the terminal's Escape key
|
||||
(or equivalent). <STRONG>notimeout(</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>TRUE)</STRONG> disables this timer. The
|
||||
purpose of the timeout is to distinguish sequences produced by a
|
||||
function key from those typed by a user. If this timer is disabled,
|
||||
<EM>curses</EM> waits forever for subsequent keystrokes until it determines the
|
||||
escape sequence to be valid or invalid.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-qiflush_noqiflush">qiflush, noqiflush</a></H3><PRE>
|
||||
<STRONG>qiflush</STRONG> and <STRONG>noqiflush</STRONG> configure the terminal driver's treatment of its
|
||||
input and output queues when it handles the interrupt, suspend, or quit
|
||||
characters under the canonical ("cooked") or cbreak line disciplines on
|
||||
POSIX systems; see <STRONG>termios(3)</STRONG>. The default behavior is inherited from
|
||||
the terminal driver settings. Calling <STRONG>qiflush</STRONG> configures the terminal
|
||||
to <EM>flush</EM> the queues (discarding their contents) when any of these
|
||||
events occurs, giving the impression of faster response to user input,
|
||||
but making the library's model of the screen contents incorrect.
|
||||
Calling <STRONG>noqiflush</STRONG> prevents such flushing, but might frustrate impatient
|
||||
users on slow connections if a <EM>curses</EM> update of the screen is in
|
||||
progress when the event occurs; see <STRONG>typeahead</STRONG> below for a mitigation of
|
||||
this problem. You may want to call <STRONG>noqiflush</STRONG> in a signal handler if,
|
||||
after the handler exits, you want output to continue as though the
|
||||
signal had not occurred.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-raw_noraw">raw, noraw</a></H3><PRE>
|
||||
The <STRONG>raw</STRONG> and <STRONG>noraw</STRONG> routines place the terminal into or out of raw mode.
|
||||
Raw mode is similar to <STRONG>cbreak</STRONG> mode, in that characters typed are
|
||||
immediately passed through to the user program. The differences are
|
||||
that in raw mode, the interrupt, quit, suspend, and flow control
|
||||
characters are all passed through uninterpreted, instead of generating
|
||||
a signal. The behavior of the BREAK key depends on other bits in the
|
||||
terminal driver that are not set by <EM>curses</EM>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-qiflush_nqiflush">qiflush, nqiflush</a></H3><PRE>
|
||||
When the <STRONG>noqiflush</STRONG> routine is used, normal flush of input and output
|
||||
queues associated with the <STRONG>INTR</STRONG>, <STRONG>QUIT</STRONG> and <STRONG>SUSP</STRONG> characters will not be
|
||||
done [see <STRONG>termios(3)</STRONG>]. When <STRONG>qiflush</STRONG> is called, the queues will be
|
||||
flushed when these control characters are read. You may want to call
|
||||
<STRONG>noqiflush</STRONG> in a signal handler if you want output to continue as though
|
||||
the interrupt had not occurred, after the handler exits.
|
||||
<STRONG>raw</STRONG> configures the terminal to read input in <EM>raw</EM> <EM>mode</EM>, which is similar
|
||||
to cbreak mode (see <STRONG>cbreak</STRONG> above) except that it furthermore passes
|
||||
through the terminal's configured interrupt, quit, suspend, and flow
|
||||
control characters uninterpreted to the application, instead of
|
||||
generating a signal or acting on I/O flow. The behavior of the
|
||||
terminal's "Break" key (if any) depends on terminal driver
|
||||
configuration parameters that <EM>curses</EM> does not handle. <STRONG>noraw</STRONG> restores
|
||||
the terminal's canonical ("cooked") line discipline.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-timeout_wtimeout">timeout, wtimeout</a></H3><PRE>
|
||||
The <STRONG>timeout</STRONG> and <STRONG>wtimeout</STRONG> routines set blocking or non-blocking read for
|
||||
a given window. If <EM>delay</EM> is negative, a blocking read is used (i.e.,
|
||||
waits indefinitely for input). If <EM>delay</EM> is zero, then a non-blocking
|
||||
read is used (i.e., <EM>read</EM> returns <STRONG>ERR</STRONG> if no input is waiting). If <EM>delay</EM>
|
||||
is positive, then <EM>read</EM> blocks for <EM>delay</EM> milliseconds, and returns <STRONG>ERR</STRONG>
|
||||
if there is still no input. Hence, these routines provide the same
|
||||
functionality as <STRONG>nodelay</STRONG>, plus the additional capability of being able
|
||||
to block for only <EM>delay</EM> milliseconds (where <EM>delay</EM> is positive).
|
||||
<STRONG>wtimeout</STRONG> configures whether a <EM>curses</EM> input character reading function
|
||||
called on window <EM>win</EM> uses blocking or non-blocking reads. If <EM>delay</EM> is
|
||||
negative, <EM>curses</EM> uses a blocking read, waiting indefinitely for input.
|
||||
If <EM>delay</EM> is zero, the read is non-blocking; an input character reading
|
||||
function returns <STRONG>ERR</STRONG> if no input is pending. If <EM>delay</EM> is positive, an
|
||||
input character reading function blocks for <EM>delay</EM> milliseconds, and
|
||||
returns <STRONG>ERR</STRONG> if the delay elapses and there is still no input pending.
|
||||
<STRONG>timeout</STRONG> calls <STRONG>wtimeout</STRONG> on <STRONG>stdscr</STRONG>.
|
||||
|
||||
|
||||
</PRE><H3><a name="h3-typeahead">typeahead</a></H3><PRE>
|
||||
<EM>curses</EM> does "line-breakout optimization" by looking for typeahead
|
||||
periodically while updating the screen. If input is found, and it is
|
||||
coming from a terminal, the current update is postponed until
|
||||
<STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> or <STRONG>doupdate</STRONG> is called again. This allows faster response
|
||||
to commands typed in advance. Normally, the input <EM>FILE</EM> pointer passed
|
||||
to <STRONG>newterm</STRONG>, or <STRONG>stdin</STRONG> in the case that <STRONG>initscr</STRONG> was used, will be used to
|
||||
do this typeahead checking. The <STRONG>typeahead</STRONG> routine specifies that the
|
||||
file descriptor <EM>fd</EM> is to be used to check for typeahead instead. If <EM>fd</EM>
|
||||
is -1, then no typeahead checking is done.
|
||||
Normally, a <EM>curses</EM> library checks the terminal's input file descriptor
|
||||
for activity with <STRONG>poll(2)</STRONG> or <STRONG>select(2)</STRONG> while updating the screen; if it
|
||||
finds any, it postpones output until the next <STRONG><A HREF="curs_refresh.3x.html">wrefresh(3x)</A></STRONG> or
|
||||
<STRONG><A HREF="curs_refresh.3x.html">doupdate(3x)</A></STRONG> call, allowing faster response to user key strokes. The
|
||||
library tests the file descriptor corresponding to the <EM>FILE</EM> stream
|
||||
pointer passed to <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG> (or <EM>stdin</EM> if <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG> was called), for
|
||||
pending input. <STRONG>typeahead</STRONG> instructs <EM>curses</EM> to test file descriptor <EM>fd</EM>
|
||||
instead. An <EM>fd</EM> of <STRONG>-1</STRONG> disables the check.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
|
||||
All routines that return an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
|
||||
(SVr4 specifies only "an integer value other than <STRONG>ERR</STRONG>") upon successful
|
||||
completion, unless otherwise noted in the preceding routine
|
||||
descriptions.
|
||||
<STRONG>timeout</STRONG> and <STRONG>wtimeout</STRONG> return no value.
|
||||
|
||||
X/Open Curses does not specify any error conditions. In this
|
||||
implementation, functions with a window parameter will return an error
|
||||
if it is null. Any function will also return an error if the terminal
|
||||
was not initialized. Also,
|
||||
<STRONG>cbreak</STRONG>, <STRONG>nocbreak</STRONG>, <STRONG>echo</STRONG>, <STRONG>noecho</STRONG>, <STRONG>halfdelay</STRONG>, <STRONG>intrflush</STRONG>, <STRONG>keypad</STRONG>, <STRONG>meta</STRONG>,
|
||||
<STRONG>nodelay</STRONG>, <STRONG>notimeout</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG>, <STRONG>raw</STRONG>, <STRONG>noraw</STRONG>, and <STRONG>typeahead</STRONG> return <STRONG>OK</STRONG> on
|
||||
success and <STRONG>ERR</STRONG> on failure.
|
||||
|
||||
<STRONG>halfdelay</STRONG>
|
||||
returns an error if its parameter is outside the range 1..255.
|
||||
In <EM>ncurses</EM>, the functions in the previous paragraph return <STRONG>ERR</STRONG> if
|
||||
|
||||
<STRONG>o</STRONG> the library's <EM>TERMINAL</EM> structure for the device has not been
|
||||
initialized with <STRONG><A HREF="curs_initscr.3x.html">initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">newterm(3x)</A></STRONG>, or <STRONG><A HREF="curs_terminfo.3x.html">setupterm(3x)</A></STRONG>, or
|
||||
|
||||
<STRONG>o</STRONG> <EM>win</EM> is a null pointer (except with <STRONG>intrflush</STRONG> and <STRONG>meta</STRONG>, which ignore
|
||||
its value).
|
||||
|
||||
Further, <STRONG>halfdelay</STRONG> returns <STRONG>ERR</STRONG> if <EM>delay</EM> is outside the range 1..255.
|
||||
|
||||
See section "EXTENSIONS" below for the return values of <STRONG>is_cbreak</STRONG>,
|
||||
<STRONG>is_echo</STRONG>, <STRONG>is_nl</STRONG>, and <STRONG>is_raw</STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
|
||||
<STRONG>echo</STRONG>, <STRONG>noecho</STRONG>, <STRONG>halfdelay</STRONG>, <STRONG>intrflush</STRONG>, <STRONG>meta</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG>, <STRONG>nodelay</STRONG>, <STRONG>notimeout</STRONG>,
|
||||
<STRONG>noqiflush</STRONG>, <STRONG>qiflush</STRONG>, <STRONG>timeout</STRONG>, and <STRONG>wtimeout</STRONG> may be implemented as macros.
|
||||
|
||||
<STRONG>noraw</STRONG> and <STRONG>nocbreak</STRONG> follow historical practice in that they attempt to
|
||||
restore normal ("cooked") mode from raw and cbreak modes respectively.
|
||||
Mixing <STRONG>raw</STRONG>/<STRONG>noraw</STRONG> and <STRONG>cbreak</STRONG>/<STRONG>nocbreak</STRONG> calls leads to terminal driver
|
||||
control states that are hard to predict or understand; doing so is not
|
||||
recommended.
|
||||
<STRONG>noraw</STRONG> and <STRONG>nocbreak</STRONG> follow historical practice in that they attempt to
|
||||
restore the terminal's canonical ("cooked") line discipline from raw
|
||||
and cbreak, respectively. Mixing <STRONG>raw</STRONG>/<STRONG>noraw</STRONG> calls with <STRONG>cbreak</STRONG>/<STRONG>nocbreak</STRONG>
|
||||
calls leads to terminal driver control states that are hard to predict
|
||||
or understand; doing so is not recommended.
|
||||
|
||||
<EM>curses</EM> documentation uses the terms "delay" and "timeout" freely to
|
||||
describe two related but distinct aspects of input handling, at the
|
||||
risk of confusing the user. The functions <STRONG>halfdelay</STRONG>, <STRONG>nodelay</STRONG>, <STRONG>timeout</STRONG>,
|
||||
and <STRONG>wtimeout</STRONG> configure whether the input character reading function
|
||||
(<STRONG><A HREF="curs_getch.3x.html">wgetch(3x)</A></STRONG> or <STRONG><A HREF="curs_get_wch.3x.html">wget_wch(3x)</A></STRONG>) waits for keyboard input to begin, and for
|
||||
how long. <STRONG>keypad</STRONG> configures whether that function waits for further
|
||||
input if the first character it reads is ESC. Calling <STRONG>notimeout</STRONG>, which
|
||||
has nothing to do with <STRONG>timeout</STRONG> or <STRONG>wtimeout</STRONG>, makes this delay in
|
||||
expectation of further characters effectively infinite. X/Open Curses
|
||||
affords no means of otherwise configuring the length of this second
|
||||
delay, but an AIX and <EM>ncurses</EM> extension, <STRONG>ESCDELAY</STRONG>, is available both as
|
||||
an environment variable and a global symbol permitting the user and
|
||||
application, respectively, to do so; see <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> and
|
||||
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
|
||||
<EM>ncurses</EM> provides four "is_" functions that may be used to detect if the
|
||||
corresponding flags were set or reset.
|
||||
<EM>ncurses</EM> provides four "is_" functions corresponding to <STRONG>cbreak</STRONG>, <STRONG>echo</STRONG>,
|
||||
<STRONG>nl</STRONG>, and <STRONG>raw</STRONG>, permitting their states to be queried by the application.
|
||||
|
||||
<STRONG>Query</STRONG> <STRONG>Set</STRONG> <STRONG>Reset</STRONG>
|
||||
------------------------------
|
||||
@@ -270,86 +319,100 @@
|
||||
|
||||
In each case, the function returns
|
||||
|
||||
1 if the flag is set,
|
||||
<STRONG>1</STRONG> if the option is set,
|
||||
|
||||
0 if the flag is reset, or
|
||||
<STRONG>0</STRONG> if the option is unset, or
|
||||
|
||||
-1 if the library is not initialized.
|
||||
|
||||
They were designed for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and are not found in SVr4 <EM>curses</EM>,
|
||||
4.4BSD <EM>curses</EM>, or any other previous <EM>curses</EM> implementation.
|
||||
<STRONG>-1</STRONG> if the library's <EM>TERMINAL</EM> structure for the device has not been
|
||||
initialized.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
|
||||
Applications employing <EM>ncurses</EM> extensions should condition their use on
|
||||
the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
|
||||
|
||||
Except as noted in section "EXTENSIONS" above, X/Open Curses, Issue 4,
|
||||
Version 2 describes these functions.
|
||||
Except as noted in section "EXTENSIONS" above, X/Open Curses Issue 4
|
||||
describes these functions. It specifies no error conditions for them.
|
||||
|
||||
<EM>ncurses</EM> follows X/Open Curses and the historical practice of AT&T
|
||||
<EM>curses</EM> implementations, in that the echo bit is cleared when <EM>curses</EM>
|
||||
initializes the terminal state. BSD <EM>curses</EM> differed from this
|
||||
slightly; it left the echo bit on at initialization, but the BSD <STRONG>raw</STRONG>
|
||||
call turned it off as a side effect. For best portability, set <STRONG>echo</STRONG> or
|
||||
<STRONG>noecho</STRONG> explicitly just after initialization, even if your program
|
||||
remains in cooked mode.
|
||||
SVr4 describes a successful return value only as "an integer value
|
||||
other than <EM>ERR</EM>".
|
||||
|
||||
X/Open Curses is ambiguous regarding whether <STRONG>raw</STRONG> should disable the
|
||||
CR/LF translations controlled by <STRONG>nl</STRONG> and <STRONG>nonl</STRONG>. BSD <EM>curses</EM> did turn off
|
||||
these translations; AT&T <EM>curses</EM> (at least as late as SVr1) did not.
|
||||
<EM>ncurses</EM> does so, on the assumption that a programmer requesting raw
|
||||
input wants a clean (ideally, 8-bit clean) connection that the
|
||||
<EM>ncurses</EM> follows X/Open Curses and the historical practice of System V
|
||||
<EM>curses</EM>, clearing the terminal driver's "echo" flag when initializing
|
||||
the screen. BSD <EM>curses</EM> did not, but its <EM>raw</EM> function turned it off as
|
||||
a side effect. For best portability, call <EM>echo</EM> or <EM>noecho</EM> explicitly
|
||||
just after initialization, even if your program retains the terminal's
|
||||
canonical ("cooked") line discipline.
|
||||
|
||||
X/Open Curses is ambiguous regarding whether <EM>raw</EM> should disable the
|
||||
carriage return and line feed translation feature controlled by <EM>nl</EM> and
|
||||
<EM>nonl</EM>. BSD <EM>curses</EM> turned off these translations; System V <EM>curses</EM> did
|
||||
not. <EM>ncurses</EM> does so, on the assumption that a programmer requesting
|
||||
raw input wants a clean (ideally, 8-bit clean) connection that the
|
||||
operating system will not alter.
|
||||
|
||||
When <STRONG>keypad</STRONG> is first enabled, <EM>ncurses</EM> loads the key definitions for the
|
||||
current terminal description. If the terminal description includes
|
||||
extended string capabilities, e.g., from using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>,
|
||||
then <EM>ncurses</EM> also defines keys for the capabilities whose names begin
|
||||
with "k". The corresponding keycodes are generated and (depending on
|
||||
previous loads of terminal descriptions) may differ from one execution
|
||||
of a program to the next. The generated keycodes are recognized by the
|
||||
<STRONG><A HREF="curs_util.3x.html">keyname(3x)</A></STRONG> function (which will then return a name beginning with "k"
|
||||
denoting the terminfo capability name rather than "K", used for <EM>curses</EM>
|
||||
key names). On the other hand, an application can use <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>
|
||||
to establish a specific keycode for a given string. This makes it
|
||||
possible for an application to check for an extended capability's
|
||||
presence with <STRONG>tigetstr</STRONG>, and reassign the keycode to match its own
|
||||
needs.
|
||||
When <STRONG>keypad</STRONG> is first enabled for a window, <EM>ncurses</EM> loads the standard
|
||||
function key string capabilities for the terminal type description of
|
||||
its screen; see the entries beginning with "key_" in <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>. If
|
||||
that description includes extended string capabilities, produced by the
|
||||
<STRONG>-x</STRONG> option of <STRONG><A HREF="tic.1m.html">tic(1)</A></STRONG>, for example, then <EM>ncurses</EM> also defines keys for
|
||||
the capabilities whose codes begin with "k". <EM>ncurses</EM> generates a
|
||||
numeric key code for each such extended capability; depending on
|
||||
previous loads of terminal type descriptions, these may differ from one
|
||||
execution of a program to the next. <STRONG><A HREF="curs_util.3x.html">keyname(3x)</A></STRONG> recognizes the
|
||||
generated key codes and returns a name beginning with "k" denoting the
|
||||
<EM>terminfo</EM> capability name rather than "KEY_", used for <EM>curses</EM> key names.
|
||||
On the other hand, an application can use <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG> to bind a
|
||||
selected key to a string of the programmer's choice. This feature
|
||||
enables an application to check for its presence with <STRONG><A HREF="curs_terminfo.3x.html">tigetstr(3x)</A></STRONG>, and
|
||||
reassign the numeric key code to match its own needs.
|
||||
|
||||
Low-level applications can use <STRONG>tigetstr</STRONG> to obtain the definition of any
|
||||
particular string capability. Higher-level applications which use the
|
||||
<EM>curses</EM> <STRONG>wgetch</STRONG> and similar functions to return keycodes rely upon the
|
||||
order in which the strings are loaded. If more than one key definition
|
||||
has the same string value, then <STRONG>wgetch</STRONG> can return only one keycode.
|
||||
Most <EM>curses</EM> implementations (including <EM>ncurses</EM>) load key definitions in
|
||||
the order defined by the array of string capability names. The last
|
||||
key to be loaded determines the keycode which will be returned. In
|
||||
<EM>ncurses</EM>, you may also have extended capabilities interpreted as key
|
||||
definitions. These are loaded after the predefined keys, and if a
|
||||
capability's value is the same as a previously-loaded key definition,
|
||||
the later definition is the one used.
|
||||
Low-level applications can use <STRONG><A HREF="curs_terminfo.3x.html">tigetstr(3x)</A></STRONG> to obtain the definition of
|
||||
any string capability. <EM>curses</EM> applications use the input character
|
||||
reading function to obtain key codes from input and rely upon the order
|
||||
in which the string capabilities are loaded. Multiple key capability
|
||||
strings can have the same value, but the input character reading
|
||||
function can report only one key code. Most <EM>curses</EM> implementations
|
||||
(including <EM>ncurses</EM>) load key definitions in the order they appear in
|
||||
the <STRONG>strfnames</STRONG> array of string capability names; see <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
|
||||
The last capability read using a particular definition determines the
|
||||
key code to be reported. In <EM>ncurses</EM>, extended capabilities can be
|
||||
interpreted as key definitions. The library loads these after its
|
||||
built-in definitions, and if an extended capability's value is the same
|
||||
as one previously loaded, the library uses the later definition.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
|
||||
Formerly, <EM>ncurses</EM> used <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> to control the conversion of
|
||||
4BSD (1980) introduced <EM>echo</EM>, <EM>noecho</EM>, <EM>nl</EM>, <EM>nonl</EM>, <EM>raw</EM>, and <EM>noraw</EM>.
|
||||
|
||||
SVr2 (1984) featured a new terminal driver, extending the <EM>curses</EM> API to
|
||||
support it with <EM>cbreak</EM>, <EM>nocbreak</EM>, <EM>intrflush</EM>, <EM>keypad</EM>, <EM>meta</EM>, <EM>nodelay</EM>, and
|
||||
<EM>typeahead</EM>.
|
||||
|
||||
SVr3 (1987) added <EM>halfdelay</EM>, <EM>notimeout</EM>, and <EM>wtimeout</EM>. <EM>qiflush</EM> and
|
||||
<EM>noqiflush</EM> appeared in SVr3.1 (1987), at which point <EM>intrflush</EM> became a
|
||||
wrapper for either of these functions, depending on the value of its
|
||||
Boolean argument. SVr3.1 also added <EM>timeout</EM>.
|
||||
|
||||
<EM>ncurses</EM> 6.5 (2024) introduced <EM>is</EM><STRONG>_</STRONG><EM>cbreak</EM>, <EM>is</EM><STRONG>_</STRONG><EM>echo</EM>, <EM>is</EM><STRONG>_</STRONG><EM>nl</EM>, and <EM>is</EM><STRONG>_</STRONG><EM>raw</EM>.
|
||||
|
||||
Formerly, <EM>ncurses</EM> used <EM>nl</EM> and <EM>nonl</EM> to control the conversion of
|
||||
newlines to carriage return/line feed on output as well as input.
|
||||
X/Open Curses documents the use of these functions only for input.
|
||||
This difference arose from converting the <EM>pcurses</EM> source (1986), which
|
||||
used <STRONG>ioctl(2)</STRONG> calls and the <EM>sgttyb</EM> structure, to <EM>termios</EM> (the POSIX
|
||||
terminal API). In the former, both input and output were controlled
|
||||
via a single option <STRONG>CRMOD</STRONG>, while the latter separates these features.
|
||||
Because that conversion interferes with output optimization, <EM>ncurses</EM>
|
||||
6.2 (2020) amended <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> to eliminate their effect on output.
|
||||
terminal API). In the former, both input and output conversions were
|
||||
controlled via a single option "CRMOD", while the latter separates
|
||||
these features. Because that conversion interferes with output
|
||||
optimization, <EM>ncurses</EM> 6.2 (2020) amended <EM>nl</EM> and <EM>nonl</EM> to eliminate their
|
||||
effect on output.
|
||||
|
||||
|
||||
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
|
||||
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>,
|
||||
<STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>, <STRONG>termios(3)</STRONG>
|
||||
<STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>, <STRONG>termios(3)</STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
|
||||
|
||||
|
||||
|
||||
ncurses 6.5 2024-04-13 <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>
|
||||
ncurses 6.6 2025-10-04 <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>
|
||||
</PRE>
|
||||
<div class="nav">
|
||||
<ul>
|
||||
@@ -366,8 +429,8 @@ ncurses 6.5 2024-04-13 <STRONG><A HREF="
|
||||
<li><a href="#h3-nl_nonl">nl, nonl</a></li>
|
||||
<li><a href="#h3-nodelay">nodelay</a></li>
|
||||
<li><a href="#h3-notimeout">notimeout</a></li>
|
||||
<li><a href="#h3-qiflush_noqiflush">qiflush, noqiflush</a></li>
|
||||
<li><a href="#h3-raw_noraw">raw, noraw</a></li>
|
||||
<li><a href="#h3-qiflush_nqiflush">qiflush, nqiflush</a></li>
|
||||
<li><a href="#h3-timeout_wtimeout">timeout, wtimeout</a></li>
|
||||
<li><a href="#h3-typeahead">typeahead</a></li>
|
||||
</ul>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user