Vendor import ncurses 6.1-20200118

This commit is contained in:
Baptiste Daroussin 2020-02-07 08:36:41 +00:00
parent cea297eb34
commit f0179cb608
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/ncurses/dist/; revision=357645
svn path=/vendor/ncurses/6.1-20200118/; revision=357646; tag=vendor/ncurses/6.1-20200118
943 changed files with 142819 additions and 72604 deletions

1398
ANNOUNCE

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2006 Free Software Foundation, Inc. --
-- Copyright (c) 2006,2017 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: AUTHORS,v 1.2 2006/10/28 21:44:52 tom Exp $
-- $Id: AUTHORS,v 1.3 2017/02/04 15:20:52 tom Exp $
-------------------------------------------------------------------------------
These are the principal authors/contributors of ncurses since 1.9.9e,
in decreasing order of their contribution:
@ -36,3 +36,4 @@ ESR Eric S Raymond
AVL Alexander V Lukyanov
PB Philippe Blain
SV Sven Verdoolaege
NB Nicolas Boulenguez

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.21 2010/11/27 21:45:27 tom Exp $
# $Id: Makefile.in,v 1.22 2015/08/05 23:15:41 tom Exp $
##############################################################################
# Copyright (c) 1998-2003,2010 Free Software Foundation, Inc. #
# Copyright (c) 1998-2010,2015 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -30,9 +30,9 @@
# Author: Juergen Pfeifer, 1996
#
# Version Control
# $Revision: 1.21 $
# $Revision: 1.22 $
#
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
THIS = Makefile

View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --

2147
Ada95/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

9292
Ada95/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 2010-2012,2013 Free Software Foundation, Inc. *
dnl Copyright (c) 2010-2019,2020 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -28,19 +28,25 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey
dnl
dnl $Id: configure.in,v 1.49 2013/11/16 20:06:37 tom Exp $
dnl $Id: configure.in,v 1.74 2020/01/11 23:33:38 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl For additional information, see
dnl https://invisible-island.net/autoconf/
dnl https://invisible-island.net/autoconf/my-autoconf.html
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20030208)
AC_REVISION($Revision: 1.49 $)
AC_PREREQ(2.52.20200111)
AC_REVISION($Revision: 1.74 $)
AC_INIT(gen/gen.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
AC_DEFUN([AC_PATH_XTRA],[])dnl ignore dependencies on this
CF_TOP_BUILDDIR
CF_HELP_MESSAGE(General Options:)
CF_WITH_SYSTYPE
### Save the given $CFLAGS to allow user-override.
@ -53,7 +59,7 @@ CF_CFG_DEFAULTS
CF_PROG_CC(gnatgcc gcc cc)
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
CF_PROG_CC_C_O(CC)
CF_PROG_CC_C_O(CC,[$CFLAGS $CPPFLAGS])
AC_ARG_PROGRAM
@ -62,12 +68,14 @@ CF_PROG_EGREP
AC_PROG_INSTALL
CF_PROG_LN_S
CF_PROG_INSTALL
CF_INSTALL_OPTS
AC_SYS_LONG_FILE_NAMES
# if we find pkg-config, check if we should install the ".pc" files.
CF_PKG_CONFIG
CF_WITH_PKG_CONFIG_LIBDIR
CF_ENABLE_PC_FILES
AC_MSG_CHECKING(if you want to build test-programs)
AC_ARG_WITH(tests,
@ -83,12 +91,12 @@ AC_ARG_ENABLE(mixed-case,
[enable_mixedcase=auto])
AC_MSG_RESULT($enable_mixedcase)
if test "$enable_mixedcase" = "auto" ; then
CF_MIXEDCASE_FILENAMES
CF_MIXEDCASE_FILENAMES
else
cf_cv_mixedcase=$enable_mixedcase
if test "$enable_mixedcase" = "yes" ; then
AC_DEFINE(MIXEDCASE_FILENAMES)
fi
cf_cv_mixedcase=$enable_mixedcase
if test "$enable_mixedcase" = "yes" ; then
AC_DEFINE(MIXEDCASE_FILENAMES)
fi
fi
# do this after mixed-case option (tags/TAGS is not as important as tic).
@ -109,10 +117,10 @@ 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 #(vi
yes|no) #(vi
[case "$withval" in
(yes|no)
;;
*) DESTDIR="$withval"
(*) DESTDIR="$withval"
;;
esac])
AC_MSG_RESULT($DESTDIR)
@ -175,10 +183,10 @@ AC_SUBST(CC_G_OPT)
AC_MSG_CHECKING(for default loader flags)
case $DFT_LWR_MODEL in
normal) LD_MODEL='' ;;
debug) LD_MODEL=$CC_G_OPT ;;
profile) LD_MODEL='-pg';;
shared) LD_MODEL='' ;;
(normal) LD_MODEL='' ;;
(debug) LD_MODEL=$CC_G_OPT ;;
(profile) LD_MODEL='-pg';;
(shared) LD_MODEL='' ;;
esac
AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
AC_MSG_RESULT($LD_MODEL)
@ -218,8 +226,8 @@ if test "$with_broken_linker" = yes ; then
AC_DEFINE(BROKEN_LINKER)
BROKEN_LINKER=1
elif test "$DFT_LWR_MODEL" = shared ; then
case $cf_cv_system_name in #(vi
cygwin*)
case $cf_cv_system_name in
(cygwin*)
AC_DEFINE(BROKEN_LINKER)
BROKEN_LINKER=1
CF_VERBOSE(cygwin linker is broken anyway)
@ -229,7 +237,7 @@ fi
AC_SUBST(BROKEN_LINKER)
# Check to define _XOPEN_SOURCE "automatically"
CF_XOPEN_SOURCE
CF_XOPEN_SOURCE(600)
CF_LARGEFILE
@ -294,27 +302,27 @@ CF_WITH_PTHREAD
AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
AC_ARG_ENABLE(weak-symbols,
[ --enable-weak-symbols enable weak-symbols for pthreads],
[use_weak_symbols=$withval],
[use_weak_symbols=no])
[ --enable-weak-symbols enable weak-symbols for pthreads],
[use_weak_symbols=$withval],
[use_weak_symbols=no])
AC_MSG_RESULT($use_weak_symbols)
if test "$use_weak_symbols" = yes ; then
CF_WEAK_SYMBOLS
CF_WEAK_SYMBOLS
else
cf_cv_weak_symbols=no
cf_cv_weak_symbols=no
fi
if test $cf_cv_weak_symbols = yes ; then
AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads])
AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads])
fi
PTHREAD=
if test "$with_pthread" = "yes" ; then
AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use the pthreads library])
enable_reentrant=yes
if test $cf_cv_weak_symbols = yes ; then
PTHREAD=-lpthread
fi
AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use the pthreads library])
enable_reentrant=yes
if test $cf_cv_weak_symbols = yes ; then
PTHREAD=-lpthread
fi
fi
AC_SUBST(PTHREAD)
@ -411,7 +419,7 @@ AC_ARG_ENABLE(macros,
# extended to all models of the ncurses library:
cf_all_traces=no
case "$CFLAGS $CPPFLAGS" in
*-DTRACE*)
(*-DTRACE*)
cf_all_traces=yes
;;
esac
@ -432,11 +440,13 @@ fi
AC_SUBST(ADA_TRACE)
CF_DISABLE_GNAT_PROJECTS
### Checks for libraries.
case $cf_cv_system_name in #(vi
*mingw32*) #(vi
case $cf_cv_system_name in
(*mingw32*)
;;
*)
(*)
AC_CHECK_FUNC(gettimeofday,
AC_DEFINE(HAVE_GETTIMEOFDAY),[
@ -447,6 +457,7 @@ AC_CHECK_LIB(bsd, gettimeofday,
esac
### Checks for header files.
AC_CHECK_SIZEOF([signed char], 0)
AC_STDC_HEADERS
AC_HEADER_DIRENT
AC_HEADER_TIME
@ -476,9 +487,10 @@ if test "$cf_with_ada" != "no" ; then
if test "$cf_cv_prog_gnat_correct" = yes; then
CF_FIXUP_ADAFLAGS
CF_GNATPREP_OPT_T
CF_GNAT_GENERICS
CF_GNAT_SIGINT
CF_GNAT_PRAGMA_UNREF
CF_GNAT_PROJECTS
CF_WITH_ADA_COMPILER
@ -489,6 +501,9 @@ if test "$cf_with_ada" != "no" ; then
CF_WITH_ADA_INCLUDE
CF_WITH_ADA_OBJECTS
CF_WITH_ADA_SHAREDLIB
# allow the Ada binding to be renamed
CF_WITH_ADA_LIBNAME(AdaCurses)
else
AC_MSG_ERROR(No usable Ada compiler found)
fi
@ -527,20 +542,29 @@ AC_MSG_RESULT($DFT_OBJ_SUBDIR)
### Set up low-level terminfo dependencies for makefiles.
if test "$DFT_LWR_MODEL" = shared ; then
case $cf_cv_system_name in #(vi
cygwin*)
case $cf_cv_system_name in
(cygwin*)
# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
;;
msys*)
(msys*)
# "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
;;
esac
fi
USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
AC_SUBST(USE_ARG_SUFFIX)
USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
AC_SUBST(USE_LIB_SUFFIX)
USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
AC_SUBST(USE_CFG_SUFFIX)
### Construct the list of subdirectories for which we'll customize makefiles
### with the appropriate compile-rules.
SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as the library path-separator])
@ -549,17 +573,6 @@ CF_ADD_CFLAGS($EXTRA_CFLAGS)
################################################################################
if test x"$enable_pc_files" = xyes ; then \
SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
MAKE_PC_FILES=
else
MAKE_PC_FILES="#"
fi
AC_SUBST(MAKE_PC_FILES)
AC_SUBST(cross_compiling)
################################################################################
TEST_ARG2=
AC_SUBST(TEST_ARG2)
@ -590,8 +603,17 @@ AC_SUBST(EXTERNAL_TREE)
ADAHTML_DIR=../doc/ada
AC_SUBST(ADAHTML_DIR)
if test "x$cross_compiling" = xyes ; then
ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
else
ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
fi
AC_SUBST(ADAGEN_LDFLAGS)
AC_OUTPUT( \
$SUB_MAKEFILES \
src/library.gpr:src/library.gpr.in \
doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \
Makefile,[
if test -z "$USE_OLD_MAKERULES" ; then

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.3 2012/08/11 21:31:56 tom Exp $
# $Id: Makefile.in,v 1.6 2019/09/07 20:21:52 tom Exp $
##############################################################################
# Copyright (c) 2011 Free Software Foundation, Inc. #
# Copyright (c) 2011-2018,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -31,7 +31,7 @@
#
# Makefile for AdaCurses manual pages.
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
DESTDIR = @DESTDIR@
@ -42,12 +42,12 @@ datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
INSTALL = @INSTALL@
INSTALL = @INSTALL@ @INSTALL_OPT_O@
INSTALL_DATA = @INSTALL_DATA@
DFT_ARG_SUFFIX = @DFT_ARG_SUFFIX@
THIS = AdaCurses
THIS = @ADA_LIBNAME@
DOCDIR = $(DESTDIR)$(datadir)/doc/$(THIS)
MANDIR = $(DESTDIR)$(mandir)/man1

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. #
# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -28,11 +28,11 @@
#
# Author: Juergen Pfeifer, 1996
#
# $Id: Makefile.in,v 1.77 2012/10/06 18:58:48 tom Exp $
# $Id: Makefile.in,v 1.89 2019/08/31 15:44:14 tom Exp $
#
.SUFFIXES:
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
THIS = Makefile
@ -46,8 +46,8 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
INSTALL = @INSTALL@
INSTALL_PROG = @INSTALL_PROGRAM@
INSTALL = @INSTALL@ @INSTALL_OPT_O@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
AWK = @AWK@
@ -55,12 +55,15 @@ LN_S = @LN_S@
CC = @CC@
HOST_CC = @BUILD_CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @ACPPFLAGS@ @CPPFLAGS@ \
CFLAGS = @CFLAGS@
HOST_CFLAGS = @BUILD_CFLAGS@
CPPFLAGS = @CPPFLAGS@
HOST_CPPFLAGS = @ACPPFLAGS@ @BUILD_CPPFLAGS@ \
-DHAVE_CONFIG_H -I$(srcdir)
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CCFLAGS = $(HOST_CPPFLAGS) $(HOST_CFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
@ -73,19 +76,29 @@ ABI_VERSION = @cf_cv_abi_version@
LOCAL_LIBDIR = @top_builddir@/lib
LINK = $(HOST_CC)
LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
# For the wide-character configuration combined with broken_linker, we need
# addresses of ACS_xxx constants, which requires linking with the newly built
# ncurses library. If cross-compiling, the developer has to fill in a workable
# native library for this purpose.
NATIVE_LDFLAGS = @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ $(LDFLAGS) @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@
CROSS_LDFLAGS = @BUILD_LDFLAGS@ @BUILD_LIBS@
ACTUAL_LDFLAGS = @ADAGEN_LDFLAGS@
RANLIB = @RANLIB@
M4 = m4
M4FLAGS = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config
ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config
WRAPPER = @NCURSES_SHLIB2@
PROG_GENERATE = ./generate$x
GENERATE = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@'
GENERATE = $(PROG_GENERATE) '@USE_ARG_SUFFIX@'
DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
GNATHTML = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
@ -97,39 +110,6 @@ ABASE = $(ALIB)-curses
ADA_SRCDIR = ../src
GEN_FILES0 = Base_Defs
GEN_FILES1 = ACS_Map \
AC_Rep \
Base_Defs \
Character_Attribute_Set_Rep \
Color_Defs \
Key_Definitions \
Linker_Options \
Old_Keys \
Public_Variables \
Trace_Defs \
Version_Info \
Window_Offsets
GEN_FILES2 = Menu_Opt_Rep \
Menu_Base_Defs \
Menu_Linker_Options \
Item_Rep
GEN_FILES3 = Form_Opt_Rep \
Form_Base_Defs \
Form_Linker_Options \
Field_Rep
GEN_FILES4 = Mouse_Base_Defs \
Mouse_Event_Rep \
Mouse_Events \
Panel_Linker_Options
GEN_FILES5 = Chtype_Def \
Eti_Defs
GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \
$(ADA_SRCDIR)/$(ABASE).adb \
$(ADA_SRCDIR)/$(ABASE)-aux.ads \
@ -143,7 +123,8 @@ GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).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)-panels-user_data.ads \
$(ADA_SRCDIR)/$(ABASE)_constants.ads
GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \
$(srcdir)/$(ABASE).adb.m4 \
@ -172,140 +153,64 @@ $(DESTDIR)$(bindir) :
install \
install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
$(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
$(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
uninstall \
uninstall.libs ::
-rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
$(PROG_GENERATE): gen.o
@ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
@ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@
gen.o: $(srcdir)/gen.c
$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
################################################################################
Character_Attribute_Set_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B A" >$@
Base_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B B" >$@
Color_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B C" >$@
Window_Offsets: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B D" >$@
Key_Definitions: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B K" >$@
Linker_Options: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B L" >$@
ACS_Map: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B M" >$@
Old_Keys: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B O" >$@
Public_Variables: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B P" >$@
AC_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B R" >$@
Version_Info: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B V" >$@
Trace_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B T" >$@
################################################################################
Menu_Opt_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) M R" >$@
Menu_Base_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) M B" >$@
Menu_Linker_Options: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) M L" >$@
Item_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) M I" >$@
################################################################################
Form_Opt_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) F R" >$@
Form_Base_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) F B" >$@
Form_Linker_Options: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) F L" >$@
Field_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) F I" >$@
################################################################################
Mouse_Base_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) P B" >$@
Mouse_Event_Rep: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) P M" >$@
Mouse_Events: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) B E" >$@
Panel_Linker_Options: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) P L" >$@
Chtype_Def: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) E C" >$@
Eti_Defs: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE) E E" >$@
$(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
$(WRAPPER) "$(GENERATE)" >$@
################################################################################
$(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \
$(GEN_FILES1) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE).ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE).adb: $(srcdir)/$(ABASE).adb.m4 \
$(GEN_FILES1) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE).adb.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
$(GEN_FILES5) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-aux.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
$(GEN_FILES5) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-trace.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
$(GEN_FILES2) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-menus.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
$(GEN_FILES3) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-forms.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
$(GEN_FILES4) $(srcdir)/normal.m4
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-mouse.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
$(GEN_FILES4) \
$(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-panels.ads.m4 |\
@ -363,11 +268,6 @@ tags:
mostlyclean ::
-rm -f a.out core $(PROG_GENERATE) *.o
-rm -f $(GEN_FILES1)
-rm -f $(GEN_FILES2)
-rm -f $(GEN_FILES3)
-rm -f $(GEN_FILES4)
-rm -f $(GEN_FILES5)
clean :: mostlyclean
-rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
@ -429,6 +329,8 @@ adahtml:
sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
sed -e 's%&lt;A HREF%<A HREF%g' |\
sed -e 's%"&gt;%">%g' |\
sed -e 's%#1A\([[:space:]]*NAME="[^"]*"\)#2%<A\1>%' |\
sed -e 's%#1/A#2%</A>%' |\
sed -e 's/3X/3x/g' |\
sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\

View File

@ -1,7 +1,7 @@
#! /bin/sh
# $Id: adacurses-config.in,v 1.6 2010/03/06 21:05:01 tom Exp $
# $Id: adacurses-config.in,v 1.13 2019/09/07 20:20:52 tom Exp $
##############################################################################
# Copyright (c) 2007-2009,2010 Free Software Foundation, Inc. #
# Copyright (c) 2007-2016,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -40,14 +40,15 @@ ADA_OBJECTS=@ADA_OBJECTS@
VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS"
LIBS="-L$ADA_OBJECTS -lAdaCurses"
CFLAGS="-aI$ADA_INCLUDE -aO$ADA_OBJECTS"
LIBS="-L$ADA_OBJECTS -l@ADA_LIBNAME@"
THIS="adacurses"
THIS="@ADA_LIBNAME@"
THIS_CFG="$THIS@DFT_ARG_SUFFIX@-config"
case "x$1" in
x--version)
echo AdaCurses $VERSION
echo @ADA_LIBNAME@ $VERSION
;;
x--cflags)
echo $CFLAGS
@ -57,23 +58,25 @@ case "x$1" in
;;
x)
# if no parameter is given, give what gnatmake needs
echo "$CFLAGS -i -largs $LIBS"
echo "$CFLAGS -largs $LIBS"
;;
x--help)
cat <<ENDHELP
Usage: ${THIS}-config [options]
Usage: ${THIS_CFG} [options]
Options:
--cflags echos the C compiler flags needed to compile with ${THIS}
--libs echos the libraries needed to link with ${THIS}
--cflags echos the gnat (Ada compiler) flags needed to compile with ${THIS}
--libs echos the gnat libraries needed to link with ${THIS}
--version echos the release+patchdate version of ${THIS}
--help prints this message
If no options are given, echos the full set of flags needed by gnatmake.
ENDHELP
;;
*)
echo 'Usage: adacurses@DFT_ARG_SUFFIX@-config [--version | --cflags | --libs]' >&2
echo 'Usage: $THIS_CFG [--version | --cflags | --libs]' >&2
exit 1
;;
esac

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. *
dnl Copyright (c) 2000-2007,2019 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
dnl $Id: html.m4,v 1.3 2007/09/01 23:59:59 tom Exp $
dnl $Id: html.m4,v 1.4 2019/03/16 21:49:15 tom Exp $
define(`ANCHORIDX',`0')dnl
define(`MANPAGE',`define(`MANPG',$1)dnl
|=====================================================================
@ -35,6 +35,6 @@ define(`MANPAGE',`define(`MANPG',$1)dnl
define(`ANCHOR',`define(`ANCHORIDX',incr(ANCHORIDX))dnl
`#'1A NAME="AFU`_'ANCHORIDX"`#'2dnl
define(`CFUNAME',`$1')define(`AFUNAME',`$2')dnl
|')dnl
|#1/A#2')dnl
define(`AKA',``AKA': <A HREF="../man/MANPG.html">CFUNAME</A>')dnl
define(`ALIAS',``AKA': $1')dnl

View File

@ -10,7 +10,7 @@ include(M4MACRO)dnl
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -38,20 +38,16 @@ include(M4MACRO)dnl
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.18 $
-- $Revision: 1.24 $
-- Binding Version 01.00
------------------------------------------------------------------------------
include(`Base_Defs')
with System;
with Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Unchecked_Conversion;
package Terminal_Interface.Curses.Aux is
pragma Preelaborate (Terminal_Interface.Curses.Aux);
use type Interfaces.C.int;
subtype C_Int is Interfaces.C.int;
subtype C_Short is Interfaces.C.short;
subtype C_Long_Int is Interfaces.C.long;
@ -60,39 +56,39 @@ package Terminal_Interface.Curses.Aux is
subtype C_ULong is Interfaces.C.unsigned_long;
subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr;
type C_Void_Ptr is new System.Address;
include(`Chtype_Def')
-- This is how those constants are defined in ncurses. I see them also
-- exactly like this in all ETI implementations I ever tested. So it
-- could be that this is quite general, but please check with your curses.
-- This is critical, because curses sometime mixes Boolean returns with
-- returning an error status.
Curses_Ok : constant C_Int := CF_CURSES_OK;
Curses_Err : constant C_Int := CF_CURSES_ERR;
Curses_Ok : constant C_Int := Curses_Constants.OK;
Curses_Err : constant C_Int := Curses_Constants.ERR;
Curses_True : constant C_Int := CF_CURSES_TRUE;
Curses_False : constant C_Int := CF_CURSES_FALSE;
Curses_True : constant C_Int := Curses_Constants.TRUE;
Curses_False : constant C_Int := Curses_Constants.FALSE;
-- Eti_Error: type for error codes returned by the menu and form subsystem
include(`Eti_Defs')
type Eti_Error is
(E_Current,
E_Invalid_Field,
E_Request_Denied,
E_Not_Connected,
E_Not_Selectable,
E_No_Match,
E_Unknown_Command,
E_Not_Posted,
E_No_Room,
E_Bad_State,
E_Connected,
E_Posted,
E_Bad_Argument,
E_System_Error,
E_Ok);
procedure Eti_Exception (Code : Eti_Error);
-- Dispatch the error code and raise the appropriate exception
--
--
-- Some helpers
function Chtype_To_AttrChar is new
Unchecked_Conversion (Source => C_Chtype,
Target => Attributed_Character);
function AttrChar_To_Chtype is new
Unchecked_Conversion (Source => Attributed_Character,
Target => C_Chtype);
function AttrChar_To_AttrType is new
Unchecked_Conversion (Source => Attributed_Character,
Target => C_AttrType);
function AttrType_To_AttrChar is new
Unchecked_Conversion (Source => C_AttrType,
Target => Attributed_Character);
-- Do nothing if Code = E_Ok.
-- Else dispatch the error code and raise the appropriate exception.
procedure Fill_String (Cp : chars_ptr;
Str : out String);
@ -102,4 +98,23 @@ include(`Eti_Defs')
function Fill_String (Cp : chars_ptr) return String;
-- Same but as function.
private
for Eti_Error'Size use C_Int'Size;
pragma Convention (C, Eti_Error);
for Eti_Error use
(E_Current => Curses_Constants.E_CURRENT,
E_Invalid_Field => Curses_Constants.E_INVALID_FIELD,
E_Request_Denied => Curses_Constants.E_REQUEST_DENIED,
E_Not_Connected => Curses_Constants.E_NOT_CONNECTED,
E_Not_Selectable => Curses_Constants.E_NOT_SELECTABLE,
E_No_Match => Curses_Constants.E_NO_MATCH,
E_Unknown_Command => Curses_Constants.E_UNKNOWN_COMMAND,
E_Not_Posted => Curses_Constants.E_NOT_POSTED,
E_No_Room => Curses_Constants.E_NO_ROOM,
E_Bad_State => Curses_Constants.E_BAD_STATE,
E_Connected => Curses_Constants.E_CONNECTED,
E_Posted => Curses_Constants.E_POSTED,
E_Bad_Argument => Curses_Constants.E_BAD_ARGUMENT,
E_System_Error => Curses_Constants.E_SYSTEM_ERROR,
E_Ok => Curses_Constants.E_OK);
end Terminal_Interface.Curses.Aux;

View File

@ -10,7 +10,7 @@ include(M4MACRO)dnl
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -38,14 +38,14 @@ include(M4MACRO)dnl
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.17 $
-- $Revision: 1.20 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux;
package Terminal_Interface.Curses.Forms.Field_Types is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types);
use type Interfaces.C.int;
subtype C_Int is Interfaces.C.int;
-- MANPAGE(`form_fieldtype.3x')
@ -227,12 +227,12 @@ private
Mak : Makearg_Function := Make_Arg'Access;
Cop : Copyarg_Function := Copy_Arg'Access;
Fre : Freearg_Function := Free_Arg'Access)
return C_Int;
return Aux.Eti_Error;
pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg");
function Set_Fieldtype_Choice (Cft : C_Field_Type;
Next, Prev : Choice_Function)
return C_Int;
return Aux.Eti_Error;
pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice");
end Terminal_Interface.Curses.Forms.Field_Types;

View File

@ -10,7 +10,7 @@ include(M4MACRO)dnl
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -38,18 +38,17 @@ include(M4MACRO)dnl
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.30 $
-- $Date: 2009/12/26 17:31:35 $
-- $Revision: 1.33 $
-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
include(`Form_Base_Defs')
with System;
with Ada.Characters.Latin_1;
package Terminal_Interface.Curses.Forms is
pragma Preelaborate (Terminal_Interface.Curses.Forms);
include(`Form_Linker_Options')dnl
include(`Linker_Options')
pragma Linker_Options ("-lform" & Curses_Constants.DFT_ARG_SUFFIX);
Space : Character renames Ada.Characters.Latin_1.Space;
type Field is private;
@ -63,18 +62,68 @@ include(`Linker_Options')
Center,
Right);
pragma Warnings (Off);
include(`Field_Rep')Dnl
type Field_Option_Set is
record
Visible : Boolean;
Active : Boolean;
Public : Boolean;
Edit : Boolean;
Wrap : Boolean;
Blank : Boolean;
Auto_Skip : Boolean;
Null_Ok : Boolean;
Pass_Ok : Boolean;
Static : Boolean;
end record;
pragma Convention (C_Pass_By_Copy, Field_Option_Set);
for Field_Option_Set use
record
Visible at 0 range Curses_Constants.O_VISIBLE_First
.. Curses_Constants.O_VISIBLE_Last;
Active at 0 range Curses_Constants.O_ACTIVE_First
.. Curses_Constants.O_ACTIVE_Last;
Public at 0 range Curses_Constants.O_PUBLIC_First
.. Curses_Constants.O_PUBLIC_Last;
Edit at 0 range Curses_Constants.O_EDIT_First
.. Curses_Constants.O_EDIT_Last;
Wrap at 0 range Curses_Constants.O_WRAP_First
.. Curses_Constants.O_WRAP_Last;
Blank at 0 range Curses_Constants.O_BLANK_First
.. Curses_Constants.O_BLANK_Last;
Auto_Skip at 0 range Curses_Constants.O_AUTOSKIP_First
.. Curses_Constants.O_AUTOSKIP_Last;
Null_Ok at 0 range Curses_Constants.O_NULLOK_First
.. Curses_Constants.O_NULLOK_Last;
Pass_Ok at 0 range Curses_Constants.O_PASSOK_First
.. Curses_Constants.O_PASSOK_Last;
Static at 0 range Curses_Constants.O_STATIC_First
.. Curses_Constants.O_STATIC_Last;
end record;
pragma Warnings (Off);
for Field_Option_Set'Size use Curses_Constants.Field_Options_Size;
pragma Warnings (On);
function Default_Field_Options return Field_Option_Set;
-- The initial defaults for the field options.
pragma Inline (Default_Field_Options);
pragma Warnings (Off);
include(`Form_Opt_Rep')Dnl
type Form_Option_Set is
record
NL_Overload : Boolean;
BS_Overload : Boolean;
end record;
pragma Convention (C_Pass_By_Copy, Form_Option_Set);
for Form_Option_Set use
record
NL_Overload at 0 range Curses_Constants.O_NL_OVERLOAD_First
.. Curses_Constants.O_NL_OVERLOAD_Last;
BS_Overload at 0 range Curses_Constants.O_BS_OVERLOAD_First
.. Curses_Constants.O_BS_OVERLOAD_Last;
end record;
pragma Warnings (Off);
for Form_Option_Set'Size use Curses_Constants.Field_Options_Size;
pragma Warnings (On);
function Default_Form_Options return Form_Option_Set;

View File

@ -10,7 +10,7 @@ include(M4MACRO)dnl
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -38,18 +38,17 @@ include(M4MACRO)dnl
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.28 $
-- $Date: 2009/12/26 18:35:22 $
-- $Revision: 1.31 $
-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
include(`Menu_Base_Defs')
with System;
with Ada.Characters.Latin_1;
package Terminal_Interface.Curses.Menus is
pragma Preelaborate (Terminal_Interface.Curses.Menus);
include(`Menu_Linker_Options')dnl
include(`Linker_Options')
pragma Linker_Options ("-lmenu" & Curses_Constants.DFT_ARG_SUFFIX);
Space : Character renames Ada.Characters.Latin_1.Space;
type Item is private;
@ -116,9 +115,34 @@ include(`Linker_Options')
--
-- Menu options
--
pragma Warnings (Off);
include(`Menu_Opt_Rep')dnl
type Menu_Option_Set is
record
One_Valued : Boolean;
Show_Descriptions : Boolean;
Row_Major_Order : Boolean;
Ignore_Case : Boolean;
Show_Matches : Boolean;
Non_Cyclic : Boolean;
end record;
pragma Convention (C_Pass_By_Copy, Menu_Option_Set);
for Menu_Option_Set use
record
One_Valued at 0 range Curses_Constants.O_ONEVALUE_First
.. Curses_Constants.O_ONEVALUE_Last;
Show_Descriptions at 0 range Curses_Constants.O_SHOWDESC_First
.. Curses_Constants.O_SHOWDESC_Last;
Row_Major_Order at 0 range Curses_Constants.O_ROWMAJOR_First
.. Curses_Constants.O_ROWMAJOR_Last;
Ignore_Case at 0 range Curses_Constants.O_IGNORECASE_First
.. Curses_Constants.O_IGNORECASE_Last;
Show_Matches at 0 range Curses_Constants.O_SHOWMATCH_First
.. Curses_Constants.O_SHOWMATCH_Last;
Non_Cyclic at 0 range Curses_Constants.O_NONCYCLIC_First
.. Curses_Constants.O_NONCYCLIC_Last;
end record;
pragma Warnings (Off);
for Menu_Option_Set'Size use Curses_Constants.Menu_Options_Size;
pragma Warnings (On);
function Default_Menu_Options return Menu_Option_Set;
@ -127,9 +151,19 @@ include(`Menu_Opt_Rep')dnl
--
-- Item options
--
pragma Warnings (Off);
include(`Item_Rep')dnl
type Item_Option_Set is
record
Selectable : Boolean;
end record;
pragma Convention (C_Pass_By_Copy, Item_Option_Set);
for Item_Option_Set use
record
Selectable at 0 range Curses_Constants.O_SELECTABLE_First
.. Curses_Constants.O_SELECTABLE_Last;
end record;
pragma Warnings (Off);
for Item_Option_Set'Size use Curses_Constants.Item_Options_Size;
pragma Warnings (On);
function Default_Item_Options return Item_Option_Set;

View File

@ -10,7 +10,7 @@ include(M4MACRO)dnl
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -38,11 +38,10 @@ include(M4MACRO)dnl
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.29 $
-- $Date: 2011/03/19 12:35:58 $
-- $Revision: 1.32 $
-- $Date: 2015/05/30 23:19:19 $
-- Binding Version 01.00
------------------------------------------------------------------------------
include(`Mouse_Base_Defs')
with System;
package Terminal_Interface.Curses.Mouse is
@ -155,7 +154,10 @@ package Terminal_Interface.Curses.Mouse is
pragma Inline (Mouse_Interval);
private
type Event_Mask is new Interfaces.C.unsigned_long;
-- This can be as little as 32 bits (unsigned), or as long as the system's
-- unsigned long. Declare it as the minimum size to handle all valid
-- sizes.
type Event_Mask is mod 4294967296;
type Mouse_Event is
record
@ -167,12 +169,35 @@ private
end record;
pragma Convention (C, Mouse_Event);
include(`Mouse_Event_Rep')
Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER;
-- This constant may be different on your system.
for Mouse_Event use
record
Id at 0 range Curses_Constants.MEVENT_id_First
.. Curses_Constants.MEVENT_id_Last;
X at 0 range Curses_Constants.MEVENT_x_First
.. Curses_Constants.MEVENT_x_Last;
Y at 0 range Curses_Constants.MEVENT_y_First
.. Curses_Constants.MEVENT_y_Last;
Z at 0 range Curses_Constants.MEVENT_z_First
.. Curses_Constants.MEVENT_z_Last;
Bstate at 0 range Curses_Constants.MEVENT_bstate_First
.. Curses_Constants.MEVENT_bstate_Last;
end record;
for Mouse_Event'Size use Curses_Constants.MEVENT_Size;
Generation_Bit_Order : System.Bit_Order renames Curses_Constants.Bit_Order;
include(`Mouse_Events')
No_Events : constant Event_Mask := 0;
All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
BUTTON_CTRL : constant Event_Mask := Curses_Constants.BUTTON_CTRL;
BUTTON_SHIFT : constant Event_Mask := Curses_Constants.BUTTON_SHIFT;
BUTTON_ALT : constant Event_Mask := Curses_Constants.BUTTON_ALT;
BUTTON1_EVENTS : constant Event_Mask
:= Curses_Constants.all_events_button_1;
BUTTON2_EVENTS : constant Event_Mask
:= Curses_Constants.all_events_button_2;
BUTTON3_EVENTS : constant Event_Mask
:= Curses_Constants.all_events_button_3;
BUTTON4_EVENTS : constant Event_Mask
:= Curses_Constants.all_events_button_4;
ALL_MOUSE_EVENTS : constant Event_Mask := Curses_Constants.ALL_MOUSE_EVENTS;
No_Events : constant Event_Mask := 0;
All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
end Terminal_Interface.Curses.Mouse;

View File

@ -10,7 +10,7 @@ include(M4MACRO)dnl
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -38,16 +38,16 @@ include(M4MACRO)dnl
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.20 $
-- $Date: 2009/12/26 17:38:58 $
-- $Revision: 1.22 $
-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System;
package Terminal_Interface.Curses.Panels is
pragma Preelaborate (Terminal_Interface.Curses.Panels);
include(`Panel_Linker_Options')dnl
include(`Linker_Options')
pragma Linker_Options ("-lpanel" & Curses_Constants.DFT_ARG_SUFFIX);
type Panel is private;
---------------------------

View File

@ -9,7 +9,7 @@ include(M4MACRO)----------------------------------------------------------------
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 Free Software Foundation, Inc. --
-- Copyright (c) 2000,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -37,16 +37,62 @@ include(M4MACRO)----------------------------------------------------------------
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control:
-- $Revision: 1.1 $
-- $Revision: 1.4 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Trace is
pragma Preelaborate (Terminal_Interface.Curses.Trace);
pragma Warnings (Off);
include(`Trace_Defs')
type Trace_Attribute_Set is
record
Times : Boolean;
Tputs : Boolean;
Update : Boolean;
Cursor_Move : Boolean;
Character_Output : Boolean;
Calls : Boolean;
Virtual_Puts : Boolean;
Input_Events : Boolean;
TTY_State : Boolean;
Internal_Calls : Boolean;
Character_Calls : Boolean;
Termcap_TermInfo : Boolean;
Attribute_Color : Boolean;
end record;
pragma Convention (C_Pass_By_Copy, Trace_Attribute_Set);
for Trace_Attribute_Set use
record
Times at 0 range Curses_Constants.TRACE_TIMES_First
.. Curses_Constants.TRACE_TIMES_Last;
Tputs at 0 range Curses_Constants.TRACE_TPUTS_First
.. Curses_Constants.TRACE_TPUTS_Last;
Update at 0 range Curses_Constants.TRACE_UPDATE_First
.. Curses_Constants.TRACE_UPDATE_Last;
Cursor_Move at 0 range Curses_Constants.TRACE_MOVE_First
.. Curses_Constants.TRACE_MOVE_Last;
Character_Output at 0 range Curses_Constants.TRACE_CHARPUT_First
.. Curses_Constants.TRACE_CHARPUT_Last;
Calls at 0 range Curses_Constants.TRACE_CALLS_First
.. Curses_Constants.TRACE_CALLS_Last;
Virtual_Puts at 0 range Curses_Constants.TRACE_VIRTPUT_First
.. Curses_Constants.TRACE_VIRTPUT_Last;
Input_Events at 0 range Curses_Constants.TRACE_IEVENT_First
.. Curses_Constants.TRACE_IEVENT_Last;
TTY_State at 0 range Curses_Constants.TRACE_BITS_First
.. Curses_Constants.TRACE_BITS_Last;
Internal_Calls at 0 range Curses_Constants.TRACE_ICALLS_First
.. Curses_Constants.TRACE_ICALLS_Last;
Character_Calls at 0 range Curses_Constants.TRACE_CCALLS_First
.. Curses_Constants.TRACE_CCALLS_Last;
Termcap_TermInfo at 0 range Curses_Constants.TRACE_DATABASE_First
.. Curses_Constants.TRACE_DATABASE_Last;
Attribute_Color at 0 range Curses_Constants.TRACE_ATTRS_First
.. Curses_Constants.TRACE_ATTRS_Last;
end record;
pragma Warnings (Off);
for Trace_Attribute_Set'Size use Curses_Constants.Trace_Size;
pragma Warnings (On);
Trace_Disable : constant Trace_Attribute_Set := (others => False);

View File

@ -9,7 +9,7 @@ include(M4MACRO)----------------------------------------------------------------
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -37,8 +37,8 @@ include(M4MACRO)----------------------------------------------------------------
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.8 $
-- $Date: 2011/03/22 23:02:14 $
-- $Revision: 1.15 $
-- $Date: 2018/07/07 23:28:45 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System;
@ -52,7 +52,6 @@ with Ada.Strings.Fixed;
package body Terminal_Interface.Curses is
use Aux;
use type System.Bit_Order;
package ASF renames Ada.Strings.Fixed;
@ -151,10 +150,10 @@ package body Terminal_Interface.Curses is
Ch : Attributed_Character)
is
function Waddch (W : Window;
Ch : C_Chtype) return C_Int;
Ch : Attributed_Character) return C_Int;
pragma Import (C, Waddch, "waddch");
begin
if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
if Waddch (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Add;
@ -178,12 +177,13 @@ package body Terminal_Interface.Curses is
function mvwaddch (W : Window;
Y : C_Int;
X : C_Int;
Ch : C_Chtype) return C_Int;
Ch : Attributed_Character) return C_Int;
pragma Import (C, mvwaddch, "mvwaddch");
begin
if mvwaddch (Win, C_Int (Line),
C_Int (Column),
AttrChar_To_Chtype (Ch)) = Curses_Err then
Ch) = Curses_Err
then
raise Curses_Exception;
end if;
end Add;
@ -208,10 +208,10 @@ package body Terminal_Interface.Curses is
Ch : Attributed_Character)
is
function Wechochar (W : Window;
Ch : C_Chtype) return C_Int;
Ch : Attributed_Character) return C_Int;
pragma Import (C, Wechochar, "wechochar");
begin
if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
if Wechochar (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Add_With_Immediate_Echo;
@ -419,7 +419,8 @@ package body Terminal_Interface.Curses is
Txt (Str'Length) := Default_Character;
if Waddchnstr (Win,
Txt,
C_Int (Len)) = Curses_Err then
C_Int (Len)) = Curses_Err
then
raise Curses_Exception;
end if;
end Add;
@ -448,26 +449,25 @@ package body Terminal_Interface.Curses is
Lower_Right_Corner_Symbol : Attributed_Character := Default_Character)
is
function Wborder (W : Window;
LS : C_Chtype;
RS : C_Chtype;
TS : C_Chtype;
BS : C_Chtype;
ULC : C_Chtype;
URC : C_Chtype;
LLC : C_Chtype;
LRC : C_Chtype) return C_Int;
LS : Attributed_Character;
RS : Attributed_Character;
TS : Attributed_Character;
BS : Attributed_Character;
ULC : Attributed_Character;
URC : Attributed_Character;
LLC : Attributed_Character;
LRC : Attributed_Character) return C_Int;
pragma Import (C, Wborder, "wborder");
begin
if Wborder (Win,
AttrChar_To_Chtype (Left_Side_Symbol),
AttrChar_To_Chtype (Right_Side_Symbol),
AttrChar_To_Chtype (Top_Side_Symbol),
AttrChar_To_Chtype (Bottom_Side_Symbol),
AttrChar_To_Chtype (Upper_Left_Corner_Symbol),
AttrChar_To_Chtype (Upper_Right_Corner_Symbol),
AttrChar_To_Chtype (Lower_Left_Corner_Symbol),
AttrChar_To_Chtype (Lower_Right_Corner_Symbol)
) = Curses_Err
Left_Side_Symbol,
Right_Side_Symbol,
Top_Side_Symbol,
Bottom_Side_Symbol,
Upper_Left_Corner_Symbol,
Upper_Right_Corner_Symbol,
Lower_Left_Corner_Symbol,
Lower_Right_Corner_Symbol) = Curses_Err
then
raise Curses_Exception;
end if;
@ -490,13 +490,14 @@ package body Terminal_Interface.Curses is
Line_Symbol : Attributed_Character := Default_Character)
is
function Whline (W : Window;
Ch : C_Chtype;
Ch : Attributed_Character;
Len : C_Int) return C_Int;
pragma Import (C, Whline, "whline");
begin
if Whline (Win,
AttrChar_To_Chtype (Line_Symbol),
C_Int (Line_Size)) = Curses_Err then
Line_Symbol,
C_Int (Line_Size)) = Curses_Err
then
raise Curses_Exception;
end if;
end Horizontal_Line;
@ -507,13 +508,14 @@ package body Terminal_Interface.Curses is
Line_Symbol : Attributed_Character := Default_Character)
is
function Wvline (W : Window;
Ch : C_Chtype;
Ch : Attributed_Character;
Len : C_Int) return C_Int;
pragma Import (C, Wvline, "wvline");
begin
if Wvline (Win,
AttrChar_To_Chtype (Line_Symbol),
C_Int (Line_Size)) = Curses_Err then
Line_Symbol,
C_Int (Line_Size)) = Curses_Err
then
raise Curses_Exception;
end if;
end Vertical_Line;
@ -611,10 +613,10 @@ package body Terminal_Interface.Curses is
On : Boolean := True)
is
function Wattron (Win : Window;
C_Attr : C_AttrType) return C_Int;
C_Attr : Attributed_Character) return C_Int;
pragma Import (C, Wattron, "wattr_on");
function Wattroff (Win : Window;
C_Attr : C_AttrType) return C_Int;
C_Attr : Attributed_Character) return C_Int;
pragma Import (C, Wattroff, "wattr_off");
-- In Ada we use the On Boolean to control whether or not we want to
-- switch on or off the attributes in the set.
@ -624,9 +626,9 @@ package body Terminal_Interface.Curses is
Attr => Attr);
begin
if On then
Err := Wattron (Win, AttrChar_To_AttrType (AC));
Err := Wattron (Win, AC);
else
Err := Wattroff (Win, AttrChar_To_AttrType (AC));
Err := Wattroff (Win, AC);
end if;
if Err = Curses_Err then
raise Curses_Exception;
@ -639,14 +641,13 @@ package body Terminal_Interface.Curses is
Color : Color_Pair := Color_Pair'First)
is
function Wattrset (Win : Window;
C_Attr : C_AttrType) return C_Int;
C_Attr : Attributed_Character) return C_Int;
pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set
begin
if Wattrset (Win,
AttrChar_To_AttrType (Attributed_Character'
(Ch => Character'First,
Color => Color,
Attr => Attr))) = Curses_Err then
if Wattrset (Win, (Ch => Character'First,
Color => Color,
Attr => Attr)) = Curses_Err
then
raise Curses_Exception;
end if;
end Set_Character_Attributes;
@ -655,20 +656,18 @@ package body Terminal_Interface.Curses is
return Character_Attribute_Set
is
function Wattrget (Win : Window;
Atr : access C_AttrType;
Atr : access Attributed_Character;
Col : access C_Short;
Opt : System.Address) return C_Int;
pragma Import (C, Wattrget, "wattr_get");
Attr : aliased C_AttrType;
Attr : aliased Attributed_Character;
Col : aliased C_Short;
Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
System.Null_Address);
Ch : Attributed_Character;
begin
if Res = Curses_Ok then
Ch := AttrType_To_AttrChar (Attr);
return Ch.Attr;
return Attr.Attr;
else
raise Curses_Exception;
end if;
@ -678,20 +677,18 @@ package body Terminal_Interface.Curses is
return Color_Pair
is
function Wattrget (Win : Window;
Atr : access C_AttrType;
Atr : access Attributed_Character;
Col : access C_Short;
Opt : System.Address) return C_Int;
pragma Import (C, Wattrget, "wattr_get");
Attr : aliased C_AttrType;
Attr : aliased Attributed_Character;
Col : aliased C_Short;
Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
System.Null_Address);
Ch : Attributed_Character;
begin
if Res = Curses_Ok then
Ch := AttrType_To_AttrChar (Attr);
return Ch.Color;
return Attr.Color;
else
raise Curses_Exception;
end if;
@ -707,7 +704,8 @@ package body Terminal_Interface.Curses is
begin
if Wset_Color (Win,
C_Short (Pair),
C_Void_Ptr (System.Null_Address)) = Curses_Err then
C_Void_Ptr (System.Null_Address)) = Curses_Err
then
raise Curses_Exception;
end if;
end Set_Color;
@ -720,17 +718,19 @@ package body Terminal_Interface.Curses is
is
function Wchgat (Win : Window;
Cnt : C_Int;
Attr : C_AttrType;
Attr : Attributed_Character;
Color : C_Short;
Opts : System.Address := System.Null_Address)
return C_Int;
pragma Import (C, Wchgat, "wchgat");
Ch : constant Attributed_Character :=
(Ch => Character'First, Color => Color_Pair'First, Attr => Attr);
begin
if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch),
C_Short (Color)) = Curses_Err then
if Wchgat (Win,
C_Int (Count),
(Ch => Character'First,
Color => Color_Pair'First,
Attr => Attr),
C_Short (Color)) = Curses_Err
then
raise Curses_Exception;
end if;
end Change_Attributes;
@ -938,7 +938,8 @@ package body Terminal_Interface.Curses is
pragma Import (C, Notimeout, "notimeout");
begin
if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off)))
= Curses_Err then
= Curses_Err
then
raise Curses_Exception;
end if;
end Set_Escape_Timer_Mode;
@ -1051,7 +1052,8 @@ package body Terminal_Interface.Curses is
pragma Import (C, Wsetscrreg, "wsetscrreg");
begin
if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line))
= Curses_Err then
= Curses_Err
then
raise Curses_Exception;
end if;
end Set_Scroll_Region;
@ -1108,7 +1110,8 @@ package body Terminal_Interface.Curses is
begin
if Wredrawln (Win,
C_Int (Begin_Line),
C_Int (Line_Count)) = Curses_Err then
C_Int (Line_Count)) = Curses_Err
then
raise Curses_Exception;
end if;
end Redraw;
@ -1158,20 +1161,21 @@ package body Terminal_Interface.Curses is
(Win : Window := Standard_Window;
Ch : Attributed_Character)
is
procedure WBackground (W : Window; Ch : C_Chtype);
procedure WBackground (W : Window; Ch : Attributed_Character);
pragma Import (C, WBackground, "wbkgdset");
begin
WBackground (Win, AttrChar_To_Chtype (Ch));
WBackground (Win, Ch);
end Set_Background;
procedure Change_Background
(Win : Window := Standard_Window;
Ch : Attributed_Character)
is
function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int;
function WChangeBkgd (W : Window; Ch : Attributed_Character)
return C_Int;
pragma Import (C, WChangeBkgd, "wbkgd");
begin
if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
if WChangeBkgd (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Change_Background;
@ -1179,10 +1183,10 @@ package body Terminal_Interface.Curses is
function Get_Background (Win : Window := Standard_Window)
return Attributed_Character
is
function Wgetbkgd (Win : Window) return C_Chtype;
function Wgetbkgd (Win : Window) return Attributed_Character;
pragma Import (C, Wgetbkgd, "getbkgd");
begin
return Chtype_To_AttrChar (Wgetbkgd (Win));
return Wgetbkgd (Win);
end Get_Background;
------------------------------------------------------------------------------
procedure Change_Lines_Status (Win : Window := Standard_Window;
@ -1197,7 +1201,8 @@ package body Terminal_Interface.Curses is
pragma Import (C, Wtouchln, "wtouchln");
begin
if Wtouchln (Win, C_Int (Start), C_Int (Count),
C_Int (Boolean'Pos (State))) = Curses_Err then
C_Int (Boolean'Pos (State))) = Curses_Err
then
raise Curses_Exception;
end if;
end Change_Lines_Status;
@ -1208,7 +1213,7 @@ package body Terminal_Interface.Curses is
X : Column_Position;
begin
Get_Size (Win, Y, X);
pragma Unreferenced (X);
pragma Warnings (Off, X); -- unreferenced
Change_Lines_Status (Win, 0, Positive (Y), True);
end Touch;
@ -1218,7 +1223,7 @@ package body Terminal_Interface.Curses is
X : Column_Position;
begin
Get_Size (Win, Y, X);
pragma Unreferenced (X);
pragma Warnings (Off, X); -- unreferenced
Change_Lines_Status (Win, 0, Positive (Y), False);
end Untouch;
@ -1288,7 +1293,8 @@ package body Terminal_Interface.Curses is
C_Int (Destination_Bottom_Row),
C_Int (Destination_Right_Column),
Boolean'Pos (Non_Destructive_Mode)
) = Curses_Err then
) = Curses_Err
then
raise Curses_Exception;
end if;
end Copy;
@ -1491,7 +1497,8 @@ package body Terminal_Interface.Curses is
C_Int (Destination_Top_Row),
C_Int (Destination_Left_Column),
C_Int (Destination_Bottom_Row),
C_Int (Destination_Right_Column)) = Curses_Err then
C_Int (Destination_Right_Column)) = Curses_Err
then
raise Curses_Exception;
end if;
end Refresh;
@ -1521,7 +1528,8 @@ package body Terminal_Interface.Curses is
C_Int (Destination_Top_Row),
C_Int (Destination_Left_Column),
C_Int (Destination_Bottom_Row),
C_Int (Destination_Right_Column)) = Curses_Err then
C_Int (Destination_Right_Column)) = Curses_Err
then
raise Curses_Exception;
end if;
end Refresh_Without_Update;
@ -1530,11 +1538,11 @@ package body Terminal_Interface.Curses is
(Pad : Window;
Ch : Attributed_Character)
is
function Pechochar (Pad : Window; Ch : C_Chtype)
function Pechochar (Pad : Window; Ch : Attributed_Character)
return C_Int;
pragma Import (C, Pechochar, "pechochar");
begin
if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then
if Pechochar (Pad, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Add_Character_To_Pad_And_Echo_It;
@ -1592,10 +1600,10 @@ package body Terminal_Interface.Curses is
function Peek (Win : Window := Standard_Window)
return Attributed_Character
is
function Winch (Win : Window) return C_Chtype;
function Winch (Win : Window) return Attributed_Character;
pragma Import (C, Winch, "winch");
begin
return Chtype_To_AttrChar (Winch (Win));
return Winch (Win);
end Peek;
function Peek
@ -1605,19 +1613,19 @@ package body Terminal_Interface.Curses is
is
function Mvwinch (Win : Window;
Lin : C_Int;
Col : C_Int) return C_Chtype;
Col : C_Int) return Attributed_Character;
pragma Import (C, Mvwinch, "mvwinch");
begin
return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column)));
return Mvwinch (Win, C_Int (Line), C_Int (Column));
end Peek;
------------------------------------------------------------------------------
procedure Insert (Win : Window := Standard_Window;
Ch : Attributed_Character)
is
function Winsch (Win : Window; Ch : C_Chtype) return C_Int;
function Winsch (Win : Window; Ch : Attributed_Character) return C_Int;
pragma Import (C, Winsch, "winsch");
begin
if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
if Winsch (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Insert;
@ -1631,13 +1639,14 @@ package body Terminal_Interface.Curses is
function Mvwinsch (Win : Window;
Lin : C_Int;
Col : C_Int;
Ch : C_Chtype) return C_Int;
Ch : Attributed_Character) return C_Int;
pragma Import (C, Mvwinsch, "mvwinsch");
begin
if Mvwinsch (Win,
C_Int (Line),
C_Int (Column),
AttrChar_To_Chtype (Ch)) = Curses_Err then
Ch) = Curses_Err
then
raise Curses_Exception;
end if;
end Insert;
@ -1679,7 +1688,8 @@ package body Terminal_Interface.Curses is
begin
To_C (Str, Txt, Length);
if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len))
= Curses_Err then
= Curses_Err
then
raise Curses_Exception;
end if;
end Insert;
@ -1840,7 +1850,8 @@ package body Terminal_Interface.Curses is
begin
To_C (Text, Txt, Len);
if Slk_Set (C_Int (Label), Txt,
C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then
C_Int (Label_Justification'Pos (Fmt))) = Curses_Err
then
raise Curses_Exception;
end if;
end Set_Soft_Label_Key;
@ -1916,9 +1927,9 @@ package body Terminal_Interface.Curses is
(Attr : Character_Attribute_Set;
On : Boolean := True)
is
function Slk_Attron (Ch : C_Chtype) return C_Int;
function Slk_Attron (Ch : Attributed_Character) return C_Int;
pragma Import (C, Slk_Attron, "slk_attron");
function Slk_Attroff (Ch : C_Chtype) return C_Int;
function Slk_Attroff (Ch : Attributed_Character) return C_Int;
pragma Import (C, Slk_Attroff, "slk_attroff");
Err : C_Int;
@ -1927,9 +1938,9 @@ package body Terminal_Interface.Curses is
Color => Color_Pair'First);
begin
if On then
Err := Slk_Attron (AttrChar_To_Chtype (Ch));
Err := Slk_Attron (Ch);
else
Err := Slk_Attroff (AttrChar_To_Chtype (Ch));
Err := Slk_Attroff (Ch);
end if;
if Err = Curses_Err then
raise Curses_Exception;
@ -1940,36 +1951,36 @@ package body Terminal_Interface.Curses is
(Attr : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Slk_Attrset (Ch : C_Chtype) return C_Int;
function Slk_Attrset (Ch : Attributed_Character) return C_Int;
pragma Import (C, Slk_Attrset, "slk_attrset");
Ch : constant Attributed_Character := (Ch => Character'First,
Attr => Attr,
Color => Color);
begin
if Slk_Attrset (AttrChar_To_Chtype (Ch)) = Curses_Err then
if Slk_Attrset (Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Set_Soft_Label_Key_Attributes;
function Get_Soft_Label_Key_Attributes return Character_Attribute_Set
is
function Slk_Attr return C_Chtype;
function Slk_Attr return Attributed_Character;
pragma Import (C, Slk_Attr, "slk_attr");
Attr : constant C_Chtype := Slk_Attr;
Attr : constant Attributed_Character := Slk_Attr;
begin
return Chtype_To_AttrChar (Attr).Attr;
return Attr.Attr;
end Get_Soft_Label_Key_Attributes;
function Get_Soft_Label_Key_Attributes return Color_Pair
is
function Slk_Attr return C_Chtype;
function Slk_Attr return Attributed_Character;
pragma Import (C, Slk_Attr, "slk_attr");
Attr : constant C_Chtype := Slk_Attr;
Attr : constant Attributed_Character := Slk_Attr;
begin
return Chtype_To_AttrChar (Attr).Color;
return Attr.Color;
end Get_Soft_Label_Key_Attributes;
procedure Set_Soft_Label_Key_Color (Pair : Color_Pair)
@ -1991,7 +2002,8 @@ package body Terminal_Interface.Curses is
pragma Import (C, Keyok, "keyok");
begin
if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable)))
= Curses_Err then
= Curses_Err
then
raise Curses_Exception;
end if;
end Enable_Key;
@ -2015,18 +2027,18 @@ package body Terminal_Interface.Curses is
procedure Un_Control (Ch : Attributed_Character;
Str : out String)
is
function Unctrl (Ch : C_Chtype) return chars_ptr;
function Unctrl (Ch : Attributed_Character) return chars_ptr;
pragma Import (C, Unctrl, "unctrl");
begin
Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str);
Fill_String (Unctrl (Ch), Str);
end Un_Control;
function Un_Control (Ch : Attributed_Character) return String
is
function Unctrl (Ch : C_Chtype) return chars_ptr;
function Unctrl (Ch : Attributed_Character) return chars_ptr;
pragma Import (C, Unctrl, "unctrl");
begin
return Fill_String (Unctrl (AttrChar_To_Chtype (Ch)));
return Fill_String (Unctrl (Ch));
end Un_Control;
procedure Delay_Output (Msecs : Natural)
@ -2099,10 +2111,10 @@ package body Terminal_Interface.Curses is
function Supported_Attributes return Character_Attribute_Set
is
function Termattrs return C_Chtype;
function Termattrs return Attributed_Character;
pragma Import (C, Termattrs, "termattrs");
Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs);
Ch : constant Attributed_Character := Termattrs;
begin
return Ch.Attr;
end Supported_Attributes;
@ -2152,11 +2164,13 @@ package body Terminal_Interface.Curses is
raise Constraint_Error;
end if;
if Integer (Fore) >= Number_Of_Colors or else
Integer (Back) >= Number_Of_Colors then
Integer (Back) >= Number_Of_Colors
then
raise Constraint_Error;
end if;
if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back))
= Curses_Err then
= Curses_Err
then
raise Curses_Exception;
end if;
end Init_Pair;
@ -2205,7 +2219,8 @@ package body Terminal_Interface.Curses is
pragma Import (C, Initcolor, "init_color");
begin
if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green),
C_Short (Blue)) = Curses_Err then
C_Short (Blue)) = Curses_Err
then
raise Curses_Exception;
end if;
end Init_Color;
@ -2236,7 +2251,8 @@ package body Terminal_Interface.Curses is
R, G, B : aliased C_Short;
begin
if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) =
Curses_Err then
Curses_Err
then
raise Curses_Exception;
else
Red := RGB_Value (R);
@ -2337,7 +2353,46 @@ package body Terminal_Interface.Curses is
end if;
end Nap_Milli_Seconds;
------------------------------------------------------------------------------
include(`Public_Variables')
function Lines return Line_Count
is
function LINES_As_Function return Interfaces.C.int;
pragma Import (C, LINES_As_Function, "LINES_as_function");
begin
return Line_Count (LINES_As_Function);
end Lines;
function Columns return Column_Count
is
function COLS_As_Function return Interfaces.C.int;
pragma Import (C, COLS_As_Function, "COLS_as_function");
begin
return Column_Count (COLS_As_Function);
end Columns;
function Tab_Size return Natural
is
function TABSIZE_As_Function return Interfaces.C.int;
pragma Import (C, TABSIZE_As_Function, "TABSIZE_as_function");
begin
return Natural (TABSIZE_As_Function);
end Tab_Size;
function Number_Of_Colors return Natural
is
function COLORS_As_Function return Interfaces.C.int;
pragma Import (C, COLORS_As_Function, "COLORS_as_function");
begin
return Natural (COLORS_As_Function);
end Number_Of_Colors;
function Number_Of_Color_Pairs return Natural
is
function COLOR_PAIRS_As_Function return Interfaces.C.int;
pragma Import (C, COLOR_PAIRS_As_Function, "COLOR_PAIRS_as_function");
begin
return Natural (COLOR_PAIRS_As_Function);
end Number_Of_Color_Pairs;
------------------------------------------------------------------------------
procedure Transform_Coordinates
(W : Window := Standard_Window;
@ -2493,7 +2548,8 @@ include(`Public_Variables')
begin
if wresize (Win,
C_Int (Number_Of_Lines),
C_Int (Number_Of_Columns)) = Curses_Err then
C_Int (Number_Of_Columns)) = Curses_Err
then
raise Curses_Exception;
end if;
end Resize;

View File

@ -9,7 +9,7 @@ include(M4MACRO)----------------------------------------------------------------
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -37,18 +37,23 @@ include(M4MACRO)----------------------------------------------------------------
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.44 $
-- $Date: 2011/03/19 23:05:56 $
-- $Revision: 1.47 $
-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
include(`Base_Defs')
with System.Storage_Elements;
with Interfaces.C; -- We need this for some assertions.
with Terminal_Interface.Curses_Constants;
package Terminal_Interface.Curses is
pragma Preelaborate (Terminal_Interface.Curses);
include(`Linker_Options')
include(`Version_Info')
pragma Linker_Options ("-lncurses" & Curses_Constants.DFT_ARG_SUFFIX);
Major_Version : constant := Curses_Constants.NCURSES_VERSION_MAJOR;
Minor_Version : constant := Curses_Constants.NCURSES_VERSION_MINOR;
NC_Version : String renames Curses_Constants.Version;
type Window is private;
Null_Window : constant Window;
@ -65,24 +70,315 @@ include(`Version_Info')
-- request codes.
-- FIXME: The "-1" should be Curses_Err
subtype Real_Key_Code is Key_Code range -1 .. M4_KEY_MAX;
subtype Real_Key_Code is Key_Code range -1 .. Curses_Constants.KEY_MAX;
-- This are the codes that potentially represent a real keystroke.
-- Not all codes may be possible on a specific terminal. To check the
-- availability of a special key, the Has_Key function is provided.
subtype Special_Key_Code is Real_Key_Code
range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
range Curses_Constants. KEY_MIN - 1 .. Real_Key_Code'Last;
-- Type for a function- or special key number
subtype Normal_Key_Code is Real_Key_Code range
Character'Pos (Character'First) .. Character'Pos (Character'Last);
-- This are the codes for regular (incl. non-graphical) characters.
-- For those who like to use the original key names we produce them were
-- they differ from the original.
-- Constants for function- and special keys
--
Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST;
include(`Key_Definitions')
Key_Max : constant Special_Key_Code
Key_None : constant Special_Key_Code
:= Curses_Constants.KEY_MIN - 1;
Key_Min : constant Special_Key_Code
:= Curses_Constants.KEY_MIN;
Key_Break : constant Special_Key_Code
:= Curses_Constants.KEY_BREAK;
KEY_DOWN : constant Special_Key_Code
:= Curses_Constants.KEY_DOWN;
Key_Cursor_Down : Special_Key_Code renames KEY_DOWN;
KEY_UP : constant Special_Key_Code
:= Curses_Constants.KEY_UP;
Key_Cursor_Up : Special_Key_Code renames KEY_UP;
KEY_LEFT : constant Special_Key_Code
:= Curses_Constants.KEY_LEFT;
Key_Cursor_Left : Special_Key_Code renames KEY_LEFT;
KEY_RIGHT : constant Special_Key_Code
:= Curses_Constants.KEY_RIGHT;
Key_Cursor_Right : Special_Key_Code renames KEY_RIGHT;
Key_Home : constant Special_Key_Code
:= Curses_Constants.KEY_HOME;
Key_Backspace : constant Special_Key_Code
:= Curses_Constants.KEY_BACKSPACE;
Key_F0 : constant Special_Key_Code
:= Curses_Constants.KEY_F0;
Key_F1 : constant Special_Key_Code
:= Curses_Constants.KEY_F1;
Key_F2 : constant Special_Key_Code
:= Curses_Constants.KEY_F2;
Key_F3 : constant Special_Key_Code
:= Curses_Constants.KEY_F3;
Key_F4 : constant Special_Key_Code
:= Curses_Constants.KEY_F4;
Key_F5 : constant Special_Key_Code
:= Curses_Constants.KEY_F5;
Key_F6 : constant Special_Key_Code
:= Curses_Constants.KEY_F6;
Key_F7 : constant Special_Key_Code
:= Curses_Constants.KEY_F7;
Key_F8 : constant Special_Key_Code
:= Curses_Constants.KEY_F8;
Key_F9 : constant Special_Key_Code
:= Curses_Constants.KEY_F9;
Key_F10 : constant Special_Key_Code
:= Curses_Constants.KEY_F10;
Key_F11 : constant Special_Key_Code
:= Curses_Constants.KEY_F11;
Key_F12 : constant Special_Key_Code
:= Curses_Constants.KEY_F12;
Key_F13 : constant Special_Key_Code
:= Curses_Constants.KEY_F13;
Key_F14 : constant Special_Key_Code
:= Curses_Constants.KEY_F14;
Key_F15 : constant Special_Key_Code
:= Curses_Constants.KEY_F15;
Key_F16 : constant Special_Key_Code
:= Curses_Constants.KEY_F16;
Key_F17 : constant Special_Key_Code
:= Curses_Constants.KEY_F17;
Key_F18 : constant Special_Key_Code
:= Curses_Constants.KEY_F18;
Key_F19 : constant Special_Key_Code
:= Curses_Constants.KEY_F19;
Key_F20 : constant Special_Key_Code
:= Curses_Constants.KEY_F20;
Key_F21 : constant Special_Key_Code
:= Curses_Constants.KEY_F21;
Key_F22 : constant Special_Key_Code
:= Curses_Constants.KEY_F22;
Key_F23 : constant Special_Key_Code
:= Curses_Constants.KEY_F23;
Key_F24 : constant Special_Key_Code
:= Curses_Constants.KEY_F24;
KEY_DL : constant Special_Key_Code
:= Curses_Constants.KEY_DL;
Key_Delete_Line : Special_Key_Code renames KEY_DL;
KEY_IL : constant Special_Key_Code
:= Curses_Constants.KEY_IL;
Key_Insert_Line : Special_Key_Code renames KEY_IL;
KEY_DC : constant Special_Key_Code
:= Curses_Constants.KEY_DC;
Key_Delete_Char : Special_Key_Code renames KEY_DC;
KEY_IC : constant Special_Key_Code
:= Curses_Constants.KEY_IC;
Key_Insert_Char : Special_Key_Code renames KEY_IC;
KEY_EIC : constant Special_Key_Code
:= Curses_Constants.KEY_EIC;
Key_Exit_Insert_Mode : Special_Key_Code renames KEY_EIC;
KEY_CLEAR : constant Special_Key_Code
:= Curses_Constants.KEY_CLEAR;
Key_Clear_Screen : Special_Key_Code renames KEY_CLEAR;
KEY_EOS : constant Special_Key_Code
:= Curses_Constants.KEY_EOS;
Key_Clear_End_Of_Screen : Special_Key_Code renames KEY_EOS;
KEY_EOL : constant Special_Key_Code
:= Curses_Constants.KEY_EOL;
Key_Clear_End_Of_Line : Special_Key_Code renames KEY_EOL;
KEY_SF : constant Special_Key_Code
:= Curses_Constants.KEY_SF;
Key_Scroll_1_Forward : Special_Key_Code renames KEY_SF;
KEY_SR : constant Special_Key_Code
:= Curses_Constants.KEY_SR;
Key_Scroll_1_Backward : Special_Key_Code renames KEY_SR;
KEY_NPAGE : constant Special_Key_Code
:= Curses_Constants.KEY_NPAGE;
Key_Next_Page : Special_Key_Code renames KEY_NPAGE;
KEY_PPAGE : constant Special_Key_Code
:= Curses_Constants.KEY_PPAGE;
Key_Previous_Page : Special_Key_Code renames KEY_PPAGE;
KEY_STAB : constant Special_Key_Code
:= Curses_Constants.KEY_STAB;
Key_Set_Tab : Special_Key_Code renames KEY_STAB;
KEY_CTAB : constant Special_Key_Code
:= Curses_Constants.KEY_CTAB;
Key_Clear_Tab : Special_Key_Code renames KEY_CTAB;
KEY_CATAB : constant Special_Key_Code
:= Curses_Constants.KEY_CATAB;
Key_Clear_All_Tabs : Special_Key_Code renames KEY_CATAB;
KEY_ENTER : constant Special_Key_Code
:= Curses_Constants.KEY_ENTER;
Key_Enter_Or_Send : Special_Key_Code renames KEY_ENTER;
KEY_SRESET : constant Special_Key_Code
:= Curses_Constants.KEY_SRESET;
Key_Soft_Reset : Special_Key_Code renames KEY_SRESET;
Key_Reset : constant Special_Key_Code
:= Curses_Constants.KEY_RESET;
Key_Print : constant Special_Key_Code
:= Curses_Constants.KEY_PRINT;
KEY_LL : constant Special_Key_Code
:= Curses_Constants.KEY_LL;
Key_Bottom : Special_Key_Code renames KEY_LL;
KEY_A1 : constant Special_Key_Code
:= Curses_Constants.KEY_A1;
Key_Upper_Left_Of_Keypad : Special_Key_Code renames KEY_A1;
KEY_A3 : constant Special_Key_Code
:= Curses_Constants.KEY_A3;
Key_Upper_Right_Of_Keypad : Special_Key_Code renames KEY_A3;
KEY_B2 : constant Special_Key_Code
:= Curses_Constants.KEY_B2;
Key_Center_Of_Keypad : Special_Key_Code renames KEY_B2;
KEY_C1 : constant Special_Key_Code
:= Curses_Constants.KEY_C1;
Key_Lower_Left_Of_Keypad : Special_Key_Code renames KEY_C1;
KEY_C3 : constant Special_Key_Code
:= Curses_Constants.KEY_C3;
Key_Lower_Right_Of_Keypad : Special_Key_Code renames KEY_C3;
KEY_BTAB : constant Special_Key_Code
:= Curses_Constants.KEY_BTAB;
Key_Back_Tab : Special_Key_Code renames KEY_BTAB;
KEY_BEG : constant Special_Key_Code
:= Curses_Constants.KEY_BEG;
Key_Beginning : Special_Key_Code renames KEY_BEG;
Key_Cancel : constant Special_Key_Code
:= Curses_Constants.KEY_CANCEL;
Key_Close : constant Special_Key_Code
:= Curses_Constants.KEY_CLOSE;
Key_Command : constant Special_Key_Code
:= Curses_Constants.KEY_COMMAND;
Key_Copy : constant Special_Key_Code
:= Curses_Constants.KEY_COPY;
Key_Create : constant Special_Key_Code
:= Curses_Constants.KEY_CREATE;
Key_End : constant Special_Key_Code
:= Curses_Constants.KEY_END;
Key_Exit : constant Special_Key_Code
:= Curses_Constants.KEY_EXIT;
Key_Find : constant Special_Key_Code
:= Curses_Constants.KEY_FIND;
Key_Help : constant Special_Key_Code
:= Curses_Constants.KEY_HELP;
Key_Mark : constant Special_Key_Code
:= Curses_Constants.KEY_MARK;
Key_Message : constant Special_Key_Code
:= Curses_Constants.KEY_MESSAGE;
Key_Move : constant Special_Key_Code
:= Curses_Constants.KEY_MOVE;
Key_Next : constant Special_Key_Code
:= Curses_Constants.KEY_NEXT;
Key_Open : constant Special_Key_Code
:= Curses_Constants.KEY_OPEN;
Key_Options : constant Special_Key_Code
:= Curses_Constants.KEY_OPTIONS;
Key_Previous : constant Special_Key_Code
:= Curses_Constants.KEY_PREVIOUS;
Key_Redo : constant Special_Key_Code
:= Curses_Constants.KEY_REDO;
Key_Reference : constant Special_Key_Code
:= Curses_Constants.KEY_REFERENCE;
Key_Refresh : constant Special_Key_Code
:= Curses_Constants.KEY_REFRESH;
Key_Replace : constant Special_Key_Code
:= Curses_Constants.KEY_REPLACE;
Key_Restart : constant Special_Key_Code
:= Curses_Constants.KEY_RESTART;
Key_Resume : constant Special_Key_Code
:= Curses_Constants.KEY_RESUME;
Key_Save : constant Special_Key_Code
:= Curses_Constants.KEY_SAVE;
KEY_SBEG : constant Special_Key_Code
:= Curses_Constants.KEY_SBEG;
Key_Shift_Begin : Special_Key_Code renames KEY_SBEG;
KEY_SCANCEL : constant Special_Key_Code
:= Curses_Constants.KEY_SCANCEL;
Key_Shift_Cancel : Special_Key_Code renames KEY_SCANCEL;
KEY_SCOMMAND : constant Special_Key_Code
:= Curses_Constants.KEY_SCOMMAND;
Key_Shift_Command : Special_Key_Code renames KEY_SCOMMAND;
KEY_SCOPY : constant Special_Key_Code
:= Curses_Constants.KEY_SCOPY;
Key_Shift_Copy : Special_Key_Code renames KEY_SCOPY;
KEY_SCREATE : constant Special_Key_Code
:= Curses_Constants.KEY_SCREATE;
Key_Shift_Create : Special_Key_Code renames KEY_SCREATE;
KEY_SDC : constant Special_Key_Code
:= Curses_Constants.KEY_SDC;
Key_Shift_Delete_Char : Special_Key_Code renames KEY_SDC;
KEY_SDL : constant Special_Key_Code
:= Curses_Constants.KEY_SDL;
Key_Shift_Delete_Line : Special_Key_Code renames KEY_SDL;
Key_Select : constant Special_Key_Code
:= Curses_Constants.KEY_SELECT;
KEY_SEND : constant Special_Key_Code
:= Curses_Constants.KEY_SEND;
Key_Shift_End : Special_Key_Code renames KEY_SEND;
KEY_SEOL : constant Special_Key_Code
:= Curses_Constants.KEY_SEOL;
Key_Shift_Clear_End_Of_Line : Special_Key_Code renames KEY_SEOL;
KEY_SEXIT : constant Special_Key_Code
:= Curses_Constants.KEY_SEXIT;
Key_Shift_Exit : Special_Key_Code renames KEY_SEXIT;
KEY_SFIND : constant Special_Key_Code
:= Curses_Constants.KEY_SFIND;
Key_Shift_Find : Special_Key_Code renames KEY_SFIND;
KEY_SHELP : constant Special_Key_Code
:= Curses_Constants.KEY_SHELP;
Key_Shift_Help : Special_Key_Code renames KEY_SHELP;
KEY_SHOME : constant Special_Key_Code
:= Curses_Constants.KEY_SHOME;
Key_Shift_Home : Special_Key_Code renames KEY_SHOME;
KEY_SIC : constant Special_Key_Code
:= Curses_Constants.KEY_SIC;
Key_Shift_Insert_Char : Special_Key_Code renames KEY_SIC;
KEY_SLEFT : constant Special_Key_Code
:= Curses_Constants.KEY_SLEFT;
Key_Shift_Cursor_Left : Special_Key_Code renames KEY_SLEFT;
KEY_SMESSAGE : constant Special_Key_Code
:= Curses_Constants.KEY_SMESSAGE;
Key_Shift_Message : Special_Key_Code renames KEY_SMESSAGE;
KEY_SMOVE : constant Special_Key_Code
:= Curses_Constants.KEY_SMOVE;
Key_Shift_Move : Special_Key_Code renames KEY_SMOVE;
KEY_SNEXT : constant Special_Key_Code
:= Curses_Constants.KEY_SNEXT;
Key_Shift_Next_Page : Special_Key_Code renames KEY_SNEXT;
KEY_SOPTIONS : constant Special_Key_Code
:= Curses_Constants.KEY_SOPTIONS;
Key_Shift_Options : Special_Key_Code renames KEY_SOPTIONS;
KEY_SPREVIOUS : constant Special_Key_Code
:= Curses_Constants.KEY_SPREVIOUS;
Key_Shift_Previous_Page : Special_Key_Code renames KEY_SPREVIOUS;
KEY_SPRINT : constant Special_Key_Code
:= Curses_Constants.KEY_SPRINT;
Key_Shift_Print : Special_Key_Code renames KEY_SPRINT;
KEY_SREDO : constant Special_Key_Code
:= Curses_Constants.KEY_SREDO;
Key_Shift_Redo : Special_Key_Code renames KEY_SREDO;
KEY_SREPLACE : constant Special_Key_Code
:= Curses_Constants.KEY_SREPLACE;
Key_Shift_Replace : Special_Key_Code renames KEY_SREPLACE;
KEY_SRIGHT : constant Special_Key_Code
:= Curses_Constants.KEY_SRIGHT;
Key_Shift_Cursor_Right : Special_Key_Code renames KEY_SRIGHT;
KEY_SRSUME : constant Special_Key_Code
:= Curses_Constants.KEY_SRSUME;
Key_Shift_Resume : Special_Key_Code renames KEY_SRSUME;
KEY_SSAVE : constant Special_Key_Code
:= Curses_Constants.KEY_SSAVE;
Key_Shift_Save : Special_Key_Code renames KEY_SSAVE;
KEY_SSUSPEND : constant Special_Key_Code
:= Curses_Constants.KEY_SSUSPEND;
Key_Shift_Suspend : Special_Key_Code renames KEY_SSUSPEND;
KEY_SUNDO : constant Special_Key_Code
:= Curses_Constants.KEY_SUNDO;
Key_Shift_Undo : Special_Key_Code renames KEY_SUNDO;
Key_Suspend : constant Special_Key_Code
:= Curses_Constants.KEY_SUSPEND;
Key_Undo : constant Special_Key_Code
:= Curses_Constants.KEY_UNDO;
Key_Mouse : constant Special_Key_Code
:= Curses_Constants.KEY_MOUSE;
Key_Resize : constant Special_Key_Code
:= Curses_Constants.KEY_RESIZE;
Key_Max : constant Special_Key_Code
:= Special_Key_Code'Last;
subtype User_Key_Code is Key_Code
@ -90,12 +386,7 @@ include(`Key_Definitions')
-- This is reserved for user defined key codes. The range between Key_Max
-- and the first user code is reserved for subsystems like menu and forms.
-- For those who like to use the original key names we produce them were
-- they differ from the original. Please note that they may differ in
-- lower/upper case.
include(`Old_Keys')dnl
------------------------------------------------------------------------------
--------------------------------------------------------------------------
type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
for Color_Number'Size use Interfaces.C.short'Size;
@ -104,7 +395,15 @@ include(`Old_Keys')dnl
-- (potentially) definable colors. Some of those indices are
-- predefined (see below), although they may not really exist.
include(`Color_Defs')
Black : constant Color_Number := Curses_Constants.COLOR_BLACK;
Red : constant Color_Number := Curses_Constants.COLOR_RED;
Green : constant Color_Number := Curses_Constants.COLOR_GREEN;
Yellow : constant Color_Number := Curses_Constants.COLOR_YELLOW;
Blue : constant Color_Number := Curses_Constants.COLOR_BLUE;
Magenta : constant Color_Number := Curses_Constants.COLOR_MAGENTA;
Cyan : constant Color_Number := Curses_Constants.COLOR_CYAN;
White : constant Color_Number := Curses_Constants.COLOR_WHITE;
type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
for RGB_Value'Size use Interfaces.C.short'Size;
-- Some system may allow to redefine a color by setting RGB values.
@ -117,8 +416,73 @@ include(`Color_Defs')
-- two colors described by Color_Numbers, one for the foreground and
-- the other for the background
include(`Character_Attribute_Set_Rep')
-- (n)curses uses all but the lowest 16 Bits for Attributes.
type Character_Attribute_Set is
record
Stand_Out : Boolean;
Under_Line : Boolean;
Reverse_Video : Boolean;
Blink : Boolean;
Dim_Character : Boolean;
Bold_Character : Boolean;
Protected_Character : Boolean;
Invisible_Character : Boolean;
Alternate_Character_Set : Boolean;
Horizontal : Boolean;
Left : Boolean;
Low : Boolean;
Right : Boolean;
Top : Boolean;
Vertical : Boolean;
end record;
for Character_Attribute_Set use
record
Stand_Out at 0 range
Curses_Constants.A_STANDOUT_First - Curses_Constants.Attr_First
.. Curses_Constants.A_STANDOUT_Last - Curses_Constants.Attr_First;
Under_Line at 0 range
Curses_Constants.A_UNDERLINE_First - Curses_Constants.Attr_First
.. Curses_Constants.A_UNDERLINE_Last - Curses_Constants.Attr_First;
Reverse_Video at 0 range
Curses_Constants.A_REVERSE_First - Curses_Constants.Attr_First
.. Curses_Constants.A_REVERSE_Last - Curses_Constants.Attr_First;
Blink at 0 range
Curses_Constants.A_BLINK_First - Curses_Constants.Attr_First
.. Curses_Constants.A_BLINK_Last - Curses_Constants.Attr_First;
Dim_Character at 0 range
Curses_Constants.A_DIM_First - Curses_Constants.Attr_First
.. Curses_Constants.A_DIM_Last - Curses_Constants.Attr_First;
Bold_Character at 0 range
Curses_Constants.A_BOLD_First - Curses_Constants.Attr_First
.. Curses_Constants.A_BOLD_Last - Curses_Constants.Attr_First;
Protected_Character at 0 range
Curses_Constants.A_PROTECT_First - Curses_Constants.Attr_First
.. Curses_Constants.A_PROTECT_Last - Curses_Constants.Attr_First;
Invisible_Character at 0 range
Curses_Constants.A_INVIS_First - Curses_Constants.Attr_First
.. Curses_Constants.A_INVIS_Last - Curses_Constants.Attr_First;
Alternate_Character_Set at 0 range
Curses_Constants.A_ALTCHARSET_First - Curses_Constants.Attr_First
.. Curses_Constants.A_ALTCHARSET_Last - Curses_Constants.Attr_First;
Horizontal at 0 range
Curses_Constants.A_HORIZONTAL_First - Curses_Constants.Attr_First
.. Curses_Constants.A_HORIZONTAL_Last - Curses_Constants.Attr_First;
Left at 0 range
Curses_Constants.A_LEFT_First - Curses_Constants.Attr_First
.. Curses_Constants.A_LEFT_Last - Curses_Constants.Attr_First;
Low at 0 range
Curses_Constants.A_LOW_First - Curses_Constants.Attr_First
.. Curses_Constants.A_LOW_Last - Curses_Constants.Attr_First;
Right at 0 range
Curses_Constants.A_RIGHT_First - Curses_Constants.Attr_First
.. Curses_Constants.A_RIGHT_Last - Curses_Constants.Attr_First;
Top at 0 range
Curses_Constants.A_TOP_First - Curses_Constants.Attr_First
.. Curses_Constants.A_TOP_Last - Curses_Constants.Attr_First;
Vertical at 0 range
Curses_Constants.A_VERTICAL_First - Curses_Constants.Attr_First
.. Curses_Constants.A_VERTICAL_Last - Curses_Constants.Attr_First;
end record;
Normal_Video : constant Character_Attribute_Set := (others => False);
@ -128,17 +492,29 @@ include(`Character_Attribute_Set_Rep')
Color : Color_Pair;
Ch : Character;
end record;
pragma Convention (C, Attributed_Character);
pragma Convention (C_Pass_By_Copy, Attributed_Character);
-- This is the counterpart for the chtype in C.
include(`AC_Rep')
for Attributed_Character use
record
Ch at 0 range Curses_Constants.A_CHARTEXT_First
.. Curses_Constants.A_CHARTEXT_Last;
Color at 0 range Curses_Constants.A_COLOR_First
.. Curses_Constants.A_COLOR_Last;
pragma Warnings (Off);
Attr at 0 range Curses_Constants.Attr_First
.. Curses_Constants.Attr_Last;
pragma Warnings (On);
end record;
for Attributed_Character'Size use Curses_Constants.chtype_Size;
Default_Character : constant Attributed_Character
:= (Ch => Character'First,
Color => Color_Pair'First,
Attr => (others => False)); -- preelaboratable Normal_Video
type Attributed_String is array (Positive range <>) of Attributed_Character;
pragma Pack (Attributed_String);
pragma Convention (C, Attributed_String);
-- In this binding we allow strings of attributed characters.
------------------
@ -188,7 +564,78 @@ include(`AC_Rep')
function Number_Of_Color_Pairs return Natural;
pragma Inline (Number_Of_Color_Pairs);
include(`ACS_Map')dnl
subtype ACS_Index is Character range
Character'Val (0) .. Character'Val (127);
function ACS_Map (Index : ACS_Index) return Attributed_Character;
pragma Import (C, ACS_Map, "acs_map_as_function");
-- Constants for several characters from the Alternate Character Set
-- You must use these constants as indices into the ACS_Map function
-- to get the corresponding attributed character at runtime
ACS_Upper_Left_Corner : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_ULCORNER);
ACS_Lower_Left_Corner : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_LLCORNER);
ACS_Upper_Right_Corner : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_URCORNER);
ACS_Lower_Right_Corner : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_LRCORNER);
ACS_Left_Tee : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_LTEE);
ACS_Right_Tee : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_RTEE);
ACS_Bottom_Tee : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_BTEE);
ACS_Top_Tee : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_TTEE);
ACS_Horizontal_Line : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_HLINE);
ACS_Vertical_Line : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_VLINE);
ACS_Plus_Symbol : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_PLUS);
ACS_Scan_Line_1 : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_S1);
ACS_Scan_Line_9 : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_S9);
ACS_Diamond : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_DIAMOND);
ACS_Checker_Board : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_CKBOARD);
ACS_Degree : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_DEGREE);
ACS_Plus_Minus : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_PLMINUS);
ACS_Bullet : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_BULLET);
ACS_Left_Arrow : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_LARROW);
ACS_Right_Arrow : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_RARROW);
ACS_Down_Arrow : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_DARROW);
ACS_Up_Arrow : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_UARROW);
ACS_Board_Of_Squares : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_BOARD);
ACS_Lantern : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_LANTERN);
ACS_Solid_Block : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_BLOCK);
ACS_Scan_Line_3 : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_S3);
ACS_Scan_Line_7 : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_S7);
ACS_Less_Or_Equal : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_LEQUAL);
ACS_Greater_Or_Equal : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_GEQUAL);
ACS_PI : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_PI);
ACS_Not_Equal : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_NEQUAL);
ACS_Sterling : constant ACS_Index
:= Character'Val (Curses_Constants.ACS_STERLING);
-- MANPAGE(`curs_initscr.3x')
-- | Not implemented: newterm, set_term, delscreen
@ -196,11 +643,13 @@ include(`ACS_Map')dnl
-- ANCHOR(`stdscr',`Standard_Window')
function Standard_Window return Window;
-- AKA
pragma Import (C, Standard_Window, "stdscr_as_function");
pragma Inline (Standard_Window);
-- ANCHOR(`curscr',`Current_Window')
function Current_Window return Window;
-- AKA
pragma Import (C, Current_Window, "curscr_as_function");
pragma Inline (Current_Window);
-- ANCHOR(`initscr()',`Init_Screen')
@ -1476,6 +1925,8 @@ include(`ACS_Map')dnl
-- MANPAGE(`default_colors.3x')
Default_Color : constant Color_Number := -1;
-- ANCHOR(`use_default_colors()',`Use_Default_Colors')
procedure Use_Default_Colors;
-- AKA
@ -1553,7 +2004,11 @@ private
-- The next constants are generated and may be different on your
-- architecture.
--
include(`Window_Offsets')dnl
Sizeof_Bool : constant := Curses_Constants.Sizeof_Bool;
type Curses_Bool is mod 2 ** Sizeof_Bool;
Curses_Bool_False : constant Curses_Bool := 0;
end Terminal_Interface.Curses;

View File

@ -1,7 +1,7 @@
#! /bin/sh
# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $
# $Id: MKncurses_def.sh,v 1.3 2003/10/25 16:19:46 tom Exp $
##############################################################################
# Copyright (c) 2000 Free Software Foundation, Inc. #
# Copyright (c) 2000,2003 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.3 2011/03/19 23:39:59 tom Exp $
# $Id: Makefile.in,v 1.5 2018/01/15 22:12:59 tom Exp $
##############################################################################
# Copyright (c) 2010,2011 Free Software Foundation, Inc. #
# Copyright (c) 2010-2015,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -39,7 +39,7 @@
# turn off _all_ suffix rules; we'll generate our own
.SUFFIXES:
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
THIS = Makefile
@ -49,7 +49,7 @@ prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
INSTALL = @INSTALL@
INSTALL = @INSTALL@ @INSTALL_OPT_O@
INSTALL_DATA = @INSTALL_DATA@
AWK = @AWK@
@ -68,7 +68,7 @@ install :: $(AUTO_SRC)
uninstall ::
ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh
AWK=$(AWK) sh $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
AWK=$(AWK) $(SHELL) $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
tags:
ctags *.[ch]

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
* Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -30,7 +30,7 @@
* Author: Thomas E. Dickey <dickey@clark.net> 1997 *
****************************************************************************/
/*
* $Id: ncurses_cfg.hin,v 1.7 2005/01/02 01:26:58 tom Exp $
* $Id: ncurses_cfg.hin,v 1.10 2018/01/01 15:10:43 tom Exp $
*
* This is a template-file used to generate the "ncurses_cfg.h" file.
*
@ -39,8 +39,8 @@
* 971222) to autoconf 2.12 or 2.13 to do this.
*
* See:
* http://invisible-island.net/autoconf/
* ftp://invisible-island.net/autoconf/
* https://invisible-island.net/autoconf/
* ftp://ftp.invisible-island.net/autoconf/
*/
#ifndef NC_CONFIG_H
#define NC_CONFIG_H

View File

@ -1,7 +1,7 @@
#!/bin/sh
# $Id: make-tar.sh,v 1.14 2013/10/26 23:10:24 tom Exp $
# $Id: make-tar.sh,v 1.17 2019/03/02 22:51:42 tom Exp $
##############################################################################
# Copyright (c) 2010-2011,2013 Free Software Foundation, Inc. #
# Copyright (c) 2010-2017,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -66,7 +66,7 @@ edit_specfile() {
make_changelog() {
test -f $1 && chmod u+w $1
cat >$1 <<EOF
`echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_MAJOR.$NCURSES_MINOR-$NCURSES_PATCH) unstable; urgency=low
`echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_MAJOR.$NCURSES_MINOR+$NCURSES_PATCH) unstable; urgency=low
* snapshot of ncurses subpackage for $PKG_NAME.
@ -80,7 +80,7 @@ test -d ./Ada95 && cd ./Ada95
SOURCE=`cd ..;pwd`
BUILD=$TMPDIR/make-tar$$
trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15
trap "cd /; rm -rf $BUILD; exit 0" EXIT INT QUIT TERM HUP
umask 077
if ! ( mkdir $BUILD )

View File

@ -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.1 2011/03/26 19:22:39 tom Exp $
# $Id: AdaCurses-doc.spec,v 1.7 2019/11/23 21:15:53 tom Exp $
Name: %{AppPackage}
Version: %{AppVersion}
Release: %{AppRelease}
License: MIT
Group: Applications/Development
URL: ftp://invisible-island.net/%{AppProgram}
URL: ftp://ftp.invisible-island.net/%{AppProgram}
Source0: %{AppProgram}-%{AppRelease}.tgz
Packager: Thomas Dickey <dickey@invisible-island.net>
@ -18,16 +18,18 @@ This is the Ada95 binding documentation from the ncurses MAJOR.MINOR
distribution, for patch-date YYYYMMDD.
%prep
%define debug_package %{nil}
%setup -q -n %{AppProgram}-%{AppRelease}
%build
INSTALL_PROGRAM='${INSTALL}' \
./configure \
--target %{_target_platform} \
--prefix=%{_prefix} \
--datadir=%{_datadir} \
--with-ada-sharedlib
%configure \
--target %{_target_platform} \
--prefix=%{_prefix} \
--datadir=%{_datadir} \
--with-ada-sharedlib
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@ -35,14 +37,25 @@ INSTALL_PROGRAM='${INSTALL}' \
(cd doc && make install.html DESTDIR=$RPM_BUILD_ROOT )
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
if rm -rf $RPM_BUILD_ROOT; then
echo OK
else
find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
fi
exit 0
%files
%defattr(-,root,root)
%{_datadir}/doc/AdaCurses
%{_datadir}/doc/%{AppProgram}
%changelog
# each patch should add its ChangeLog entries here
* Sat Mar 26 2010 Thomas Dickey
* Sat Nov 16 2019 Thomas Dickey
- modify clean-rule to work around Fedora NFS bugs.
* Sat Sep 07 2019 Thomas Dickey
- use AppProgram to replace "AdaCurses" globally
* Sat Mar 26 2011 Thomas Dickey
- initial version

View File

@ -1,14 +1,14 @@
Summary: AdaCurses - Ada95 binding for ncurses
Summary: Ada95 binding for ncurses
%define AppProgram AdaCurses
%define AppVersion MAJOR.MINOR
%define AppRelease YYYYMMDD
# $Id: AdaCurses.spec,v 1.12 2011/04/01 00:08:32 tom Exp $
# $Id: AdaCurses.spec,v 1.25 2019/11/23 21:15:31 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: %{AppRelease}
License: MIT
Group: Applications/Development
URL: ftp://invisible-island.net/%{AppProgram}
URL: ftp://ftp.invisible-island.net/%{AppProgram}
Source0: %{AppProgram}-%{AppRelease}.tgz
Packager: Thomas Dickey <dickey@invisible-island.net>
@ -17,14 +17,25 @@ This is the Ada95 binding from the ncurses MAJOR.MINOR distribution, for
patch-date YYYYMMDD.
In addition to a library, this package installs sample programs in
"bin/AdaCurses" to avoid conflict with other packages.
"bin/%{AppProgram}" to avoid conflict with other packages.
%prep
%define debug_package %{nil}
%define need_filter %(if grep -E -i '(mageia|red hat|fedora)' /etc/issue >/dev/null; then echo 1; elif test -f /etc/fedora-release; then echo 1; else echo 0; fi)
%if %{need_filter} == 1
# http://fedoraproject.org/wiki/EPEL:Packaging_Autoprovides_and_Requires_Filtering
%filter_from_requires /lib%{AppProgram}.so.1/d
%filter_setup
%endif
%setup -q -n %{AppProgram}-%{AppRelease}
%build
%define ada_libdir %{_prefix}/lib/ada/adalib
%define ada_include %{_prefix}/share/ada/adainclude
INSTALL_PROGRAM='${INSTALL}' \
./configure \
@ -32,6 +43,8 @@ INSTALL_PROGRAM='${INSTALL}' \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--with-ada-include=%{ada_include} \
--with-ada-objects=%{ada_libdir} \
--mandir=%{_mandir} \
--datadir=%{_datadir} \
--disable-rpath-link \
@ -43,36 +56,52 @@ make
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
( cd samples &&
make install.examples \
DESTDIR=$RPM_BUILD_ROOT \
BINDIR=$RPM_BUILD_ROOT%{_bindir}/%{AppProgram}
DESTDIR=$RPM_BUILD_ROOT \
BINDIR=$RPM_BUILD_ROOT%{_bindir}/%{AppProgram}
)
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
if rm -rf $RPM_BUILD_ROOT; then
echo OK
else
find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
fi
exit 0
%files
%defattr(-,root,root)
%{_bindir}/adacurses*-config
%{_bindir}/%{AppProgram}/*
%{_libdir}/libAdaCurses.*
%{ada_libdir}/libAdaCurses.*
%{ada_libdir}/terminal_interface*
%{ada_libdir}/
%if %{need_filter} == 1
%{_libdir}/lib%{AppProgram}.*
%endif
%{_mandir}/man1/adacurses*-config.1*
%{_datadir}/%{AppProgram}/*
%{_datadir}/ada/adainclude/terminal_interface*
%{ada_include}/
%changelog
# each patch should add its ChangeLog entries here
* Thu Mar 31 2010 Thomas Dickey
* Sat Nov 16 2019 Thomas Dickey
- modify clean-rule to work around Fedora NFS bugs.
* Sat Sep 14 2019 Thomas Dickey
- build-fixes for Fedora29, OpenSUSE
* Sat Sep 07 2019 Thomas Dickey
- use AppProgram to replace "AdaCurses" globally
- amend install-paths to work with Fedora30
* Thu Mar 31 2011 Thomas Dickey
- use --with-shared option for consistency with --with-ada-sharelib
- ensure that MY_DATADIR is set when installing examples
- add ada_libdir symbol to handle special case where libdir is /usr/lib64
- use --disable-rpath-link to link sample programs without rpath
* Fri Mar 25 2010 Thomas Dickey
* Fri Mar 25 2011 Thomas Dickey
- initial version

View File

@ -1 +1 @@
5
9

View File

@ -4,12 +4,12 @@ Section: misc
Priority: optional
Standards-Version: 3.8.4
Build-Depends: debhelper (>= 5)
Homepage: http://invisible-island.net/adacurses/
Homepage: https://invisible-island.net/adacurses/
Package: adacurses
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: AdaCurses - Ada95 binding for ncurses
Description: Ada95 binding for ncurses
This package installs as "adacurses" to avoid conflict with other packages.
This is the Ada95 binding from the ncurses distribution.
.

View File

@ -1,9 +1,15 @@
Upstream source http://invisible-island.net/ncurses/ncurses-examples.html
Upstream source https://invisible-island.net/ncurses/ncurses-examples.html
Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
-------------------------------------------------------------------------------
Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.
Files: *
Copyright: 1998-2019,2020 Free Software Foundation, Inc.
Licence: X11
Files: aclocal.m4 package
Copyright: 2010-2019,2020 by Thomas E. Dickey
Licence: X11
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@ -28,11 +34,12 @@ Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
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
Licence: other-BSD
Licence: 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
@ -67,3 +74,5 @@ Licence: other-BSD
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

View File

@ -14,7 +14,9 @@ DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
TARGET_DIR = $(CURDIR)/debian/adacurses
SAMPLE_DIR = $(TARGET_DIR)/usr/bin/AdaCurses
CFLAGS =
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(CC_NORMAL)
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
@ -30,13 +32,16 @@ configure: configure-stamp
configure-stamp:
dh_testdir
CFLAGS="$(CFLAGS)" ./configure \
CFLAGS="$(CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" \
LDFLAGS="$(LDFLAGS)" ./configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--disable-rpath-link \
--with-shared \
--with-ada-sharedlib
--with-ada-sharedlib \
--without-pkg-config
touch configure-stamp
@ -88,6 +93,7 @@ binary-arch: build install
dh_compress
dh_fixperms
dh_installdeb
dh_makeshlibs
dh_shlibdeps
dh_gencontrol
dh_md5sums

View File

@ -1,4 +1,4 @@
version=3
opts=passive ftp://invisible-island.net/AdaCurses/AdaCurses-([\d.]+)\.tgz \
opts=passive ftp://ftp.invisible-island.net/AdaCurses/AdaCurses-([\d.]+)\.tgz \
debian uupdate

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. #
# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -28,11 +28,11 @@
#
# Author: Juergen Pfeifer, 1996
#
# $Id: Makefile.in,v 1.48 2012/10/06 19:00:42 tom Exp $
# $Id: Makefile.in,v 1.57 2019/12/22 01:09:19 tom Exp $
#
.SUFFIXES:
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
THIS = Makefile
@ -47,7 +47,7 @@ datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
INSTALL = @INSTALL@
INSTALL = @INSTALL@ @INSTALL_OPT_O@
INSTALL_DATA = @INSTALL_DATA@
AWK = @AWK@
@ -81,26 +81,32 @@ BINDIR = $(DESTDIR)$(bindir)
DATADIR = $(DESTDIR)$(datadir)
LIBDIR = $(DESTDIR)$(libdir)
MY_DATADIR = $(DATADIR)/AdaCurses
MY_DATADIR = $(DATADIR)/@ADA_LIBNAME@
THIS_DATADIR = $(datadir)/@ADA_LIBNAME@
################################################################################
ada_srcdir=../src
ada_srcdir = ../src
LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
ADA = @cf_ada_compiler@
ADAFLAGS = @ADAFLAGS@ -I$(srcdir)
ADA = @cf_ada_compiler@
ADAPREP = gnatprep
ADAFLAGS = @ADAFLAGS@ -I$(srcdir)
ADAMAKE = @cf_ada_make@
ADAMAKEFLAGS = -a -A$(srcdir) -A$(ada_srcdir) -A$(srcdir)/$(ada_srcdir)
ADAMAKE = @cf_ada_make@
ADAMAKEFLAGS = -a \
-A$(srcdir) \
-A$(ada_srcdir) \
-A$(srcdir)/$(ada_srcdir)
ALIB = @cf_ada_package@
ABASE = $(ALIB)-curses
ALIB = @cf_ada_package@
ABASE = $(ALIB)-curses
THISLIB = sample
CARGS =-cargs $(ADAFLAGS)
LARGS =-largs -L../lib -lAdaCurses @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@
CARGS = -cargs $(ADAFLAGS)
LARGS = -largs -L../lib -l@ADA_LIBNAME@ @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@
PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
all :: $(PROGS)
@echo made $@
@ -133,13 +139,15 @@ $(BINDIR) \
$(MY_DATADIR) :
mkdir -p $@
ncurses$x :
AUTO_SRC = $(THISLIB)-explanation.adb
ncurses$x : $(AUTO_SRC)
$(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS)
tour$x :
tour$x : $(AUTO_SRC)
$(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS)
rain$x :
rain$x : $(AUTO_SRC)
$(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS)
mostlyclean:
@ -147,10 +155,15 @@ mostlyclean:
clean :: mostlyclean
rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
trace screendump b~*.ad[bs]
rm -f $(AUTO_SRC)
rm -f trace screendump b~*.ad[bs]
distclean :: clean
rm -f Makefile
realclean :: distclean
@echo made $@
$(THISLIB)-explanation.adb : $(srcdir)/$(THISLIB)-explanation.adb_p
rm -f $@
$(ADAPREP) -DTHIS_DATADIR=\"$(THIS_DATADIR)/\" @GNATPREP_OPTS@ $(srcdir)/$(THISLIB)-explanation.adb_p $@

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2011,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.11 $
-- $Date: 2011/03/23 00:33:00 $
-- $Revision: 1.12 $
-- $Date: 2018/07/07 23:31:55 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Windows and scrolling tester.
@ -226,14 +226,11 @@ procedure ncurses2.acs_and_scroll is
mypair : pair;
use Ada.Strings.Fixed;
begin
Move_Cursor (Line => Lines - 4, Column => 0);
for n in legend'Range loop
pos := Ada.Strings.Fixed.Index (Source => legend (n).msg.all,
Pattern => "%s");
-- buf := (others => ' ');
buf := To_Bounded_String (legend (n).msg.all);
case legend (n).code is
when 0 => null;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.6 $
-- $Date: 2011/03/23 00:44:12 $
-- $Revision: 1.7 $
-- $Date: 2014/09/13 19:10:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@ -317,8 +317,9 @@ procedure ncurses2.demo_forms is
function my_form_driver (f : Form; c : Key_Code) return Boolean is
flag : constant Driver_Result := Driver (f, F_Validate_Field);
begin
if c = Form_Request_Code'Last + 1
and flag = Form_Ok then
if c = Form_Request_Code'Last + 1 and
flag = Form_Ok
then
return True;
else
Beep;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2014,2020 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2011/03/23 00:44:12 $
-- $Revision: 1.10 $
-- $Date: 2020/01/18 17:02:13 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@ -437,7 +437,8 @@ procedure ncurses2.demo_pad is
-- pan rightwards
-- if (basex + portx - (pymax > porty) < pxmax)
if basex + portx -
Column_Position (greater (pymax, porty)) < pxmax then
Column_Position (greater (pymax, porty)) < pxmax
then
-- if basex + portx < pxmax or
-- (pymax > porty and basex + portx - 1 < pxmax) then
basex := basex + 1;
@ -457,7 +458,8 @@ procedure ncurses2.demo_pad is
-- pan downwards
-- same as if (basey + porty - (pxmax > portx) < pymax)
if basey + porty -
Line_Position (greater (pxmax, portx)) < pymax then
Line_Position (greater (pxmax, portx)) < pymax
then
-- if (basey + porty < pymax) or
-- (pxmax > portx and basey + porty - 1 < pymax) then
basey := basey + 1;
@ -486,7 +488,7 @@ procedure ncurses2.demo_pad is
-- more writing off the screen.
-- Interestingly, the exception is not handled if
-- we put a block around this.
-- delcare --begin
-- declare --begin
if top_y /= 0 and top_x /= 0 then
Add (Line => top_y - 1, Column => top_x - 1,
Ch => ACS_Map (ACS_Upper_Left_Corner));
@ -577,7 +579,7 @@ procedure ncurses2.demo_pad is
declare
-- the C version allows the panel to have a zero height
-- wich raise the exception
-- which raise the exception
begin
Refresh_Without_Update
(

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2011,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.7 $
-- $Date: 2011/03/23 00:44:12 $
-- $Revision: 1.8 $
-- $Date: 2018/07/07 23:31:02 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@ -47,7 +47,6 @@ with Terminal_Interface.Curses.Panels.User_Data;
with ncurses2.genericPuts;
procedure ncurses2.demo_panels (nap_mseci : Integer) is
use Int_IO;
function mkpanel (color : Color_Number;
rows : Line_Count;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2009,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2009/12/26 17:38:58 $
-- $Revision: 1.9 $
-- $Date: 2014/09/13 19:10:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Character input test
@ -210,8 +210,10 @@ begin
end;
elsif c = Character'Pos ('s') then
ShellOut (True);
elsif c = Character'Pos ('x') or c = Character'Pos ('q') or
(c = Key_None and blockflag = Blocking) then
elsif c = Character'Pos ('x') or
c = Character'Pos ('q') or
(c = Key_None and blockflag = Blocking)
then
exit;
elsif c = Character'Pos ('?') then
Add (Str => "Type any key to see its keypad value. Also:");

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2018,2020 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2008/07/26 18:47:50 $
-- $Revision: 1.10 $
-- $Date: 2020/01/18 17:02:13 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- TODO use Default_Character where appropriate
@ -50,7 +50,6 @@ with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Latin_1;
-- with Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
@ -76,7 +75,6 @@ with ncurses2.trace_set;
with ncurses2.getopt; use ncurses2.getopt;
package body ncurses2.m is
use Int_IO;
function To_trace (n : Integer) return Trace_Attribute_Set;
procedure usage;
@ -188,7 +186,7 @@ package body ncurses2.m is
Erase (Win);
Move_Cursor (Win, 0, 0);
Add (Win, "header:" & Columns'Img & " columns");
-- 'Img is a GNAT extention
-- 'Img is a GNAT extension
Refresh_Without_Update (Win);
return 0; -- Curses_OK;
end rip_header;
@ -304,7 +302,6 @@ package body ncurses2.m is
tmpi : Integer;
package myio is new Ada.Text_IO.Integer_IO (Integer);
use myio;
save_trace : Integer := 0;
save_trace_set : Trace_Attribute_Set;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2004,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2014,2015 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.5 $
-- $Date: 2011/03/19 12:07:18 $
-- $Revision: 1.7 $
-- $Date: 2015/07/25 23:43:19 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@ -72,8 +72,9 @@ procedure ncurses2.overlap_test is
Get_Size (win, y1, x1);
for y in 0 .. y1 - 1 loop
for x in 0 .. x1 - 1 loop
if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3))
or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3))) then
if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3)) or
(((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3)))
then
Move_Cursor (win, y, x);
Add (win, Ch => ch);
end if;
@ -93,7 +94,7 @@ begin
Add (Str => "This test shows the behavior of wnoutrefresh() with " &
"respect to");
Add (Ch => newl);
Add (Str => "the shared region of two overlapping windows A and B. "&
Add (Str => "the shared region of two overlapping windows A and B. " &
"The cross");
Add (Ch => newl);
Add (Str => "pattern in each window does not overlap the other.");

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2011,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.9 $
-- $Date: 2011/03/19 12:03:08 $
-- $Revision: 1.10 $
-- $Date: 2018/07/07 23:30:32 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@ -76,8 +76,6 @@ procedure ncurses2.slk_test is
Str := To_Unbounded_String (To_Ada (Txt, True));
end myGet;
use Int_IO;
use Ada.Strings.Unbounded;
c : Key_Code;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.5 $
-- $Date: 2011/03/23 00:40:33 $
-- $Revision: 1.6 $
-- $Date: 2014/09/13 19:10:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@ -141,7 +141,8 @@ procedure ncurses2.trace_set is
(super.Internal_Calls or not sub.Internal_Calls) and
(super.Character_Calls or not sub.Character_Calls) and
(super.Termcap_TermInfo or not sub.Termcap_TermInfo) and
True then
True
then
return True;
else
return False;
@ -250,93 +251,107 @@ procedure ncurses2.trace_set is
else
if subset (tlevel,
Trace_Attribute_Set'(Times => True, others => False)) then
Trace_Attribute_Set'(Times => True, others => False))
then
Append (buf, "Times");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Tputs => True, others => False)) then
Trace_Attribute_Set'(Tputs => True, others => False))
then
Append (buf, "Tputs");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Update => True, others => False)) then
Trace_Attribute_Set'(Update => True, others => False))
then
Append (buf, "Update");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Cursor_Move => True,
others => False)) then
others => False))
then
Append (buf, "Cursor_Move");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Character_Output => True,
others => False)) then
others => False))
then
Append (buf, "Character_Output");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Ordinary) then
Trace_Ordinary)
then
Append (buf, "Ordinary");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Calls => True, others => False)) then
Trace_Attribute_Set'(Calls => True, others => False))
then
Append (buf, "Calls");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Virtual_Puts => True,
others => False)) then
others => False))
then
Append (buf, "Virtual_Puts");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Input_Events => True,
others => False)) then
others => False))
then
Append (buf, "Input_Events");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(TTY_State => True,
others => False)) then
others => False))
then
Append (buf, "TTY_State");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Internal_Calls => True,
others => False)) then
others => False))
then
Append (buf, "Internal_Calls");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Character_Calls => True,
others => False)) then
others => False))
then
Append (buf, "Character_Calls");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Termcap_TermInfo => True,
others => False)) then
others => False))
then
Append (buf, "Termcap_TermInfo");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Maximum) then
Trace_Maximum)
then
Append (buf, "Maximium");
Append (buf, ", ");
end if;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2008,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,16 +35,12 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.7 $
-- $Date: 2008/07/26 18:51:20 $
-- $Revision: 1.9 $
-- $Date: 2014/05/24 21:32:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
pragma Warnings (Off);
with Terminal_Interface.Curses.Aux;
pragma Warnings (On);
with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace;
with Interfaces.C;
@ -115,7 +111,6 @@ package body ncurses2.util is
procedure Cannot (s : String) is
use Interfaces.C;
use Interfaces.C.Strings;
use Terminal_Interface.Curses.Aux;
function getenv (x : char_array) return chars_ptr;
pragma Import (C, getenv, "getenv");
tmp1 : char_array (0 .. 10);

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -36,7 +36,7 @@
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.6 $
-- $Revision: 1.7 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- --

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.12 $
-- $Revision: 1.13 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo.Attributes is

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo.Mouse is

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo is

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2019 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.26 $
-- $Date: 2011/03/26 22:33:29 $
-- $Revision: 1.4 $
-- $Date: 2019/09/08 00:14:54 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Poor mans help system. This scans a sequential file for key lines and
@ -321,8 +321,10 @@ package body Sample.Explanation is
Outer :
loop
exit Outer when not Next_Line;
if Last = (1 + Key'Length) and then Key = Buffer (2 .. Last)
and then Buffer (1) = '#' then
if Last = (1 + Key'Length)
and then Key = Buffer (2 .. Last)
and then Buffer (1) = '#'
then
loop
exit when not Next_Line;
exit when Buffer (1) = '#';
@ -417,14 +419,23 @@ package body Sample.Explanation is
end Check_File;
begin
if Check_File ("/usr/share/AdaCurses/" & File_Name) then
Open (F, In_File, "/usr/share/AdaCurses/" & File_Name);
if Check_File
($THIS_DATADIR
& File_Name)
then
Open (F, In_File,
$THIS_DATADIR
& File_Name);
elsif Check_File (File_Name) then
Open (F, In_File, File_Name);
else
Put_Line (Standard_Error,
"The file explain.txt was not found in the current directory."
"The file "
& File_Name
& " was not found in "
& $THIS_DATADIR
);
raise Name_Error;
end if;
end Sample.Explanation;
-- vile:adamode

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Form_Demo is

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.19 $
-- $Date: 2011/03/22 23:54:38 $
-- $Revision: 1.20 $
-- $Date: 2014/09/13 19:10:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Calendar; use Ada.Calendar;
@ -121,8 +121,11 @@ package body Sample.Header_Handler is
D : constant Day_Number := Day (Now);
begin
if Header_Window /= Null_Window then
if Minute /= Display_Min or else Hour /= Display_Hour
or else Display_Day /= D or else Display_Month /= Mon then
if Minute /= Display_Min
or else Hour /= Display_Hour
or else Display_Day /= D
or else Display_Month /= Mon
then
Move_Cursor (Header_Window, 0, 0);
N_Out (D); Add (Header_Window, '.');
Add (Header_Window, Month_Names (Mon));

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Menu_Demo is

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.17 $
-- $Date: 2011/03/23 00:44:12 $
-- $Revision: 1.18 $
-- $Date: 2018/07/07 23:38:02 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Numerics.Generic_Elementary_Functions;
@ -57,7 +57,6 @@ with Terminal_Interface.Curses.Text_IO.Integer_IO;
with Terminal_Interface.Curses.Text_IO.Float_IO;
with Terminal_Interface.Curses.Text_IO.Enumeration_IO;
with Terminal_Interface.Curses.Text_IO.Complex_IO;
with Terminal_Interface.Curses.Text_IO.Fixed_IO;
with Terminal_Interface.Curses.Text_IO.Decimal_IO;
with Terminal_Interface.Curses.Text_IO.Modular_IO;
@ -69,7 +68,6 @@ with Sample.Explanation; use Sample.Explanation;
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Complex_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Decimal_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Enumeration_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Fixed_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Float_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Modular_IO);
@ -84,7 +82,6 @@ package body Sample.Text_IO_Demo is
Friday,
Saturday);
type Fix is delta 0.1 range 0.0 .. 4.0;
type Dec is delta 0.01 digits 5 range 0.0 .. 4.0;
type Md is mod 5;
@ -107,10 +104,6 @@ package body Sample.Text_IO_Demo is
Terminal_Interface.Curses.Text_IO.Complex_IO (Ada.Numerics.Complex_Types);
use C_IO;
package F_IO is new
Terminal_Interface.Curses.Text_IO.Fixed_IO (Fix);
use F_IO;
package D_IO is new
Terminal_Interface.Curses.Text_IO.Decimal_IO (Dec);
use D_IO;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Text_IO_Demo is

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample is

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -36,7 +36,7 @@
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.7 $
-- $Revision: 1.8 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet <pautet@gnat.com> --

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -36,7 +36,7 @@
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet <pautet@gnat.com> --

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample; use Sample;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure Tour;

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. #
# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -28,14 +28,17 @@
#
# Author: Juergen Pfeifer, 1996
#
# $Id: Makefile.in,v 1.62 2011/04/30 22:24:45 tom Exp $
# $Id: Makefile.in,v 1.87 2019/09/07 20:53:06 tom Exp $
#
.SUFFIXES:
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
THIS = Makefile
ADA_MFLAGS = @cf_cv_makeflags@
@SET_MAKE@
MODEL = ../../@DFT_OBJ_SUBDIR@
DESTDIR = @DESTDIR@
@ -51,7 +54,7 @@ LIBDIR = $(DESTDIR)$(libdir)
ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@
ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@
INSTALL = @INSTALL@
INSTALL = @INSTALL@ @INSTALL_OPT_O@
INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
AR = @AR@
@ -80,14 +83,14 @@ LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
RANLIB = @RANLIB@
################################################################################
ADA = @cf_ada_compiler@
ADA = @cf_ada_compiler@
ADAPREP = gnatprep
ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir)
ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir)
LIB_NAME = AdaCurses
LIB_NAME = @ADA_LIBNAME@
SONAME = @ADA_SHAREDLIB@
GNAT_PROJECT = $(srcdir)/library.gpr
GNAT_PROJECT = @ADA_LIBNAME@.gpr
# build/source are the Ada95 tree
BUILD_DIR = ..
@ -96,8 +99,8 @@ SOURCE_DIR = ..
BUILD_DIR_LIB = $(BUILD_DIR)/lib
SOURCE_DIR_SRC = $(SOURCE_DIR)/src
ADAMAKE = @cf_ada_make@
ADAMAKEFLAGS = \
ADAMAKE = @cf_ada_make@
ADAMAKEFLAGS = \
-P$(GNAT_PROJECT) \
-XBUILD_DIR=`cd $(BUILD_DIR);pwd` \
-XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \
@ -179,7 +182,10 @@ $(LIBDIR) \
$(BUILD_DIR_LIB) :
mkdir -p $@
sources :
$(GENERATED_SOURCES) :
cd ../gen; $(MAKE) $(ADA_MFLAGS)
sources : $(GENERATED_SOURCES)
@echo made $@
libs \
@ -207,7 +213,7 @@ clean :: mostlyclean
rm -f $(ABASE)-trace.adb
distclean :: clean
rm -f Makefile
rm -f Makefile library.gpr
realclean :: distclean
@ -215,27 +221,33 @@ BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
rm -f $@
$(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
$(ADAPREP) -DADA_TRACE=@ADA_TRACE@ @GNATPREP_OPTS@ $(srcdir)/$(ABASE)-trace.adb_p $@
###############################################################################
# Use these definitions when building a shared library.
SHARED_C_OBJS = c_varargs_to_ada.o ncurses_compat.o
SHARED_C_OBJS = c_varargs_to_ada.o c_threaded_variables.o ncurses_compat.o
SHARED_OBJS = $(SHARED_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c
$(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c
c_threaded_variables.o : $(srcdir)/c_threaded_variables.c
$(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_threaded_variables.c
ncurses_compat.o : $(srcdir)/ncurses_compat.c
$(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/ncurses_compat.c
###############################################################################
# Use these definitions when building a static library.
STATIC_C_OBJS = static_c_varargs_to_ada.o static_ncurses_compat.o
STATIC_C_OBJS = static_c_varargs_to_ada.o static_c_threaded_variables.o static_ncurses_compat.o
STATIC_OBJS = $(STATIC_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
static_c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c
$(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_varargs_to_ada.c
static_c_threaded_variables.o : $(srcdir)/c_threaded_variables.c
$(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_threaded_variables.c
static_ncurses_compat.o : $(srcdir)/ncurses_compat.c
$(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/ncurses_compat.c
@ -258,8 +270,14 @@ STATIC_DIRS = \
@USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \
@USE_GNAT_PROJECTS@ $(STATIC_C_OBJS) \
@USE_GNAT_PROJECTS@ $(STATIC_DIRS)
@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 $(srcdir)/library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT)
@USE_GNAT_PROJECTS@ @echo "Using GNAT Project:"
@USE_GNAT_PROJECTS@ @-$(SHELL) -c "diff -u $(srcdir)/library.gpr $(GNAT_PROJECT); exit 0"
@USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
@USE_GNAT_PROJECTS@ $(AR) $(ARFLAGS) $@ $(STATIC_C_OBJS)
@USE_GNAT_PROJECTS@ -rm -f $(GNAT_PROJECT)
@USE_GNAT_PROJECTS@
@USE_GNAT_LIBRARIES@install \
@USE_GNAT_LIBRARIES@install.libs :: \
@ -290,7 +308,13 @@ SHARED_DIRS = \
@MAKE_ADA_SHAREDLIB@ $(SHARED_DIRS) \
@MAKE_ADA_SHAREDLIB@ $(SHARED_OBJS)
@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)
@MAKE_ADA_SHAREDLIB@ $(SHELL) $(srcdir)/library-cfg.sh dynamic $(srcdir)/library.gpr $(CFLAGS_SHARED) >$(GNAT_PROJECT)
@MAKE_ADA_SHAREDLIB@ @echo "Making Ada shared-lib:"
@MAKE_ADA_SHAREDLIB@ @-$(SHELL) -c "diff -u $(srcdir)/library.gpr $(GNAT_PROJECT); exit 0"
@MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
@MAKE_ADA_SHAREDLIB@ -rm -f $(GNAT_PROJECT)
install \
install.libs :: $(ADA_INCLUDE)
@ -328,6 +352,7 @@ uninstall.libs ::
@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_LIBNAME)
clean ::
rm -rf $(BUILD_DIR)/*-ali
rm -rf $(BUILD_DIR)/*-obj
rm -rf $(BUILD_DIR_LIB)
-rm -f default.cgpr
-rm -rf $(BUILD_DIR)/*-ali
-rm -rf $(BUILD_DIR)/*-obj
-rm -rf $(BUILD_DIR_LIB)

View File

@ -0,0 +1,56 @@
/****************************************************************************
* Copyright (c) 2011,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Nicolas Boulenguez, 2011 *
****************************************************************************/
#include "c_threaded_variables.h"
#define WRAP(type, name) \
type \
name ## _as_function () \
{ \
return name; \
}
/* *INDENT-OFF* */
WRAP(WINDOW *, stdscr)
WRAP(WINDOW *, curscr)
WRAP(int, LINES)
WRAP(int, COLS)
WRAP(int, TABSIZE)
WRAP(int, COLORS)
WRAP(int, COLOR_PAIRS)
chtype
acs_map_as_function(char inx)
{
return acs_map[(unsigned char) inx];
}
/* *INDENT-ON* */

View File

@ -0,0 +1,58 @@
/****************************************************************************
* Copyright (c) 2011-2014,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/* $Id: c_threaded_variables.h,v 1.3 2015/08/06 23:09:47 tom Exp $ */
#ifndef __C_THREADED_VARIABLES_H
#define __C_THREADED_VARIABLES_H
#include <ncurses_cfg.h>
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
#include <curses.h>
extern WINDOW *stdscr_as_function(void);
extern WINDOW *curscr_as_function(void);
extern int LINES_as_function(void);
extern int LINES_as_function(void);
extern int COLS_as_function(void);
extern int TABSIZE_as_function(void);
extern int COLORS_as_function(void);
extern int COLOR_PAIRS_as_function(void);
extern chtype acs_map_as_function(char /* index */ );
#endif /* __C_THREADED_VARIABLES_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2011 Free Software Foundation, Inc. *
* Copyright (c) 2011,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,12 +32,12 @@
/*
Version Control
$Id: c_varargs_to_ada.c,v 1.4 2011/03/19 19:07:39 tom Exp $
$Id: c_varargs_to_ada.c,v 1.6 2014/05/24 21:32:18 tom Exp $
--------------------------------------------------------------------------*/
/*
*/
#include <c_varargs_to_ada.h>
#include "c_varargs_to_ada.h"
int
set_field_type_alnum(FIELD *field,

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2011 Free Software Foundation, Inc. *
* Copyright (c) 2011,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -26,11 +26,19 @@
* authorization. *
****************************************************************************/
/* $Id: c_varargs_to_ada.h,v 1.3 2011/03/19 19:07:41 tom Exp $ */
/* $Id: c_varargs_to_ada.h,v 1.4 2015/08/06 23:08:47 tom Exp $ */
#ifndef __C_VARARGS_TO_ADA_H
#define __C_VARARGS_TO_ADA_H
#ifdef HAVE_CONFIG_H
#include <ncurses_cfg.h>
#else
#include <ncurses.h>
#endif
#include <stdlib.h>
#include <form.h>
extern int set_field_type_alnum(FIELD * /* field */ ,

72
Ada95/src/library-cfg.sh Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh
##############################################################################
# Copyright (c) 2016-2018,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# to deal in the Software without restriction, including without limitation #
# the rights to use, copy, modify, merge, publish, distribute, distribute #
# with modifications, sublicense, and/or sell copies of the Software, and to #
# permit persons to whom the Software is furnished to do so, subject to the #
# following conditions: #
# #
# The above copyright notice and this permission notice shall be included in #
# all copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
# DEALINGS IN THE SOFTWARE. #
# #
# Except as contained in this notice, the name(s) of the above copyright #
# holders shall not be used in advertising or otherwise to promote the sale, #
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
#
# $Id: library-cfg.sh,v 1.6 2019/09/07 20:27:26 tom Exp $
#
# Work around incompatible behavior introduced with gnat6, which causes
# gnatmake to attempt to compile all of the C objects which might be part of
# the project. This can only work if we provide the compiler flags (done here
# by making a copy of the project file with that information filled in).
model=$1
shift 1
input=$1
shift 1
param=
while test $# != 0
do
case "x$1" in
*-[OgDIWf]*)
test -n "$param" && param="$param,"
param="$param\"$1\""
;;
*)
echo "${0##*/}: ignored option $1" >&2
;;
esac
shift 1
done
SHARE="-- "
test "x$model" = "xdynamic" && SHARE=
SCRIPT=library-cfg.tmp
cat >$SCRIPT <<EOF
/for Library_Options use /{
s,-- ,$SHARE,
}
/for Default_Switches ("C") use/{
s,-- ,,
s% use .*% use($param);%
}
EOF
sed -f $SCRIPT $input
rc=$?
rm -f $SCRIPT
exit $?

View File

@ -1,5 +1,5 @@
------------------------------------------------------------------------------
-- Copyright (c) 2010,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2010-2018,2019 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -25,10 +25,10 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- $Id: library.gpr,v 1.7 2011/03/18 23:10:28 Nicolas.Boulenguez Exp $
-- $Id: library.gpr.in,v 1.1 2019/09/07 20:29:02 tom Exp $
-- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html
-- http://www.adaworld.com/debian/debian-ada-policy.html
project Library is
project AdaCurses is
Build_Dir := External ("BUILD_DIR");
Source_Dir := External ("SOURCE_DIR");
Source_Dir2 := External ("SOURCE_DIR2");
@ -43,7 +43,7 @@ project Library is
for Source_Dirs use (Source_Dir & "/src",
Source_Dir2,
Build_Dir & "/src");
for Library_Options use ("-lncurses", "-lpanel", "-lmenu", "-lform");
-- for Library_Options use ("-lncurses@USE_LIB_SUFFIX@", "-lpanel@USE_LIB_SUFFIX@", "-lmenu@USE_LIB_SUFFIX@", "-lform@USE_LIB_SUFFIX@");
package Compiler is
for Default_Switches ("Ada") use
("-g",
@ -51,6 +51,7 @@ project Library is
"-gnatafno",
"-gnatVa", -- All validity checks
"-gnatwa"); -- Activate all optional errors
-- for Default_Switches ("C") use (CFLAGS)
end Compiler;
for Languages use ("C", "Ada");
end Library;
end AdaCurses;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2011 Free Software Foundation, Inc. *
* Copyright (c) 2011,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,12 +32,22 @@
/*
Version Control
$Id: ncurses_compat.c,v 1.2 2011/03/28 00:29:04 tom Exp $
$Id: ncurses_compat.c,v 1.3 2015/08/06 23:09:10 tom Exp $
--------------------------------------------------------------------------*/
/*
* Provide compatibility with older versions of ncurses.
*/
#include <ncurses_cfg.h>
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
#include <curses.h>
#if defined(NCURSES_VERSION_PATCH)
@ -49,7 +59,7 @@ extern int _nc_has_mouse(void);
bool
has_mouse(void)
{
return (bool) _nc_has_mouse();
return (bool)_nc_has_mouse();
}
#endif

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- $Date: 2011/03/19 00:45:37 $
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -47,15 +47,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is
Typ : Alpha_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int) return C_Int;
Arg1 : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_alpha");
Res : Eti_Error;
begin
Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width));
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- $Date: 2011/03/19 00:45:37 $
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -47,15 +47,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
Typ : AlphaNumeric_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int) return C_Int;
Arg1 : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_alnum");
Res : Eti_Error;
begin
Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width));
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- Copyright (c) 1998,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.10 $
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.10 $
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
@ -94,21 +94,18 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
function Set_Fld_Type (F : Field := Fld;
Arg1 : chars_ptr_array;
Arg2 : C_Int;
Arg3 : C_Int) return C_Int;
Arg3 : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_enum");
Res : Eti_Error;
begin
if Typ.Arr = null then
raise Form_Exception;
end if;
Res := Set_Fld_Type (Arg1 => Typ.Arr.all,
Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)),
Arg3 => C_Int (Boolean'Pos
(Typ.Match_Must_Be_Unique)));
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception
(Set_Fld_Type
(Arg1 => Typ.Arr.all,
Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)),
Arg3 => C_Int (Boolean'Pos (Typ.Match_Must_Be_Unique))));
Wrap_Builtin (Fld, Typ, C_Choice_Router);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2018,2020 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- $Revision: 1.14 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C.Strings;
@ -54,9 +54,9 @@ package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
type Enumeration_Info (C : Positive) is
record
Names : Enum_Array (1 .. C);
Case_Sensitive : Boolean := False;
Match_Must_Be_Unique : Boolean := False;
Names : Enum_Array (1 .. C);
end record;
type Enumeration_Field is new Field_Type with private;
@ -78,7 +78,7 @@ package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
-- But we may want to release the field to release the memory allocated
-- by it internally. After that the Enumeration field is no longer usable.
-- The next type defintions are all ncurses extensions. They are typically
-- The next type definitions are all ncurses extensions. They are typically
-- not available in other curses implementations.
procedure Set_Field_Type (Fld : Field;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- $Date: 2011/03/19 00:45:37 $
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -49,17 +49,13 @@ package body Terminal_Interface.Curses.Forms.Field_Types.IntField is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int;
Arg2 : C_Long_Int;
Arg3 : C_Long_Int) return C_Int;
Arg3 : C_Long_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_integer");
Res : Eti_Error;
begin
Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => C_Long_Int (Typ.Lower_Limit),
Arg3 => C_Long_Int (Typ.Upper_Limit));
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => C_Long_Int (Typ.Lower_Limit),
Arg3 => C_Long_Int (Typ.Upper_Limit)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- $Date: 2011/03/19 00:45:37 $
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -47,15 +47,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
Typ : Internet_V4_Address_Field)
is
function Set_Fld_Type (F : Field := Fld)
return C_Int;
return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_ipv4");
Res : Eti_Error;
begin
Res := Set_Fld_Type;
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type);
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- $Date: 2011/03/19 00:45:37 $
-- $Revision: 1.14 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
@ -52,17 +52,13 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int;
Arg2 : Double;
Arg3 : Double) return C_Int;
Arg3 : Double) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_numeric");
Res : Eti_Error;
begin
Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => Double (Typ.Lower_Limit),
Arg3 => Double (Typ.Upper_Limit));
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => Double (Typ.Lower_Limit),
Arg3 => Double (Typ.Upper_Limit)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.10 $
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C; use Interfaces.C;
@ -46,21 +46,12 @@ package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is
procedure Set_Field_Type (Fld : Field;
Typ : Regular_Expression_Field)
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Ftyp (F : Field := Fld;
Arg1 : Char_Ptr) return C_Int;
Arg1 : char_array) return Eti_Error;
pragma Import (C, Set_Ftyp, "set_field_type_regexp");
Txt : char_array (0 .. Typ.Regular_Expression.all'Length);
Len : size_t;
Res : Eti_Error;
begin
To_C (Typ.Regular_Expression.all, Txt, Len);
Res := Set_Ftyp (Arg1 => Txt (Txt'First)'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Ftyp (Arg1 => To_C (Typ.Regular_Expression.all)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.17 $
-- $Date: 2011/03/22 10:53:37 $
-- $Revision: 1.20 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System.Address_To_Access_Conversions;
@ -53,7 +53,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
Result : Boolean;
Udf : constant User_Defined_Field_Type_With_Choice_Access :=
User_Defined_Field_Type_With_Choice_Access
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ);
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
begin
Result := Next (Fld, Udf.all);
return Curses_Bool (Boolean'Pos (Result));
@ -65,7 +65,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
Result : Boolean;
Udf : constant User_Defined_Field_Type_With_Choice_Access :=
User_Defined_Field_Type_With_Choice_Access
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ);
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
begin
Result := Previous (Fld, Udf.all);
return Curses_Bool (Boolean'Pos (Result));
@ -88,16 +88,12 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Res);
Res := Set_Fieldtype_Choice (T,
Generic_Next'Access,
Generic_Prev'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Res);
end if;
M_Generic_Choice := T;
end if;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.21 $
-- $Date: 2011/03/23 00:44:58 $
-- $Revision: 1.23 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System.Address_To_Access_Conversions;
@ -53,11 +53,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is
function Set_Fld_Type (F : Field := Fld;
Cft : C_Field_Type := C_Generic_Type;
Arg1 : Argument_Access)
return C_Int;
return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_user");
Res : Eti_Error;
function Allocate_Arg (T : User_Defined_Field_Type'Class)
return Argument_Access
is
@ -70,10 +68,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is
end Allocate_Arg;
begin
Res := Set_Fld_Type (Arg1 => Allocate_Arg (Typ));
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type (Arg1 => Allocate_Arg (Typ)));
end Set_Field_Type;
package Argument_Conversions is
@ -120,9 +115,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Res);
end if;
M_Generic_Type := T;
end if;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.25 $
-- $Date: 2011/03/22 23:22:27 $
-- $Revision: 1.28 $
-- $Date: 2014/09/13 19:00:47 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -76,9 +76,10 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
return null;
else
if Low_Level = M_Builtin_Router or else
Low_Level = M_Generic_Type or else
Low_Level = M_Choice_Router or else
Low_Level = M_Generic_Choice then
Low_Level = M_Generic_Type or else
Low_Level = M_Choice_Router or else
Low_Level = M_Generic_Choice
then
Arg := Argument_Access
(Argument_Conversions.To_Pointer (Get_Arg (Fld)));
if Arg = null then
@ -130,10 +131,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
Usr_Arg : constant System.Address := Get_Arg (Fld);
Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
Arg : Argument_Access;
Res : Eti_Error;
function Set_Fld_Type (F : Field := Fld;
Cf : C_Field_Type := Cft;
Arg1 : Argument_Access) return C_Int;
Arg1 : Argument_Access) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_user");
begin
@ -152,10 +152,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
end if;
end if;
Res := Set_Fld_Type (Arg1 => Arg);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Type (Arg1 => Arg));
end if;
end Wrap_Builtin;
@ -223,7 +220,6 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
--
function C_Builtin_Router return C_Field_Type
is
Res : Eti_Error;
T : C_Field_Type;
begin
if M_Builtin_Router = Null_Field_Type then
@ -232,13 +228,10 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
if T = Null_Field_Type then
raise Form_Exception;
else
Res := Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access));
end if;
M_Builtin_Router := T;
end if;
@ -250,7 +243,6 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
--
function C_Choice_Router return C_Field_Type
is
Res : Eti_Error;
T : C_Field_Type;
begin
if M_Choice_Router = Null_Field_Type then
@ -259,20 +251,14 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
if T = Null_Field_Type then
raise Form_Exception;
else
Res := Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access));
Res := Set_Fieldtype_Choice (T,
Next_Router'Access,
Prev_Router'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fieldtype_Choice (T,
Next_Router'Access,
Prev_Router'Access));
end if;
M_Choice_Router := T;
end if;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Revision: 1.16 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -49,20 +49,15 @@ package body Terminal_Interface.Curses.Forms.Field_User_Data is
-- |
-- |
-- |
use type Interfaces.C.int;
procedure Set_User_Data (Fld : Field;
Data : User_Access)
is
function Set_Field_Userptr (Fld : Field;
Usr : User_Access) return C_Int;
Usr : User_Access) return Eti_Error;
pragma Import (C, Set_Field_Userptr, "set_field_userptr");
Res : constant Eti_Error := Set_Field_Userptr (Fld, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Userptr (Fld, Data));
end Set_User_Data;
-- |
-- |

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Revision: 1.16 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- |
@ -47,8 +47,6 @@ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Form_User_Data is
use type Interfaces.C.int;
-- |
-- |
-- |
@ -56,14 +54,11 @@ package body Terminal_Interface.Curses.Forms.Form_User_Data is
Data : User_Access)
is
function Set_Form_Userptr (Frm : Form;
Data : User_Access) return C_Int;
Data : User_Access) return Eti_Error;
pragma Import (C, Set_Form_Userptr, "set_form_userptr");
Res : constant Eti_Error := Set_Form_Userptr (Frm, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Form_Userptr (Frm, Data));
end Set_User_Data;
-- |
-- |

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,12 +35,11 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.28 $
-- $Date: 2011/03/22 23:37:32 $
-- $Revision: 1.32 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Ada.Unchecked_Conversion;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
@ -62,22 +61,6 @@ package body Terminal_Interface.Curses.Forms is
-- |
-- subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
function FOS_2_CInt is new
Ada.Unchecked_Conversion (Field_Option_Set,
C_Int);
function CInt_2_FOS is new
Ada.Unchecked_Conversion (C_Int,
Field_Option_Set);
function FrmOS_2_CInt is new
Ada.Unchecked_Conversion (Form_Option_Set,
C_Int);
function CInt_2_FrmOS is new
Ada.Unchecked_Conversion (C_Int,
Form_Option_Set);
procedure Request_Name (Key : Form_Request_Code;
Name : out String)
is
@ -130,15 +113,11 @@ package body Terminal_Interface.Curses.Forms is
-- |
procedure Delete (Fld : in out Field)
is
function Free_Field (Fld : Field) return C_Int;
function Free_Field (Fld : Field) return Eti_Error;
pragma Import (C, Free_Field, "free_field");
Res : Eti_Error;
begin
Res := Free_Field (Fld);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Free_Field (Fld));
Fld := Null_Field;
end Delete;
-- |
@ -194,16 +173,12 @@ package body Terminal_Interface.Curses.Forms is
Just : Field_Justification := None)
is
function Set_Field_Just (Fld : Field;
Just : C_Int) return C_Int;
Just : C_Int) return Eti_Error;
pragma Import (C, Set_Field_Just, "set_field_just");
Res : constant Eti_Error :=
Set_Field_Just (Fld,
C_Int (Field_Justification'Pos (Just)));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Just (Fld,
C_Int (Field_Justification'Pos (Just))));
end Set_Justification;
-- |
-- |
@ -227,22 +202,14 @@ package body Terminal_Interface.Curses.Forms is
Buffer : Buffer_Number := Buffer_Number'First;
Str : String)
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Fld_Buffer (Fld : Field;
Bufnum : C_Int;
S : Char_Ptr)
return C_Int;
S : char_array)
return Eti_Error;
pragma Import (C, Set_Fld_Buffer, "set_field_buffer");
Txt : char_array (0 .. Str'Length);
Len : size_t;
Res : Eti_Error;
begin
To_C (Str, Txt, Len);
Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Fld_Buffer (Fld, C_Int (Buffer), To_C (Str)));
end Set_Buffer;
-- |
-- |
@ -276,12 +243,11 @@ package body Terminal_Interface.Curses.Forms is
Status : Boolean := True)
is
function Set_Fld_Status (Fld : Field;
St : C_Int) return C_Int;
St : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Status, "set_field_status");
Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status));
begin
if Res /= E_Ok then
if Set_Fld_Status (Fld, Boolean'Pos (Status)) /= E_Ok then
raise Form_Exception;
end if;
end Set_Status;
@ -308,14 +274,11 @@ package body Terminal_Interface.Curses.Forms is
Max : Natural := 0)
is
function Set_Field_Max (Fld : Field;
M : C_Int) return C_Int;
M : C_Int) return Eti_Error;
pragma Import (C, Set_Field_Max, "set_max_field");
Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Max (Fld, C_Int (Max)));
end Set_Maximum_Size;
-- |
-- |=====================================================================
@ -328,16 +291,11 @@ package body Terminal_Interface.Curses.Forms is
Options : Field_Option_Set)
is
function Set_Field_Opts (Fld : Field;
Opt : C_Int) return C_Int;
Opt : Field_Option_Set) return Eti_Error;
pragma Import (C, Set_Field_Opts, "set_field_opts");
Opt : constant C_Int := FOS_2_CInt (Options);
Res : Eti_Error;
begin
Res := Set_Field_Opts (Fld, Opt);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Opts (Fld, Options));
end Set_Options;
-- |
-- |
@ -347,22 +305,17 @@ package body Terminal_Interface.Curses.Forms is
On : Boolean := True)
is
function Field_Opts_On (Fld : Field;
Opt : C_Int) return C_Int;
Opt : Field_Option_Set) return Eti_Error;
pragma Import (C, Field_Opts_On, "field_opts_on");
function Field_Opts_Off (Fld : Field;
Opt : C_Int) return C_Int;
Opt : Field_Option_Set) return Eti_Error;
pragma Import (C, Field_Opts_Off, "field_opts_off");
Err : Eti_Error;
Opt : constant C_Int := FOS_2_CInt (Options);
begin
if On then
Err := Field_Opts_On (Fld, Opt);
Eti_Exception (Field_Opts_On (Fld, Options));
else
Err := Field_Opts_Off (Fld, Opt);
end if;
if Err /= E_Ok then
Eti_Exception (Err);
Eti_Exception (Field_Opts_Off (Fld, Options));
end if;
end Switch_Options;
-- |
@ -371,12 +324,11 @@ package body Terminal_Interface.Curses.Forms is
procedure Get_Options (Fld : Field;
Options : out Field_Option_Set)
is
function Field_Opts (Fld : Field) return C_Int;
function Field_Opts (Fld : Field) return Field_Option_Set;
pragma Import (C, Field_Opts, "field_opts");
Res : constant C_Int := Field_Opts (Fld);
begin
Options := CInt_2_FOS (Res);
Options := Field_Opts (Fld);
end Get_Options;
-- |
-- |
@ -402,18 +354,13 @@ package body Terminal_Interface.Curses.Forms is
Color : Color_Pair := Color_Pair'First)
is
function Set_Field_Fore (Fld : Field;
Attr : C_Chtype) return C_Int;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Field_Fore, "set_field_fore");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Fore);
Res : constant Eti_Error :=
Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Fore (Fld, (Ch => Character'First,
Color => Color,
Attr => Fore)));
end Set_Foreground;
-- |
-- |
@ -421,21 +368,21 @@ package body Terminal_Interface.Curses.Forms is
procedure Foreground (Fld : Field;
Fore : out Character_Attribute_Set)
is
function Field_Fore (Fld : Field) return C_Chtype;
function Field_Fore (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Fore, "field_fore");
begin
Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
Fore := Field_Fore (Fld).Attr;
end Foreground;
procedure Foreground (Fld : Field;
Fore : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Field_Fore (Fld : Field) return C_Chtype;
function Field_Fore (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Fore, "field_fore");
begin
Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color;
Fore := Field_Fore (Fld).Attr;
Color := Field_Fore (Fld).Color;
end Foreground;
-- |
-- |
@ -446,18 +393,13 @@ package body Terminal_Interface.Curses.Forms is
Color : Color_Pair := Color_Pair'First)
is
function Set_Field_Back (Fld : Field;
Attr : C_Chtype) return C_Int;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Field_Back, "set_field_back");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Back);
Res : constant Eti_Error :=
Set_Field_Back (Fld, AttrChar_To_Chtype (Ch));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Back (Fld, (Ch => Character'First,
Color => Color,
Attr => Back)));
end Set_Background;
-- |
-- |
@ -465,21 +407,21 @@ package body Terminal_Interface.Curses.Forms is
procedure Background (Fld : Field;
Back : out Character_Attribute_Set)
is
function Field_Back (Fld : Field) return C_Chtype;
function Field_Back (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Back, "field_back");
begin
Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
Back := Field_Back (Fld).Attr;
end Background;
procedure Background (Fld : Field;
Back : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Field_Back (Fld : Field) return C_Chtype;
function Field_Back (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Back, "field_back");
begin
Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
Color := Chtype_To_AttrChar (Field_Back (Fld)).Color;
Back := Field_Back (Fld).Attr;
Color := Field_Back (Fld).Color;
end Background;
-- |
-- |
@ -488,15 +430,12 @@ package body Terminal_Interface.Curses.Forms is
Pad : Character := Space)
is
function Set_Field_Pad (Fld : Field;
Ch : C_Int) return C_Int;
Ch : C_Int) return Eti_Error;
pragma Import (C, Set_Field_Pad, "set_field_pad");
Res : constant Eti_Error := Set_Field_Pad (Fld,
C_Int (Character'Pos (Pad)));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Pad (Fld,
C_Int (Character'Pos (Pad))));
end Set_Pad_Character;
-- |
-- |
@ -527,25 +466,21 @@ package body Terminal_Interface.Curses.Forms is
type C_Int_Access is access all C_Int;
function Fld_Info (Fld : Field;
L, C, Fr, Fc, Os, Ab : C_Int_Access)
return C_Int;
return Eti_Error;
pragma Import (C, Fld_Info, "field_info");
L, C, Fr, Fc, Os, Ab : aliased C_Int;
Res : constant Eti_Error := Fld_Info (Fld,
L'Access, C'Access,
Fr'Access, Fc'Access,
Os'Access, Ab'Access);
begin
if Res /= E_Ok then
Eti_Exception (Res);
else
Lines := Line_Count (L);
Columns := Column_Count (C);
First_Row := Line_Position (Fr);
First_Column := Column_Position (Fc);
Off_Screen := Natural (Os);
Additional_Buffers := Buffer_Number (Ab);
end if;
Eti_Exception (Fld_Info (Fld,
L'Access, C'Access,
Fr'Access, Fc'Access,
Os'Access, Ab'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
First_Row := Line_Position (Fr);
First_Column := Column_Position (Fc);
Off_Screen := Natural (Os);
Additional_Buffers := Buffer_Number (Ab);
end Info;
-- |
-- |
@ -556,21 +491,17 @@ package body Terminal_Interface.Curses.Forms is
Max : out Natural)
is
type C_Int_Access is access all C_Int;
function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int;
function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return Eti_Error;
pragma Import (C, Dyn_Info, "dynamic_field_info");
L, C, M : aliased C_Int;
Res : constant Eti_Error := Dyn_Info (Fld,
L'Access, C'Access,
M'Access);
begin
if Res /= E_Ok then
Eti_Exception (Res);
else
Lines := Line_Count (L);
Columns := Column_Count (C);
Max := Natural (M);
end if;
Eti_Exception (Dyn_Info (Fld,
L'Access, C'Access,
M'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
Max := Natural (M);
end Dynamic_Info;
-- |
-- |=====================================================================
@ -583,14 +514,11 @@ package body Terminal_Interface.Curses.Forms is
Win : Window)
is
function Set_Form_Win (Frm : Form;
Win : Window) return C_Int;
Win : Window) return Eti_Error;
pragma Import (C, Set_Form_Win, "set_form_win");
Res : constant Eti_Error := Set_Form_Win (Frm, Win);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Form_Win (Frm, Win));
end Set_Window;
-- |
-- |
@ -611,14 +539,11 @@ package body Terminal_Interface.Curses.Forms is
Win : Window)
is
function Set_Form_Sub (Frm : Form;
Win : Window) return C_Int;
Win : Window) return Eti_Error;
pragma Import (C, Set_Form_Sub, "set_form_sub");
Res : constant Eti_Error := Set_Form_Sub (Frm, Win);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Form_Sub (Frm, Win));
end Set_Sub_Window;
-- |
-- |
@ -640,16 +565,13 @@ package body Terminal_Interface.Curses.Forms is
Columns : out Column_Count)
is
type C_Int_Access is access all C_Int;
function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int;
function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return Eti_Error;
pragma Import (C, M_Scale, "scale_form");
X, Y : aliased C_Int;
Res : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Lines := Line_Count (Y);
Eti_Exception (M_Scale (Frm, Y'Access, X'Access));
Lines := Line_Count (Y);
Columns := Column_Count (X);
end Scale;
-- |
@ -663,14 +585,11 @@ package body Terminal_Interface.Curses.Forms is
Proc : Form_Hook_Function)
is
function Set_Field_Init (Frm : Form;
Proc : Form_Hook_Function) return C_Int;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Field_Init, "set_field_init");
Res : constant Eti_Error := Set_Field_Init (Frm, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Init (Frm, Proc));
end Set_Field_Init_Hook;
-- |
-- |
@ -679,14 +598,11 @@ package body Terminal_Interface.Curses.Forms is
Proc : Form_Hook_Function)
is
function Set_Field_Term (Frm : Form;
Proc : Form_Hook_Function) return C_Int;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Field_Term, "set_field_term");
Res : constant Eti_Error := Set_Field_Term (Frm, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Field_Term (Frm, Proc));
end Set_Field_Term_Hook;
-- |
-- |
@ -695,14 +611,11 @@ package body Terminal_Interface.Curses.Forms is
Proc : Form_Hook_Function)
is
function Set_Form_Init (Frm : Form;
Proc : Form_Hook_Function) return C_Int;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Form_Init, "set_form_init");
Res : constant Eti_Error := Set_Form_Init (Frm, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Form_Init (Frm, Proc));
end Set_Form_Init_Hook;
-- |
-- |
@ -711,14 +624,11 @@ package body Terminal_Interface.Curses.Forms is
Proc : Form_Hook_Function)
is
function Set_Form_Term (Frm : Form;
Proc : Form_Hook_Function) return C_Int;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Form_Term, "set_form_term");
Res : constant Eti_Error := Set_Form_Term (Frm, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Form_Term (Frm, Proc));
end Set_Form_Term_Hook;
-- |
-- |=====================================================================
@ -731,19 +641,15 @@ package body Terminal_Interface.Curses.Forms is
Flds : Field_Array_Access)
is
function Set_Frm_Fields (Frm : Form;
Items : System.Address) return C_Int;
Items : System.Address) return Eti_Error;
pragma Import (C, Set_Frm_Fields, "set_form_fields");
Res : Eti_Error;
begin
pragma Assert (Flds.all (Flds'Last) = Null_Field);
if Flds.all (Flds'Last) /= Null_Field then
raise Form_Exception;
else
Res := Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address));
end if;
end Redefine;
-- |
@ -783,14 +689,11 @@ package body Terminal_Interface.Curses.Forms is
Line : Line_Position;
Column : Column_Position)
is
function Move (Fld : Field; L, C : C_Int) return C_Int;
function Move (Fld : Field; L, C : C_Int) return Eti_Error;
pragma Import (C, Move, "move_field");
Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Move (Fld, C_Int (Line), C_Int (Column)));
end Move;
-- |
-- |=====================================================================
@ -822,14 +725,11 @@ package body Terminal_Interface.Curses.Forms is
-- |
procedure Delete (Frm : in out Form)
is
function Free (Frm : Form) return C_Int;
function Free (Frm : Form) return Eti_Error;
pragma Import (C, Free, "free_form");
Res : constant Eti_Error := Free (Frm);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Free (Frm));
Frm := Null_Form;
end Delete;
-- |
@ -843,16 +743,11 @@ package body Terminal_Interface.Curses.Forms is
Options : Form_Option_Set)
is
function Set_Form_Opts (Frm : Form;
Opt : C_Int) return C_Int;
Opt : Form_Option_Set) return Eti_Error;
pragma Import (C, Set_Form_Opts, "set_form_opts");
Opt : constant C_Int := FrmOS_2_CInt (Options);
Res : Eti_Error;
begin
Res := Set_Form_Opts (Frm, Opt);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Form_Opts (Frm, Options));
end Set_Options;
-- |
-- |
@ -862,22 +757,17 @@ package body Terminal_Interface.Curses.Forms is
On : Boolean := True)
is
function Form_Opts_On (Frm : Form;
Opt : C_Int) return C_Int;
Opt : Form_Option_Set) return Eti_Error;
pragma Import (C, Form_Opts_On, "form_opts_on");
function Form_Opts_Off (Frm : Form;
Opt : C_Int) return C_Int;
Opt : Form_Option_Set) return Eti_Error;
pragma Import (C, Form_Opts_Off, "form_opts_off");
Err : Eti_Error;
Opt : constant C_Int := FrmOS_2_CInt (Options);
begin
if On then
Err := Form_Opts_On (Frm, Opt);
Eti_Exception (Form_Opts_On (Frm, Options));
else
Err := Form_Opts_Off (Frm, Opt);
end if;
if Err /= E_Ok then
Eti_Exception (Err);
Eti_Exception (Form_Opts_Off (Frm, Options));
end if;
end Switch_Options;
-- |
@ -886,12 +776,11 @@ package body Terminal_Interface.Curses.Forms is
procedure Get_Options (Frm : Form;
Options : out Form_Option_Set)
is
function Form_Opts (Frm : Form) return C_Int;
function Form_Opts (Frm : Form) return Form_Option_Set;
pragma Import (C, Form_Opts, "form_opts");
Res : constant C_Int := Form_Opts (Frm);
begin
Options := CInt_2_FrmOS (Res);
Options := Form_Opts (Frm);
end Get_Options;
-- |
-- |
@ -913,20 +802,16 @@ package body Terminal_Interface.Curses.Forms is
procedure Post (Frm : Form;
Post : Boolean := True)
is
function M_Post (Frm : Form) return C_Int;
function M_Post (Frm : Form) return Eti_Error;
pragma Import (C, M_Post, "post_form");
function M_Unpost (Frm : Form) return C_Int;
function M_Unpost (Frm : Form) return Eti_Error;
pragma Import (C, M_Unpost, "unpost_form");
Res : Eti_Error;
begin
if Post then
Res := M_Post (Frm);
Eti_Exception (M_Post (Frm));
else
Res := M_Unpost (Frm);
end if;
if Res /= E_Ok then
Eti_Exception (Res);
Eti_Exception (M_Unpost (Frm));
end if;
end Post;
-- |
@ -938,14 +823,11 @@ package body Terminal_Interface.Curses.Forms is
-- |
procedure Position_Cursor (Frm : Form)
is
function Pos_Form_Cursor (Frm : Form) return C_Int;
function Pos_Form_Cursor (Frm : Form) return Eti_Error;
pragma Import (C, Pos_Form_Cursor, "pos_form_cursor");
Res : constant Eti_Error := Pos_Form_Cursor (Frm);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Pos_Form_Cursor (Frm));
end Position_Cursor;
-- |
-- |=====================================================================
@ -993,25 +875,22 @@ package body Terminal_Interface.Curses.Forms is
function Driver (Frm : Form;
Key : Key_Code) return Driver_Result
is
function Frm_Driver (Frm : Form; Key : C_Int) return C_Int;
function Frm_Driver (Frm : Form; Key : C_Int) return Eti_Error;
pragma Import (C, Frm_Driver, "form_driver");
R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key));
begin
if R /= E_Ok then
if R = E_Unknown_Command then
case R is
when E_Unknown_Command =>
return Unknown_Request;
elsif R = E_Invalid_Field then
when E_Invalid_Field =>
return Invalid_Field;
elsif R = E_Request_Denied then
when E_Request_Denied =>
return Request_Denied;
else
when others =>
Eti_Exception (R);
return Form_Ok;
end if;
else
return Form_Ok;
end if;
end case;
end Driver;
-- |
-- |=====================================================================
@ -1023,14 +902,11 @@ package body Terminal_Interface.Curses.Forms is
procedure Set_Current (Frm : Form;
Fld : Field)
is
function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int;
function Set_Current_Fld (Frm : Form; Fld : Field) return Eti_Error;
pragma Import (C, Set_Current_Fld, "set_current_field");
Res : constant Eti_Error := Set_Current_Fld (Frm, Fld);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Current_Fld (Frm, Fld));
end Set_Current;
-- |
-- |
@ -1053,14 +929,11 @@ package body Terminal_Interface.Curses.Forms is
procedure Set_Page (Frm : Form;
Page : Page_Number := Page_Number'First)
is
function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int;
function Set_Frm_Page (Frm : Form; Pg : C_Int) return Eti_Error;
pragma Import (C, Set_Frm_Page, "set_form_page");
Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Frm_Page (Frm, C_Int (Page)));
end Set_Page;
-- |
-- |
@ -1102,14 +975,11 @@ package body Terminal_Interface.Curses.Forms is
procedure Set_New_Page (Fld : Field;
New_Page : Boolean := True)
is
function Set_Page (Fld : Field; Flg : C_Int) return C_Int;
function Set_Page (Fld : Field; Flg : C_Int) return Eti_Error;
pragma Import (C, Set_Page, "set_new_page");
Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Page (Fld, Boolean'Pos (New_Page)));
end Set_New_Page;
-- |
-- |

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,28 +35,22 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Menus.Item_User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Itm : Item;
Data : User_Access)
is
function Set_Item_Userptr (Itm : Item;
Addr : User_Access) return C_Int;
Addr : User_Access) return Eti_Error;
pragma Import (C, Set_Item_Userptr, "set_item_userptr");
Res : constant Eti_Error := Set_Item_Userptr (Itm, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Item_Userptr (Itm, Data));
end Set_User_Data;
function Get_User_Data (Itm : Item) return User_Access

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,27 +35,23 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Revision: 1.16 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Menus.Menu_User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Men : Menu;
Data : User_Access)
is
function Set_Menu_Userptr (Men : Menu;
Data : User_Access) return C_Int;
Data : User_Access) return Eti_Error;
pragma Import (C, Set_Menu_Userptr, "set_menu_userptr");
Res : constant Eti_Error := Set_Menu_Userptr (Men, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Userptr (Men, Data));
end Set_User_Data;
function Get_User_Data (Men : Menu) return User_Access

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.28 $
-- $Date: 2011/03/22 23:38:12 $
-- $Revision: 1.33 $
-- $Date: 2018/07/07 23:36:44 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
@ -46,33 +46,14 @@ with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Pointers;
with Ada.Unchecked_Conversion;
package body Terminal_Interface.Curses.Menus is
type C_Item_Array is array (Natural range <>) of aliased Item;
package I_Array is new
Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item);
use type System.Bit_Order;
subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
function MOS_2_CInt is new
Ada.Unchecked_Conversion (Menu_Option_Set,
C_Int);
function CInt_2_MOS is new
Ada.Unchecked_Conversion (C_Int,
Menu_Option_Set);
function IOS_2_CInt is new
Ada.Unchecked_Conversion (Item_Option_Set,
C_Int);
function CInt_2_IOS is new
Ada.Unchecked_Conversion (C_Int,
Item_Option_Set);
------------------------------------------------------------------------------
procedure Request_Name (Key : Menu_Request_Code;
Name : out String)
@ -128,10 +109,9 @@ package body Terminal_Interface.Curses.Menus is
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
function Freeitem (Itm : Item) return C_Int;
function Freeitem (Itm : Item) return Eti_Error;
pragma Import (C, Freeitem, "free_item");
Res : Eti_Error;
Ptr : chars_ptr;
begin
Ptr := Descname (Itm);
@ -142,10 +122,7 @@ package body Terminal_Interface.Curses.Menus is
if Ptr /= Null_Ptr then
Interfaces.C.Strings.Free (Ptr);
end if;
Res := Freeitem (Itm);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Freeitem (Itm));
Itm := Null_Item;
end Delete;
-------------------------------------------------------------------------------
@ -153,14 +130,11 @@ package body Terminal_Interface.Curses.Menus is
Value : Boolean := True)
is
function Set_Item_Val (Itm : Item;
Val : C_Int) return C_Int;
Val : C_Int) return Eti_Error;
pragma Import (C, Set_Item_Val, "set_item_value");
Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Item_Val (Itm, Boolean'Pos (Value)));
end Set_Value;
function Value (Itm : Item) return Boolean
@ -192,16 +166,11 @@ package body Terminal_Interface.Curses.Menus is
Options : Item_Option_Set)
is
function Set_Item_Opts (Itm : Item;
Opt : C_Int) return C_Int;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Set_Item_Opts, "set_item_opts");
Opt : constant C_Int := IOS_2_CInt (Options);
Res : Eti_Error;
begin
Res := Set_Item_Opts (Itm, Opt);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Item_Opts (Itm, Options));
end Set_Options;
procedure Switch_Options (Itm : Item;
@ -209,34 +178,28 @@ package body Terminal_Interface.Curses.Menus is
On : Boolean := True)
is
function Item_Opts_On (Itm : Item;
Opt : C_Int) return C_Int;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Item_Opts_On, "item_opts_on");
function Item_Opts_Off (Itm : Item;
Opt : C_Int) return C_Int;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Item_Opts_Off, "item_opts_off");
Opt : constant C_Int := IOS_2_CInt (Options);
Err : Eti_Error;
begin
if On then
Err := Item_Opts_On (Itm, Opt);
Eti_Exception (Item_Opts_On (Itm, Options));
else
Err := Item_Opts_Off (Itm, Opt);
end if;
if Err /= E_Ok then
Eti_Exception (Err);
Eti_Exception (Item_Opts_Off (Itm, Options));
end if;
end Switch_Options;
procedure Get_Options (Itm : Item;
Options : out Item_Option_Set)
is
function Item_Opts (Itm : Item) return C_Int;
function Item_Opts (Itm : Item) return Item_Option_Set;
pragma Import (C, Item_Opts, "item_opts");
Res : constant C_Int := Item_Opts (Itm);
begin
Options := CInt_2_IOS (Res);
Options := Item_Opts (Itm);
end Get_Options;
function Get_Options (Itm : Item := Null_Item) return Item_Option_Set
@ -285,14 +248,11 @@ package body Terminal_Interface.Curses.Menus is
Itm : Item)
is
function Set_Curr_Item (Men : Menu;
Itm : Item) return C_Int;
Itm : Item) return Eti_Error;
pragma Import (C, Set_Curr_Item, "set_current_item");
Res : constant Eti_Error := Set_Curr_Item (Men, Itm);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Curr_Item (Men, Itm));
end Set_Current;
function Current (Men : Menu) return Item
@ -312,14 +272,11 @@ package body Terminal_Interface.Curses.Menus is
Line : Line_Position)
is
function Set_Toprow (Men : Menu;
Line : C_Int) return C_Int;
Line : C_Int) return Eti_Error;
pragma Import (C, Set_Toprow, "set_top_row");
Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Toprow (Men, C_Int (Line)));
end Set_Top_Row;
function Top_Row (Men : Menu) return Line_Position
@ -351,20 +308,16 @@ package body Terminal_Interface.Curses.Menus is
procedure Post (Men : Menu;
Post : Boolean := True)
is
function M_Post (Men : Menu) return C_Int;
function M_Post (Men : Menu) return Eti_Error;
pragma Import (C, M_Post, "post_menu");
function M_Unpost (Men : Menu) return C_Int;
function M_Unpost (Men : Menu) return Eti_Error;
pragma Import (C, M_Unpost, "unpost_menu");
Res : Eti_Error;
begin
if Post then
Res := M_Post (Men);
Eti_Exception (M_Post (Men));
else
Res := M_Unpost (Men);
end if;
if Res /= E_Ok then
Eti_Exception (Res);
Eti_Exception (M_Unpost (Men));
end if;
end Post;
-------------------------------------------------------------------------------
@ -372,16 +325,11 @@ package body Terminal_Interface.Curses.Menus is
Options : Menu_Option_Set)
is
function Set_Menu_Opts (Men : Menu;
Opt : C_Int) return C_Int;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Set_Menu_Opts, "set_menu_opts");
Opt : constant C_Int := MOS_2_CInt (Options);
Res : Eti_Error;
begin
Res := Set_Menu_Opts (Men, Opt);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Opts (Men, Options));
end Set_Options;
procedure Switch_Options (Men : Menu;
@ -389,34 +337,28 @@ package body Terminal_Interface.Curses.Menus is
On : Boolean := True)
is
function Menu_Opts_On (Men : Menu;
Opt : C_Int) return C_Int;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Menu_Opts_On, "menu_opts_on");
function Menu_Opts_Off (Men : Menu;
Opt : C_Int) return C_Int;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Menu_Opts_Off, "menu_opts_off");
Opt : constant C_Int := MOS_2_CInt (Options);
Err : Eti_Error;
begin
if On then
Err := Menu_Opts_On (Men, Opt);
Eti_Exception (Menu_Opts_On (Men, Options));
else
Err := Menu_Opts_Off (Men, Opt);
end if;
if Err /= E_Ok then
Eti_Exception (Err);
Eti_Exception (Menu_Opts_Off (Men, Options));
end if;
end Switch_Options;
procedure Get_Options (Men : Menu;
Options : out Menu_Option_Set)
is
function Menu_Opts (Men : Menu) return C_Int;
function Menu_Opts (Men : Menu) return Menu_Option_Set;
pragma Import (C, Menu_Opts, "menu_opts");
Res : constant C_Int := Menu_Opts (Men);
begin
Options := CInt_2_MOS (Res);
Options := Menu_Opts (Men);
end Get_Options;
function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set
@ -431,14 +373,11 @@ package body Terminal_Interface.Curses.Menus is
Win : Window)
is
function Set_Menu_Win (Men : Menu;
Win : Window) return C_Int;
Win : Window) return Eti_Error;
pragma Import (C, Set_Menu_Win, "set_menu_win");
Res : constant Eti_Error := Set_Menu_Win (Men, Win);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Win (Men, Win));
end Set_Window;
function Get_Window (Men : Menu) return Window
@ -455,14 +394,11 @@ package body Terminal_Interface.Curses.Menus is
Win : Window)
is
function Set_Menu_Sub (Men : Menu;
Win : Window) return C_Int;
Win : Window) return Eti_Error;
pragma Import (C, Set_Menu_Sub, "set_menu_sub");
Res : constant Eti_Error := Set_Menu_Sub (Men, Win);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Sub (Men, Win));
end Set_Sub_Window;
function Get_Sub_Window (Men : Menu) return Window
@ -481,29 +417,23 @@ package body Terminal_Interface.Curses.Menus is
is
type C_Int_Access is access all C_Int;
function M_Scale (Men : Menu;
Yp, Xp : C_Int_Access) return C_Int;
Yp, Xp : C_Int_Access) return Eti_Error;
pragma Import (C, M_Scale, "scale_menu");
X, Y : aliased C_Int;
Res : constant Eti_Error := M_Scale (Men, Y'Access, X'Access);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (M_Scale (Men, Y'Access, X'Access));
Lines := Line_Count (Y);
Columns := Column_Count (X);
end Scale;
-------------------------------------------------------------------------------
procedure Position_Cursor (Men : Menu)
is
function Pos_Menu_Cursor (Men : Menu) return C_Int;
function Pos_Menu_Cursor (Men : Menu) return Eti_Error;
pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor");
Res : constant Eti_Error := Pos_Menu_Cursor (Men);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Pos_Menu_Cursor (Men));
end Position_Cursor;
-------------------------------------------------------------------------------
@ -512,18 +442,14 @@ package body Terminal_Interface.Curses.Menus is
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Mark (Men : Menu;
Mark : Char_Ptr) return C_Int;
Mark : Char_Ptr) return Eti_Error;
pragma Import (C, Set_Mark, "set_menu_mark");
Txt : char_array (0 .. Mark'Length);
Len : size_t;
Res : Eti_Error;
begin
To_C (Mark, Txt, Len);
Res := Set_Mark (Men, Txt (Txt'First)'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Mark (Men, Txt (Txt'First)'Access));
end Set_Mark;
procedure Mark (Men : Menu;
@ -550,37 +476,34 @@ package body Terminal_Interface.Curses.Menus is
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Fore (Men : Menu;
Attr : C_Chtype) return C_Int;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Fore, "set_menu_fore");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Fore);
Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Fore (Men, Ch));
end Set_Foreground;
procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set)
is
function Menu_Fore (Men : Menu) return C_Chtype;
function Menu_Fore (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Fore, "menu_fore");
begin
Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
Fore := Menu_Fore (Men).Attr;
end Foreground;
procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Fore (Men : Menu) return C_Chtype;
function Menu_Fore (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Fore, "menu_fore");
begin
Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color;
Fore := Menu_Fore (Men).Attr;
Color := Menu_Fore (Men).Color;
end Foreground;
procedure Set_Background
@ -589,37 +512,34 @@ package body Terminal_Interface.Curses.Menus is
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Back (Men : Menu;
Attr : C_Chtype) return C_Int;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Back, "set_menu_back");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Back);
Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Back (Men, Ch));
end Set_Background;
procedure Background (Men : Menu;
Back : out Character_Attribute_Set)
is
function Menu_Back (Men : Menu) return C_Chtype;
function Menu_Back (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Back, "menu_back");
begin
Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
Back := Menu_Back (Men).Attr;
end Background;
procedure Background (Men : Menu;
Back : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Back (Men : Menu) return C_Chtype;
function Menu_Back (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Back, "menu_back");
begin
Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
Color := Chtype_To_AttrChar (Menu_Back (Men)).Color;
Back := Menu_Back (Men).Attr;
Color := Menu_Back (Men).Color;
end Background;
procedure Set_Grey (Men : Menu;
@ -627,53 +547,46 @@ package body Terminal_Interface.Curses.Menus is
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Grey (Men : Menu;
Attr : C_Chtype) return C_Int;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Grey, "set_menu_grey");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Grey);
Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Grey (Men, Ch));
end Set_Grey;
procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set)
is
function Menu_Grey (Men : Menu) return C_Chtype;
function Menu_Grey (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Grey, "menu_grey");
begin
Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
Grey := Menu_Grey (Men).Attr;
end Grey;
procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Grey (Men : Menu) return C_Chtype;
function Menu_Grey (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Grey, "menu_grey");
begin
Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color;
Grey := Menu_Grey (Men).Attr;
Color := Menu_Grey (Men).Color;
end Grey;
procedure Set_Pad_Character (Men : Menu;
Pad : Character := Space)
is
function Set_Menu_Pad (Men : Menu;
Ch : C_Int) return C_Int;
Ch : C_Int) return Eti_Error;
pragma Import (C, Set_Menu_Pad, "set_menu_pad");
Res : constant Eti_Error := Set_Menu_Pad (Men,
C_Int (Character'Pos (Pad)));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Pad (Men, C_Int (Character'Pos (Pad))));
end Set_Pad_Character;
procedure Pad_Character (Men : Menu;
@ -691,17 +604,14 @@ package body Terminal_Interface.Curses.Menus is
Col : Column_Position := 0)
is
function Set_Spacing (Men : Menu;
D, R, C : C_Int) return C_Int;
D, R, C : C_Int) return Eti_Error;
pragma Import (C, Set_Spacing, "set_menu_spacing");
Res : constant Eti_Error := Set_Spacing (Men,
C_Int (Descr),
C_Int (Row),
C_Int (Col));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Spacing (Men,
C_Int (Descr),
C_Int (Row),
C_Int (Col)));
end Set_Spacing;
procedure Spacing (Men : Menu;
@ -711,22 +621,18 @@ package body Terminal_Interface.Curses.Menus is
is
type C_Int_Access is access all C_Int;
function Get_Spacing (Men : Menu;
D, R, C : C_Int_Access) return C_Int;
D, R, C : C_Int_Access) return Eti_Error;
pragma Import (C, Get_Spacing, "menu_spacing");
D, R, C : aliased C_Int;
Res : constant Eti_Error := Get_Spacing (Men,
D'Access,
R'Access,
C'Access);
begin
if Res /= E_Ok then
Eti_Exception (Res);
else
Descr := Column_Position (D);
Row := Line_Position (R);
Col := Column_Position (C);
end if;
Eti_Exception (Get_Spacing (Men,
D'Access,
R'Access,
C'Access));
Descr := Column_Position (D);
Row := Line_Position (R);
Col := Column_Position (C);
end Spacing;
-------------------------------------------------------------------------------
function Set_Pattern (Men : Menu;
@ -734,7 +640,7 @@ package body Terminal_Interface.Curses.Menus is
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Pattern (Men : Menu;
Pattern : Char_Ptr) return C_Int;
Pattern : Char_Ptr) return Eti_Error;
pragma Import (C, Set_Pattern, "set_menu_pattern");
S : char_array (0 .. Text'Length);
@ -744,11 +650,11 @@ package body Terminal_Interface.Curses.Menus is
To_C (Text, S, L);
Res := Set_Pattern (Men, S (S'First)'Access);
case Res is
when E_No_Match => return False;
when E_Ok => return True;
when E_No_Match =>
return False;
when others =>
Eti_Exception (Res);
return False;
return True;
end case;
end Set_Pattern;
@ -767,16 +673,14 @@ package body Terminal_Interface.Curses.Menus is
is
function Set_Menu_Fmt (Men : Menu;
Lin : C_Int;
Col : C_Int) return C_Int;
Col : C_Int) return Eti_Error;
pragma Import (C, Set_Menu_Fmt, "set_menu_format");
Res : constant Eti_Error := Set_Menu_Fmt (Men,
C_Int (Lines),
C_Int (Columns));
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Fmt (Men,
C_Int (Lines),
C_Int (Columns)));
end Set_Format;
procedure Format (Men : Menu;
@ -785,74 +689,58 @@ package body Terminal_Interface.Curses.Menus is
is
type C_Int_Access is access all C_Int;
function Menu_Fmt (Men : Menu;
Y, X : C_Int_Access) return C_Int;
Y, X : C_Int_Access) return Eti_Error;
pragma Import (C, Menu_Fmt, "menu_format");
L, C : aliased C_Int;
Res : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access);
begin
if Res /= E_Ok then
Eti_Exception (Res);
else
Lines := Line_Count (L);
Columns := Column_Count (C);
end if;
Eti_Exception (Menu_Fmt (Men, L'Access, C'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
end Format;
-------------------------------------------------------------------------------
procedure Set_Item_Init_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Item_Init (Men : Menu;
Proc : Menu_Hook_Function) return C_Int;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Item_Init, "set_item_init");
Res : constant Eti_Error := Set_Item_Init (Men, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Item_Init (Men, Proc));
end Set_Item_Init_Hook;
procedure Set_Item_Term_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Item_Term (Men : Menu;
Proc : Menu_Hook_Function) return C_Int;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Item_Term, "set_item_term");
Res : constant Eti_Error := Set_Item_Term (Men, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Item_Term (Men, Proc));
end Set_Item_Term_Hook;
procedure Set_Menu_Init_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Menu_Init (Men : Menu;
Proc : Menu_Hook_Function) return C_Int;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Menu_Init, "set_menu_init");
Res : constant Eti_Error := Set_Menu_Init (Men, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Init (Men, Proc));
end Set_Menu_Init_Hook;
procedure Set_Menu_Term_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Menu_Term (Men : Menu;
Proc : Menu_Hook_Function) return C_Int;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Menu_Term, "set_menu_term");
Res : constant Eti_Error := Set_Menu_Term (Men, Proc);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Menu_Term (Men, Proc));
end Set_Menu_Term_Hook;
function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function
@ -891,19 +779,15 @@ package body Terminal_Interface.Curses.Menus is
Items : Item_Array_Access)
is
function Set_Items (Men : Menu;
Items : System.Address) return C_Int;
Items : System.Address) return Eti_Error;
pragma Import (C, Set_Items, "set_menu_items");
Res : Eti_Error;
begin
pragma Assert (Items.all (Items'Last) = Null_Item);
if Items.all (Items'Last) /= Null_Item then
raise Menu_Exception;
else
Res := Set_Items (Men, Items.all'Address);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Set_Items (Men, Items.all'Address));
end if;
end Redefine;
@ -955,14 +839,11 @@ package body Terminal_Interface.Curses.Menus is
procedure Delete (Men : in out Menu)
is
function Free (Men : Menu) return C_Int;
function Free (Men : Menu) return Eti_Error;
pragma Import (C, Free, "free_menu");
Res : constant Eti_Error := Free (Men);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Eti_Exception (Free (Men));
Men := Null_Menu;
end Delete;
@ -971,22 +852,22 @@ package body Terminal_Interface.Curses.Menus is
Key : Key_Code) return Driver_Result
is
function Driver (Men : Menu;
Key : C_Int) return C_Int;
Key : C_Int) return Eti_Error;
pragma Import (C, Driver, "menu_driver");
R : constant Eti_Error := Driver (Men, C_Int (Key));
begin
if R /= E_Ok then
case R is
when E_Unknown_Command => return Unknown_Request;
when E_No_Match => return No_Match;
when E_Request_Denied |
E_Not_Selectable => return Request_Denied;
when others =>
Eti_Exception (R);
end case;
end if;
return Menu_Ok;
case R is
when E_Unknown_Command =>
return Unknown_Request;
when E_No_Match =>
return No_Match;
when E_Request_Denied | E_Not_Selectable =>
return Request_Denied;
when others =>
Eti_Exception (R);
return Menu_Ok;
end case;
end Driver;
procedure Free (IA : in out Item_Array_Access;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2014,2018 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.24 $
-- $Date: 2009/12/26 17:38:58 $
-- $Revision: 1.26 $
-- $Date: 2018/07/07 23:35:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@ -45,8 +45,6 @@ use Interfaces;
package body Terminal_Interface.Curses.Mouse is
use type System.Bit_Order;
function Has_Mouse return Boolean
is
function Mouse_Avail return C_Int;
@ -199,7 +197,8 @@ package body Terminal_Interface.Curses.Mouse is
pragma Import (C, Wenclose, "wenclose");
begin
if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X))
= Curses_Bool_False then
= Curses_Bool_False
then
return False;
else
return True;

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 Free Software Foundation, Inc. --
-- Copyright (c) 2000,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- $Revision: 1.4 $
-- Binding Version 01.00
with Ada.Streams.Stream_IO.C_Streams;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 Free Software Foundation, Inc. --
-- Copyright (c) 2000,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- $Revision: 1.4 $
-- Binding Version 01.00
with Ada.Streams.Stream_IO;

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 Free Software Foundation, Inc. --
-- Copyright (c) 2000,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- $Revision: 1.4 $
-- Binding Version 01.00
------------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 Free Software Foundation, Inc. --
-- Copyright (c) 2000,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,7 +35,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- $Revision: 1.4 $
-- Binding Version 01.00
------------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,8 +35,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.20 $
-- $Date: 2011/03/22 23:38:49 $
-- $Revision: 1.22 $
-- $Date: 2014/05/24 21:32:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Text_IO is
@ -205,7 +205,7 @@ package body Terminal_Interface.Curses.Text_IO is
end if;
Get_Cursor_Position (Win, Y1, X);
pragma Unreferenced (X);
pragma Warnings (Off, X); -- unreferenced
N := Natural (To); N := N - 1;
Y2 := Line_Position (N);
if Y2 < Y1 then

View File

@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2004,2009 Free Software Foundation, Inc. --
-- Copyright (c) 2000-2009,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -35,60 +35,39 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.7 $
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
#if ADA_TRACE then
with Interfaces.C; use Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Ada.Unchecked_Conversion;
#end if;
package body Terminal_Interface.Curses.Trace is
#if ADA_TRACE then
type C_TraceType is new C_UInt;
function TraceAda_To_TraceC is new
Ada.Unchecked_Conversion (Source => Trace_Attribute_Set,
Target => C_TraceType);
procedure Trace_On (x : Trace_Attribute_Set) is
procedure traceC (y : C_TraceType);
procedure traceC (y : Trace_Attribute_Set);
pragma Import (C, traceC, "trace");
begin
traceC (TraceAda_To_TraceC (x));
traceC (x);
end Trace_On;
-- 75. (12) A C function that takes a variable number of arguments can
-- correspond to several Ada subprograms, taking various specific
-- numbers and types of parameters.
procedure Trace_Put (str : String) is
procedure tracef (format : char_array; s : char_array);
pragma Import (C, tracef, "_traces");
Txt : char_array (0 .. str'Length);
Length : size_t;
formatstr : constant String := "%s" & ASCII.NUL;
formattxt : char_array (0 .. formatstr'Length);
-- _traces() is defined in c_varargs_to_ada.h
begin
To_C (formatstr, formattxt, Length);
To_C (str, Txt, Length);
tracef (formattxt, Txt);
tracef (To_C ("%s"), To_C (str));
end Trace_Put;
#else
procedure Trace_On (x : Trace_Attribute_Set) is
#if PRAGMA_UNREF
pragma Unreferenced (x);
#end if;
pragma Warnings (Off, x); -- unreferenced
begin
null;
end Trace_On;
procedure Trace_Put (str : String) is
#if PRAGMA_UNREF
pragma Unreferenced (str);
#end if;
pragma Warnings (Off, str); -- unreferenced
begin
null;
end Trace_Put;

View File

@ -1,4 +1,4 @@
Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.
Copyright (c) 1998-2019,2020 Free Software Foundation, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@ -25,4 +25,4 @@ sale, use or other dealings in this Software without prior written
authorization.
-- vile:txtmode fc=72
-- $Id: COPYING,v 1.2 2014/01/18 23:59:29 tom Exp $
-- $Id: COPYING,v 1.8 2020/01/04 14:49:29 tom Exp $

493
INSTALL
View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2019,2020 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: INSTALL,v 1.168 2013/08/03 23:15:23 tom Exp $
-- $Id: INSTALL,v 1.215 2020/01/18 17:02:13 tom Exp $
---------------------------------------------------------------------
How to install Ncurses/Terminfo on your system
---------------------------------------------------------------------
@ -196,17 +196,16 @@ INSTALLATION PROCEDURE:
NOTE: You must have installed the terminfo database, or set the
environment variable $TERMINFO to point to a SVr4-compatible terminfo
database before running the test programs. Not all vendors' terminfo
databases are SVr4-compatible, but most seem to be. Exceptions include
DEC's Digital Unix (formerly known as OSF/1).
databases are SVr4-compatible, but most seem to be.
It is possible to configure ncurses to use other terminfo database formats.
A few are provided as examples in the include-directory (see --with-caps).
If you run the test programs WITHOUT installing terminfo, ncurses may
read the termcap file and cache that in $HOME/.terminfo, which will
thereafter be used instead of the terminfo database. See the comments
on "--enable-getcap-cache", to see why this is a Bad Thing.
It is possible to configure ncurses to use other terminfo database formats.
A few are provided as examples in the include-directory (see --with-caps).
The ncurses program is designed specifically to test the ncurses library.
You can use it to verify that the screen highlights work correctly, that
cursor addressing and window scrolling works OK, etc.
@ -227,8 +226,7 @@ INSTALLATION PROCEDURE:
############################################################################
# CAVEAT EMPTOR: `install.data' run as root will NUKE any existing #
# terminfo database. If you have any custom or unusual entries SAVE them #
# before you install ncurses. I have a file called terminfo.custom for #
# this purpose. Don't forget to run tic on the file once you're done. #
# before you install ncurses. #
############################################################################
The terminfo(5) manual page must be preprocessed with tbl(1) before
@ -312,18 +310,27 @@ SUMMARY OF CONFIGURE OPTIONS:
and termcap data from disk. You can configure ncurses to have a
built-in database, aka "fallback" entries. Embedded applications may
have no need for an external database. Some, but not all of the
programs are useful in this configuration, e.g., reset and tput versus
programs are useful in this configuration, e.g., tset and tput versus
infocmp and tic.
--disable-db-install
Do not install the terminal database. This is used to omit features
for packages, as done with --without-progs.
--disable-echo
Use the option --disable-echo to make the build-log less verbose by
suppressing the display of the compile and link commands. This makes
it easier to see the compiler warnings. (You can always use "make -n"
to see the options that are used).
--disable-ext-funcs
Disable function-extensions. Configure ncurses without the functions
that are not specified by XSI. See ncurses/modules for the exact
list of library modules that would be suppressed.
--disable-gnat-projects
Disable GNAT projects even if usable, for testing old makefile rules.
--disable-hashmap
Compile without hashmap scrolling-optimization code. This algorithm is
the default.
@ -337,6 +344,30 @@ SUMMARY OF CONFIGURE OPTIONS:
--disable-largefile
Disable compiler flags needed to use large-file interfaces.
--disable-leaks
For testing, compile-in code that frees memory that normally would not
be freed, to simplify analysis of memory-leaks.
Any implementation of curses must not free the memory associated with
a screen, since (even after calling endwin()), it must be available
for use in the next call to refresh(). There are also chunks of
memory held for performance reasons. That makes it hard to analyze
curses applications for memory leaks. To work around this, build a
debugging version of the ncurses library which frees those chunks
which it can, and provides the _nc_free_and_exit() function to free
the remainder and then exit. The ncurses utility and test programs
use this feature, e.g., via the ExitProgram() macro.
Because this lies outside of the library's intended usage, it is not
normally considered part of the ABI. If there were some (as yet
unplanned) extension which frees memory in a manner that would let the
library resume and reallocate memory, then that would not use a "_nc_"
prefix.
--disable-lib-suffixes
Suppress the "w", "t" or "tw" suffixes which normally would be added
to the library names for the --enable-widec and --with-pthread options.
--disable-libtool-version
when using --with-libtool, control how the major/minor version numbers
are used for constructing the library name.
@ -348,19 +379,9 @@ SUMMARY OF CONFIGURE OPTIONS:
Use --disable-libtool-version to use the libtool -version-info feature.
This corresponds to the setting used before patch 20100515.
--disable-leaks
For testing, compile-in code that frees memory that normally would not
be freed, to simplify analysis of memory-leaks.
Any implementation of curses must not free the memory associated with
a screen, since (even after calling endwin()), it must be available
for use in the next call to refresh(). There are also chunks of
memory held for performance reasons. That makes it hard to analyze
curses applications for memory leaks. To work around this, build
a debugging version of the ncurses library which frees those chunks
which it can, and provides the _nc_free_and_exit() function to free
the remainder on exit. The ncurses utility and test programs use this
feature, e.g., via the ExitProgram() macro.
Starting with patch 20141115, using this option causes the configure
script to apply the top-level VERSION file to the ABI version used
for libtool.
--disable-lp64
The header files will ignore use of the _LP64 symbol to make chtype
@ -386,12 +407,51 @@ SUMMARY OF CONFIGURE OPTIONS:
rather than the include directory. This makes it simpler to avoid
compile-time conflicts with other versions of curses.h
Putting the header files into a subdirectory assumes that applications
will follow the (standard) practice of including the headers with
reference to the subdirectory name. For instance, the normal ncurses
header would be included using
#include <ncurses/curses.h>
#include <ncurses/term.h>
while the ncursesw headers would be found this way:
#include <ncursesw/curses.h>
#include <ncursesw/term.h>
In either case (with or without the --disable-overwrite option),
almost all applications are designed to include a related set of
curses header files from the same directory.
Manipulating the --includedir configure option to put header files
directly in a subdirectory of the normal include-directory defeats
this, and breaks builds of portable applications. Likewise, putting
some headers in /usr/include, and others in a subdirectory is a good
way to break builds.
When configured with --disable-overwrite, the installed header files'
embedded #include's are adjusted to use the same style of includes
noted above. In particular, the unctrl.h header is included from
curses.h, which means that a makefile which tells the compiler to
include directly from the subdirectory will fail to compile correctly.
Without some special effort, it will either fail to compile at all,
or the compiler may find a different unctrl.h file.
--disable-relink
If --enable-rpath is given, the generated makefiles normally will
rebuild the libraries during install. Use this option to simply
copy whatever the linked produced.
rebuild shared libraries during install. Use this option to simply
copy whatever the linker produced.
This option is ignored if --enable-rpath is not given.
Static libraries cannot simply be copied because tools use timestamps
to determine if the library's symbol table is up to date. If your
install program supports the "-p" (preserve timestamp) option, that
is used when --disable-relink is given, to avoid rebuilding the symbol
table.
Finally, some tools ignore the subsecond timestamps supported by some
filesystems. This option adds a 1-second sleep to help those tools
avoid unnecessary relinking during the install process.
--disable-root-environ
Compile with environment restriction, so certain environment variables
@ -409,6 +469,9 @@ SUMMARY OF CONFIGURE OPTIONS:
Compile without scroll-hints code. This option is ignored when
hashmap scrolling is configured, which is the default.
--disable-stripping
Do not strip installed executables.
--disable-tic-depends
When building shared libraries, normally the tic library is linked to
depend upon the ncurses library (or equivalently, on the tinfo-library
@ -427,6 +490,26 @@ SUMMARY OF CONFIGURE OPTIONS:
list documented in X/Open. ncurses provides varargs support for this
function. Use --disable-tparm-varargs to disable this support.
--disable-wattr-macros
The 6.0 ABI adds support for extended colors and for extended mouse.
The former is a noticeable problem when developers inadvertently
compile using the ncurses6 header files and link with an ncurses5
library, because the wattr* macros use a new field in the WINDOW
structure. These macros are used in several applications.
Since ncurses provides an actual function for each of these macros,
suppressing them from the curses.h header allows the ncurses5 libraries
to be used in most applications.
NOTE: The extended colors also are used in the cchar_t structure, but
fewer applications use that.
NOTE: This workaround does not help with mismatches in the ncurses
mouse version. The extended mouse feature uses one less fewer bit for
each button, so that only the first button will work as expected with
a mismatch between header and library. Again, most applications will
work, since most use only the first button.
--enable-assertions
For testing, compile-in assertion code. This is used only for a few
places where ncurses cannot easily recover by returning an error code.
@ -473,12 +556,6 @@ SUMMARY OF CONFIGURE OPTIONS:
issues arise when porting to SVr4 curses, which uses const in even
fewer places.
--enable-echo
Use the option --disable-echo to make the build-log less verbose by
suppressing the display of the compile and link commands. This makes
it easier to see the compiler warnings. (You can always use "make -n"
to see the options that are used).
--enable-expanded
For testing, generate functions for certain macros to make them visible
as such to the debugger. See also the --disable-macros option.
@ -501,6 +578,14 @@ SUMMARY OF CONFIGURE OPTIONS:
compatible with libncursesw 5.4. None of the interfaces change, but
applications which have mouse mask mmask_t's must be recompiled.
--enable-ext-putwin
Modify the file-format written by putwin() to use printable text rather
than binary files, allowing getwin() to read screen dumps written by
differently-configured ncurses libraries. The extended getwin() can
still read binary screen dumps from the "same" configuration of
ncurses. This does not change the ABI (the binary interface seen by
calling applications).
--enable-getcap
Use the 4.4BSD getcap code if available, or a bundled version of it to
fetch termcap entries. Entries read in this way cannot use (make
@ -546,6 +631,14 @@ SUMMARY OF CONFIGURE OPTIONS:
terminfo entries. This is the default, unless you have disabled the
extended functions.
--enable-opaque-curses
--enable-opaque-form
--enable-opaque-menu
--enable-opaque-panel
Define symbol in curses.h which controls whether some library
structures are treated as "opaque". The --enable-opaque-curses option
is overridden by the --enable-reentrant option.
--enable-pc-files
If pkg-config is found (see --with-pkg-config), generate ".pc" files
for each of the libraries, and install them in pkg-config's library
@ -556,9 +649,9 @@ SUMMARY OF CONFIGURE OPTIONS:
call can be interrupted for SIGWINCH.
--enable-reentrant
Compile experimental configuration which improves reentrant use of the
library by reducing global and static variables. This option is also
set if --with-pthread is used.
Compile configuration which improves reentrant use of the library by
reducing global and static variables. This option is also set if
--with-pthread is used.
Enabling this option adds a "t" to the library names, except for the
special case when --enable-weak-symbols is also used.
@ -582,14 +675,8 @@ SUMMARY OF CONFIGURE OPTIONS:
--enable-safe-sprintf
Compile with experimental safe-sprintf code. You may consider using
this if you are building ncurses for a system that has neither
vsnprintf() or vsprintf(). It is slow, however.
--enable-sigwinch
Compile support for ncurses' SIGWINCH handler. If your application has
its own SIGWINCH handler, ncurses will not use its own. The ncurses
handler causes wgetch() to return KEY_RESIZE when the screen-size
changes. This option is the default, unless you have disabled the
extended functions.
vsnprintf() or vsprintf(). It is slow, however, and is used only on
very old systems which lack vsnprintf().
--enable-signed-char
The term.h header declares a Booleans[] array typed "char". But it
@ -598,6 +685,13 @@ SUMMARY OF CONFIGURE OPTIONS:
is not strictly compatible. This option allows one to implement this
alteration without patching the source code.
--enable-sigwinch
Compile support for ncurses' SIGWINCH handler. If your application has
its own SIGWINCH handler, ncurses will not use its own. The ncurses
handler causes wgetch() to return KEY_RESIZE when the screen-size
changes. This option is the default, unless you have disabled the
extended functions.
--enable-sp-funcs
Compile-in support for extended functions which accept a SCREEN pointer,
reducing the need for juggling the global SP value with set_term() and
@ -684,6 +778,9 @@ SUMMARY OF CONFIGURE OPTIONS:
Tell where to install the Ada includes (default:
PREFIX/lib/ada/adainclude)
--with-ada-libname=NAME
Override the name of the Ada binding (default: "AdaCurses")
--with-ada-objects=DIR
Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib)
@ -700,10 +797,6 @@ SUMMARY OF CONFIGURE OPTIONS:
correspond with that in <stdbool.h>, or defaults to platform-specific
sizes).
--with-build-cpp=XXX
This option is provided by the same macro used for $BUILD_CC, etc.,
but is not directly used by ncurses.
--with-build-cc=XXX
If cross-compiling, specify a host C compiler, which is needed to
compile a few utilities which generate source modules for ncurses.
@ -718,6 +811,10 @@ SUMMARY OF CONFIGURE OPTIONS:
You can also set the environment variable $BUILD_CFLAGS rather than
use this option.
--with-build-cpp=XXX
This option is provided by the same macro used for $BUILD_CC, etc.,
but is not directly used by ncurses.
--with-build-cppflags=XXX
If cross-compiling, specify the host C preprocessor-flags. You might
need to do this if the target compiler has unusual flags which confuse
@ -762,6 +859,10 @@ SUMMARY OF CONFIGURE OPTIONS:
executables, e.g., by setting "--with-chtype=long" (the configure
script supplies "unsigned").
--with-config-suffix=XXX
Specify a suffix for the ncursesw6-config file, etc., used to work
around conflicts with packages.
--with-cxx-shared
When --with-shared is set, build libncurses++ as a shared library.
This implicitly relies upon building with gcc/g++, since other
@ -790,10 +891,23 @@ SUMMARY OF CONFIGURE OPTIONS:
For testing, compile and link with Gray Watson's dmalloc library.
This also sets the --disable-leaks option.
--with-export-syms[=XXX]
Limit exported symbols using libtool. The configure script
automatically chooses an appropriate ".sym" file, which lists the
symbols which are part of the ABI.
--with-extra-suffix[=XXX]
Add the given suffix to header- and library-names to simplify
installing incompatible ncurses libraries, e.g., those using a
different ABI. The renaming affects the name of the
include-subdirectory if --disable-overwrite is given.
--with-fallbacks=XXX
Specify a list of fallback terminal descriptions which will be
compiled into the ncurses library. See CONFIGURING FALLBACK ENTRIES.
See also "--with-tic-path" and "--with-infocmp-path".
--with-gpm
use Alessandro Rubini's GPM library to provide mouse support on the
Linux console. Prior to ncurses 5.5, this introduced a dependency on
@ -833,13 +947,22 @@ SUMMARY OF CONFIGURE OPTIONS:
filesystem-based terminfo entries.
Use the parameter value to give the install-prefix used for the
datbase, e.g.,
database, e.g.,
--with-hashed-db=/usr/local/BigBase
to find the corresponding include- and lib-directories under the
given directory.
given directory. Alternatively, you can specify a directory leaf
name, e.g.,
--with-hashed-db=db4
to make the configure script look for files in a subdirectory such as
/usr/include/db4/db.h
/usr/lib/db4/libdb.so
See also the --enable-getcap option.
--with-infocmp-path[=XXX]
Use this option to override the automatic detection of tic in your
$PATH when building fallbacks (see "--with-fallbacks").
--with-install-prefix=XXX
Allows you to specify an alternate location for installing ncurses
after building it. The value you specify is prepended to the "real"
@ -878,7 +1001,14 @@ SUMMARY OF CONFIGURE OPTIONS:
macros for libtool, e.g., AC_PROG_LIBTOOL. See the comments in
aclocal.m4 for CF_PROG_LIBTOOL, and ensure that you build configure
using the appropriate patch for autoconf from
http://invisible-island.net/autoconf/
https://invisible-island.net/autoconf/
--with-libtool-opts=XXX
Allow user to pass additional libtool options into the library creation
and link steps. The main use for this is to do something like
./configure --with-libtool-opts=-static
to get the same behavior as automake-flavored
./configure --enable-static
--with-manpage-aliases
Tell the configure script you wish to create entries in the
@ -908,7 +1038,7 @@ SUMMARY OF CONFIGURE OPTIONS:
copying the man-page for each alias.
--with-manpage-tbl
Tell the configure script that you with to preprocess the manpages
Tell the configure script that you wish to preprocess the manpages
by running them through tbl to generate tables understandable by
nroff.
@ -939,6 +1069,20 @@ SUMMARY OF CONFIGURE OPTIONS:
those using termcap, do not use the higher speeds. Your application
(or system, in general) may or may not.
--with-pc-suffix=SUFFIX
If ".pc" files are installed, optionally add a suffix to the files
and corresponding package names to separate unusual configurations.
If no option value is given (or if it is "none"), no suffix is added.
--with-pcre2
Add PCRE2 (Perl-compatible regular expressions v2) to the build if it
is available and the user requests it. Assume the application will
otherwise use the POSIX interface.
This is useful for MinGW builds because the usual POSIX interface is
not supplied by the development environment, while ncurses' form
library uses a regular expression feature for one of the field types.
--with-pkg-config=[DIR]
Check for pkg-config, optionally specifying its path.
@ -978,11 +1122,23 @@ SUMMARY OF CONFIGURE OPTIONS:
shared libraries, you may encounter problems with the linker.
For example, it may prevent you from running the build tree's
copy of tic (for installing the terminfo database) because it
loads the system's copy of the ncurses shared libraries. In that
case, using the misc/shlib script may be helpful, since it sets
$LD_LIBRARY_PATH to point to the build tree, e.g.,
loads the system's copy of the ncurses shared libraries.
In that case, using the misc/shlib script may be helpful, since it
sets $LD_LIBRARY_PATH to point to the build tree, e.g.,
./misc/shlib make install
Alternatively, for most platforms, the linker accepts a list of
directories which will be searched for libraries at run-time. The
configure script allows you to modify this list using the
RPATH_LIST environment variable. It is a colon-separated list of
directories (default: the "libdir" set via the configure script).
If you set that to put "../lib" first in the list, the linker will
look first at the build-directory, and avoid conflict with libraries
already installed. One drawback to this approach is that libraries
can be accidentally searched in any "../lib" directory.
NOTE: If you use the --with-ada-sharedlib option, you should also
set this option, to ensure that C-language modules needed for the
Ada binding use appropriate compiler options.
@ -1006,6 +1162,9 @@ SUMMARY OF CONFIGURE OPTIONS:
Specify a search-list of terminfo directories which will be compiled
into the ncurses library (default: DATADIR/terminfo)
This is a colon-separated list, like the TERMINFO_DIRS environment
variable.
--with-termlib[=XXX]
When building the ncurses library, organize this as two parts: the
curses library (libncurses) and the low-level terminfo library
@ -1023,6 +1182,10 @@ SUMMARY OF CONFIGURE OPTIONS:
Specify a search-list of termcap files which will be compiled into the
ncurses library (default: /etc/termcap:/usr/share/misc/termcap)
--with-tic-path[=XXX]
Use this option to override the automatic detection of tic in your
$PATH when building fallbacks (see "--with-fallbacks").
--with-ticlib[=XXX]
When building the ncurses library, build a separate library for
the modules that are used only by the utility programs. Normally
@ -1051,18 +1214,41 @@ SUMMARY OF CONFIGURE OPTIONS:
Configure the trace() function as part of the all models of the ncurses
library. Normally it is part of the debug (libncurses_g) library only.
--with-xterm-kbs=XXX
Configure xterm's terminfo entries to use either BS (^H, i.e., ASCII
backspace) or DEL (^?, or 127). XXX can be BS (or bs, 8) or DEL
(or del, 127).
During installation, the makefile and scripts modifies the "xterm+kbs"
terminfo entry to use this setting.
--with-valgrind
For testing, compile with debug option.
This also sets the --disable-leaks option.
--with-versioned-syms[=XXX]
The Solaris, GNU and reportedly some other linkers (ld) accept a
"--version-script" option which tells the linker to annotate the
resulting objects with version identifiers.
Use "objdump -T" on a library to see the annotations.
The configure script attempts to automatically apply a suitable ".map"
file to provide this information for Linux. Solaris mapfiles differ:
a) comments are not accepted
b) wildcards are not accepted, except for a special case of "_*".
c) each symbol listed in the map file must exist in the library
The Solaris limitations conflict with the development goal of providing
a small set of ".map" files as examples, which cover the most common
configurations. Because that coverage is done by merging together
several builds, some symbols will be listed in the the ".map" files
that do not happen to be present in one configuration or another.
The sample ".map" (and ".sym") files are generated using a set of
scripts which build several configurations for each release version,
checking to see which of the "_nc_" symbols can be made local. In
addition to the ncurses libraries and programs, the symbols used
by the "tack" program before version 1.08 are made global.
These sample ".map" files will not cover all possible combinations.
In some cases, e.g., when using the --with-weak-symbols option, you
may prefer to use a different ".map" file by setting this option's
value.
--with-wrap-prefix=XXX
When using the --enable-reentrant option, ncurses redefines variables
that would be global in curses, e.g., LINES, as a macro that calls a
@ -1074,6 +1260,19 @@ SUMMARY OF CONFIGURE OPTIONS:
which applications should not call even via a macro. This configure
option lets you choose the prefix for these wrapped variables.
--with-x11-rgb=FILE
Provide a pathname for the X11 rgb file, used by the picsmap program.
This overrides a configure check which usually works, but is needed
due to the lack of standardization for X11's files.
--with-xterm-kbs=XXX
Configure xterm's terminfo entries to use either BS (^H, i.e., ASCII
backspace) or DEL (^?, or 127). XXX can be BS (or bs, 8) or DEL
(or del, 127).
During installation, the makefile and scripts modifies the "xterm+kbs"
terminfo entry to use this setting.
--without-ada
Suppress the configure script's check for Ada95, do not build the
Ada95 binding and related demo.
@ -1113,6 +1312,11 @@ SUMMARY OF CONFIGURE OPTIONS:
programs (e.g., tic). The test applications will still be built if you
type "make", though not if you simply do "make install".
--without-tack
Suppress build/install with tack program, if it happens to be
in the same build-tree (tack was moved out of the ncurses source-tree
in 20070203).
--without-tests
Tell the configure script to suppress the build of ncurses' test
programs.
@ -1126,18 +1330,147 @@ SUMMARY OF CONFIGURE OPTIONS:
COMPATIBILITY WITH OLDER VERSIONS OF NCURSES:
--------------------------------------------
Because ncurses implements the X/Open Curses Specification, its interface
is fairly stable. That does not mean the interface does not change.
Changes are made to the documented interfaces when we find differences
between ncurses and X/Open or implementations which they certify (such as
Solaris). We add extensions to those interfaces to solve problems not
addressed by the original curses design, but those must not conflict with
the X/Open documentation.
Because ncurses implements X/Open Curses, its interface is fairly stable.
That does not mean the interface does not change. Changes are made to the
documented interfaces when we find differences between ncurses and X/Open
or implementations which largely correspond to X/Open (such as Solaris).
We add extensions to those interfaces to solve problems not addressed by
the original curses design, but those must not conflict with the X/Open
documentation.
Here are some of the major interface changes, and related problems which
you may encounter when building a system with different versions of
ncurses:
6.1 (Jan 27, 2018)
Interface changes:
+ X/Open Curses specifies a "reserved" void* parameter in several
functions, saying that it must be NULL. In this release, if the
parameter is non-NULL, it is interpreted as a point to an integer
containing a color pair. In previous releases, a non-NULL parameter
caused an error return. Portable applications are unaffected. Here
are the functions which have been extended:
attr_get
attr_off
attr_on
attr_set
chgat
color_set
mvchgat
mvwchgat
slk_attr_off
slk_attr_on
slk_attr_set
wattr_get
wattr_on
wattr_off
wattr_set
wchgat
wcolor_set
+ the TERMINAL structure declared in <term.h> has been made opaque,
and its size increased to handle the increased size of color pair
and color value, as well as other numeric capabilities.
A few applications required change, e.g., to use def_prog_mode;
only one application (tack) is known to have a valid reason for
accessing these internal details, and that was addressed by the
release of tack 1.08 in 2017. Internal functions marked as used
by tack will be deprecated in future releases.
Added extensions:
+ Several new functions were added to manipulate extended color pairs
and color values. These include:
alloc_pair
extended_color_content
extended_pair_content
extended_slk_color
find_pair
free_pair
init_extended_color
init_extended_pair
reset_color_pairs
as well as corresponding sp-functions.
+ A new terminfo capability "RGB" tells the ncurses library that the
color values are red/green/blue, to eliminate the need for palettes
in that special case for the color_content function.
Added internal functions (other than "_sp" variants):
_nc_copy_termtype2
_nc_export_termtype2
_nc_fallback2
_nc_find_prescr
_nc_forget_prescr
_nc_free_termtype2
_nc_read_entry2
_nc_write_object
Removed internal functions:
_nc_check_termtype
_nc_resolve_uses
Modified internal functions:
+ symbols are used by tic/infocmp/toe:
_nc_align_termtype - change parameters to TERMTYPE2*
_nc_check_termtype2 - change parameter to TERMTYPE2*
_nc_read_file_entry - change parameter to TERMTYPE2*
_nc_read_termtype - change parameter to TERMTYPE2*
_nc_trim_sgr0 - change parameter to TERMTYPE2*
_nc_write_entry - change parameter to TERMTYPE2*
+ symbols used only within the library:
_nc_fallback - change return type to TERMTYPE2*
_nc_init_termtype - change parameter to TERMTYPE2*
6.0 (Aug 08, 2015)
Interface changes:
+ The 6.0 ABI modifies the defaults for these configure options:
--enable-const
--enable-ext-colors
--enable-ext-mouse
--enable-ext-putwin
--enable-interop
--enable-lp64
--enable-sp-funcs
--with-chtype=uint32_t
--with-mmask_t=uint32_t
--with-tparm-arg=intptr_t
+ ncurses supports symbol versioning. If you use this feature, about
half of the "_nc_" private symbols are changed to local symbols.
+ a few applications may need to explicitly flush the standard output
when switching between printf's and (curses) printw.
Added extensions:
+ use_tioctl is an improvement over use_env
+ added wgetdelay to support the NCURSES_OPAQUE feature.
Added internal functions (other than "_sp" variants):
_nc_init_termtype
_nc_mvcur
_nc_putchar
_nc_setenv_num
_nc_trace_mmask_t
Removed internal functions:
none
Modified internal functions:
_nc_do_color - change parameters from short/bool to int
_nc_keypad - change parameter from bool to int
_nc_setupscreen - change parameter from bool to int
_nc_signal_handler - change parameter from bool to int
5.9 (Apr 04, 2011)
5.8 (Feb 26, 2011)
Interface changes:
@ -1688,9 +2021,10 @@ IF YOU ARE A SYSTEM INTEGRATOR:
Configuration and Installation:
On platforms where ncurses is assumed to be installed in /usr/lib,
the configure script uses "/usr" as a default:
the configure script uses "/usr" as a default. These include any
that use the Linux kernel, as well as these special cases:
GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin
FreeBSD, NetBSD, OpenBSD, Cygwin, MinGW
For other platforms, the default is "/usr/local". See the discussion
of the "--disable-overwrite" option.
@ -1799,9 +2133,10 @@ CONFIGURING FALLBACK ENTRIES:
$TERMINFO \
../misc/terminfo.src \
`which tic` \
`which infocmp` \
linux vt100 xterm >fallback.c
The first three parameters of the script are normally supplied by
The first four parameters of the script are normally supplied by
the configured makefiles via the "--with-fallbacks" option. They
are
@ -1809,6 +2144,8 @@ CONFIGURING FALLBACK ENTRIES:
2) the source for the terminfo entries
3) the location of the tic program, used to create a terminfo
database.
4) the location of the infocmp program, used to print a terminfo
description.
Then just rebuild and reinstall the library as you would normally.
You can restore the default empty fallback list with
@ -1817,10 +2154,11 @@ CONFIGURING FALLBACK ENTRIES:
$TERMINFO \
../misc/terminfo.src \
`which tic` \
`which infocmp` \
>fallback.c
The overhead for an empty fallback list is one trivial stub function.
Any non-empty fallback list is const-ed and therefore lives in sharable
Any non-empty fallback list is const'd and therefore lives in shareable
text space. You can look at the comment trailing each initializer in
the generated ncurses/fallback.c file to see the core cost of the
fallbacks. A good rule of thumb for modern vt100-like entries is that
@ -1851,11 +2189,10 @@ installation), there are a couple of details you need to be aware of.
They have to do with the ncurses library, which uses terminfo rather
than termcap for describing terminal characteristics.
Though the ncurses library is terminfo-based, it will interpret your
Though the ncurses library is terminfo-based, it can interpret your
TERMCAP variable (if present), any local termcap files you reference
through it, and the system termcap file. However, in order to avoid
slowing down your application startup, it will only do this once per
terminal type!
through it, and the system termcap file. However, to avoid slowing
down your application startup, it does this only once per terminal type!
The first time you load a given terminal type from your termcap
database, the library initialization code will automatically write it
@ -1914,7 +2251,7 @@ USING NCURSES WITH GPM:
but the linker may not cooperate, producing mysterious errors.
See the FAQ, as well as the discussion under the --with-gpm option:
http://invisible-island.net/ncurses/ncurses.faq.html#using_gpm_lib
https://invisible-island.net/ncurses/ncurses.faq.html#using_gpm_lib
BUILDING NCURSES WITH A CROSS-COMPILER
Ncurses can be built with a cross-compiler. Some parts must be built

View File

@ -94,7 +94,7 @@
./Ada95/samples/sample-curses_demo-mouse.ads
./Ada95/samples/sample-curses_demo.adb
./Ada95/samples/sample-curses_demo.ads
./Ada95/samples/sample-explanation.adb
./Ada95/samples/sample-explanation.adb_p
./Ada95/samples/sample-explanation.ads
./Ada95/samples/sample-form_demo-aux.adb
./Ada95/samples/sample-form_demo-aux.ads
@ -128,9 +128,12 @@
./Ada95/samples/tour.adb
./Ada95/samples/tour.ads
./Ada95/src/Makefile.in
./Ada95/src/c_threaded_variables.c
./Ada95/src/c_threaded_variables.h
./Ada95/src/c_varargs_to_ada.c
./Ada95/src/c_varargs_to_ada.h
./Ada95/src/library.gpr
./Ada95/src/library-cfg.sh
./Ada95/src/library.gpr.in
./Ada95/src/modules
./Ada95/src/ncurses_compat.c
./Ada95/src/terminal_interface-curses-aux.adb
@ -200,6 +203,7 @@
./README.MinGW
./README.emx
./TO-DO
./VERSION
./aclocal.m4
./announce.html.in
./c++/Makefile.in
@ -333,11 +337,12 @@
./doc/html/ada/terminal_interface-curses-trace__ads.htm
./doc/html/ada/terminal_interface-curses__adb.htm
./doc/html/ada/terminal_interface-curses__ads.htm
./doc/html/ada/terminal_interface-curses_constants__ads.htm
./doc/html/ada/terminal_interface__ads.htm
./doc/html/announce.html
./doc/html/hackguide.html
./doc/html/index.html
./doc/html/man/adacurses-config.1.html
./doc/html/man/adacurses6-config.1.html
./doc/html/man/captoinfo.1m.html
./doc/html/man/clear.1.html
./doc/html/man/curs_add_wch.3x.html
@ -458,9 +463,11 @@
./doc/html/man/mitem_value.3x.html
./doc/html/man/mitem_visible.3x.html
./doc/html/man/ncurses.3x.html
./doc/html/man/ncurses5-config.1.html
./doc/html/man/ncurses6-config.1.html
./doc/html/man/new_pair.3x.html
./doc/html/man/panel.3x.html
./doc/html/man/resizeterm.3x.html
./doc/html/man/scr_dump.5.html
./doc/html/man/tabs.1.html
./doc/html/man/term.5.html
./doc/html/man/term.7.html
@ -470,6 +477,7 @@
./doc/html/man/toe.1m.html
./doc/html/man/tput.1.html
./doc/html/man/tset.1.html
./doc/html/man/user_caps.5.html
./doc/html/man/wresize.3x.html
./doc/html/ncurses-intro.html
./doc/ncurses-intro.doc
@ -525,6 +533,7 @@
./form/llib-lformw
./form/modules
./include/Caps
./include/Caps-ncurses
./include/Caps.aix4
./include/Caps.hpux11
./include/Caps.keys
@ -686,8 +695,10 @@
./man/mitem_value.3x
./man/mitem_visible.3x
./man/ncurses.3x
./man/new_pair.3x
./man/panel.3x
./man/resizeterm.3x
./man/scr_dump.5
./man/tabs.1
./man/term.5
./man/term.7
@ -698,6 +709,7 @@
./man/toe.1m
./man/tput.1
./man/tset.1
./man/user_caps.5
./man/wresize.3x
./menu/Makefile.in
./menu/READ.ME
@ -748,6 +760,7 @@
./misc/form.ref
./misc/gen-pkgconfig.in
./misc/gen_edit.sh
./misc/magic
./misc/makedef.cmd
./misc/makellib
./misc/menu.def
@ -855,6 +868,7 @@
./ncurses/base/lib_winch.c
./ncurses/base/lib_window.c
./ncurses/base/nc_panel.c
./ncurses/base/new_pair.c
./ncurses/base/resizeterm.c
./ncurses/base/safe_sprintf.c
./ncurses/base/sigaction.c
@ -879,12 +893,15 @@
./ncurses/llib-ltinfotw
./ncurses/llib-ltinfow
./ncurses/modules
./ncurses/new_pair.h
./ncurses/report_offsets.c
./ncurses/tinfo/MKcaptab.awk
./ncurses/tinfo/MKcaptab.sh
./ncurses/tinfo/MKcodes.awk
./ncurses/tinfo/MKfallback.sh
./ncurses/tinfo/MKkeys_list.sh
./ncurses/tinfo/MKnames.awk
./ncurses/tinfo/MKuserdefs.sh
./ncurses/tinfo/README
./ncurses/tinfo/access.c
./ncurses/tinfo/add_tries.c
@ -984,6 +1001,7 @@
./package/debian-mingw/compat
./package/debian-mingw/control
./package/debian-mingw/copyright
./package/debian-mingw/mingw32-ncurses6.lintian-overrides
./package/debian-mingw/rules
./package/debian-mingw/source/format
./package/debian-mingw/watch
@ -991,6 +1009,7 @@
./package/debian-mingw64/compat
./package/debian-mingw64/control
./package/debian-mingw64/copyright
./package/debian-mingw64/mingw64-ncurses6.lintian-overrides
./package/debian-mingw64/rules
./package/debian-mingw64/source/format
./package/debian-mingw64/watch
@ -998,12 +1017,25 @@
./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/rules
./package/debian/source/format
./package/debian/watch
./package/mingw-ncurses.nsi
./package/mingw-ncurses.spec
./package/ncurses.map
./package/ncurses.spec
./package/ncurses.sym
./package/ncursest.map
./package/ncursest.spec
./package/ncursest.sym
./package/ncursestw.map
./package/ncursestw.sym
./package/ncursesw.map
./package/ncursesw.sym
./panel/Makefile.in
./panel/headers
./panel/llib-lpanel
@ -1033,17 +1065,25 @@
./progs/capconvert
./progs/clear.c
./progs/clear.sh
./progs/clear_cmd.c
./progs/clear_cmd.h
./progs/dump_entry.c
./progs/dump_entry.h
./progs/infocmp.c
./progs/modules
./progs/progs.priv.h
./progs/reset_cmd.c
./progs/reset_cmd.h
./progs/tabs.c
./progs/tic.c
./progs/toe.c
./progs/tparm_type.c
./progs/tparm_type.h
./progs/tput.c
./progs/transform.c
./progs/tset.c
./progs/tty_settings.c
./progs/tty_settings.h
./test/Makefile.in
./test/README
./test/aclocal.m4
@ -1051,11 +1091,13 @@
./test/blue.c
./test/bs.6
./test/bs.c
./test/bulgarian-utf8-tabs.txt
./test/bulgarian-utf8.txt
./test/cardfile.c
./test/cardfile.dat
./test/chgat.c
./test/clip_printw.c
./test/color_content.c
./test/color_name.h
./test/color_set.c
./test/configure
@ -1066,16 +1108,24 @@
./test/demo_forms.txt
./test/demo_keyok.c
./test/demo_menus.c
./test/demo_new_pair.c
./test/demo_panels.c
./test/demo_tabs.c
./test/demo_termcap.c
./test/demo_terminfo.c
./test/ditto.c
./test/dots.c
./test/dots_curses.c
./test/dots_mvcur.c
./test/dots_termcap.c
./test/dots_xcurses.c
./test/dump_window.c
./test/dump_window.h
./test/echochar.c
./test/edit_field.c
./test/edit_field.h
./test/escherknot.xbm
./test/extended_color.c
./test/filter.c
./test/firework.c
./test/firstlast.c
@ -1095,15 +1145,32 @@
./test/knight.c
./test/linedata.h
./test/linux-color.dat
./test/list_keys.c
./test/listused.sh
./test/lrtest.c
./test/make-tar.sh
./test/mensetmanus.xbm
./test/mini.xterm_48x48.xpm
./test/mk-test.awk
./test/modules
./test/movewindow.c
./test/ncurses.c
./test/ncurses_tst.hin
./test/newdemo.c
./test/package/debian-mingw/compat
./test/package/debian-mingw/control
./test/package/debian-mingw/copyright
./test/package/debian-mingw/docs
./test/package/debian-mingw/rules
./test/package/debian-mingw/source/format
./test/package/debian-mingw/watch
./test/package/debian-mingw64/compat
./test/package/debian-mingw64/control
./test/package/debian-mingw64/copyright
./test/package/debian-mingw64/docs
./test/package/debian-mingw64/rules
./test/package/debian-mingw64/source/format
./test/package/debian-mingw64/watch
./test/package/debian/compat
./test/package/debian/control
./test/package/debian/copyright
@ -1113,13 +1180,22 @@
./test/package/debian/watch
./test/package/mingw-ncurses-examples.spec
./test/package/ncurses-examples.spec
./test/padview.c
./test/pair_content.c
./test/parse_rgb.h
./test/picsmap.c
./test/picsmap.h
./test/popup_msg.c
./test/popup_msg.h
./test/programs
./test/railroad.c
./test/rain.c
./test/redraw.c
./test/savescreen.c
./test/savescreen.sh
./test/sp_tinfo.c
./test/tclock.c
./test/terminal.xbm
./test/test.priv.h
./test/test_add_wchstr.c
./test/test_addchstr.c
@ -1131,13 +1207,19 @@
./test/test_instr.c
./test/test_inwstr.c
./test/test_opaque.c
./test/test_setupterm.c
./test/test_sgr.c
./test/test_termattrs.c
./test/test_vid_puts.c
./test/test_vidputs.c
./test/testaddch.c
./test/testcurs.c
./test/testscanw.c
./test/tput-colorcube
./test/tput-initc
./test/tracemunch
./test/view.c
./test/widechars-utf8-tabs.txt
./test/widechars-utf8.txt
./test/widechars.h
./test/worm.c
@ -1145,3 +1227,4 @@
./test/xterm-16color.dat
./test/xterm-256color.dat
./test/xterm-88color.dat
./test/xterm-color_48x48.xpm

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.38 2014/01/18 20:19:45 tom Exp $
# $Id: Makefile.in,v 1.42 2019/01/06 00:35:11 tom Exp $
##############################################################################
# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. #
# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -31,7 +31,7 @@
#
# Master Makefile for ncurses library.
SHELL = /bin/sh
SHELL = @SHELL@
VPATH = @srcdir@
DESTDIR=@DESTDIR@
@ -57,6 +57,7 @@ includedir = @includedir@
includesubdir = @includesubdir@
libdir = @libdir@
mandir = @mandir@
pkgdir = @PKG_CONFIG_LIBDIR@
include_dir = ${includedir}${includesubdir}
@ -74,14 +75,16 @@ preinstall :
@ echo ''
@ echo '** Configuration summary for NCURSES $(NCURSES_MAJOR).$(NCURSES_MINOR) $(NCURSES_PATCH):'
@ echo ''
@ echo ' extended funcs: '`test @NCURSES_EXT_FUNCS@ != 0 && echo yes || echo no`
@ echo ' xterm terminfo: '@WHICH_XTERM@
@ echo ' extended funcs: '`test @NCURSES_EXT_FUNCS@ != 0 && echo yes || echo no`
@ echo ' xterm terminfo: '@WHICH_XTERM@
@ echo ''
@ echo ' bin directory: '$(bindir)
@ echo ' lib directory: '$(libdir)
@ echo ' include directory: '$(include_dir)
@ echo ' man directory: '$(mandir)
@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir)
@ echo ' bin directory: '$(bindir)
@ echo ' lib directory: '$(libdir)
@ echo ' include directory: '$(include_dir)
@ echo ' man directory: '$(mandir)
@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir)
@USE_FALLBACKS@ @ echo ' using fallback-list: '@FALLBACK_LIST@
@MAKE_PC_FILES@ @ echo ' pkg-config directory: '$(pkgdir)
@ echo ''
@ test "$(include_dir)" = "$(prefix)/include" || \
echo '** Include-directory is not in a standard location'
@ -95,6 +98,9 @@ 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.

2811
NEWS

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More