libncurses: Import https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz changes
Change-Id: I3433d30ca01359fd2e3623ede96b531f0b39cbfa
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/menu/Makefile b/menu/Makefile
deleted file mode 100644
index 3967db6..0000000
--- a/menu/Makefile
+++ /dev/null
@@ -1,690 +0,0 @@
-# $Id: Makefile.in,v 1.64 2015/08/05 23:15:41 tom Exp $
-##############################################################################
-# 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 "Software"), #
-# to deal in the Software without restriction, including without limitation #
-# the rights to use, copy, modify, merge, publish, distribute, distribute #
-# with modifications, sublicense, and/or sell copies of the Software, and to #
-# permit persons to whom the Software is furnished to do so, subject to the #
-# following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in #
-# all copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
-# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
-# DEALINGS IN THE SOFTWARE. #
-# #
-# Except as contained in this notice, the name(s) of the above copyright #
-# holders shall not be used in advertising or otherwise to promote the sale, #
-# use or other dealings in this Software without prior written #
-# authorization. #
-##############################################################################
-#
-# Author: Thomas E. Dickey 1996-on
-#
-# Makefile for menu source code.
-#
-# This makes the following:
-# libraries (normal/debug/profile/shared)
-#
-# The variable 'srcdir' refers to the source-distribution, and can be set with
-# the configure script by "--srcdir=DIR".
-#
-# The rules are organized to produce the libraries for the configured models,
-
-# turn off _all_ suffix rules; we'll generate our own
-.SUFFIXES:
-
-SHELL = /bin/sh
-
-THIS = Makefile
-
-x =
-o = .o
-
-MODEL = normal
-DESTDIR =
-top_srcdir = ..
-srcdir = .
-prefix = /system
-exec_prefix = ${prefix}
-bindir = ${exec_prefix}/bin
-libdir = ${exec_prefix}/lib
-includedir = ${prefix}/include
-includesubdir = /ncurses
-
-INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
-
-PACKAGE = ncurses
-
-LIBTOOL =
-LIBTOOL_OPTS =
-LIBTOOL_CLEAN =
-LIBTOOL_COMPILE =
-LIBTOOL_LINK = ${CC}
-LIBTOOL_INSTALL =
-LIBTOOL_UNINSTALL =
-LT_UNDEF =
-
-INSTALL = /usr/bin/install -c
-INSTALL_LIB = /usr/bin/install -c -m 644
-INSTALL_PROG = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-
-AR = arm-linux-androideabi-ar
-ARFLAGS = -curv
-AWK = mawk
-LD = arm-linux-androideabi-ld
-LN_S = ln -s -f
-
-CTAGS =
-ETAGS =
-
-CC = /home/shade/dev/cm/13/prebuilts/clang/linux-x86/host/3.6/bin/clang
-CPP = /home/shade/dev/cm/13/prebuilts/clang/linux-x86/host/3.6/bin/clang -E
-CFLAGS = -target arm-linux-androideabi -I/home/shade/dev/cm/13/bionic/libc/include -I/home/shade/dev/cm/13/bionic/libc/kernel/uapi -I/home/shade/dev/cm/13/bionic/libc/arch-arm/include -I/home/shade/dev/cm/13/bionic/libc/kernel/uapi/asm-arm --sysroot=/home/shade/dev/cm/13/prebuilts/ndk/current/platforms/android-21/arch-arm -L/home/shade/dev/cm/13/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a -I/home/shade/dev/cm/13/bionic/libm/include -I/home/shade/dev/cm/13/bionic/libm/include/arm -I/home/shade/dev/cm/13/external/libselinux/include -I/home/shade/dev/cm/13/system/core/include -I/home/shade/dev/cm/13/bionic/libc/dns/include -I. --param max-inline-insns-single=1200
-
-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H -I. -I../include -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -DNDEBUG
-
-CCFLAGS = $(CPPFLAGS) $(CFLAGS)
-
-CFLAGS_LIBTOOL = $(CCFLAGS)
-CFLAGS_NORMAL = $(CCFLAGS)
-CFLAGS_DEBUG = $(CCFLAGS) -g -DTRACE
-CFLAGS_PROFILE = $(CCFLAGS) -pg
-CFLAGS_SHARED = $(CCFLAGS) -fPIC
-
-CFLAGS_DEFAULT = $(CFLAGS_NORMAL)
-
-LINK = $(LIBTOOL_LINK)
-LDFLAGS = -L/home/shade/dev/cm/13/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a -L/home/shade/dev/cm/13/out/target/product/bacon/system/lib -lc -lselinux -lcutils
-
-SHLIB_DIRS = -L../lib
-SHLIB_LIST = $(SHLIB_DIRS) -lncurses
-
-RPATH_LIST = ${libdir}
-RESULTING_SYMS =
-VERSIONED_SYMS =
-MK_SHARED_LIB = ${CC} ${CFLAGS} -shared -Wl,-soname,`basename $@ .${REL_VERSION}`.${ABI_VERSION},-stats,-lc -o $@
-
-NCURSES_MAJOR = 6
-NCURSES_MINOR = 0
-REL_VERSION = 6.0
-ABI_VERSION = 6
-
-RANLIB = arm-linux-androideabi-ranlib
-
-LIBRARIES = ../lib/libmenu.a ../lib/libmenu_g.a
-
-LINT = lint
-LINT_OPTS =
-LINT_LIBS = -lmenu -lncurses
-
-AUTO_SRC = \
- ../include/menu.h \
- ../include/eti.h \
- ../include/mf_common.h
-
-################################################################################
-all \
-libs \
-install :: $(AUTO_SRC) $(LIBRARIES)
-
-sources : $(AUTO_SRC)
-
-$(DESTDIR)$(bindir) \
-$(DESTDIR)$(libdir) :
- mkdir -p $@
-
-# make copies to simplify include-paths while still keeping menu's include
-# file in this directory.
-../include/menu.h : $(srcdir)/menu.h
- -rm -f $@
- cp $(srcdir)/menu.h $@
-../include/eti.h : $(srcdir)/eti.h
- -rm -f $@
- cp $(srcdir)/eti.h $@
-../include/mf_common.h : $(srcdir)/mf_common.h
- -rm -f $@
- cp $(srcdir)/mf_common.h $@
-
-HEADER_DEPS = \
- $(srcdir)/menu.priv.h \
- $(AUTO_SRC) \
- ../include/curses.h
-
-tags:
- $(CTAGS) *.[ch]
-
-#TAGS:
-# $(ETAGS) *.[ch]
-
-mostlyclean ::
- -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
-
-clean :: mostlyclean
- -rm -f $(AUTO_SRC)
- -rm -rf .libs *.dSYM
-
-distclean :: clean
- -rm -f Makefile
-
-realclean :: distclean
-
-###############################################################################
-# The remainder of this file is automatically generated during configuration
-###############################################################################
-
-# Generated by CF_LIB_RULES
-resulting.map:
- sed -e "s/NCURSES\([WT]\+\)\?_/NCURSES\16_/g" -e "/deprecated in ABI6/d" < >$@
-
-clean::
- rm -f resulting.map
-
-# generated by mk-0th.awk
-# libname: menu
-# subsets: ticlib+termlib+ext_tinfo+base+ext_funcs
-
-.SUFFIXES: .c .cc .h .i .ii
-.c.i :
- $(CPP) $(CPPFLAGS) $< >$@
-.cc.ii :
- $(CPP) $(CPPFLAGS) $< >$@
-.h.i :
- $(CPP) $(CPPFLAGS) $< >$@
-
-C_SRC = \
- $(srcdir)/m_attribs.c \
- $(srcdir)/m_cursor.c \
- $(srcdir)/m_driver.c \
- $(srcdir)/m_format.c \
- $(srcdir)/m_global.c \
- $(srcdir)/m_hook.c \
- $(srcdir)/m_item_cur.c \
- $(srcdir)/m_item_nam.c \
- $(srcdir)/m_item_new.c \
- $(srcdir)/m_item_opt.c \
- $(srcdir)/m_item_top.c \
- $(srcdir)/m_item_use.c \
- $(srcdir)/m_item_val.c \
- $(srcdir)/m_item_vis.c \
- $(srcdir)/m_items.c \
- $(srcdir)/m_new.c \
- $(srcdir)/m_opts.c \
- $(srcdir)/m_pad.c \
- $(srcdir)/m_pattern.c \
- $(srcdir)/m_post.c \
- $(srcdir)/m_req_name.c \
- $(srcdir)/m_scale.c \
- $(srcdir)/m_spacing.c \
- $(srcdir)/m_sub.c \
- $(srcdir)/m_trace.c \
- $(srcdir)/m_userptr.c \
- $(srcdir)/m_win.c
-
-# Producing llib-lmenu is time-consuming, so there's no direct-dependency for
-# it in the lintlib rule. We'll only remove in the cleanest setup.
-
-MENU_SRC = \
- $(srcdir)/m_attribs.c \
- $(srcdir)/m_cursor.c \
- $(srcdir)/m_driver.c \
- $(srcdir)/m_format.c \
- $(srcdir)/m_global.c \
- $(srcdir)/m_hook.c \
- $(srcdir)/m_item_cur.c \
- $(srcdir)/m_item_nam.c \
- $(srcdir)/m_item_new.c \
- $(srcdir)/m_item_opt.c \
- $(srcdir)/m_item_top.c \
- $(srcdir)/m_item_use.c \
- $(srcdir)/m_item_val.c \
- $(srcdir)/m_item_vis.c \
- $(srcdir)/m_items.c \
- $(srcdir)/m_new.c \
- $(srcdir)/m_opts.c \
- $(srcdir)/m_pad.c \
- $(srcdir)/m_pattern.c \
- $(srcdir)/m_post.c \
- $(srcdir)/m_req_name.c \
- $(srcdir)/m_scale.c \
- $(srcdir)/m_spacing.c \
- $(srcdir)/m_sub.c \
- $(srcdir)/m_trace.c \
- $(srcdir)/m_userptr.c \
- $(srcdir)/m_win.c
-
-clean ::
- rm -f llib-lmenu.*
-
-realclean ::
- rm -f llib-lmenu
-
-llib-lmenu : $(MENU_SRC)
- cproto -a -l -DNCURSES_ENABLE_STDBOOL_H=0 -DLINT $(CPPFLAGS) $(MENU_SRC) >$@
-
-lintlib ::
- sh $(srcdir)/../misc/makellib menu $(CPPFLAGS)
-
-lint ::
- $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(MENU_SRC) $(LINT_LIBS)
-
-# generated by mk-1st.awk (subset=ticlib+termlib+ext_tinfo+base+ext_funcs)
-# name: menu
-# traces: DEBUG
-# MODEL: NORMAL
-# CXX_MODEL: NORMAL
-# model: objects
-# prefix: lib
-# suffix: .a
-# subset: ticlib+termlib+ext_tinfo+base+ext_funcs
-# driver: no
-# ShlibVer: rel
-# ShlibVerInfix: no
-# SymLink: ln -s -f
-# TermlibRoot: ncurses
-# TermlibSuffix: .a
-# ReLink: no
-# DoLinks: yes
-# rmSoLocs: no
-# ldconfig: :
-# overwrite: no
-# depend: ../include/ncurses_cfg.h ./menu.priv.h
-# host: arm-unknown-linux-androideabi
-
-NORMAL_OBJS = \
- ../objects/m_attribs$o \
- ../objects/m_cursor$o \
- ../objects/m_driver$o \
- ../objects/m_format$o \
- ../objects/m_global$o \
- ../objects/m_hook$o \
- ../objects/m_item_cur$o \
- ../objects/m_item_nam$o \
- ../objects/m_item_new$o \
- ../objects/m_item_opt$o \
- ../objects/m_item_top$o \
- ../objects/m_item_use$o \
- ../objects/m_item_val$o \
- ../objects/m_item_vis$o \
- ../objects/m_items$o \
- ../objects/m_new$o \
- ../objects/m_opts$o \
- ../objects/m_pad$o \
- ../objects/m_pattern$o \
- ../objects/m_post$o \
- ../objects/m_req_name$o \
- ../objects/m_scale$o \
- ../objects/m_spacing$o \
- ../objects/m_sub$o \
- ../objects/m_userptr$o \
- ../objects/m_win$o
-
-$(NORMAL_OBJS) : ../include/ncurses_cfg.h ./menu.priv.h
-
-../lib/libmenu.a : $(NORMAL_OBJS)
- $(AR) $(ARFLAGS) $@ $?
- $(RANLIB) $@
-
-install \
-install.libs \
-install.menu :: $(DESTDIR)$(libdir) ../lib/libmenu.a
- @echo installing ../lib/libmenu.a as $(DESTDIR)$(libdir)/libmenu.a
- $(INSTALL_DATA) ../lib/libmenu.a $(DESTDIR)$(libdir)/libmenu.a
- $(RANLIB) $(DESTDIR)$(libdir)/libmenu.a
-
-uninstall \
-uninstall.libs \
-uninstall.menu ::
- @echo uninstalling $(DESTDIR)$(libdir)/libmenu.a
- -@rm -f $(DESTDIR)$(libdir)/libmenu.a
-
-clean ::
- -rm -f ../lib/libmenu.a
-
-mostlyclean::
- -rm -f $(NORMAL_OBJS)
-
-# generated by mk-2nd.awk
-# model: objects
-# MODEL: NORMAL
-# echo: yes
-# subset: ticlib+termlib+ext_tinfo+base+ext_funcs
-# crenames: yes
-# cxxrenames:
-# traces: DEBUG
-# srcdir: .
-
-../objects/m_attribs$o : $(srcdir)/m_attribs.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_attribs.c -o ../objects/m_attribs$o
-
-../objects/m_cursor$o : $(srcdir)/m_cursor.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_cursor.c -o ../objects/m_cursor$o
-
-../objects/m_driver$o : $(srcdir)/m_driver.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_driver.c -o ../objects/m_driver$o
-
-../objects/m_format$o : $(srcdir)/m_format.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_format.c -o ../objects/m_format$o
-
-../objects/m_global$o : $(srcdir)/m_global.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_global.c -o ../objects/m_global$o
-
-../objects/m_hook$o : $(srcdir)/m_hook.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_hook.c -o ../objects/m_hook$o
-
-../objects/m_item_cur$o : $(srcdir)/m_item_cur.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_cur.c -o ../objects/m_item_cur$o
-
-../objects/m_item_nam$o : $(srcdir)/m_item_nam.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_nam.c -o ../objects/m_item_nam$o
-
-../objects/m_item_new$o : $(srcdir)/m_item_new.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_new.c -o ../objects/m_item_new$o
-
-../objects/m_item_opt$o : $(srcdir)/m_item_opt.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_opt.c -o ../objects/m_item_opt$o
-
-../objects/m_item_top$o : $(srcdir)/m_item_top.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_top.c -o ../objects/m_item_top$o
-
-../objects/m_item_use$o : $(srcdir)/m_item_use.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_use.c -o ../objects/m_item_use$o
-
-../objects/m_item_val$o : $(srcdir)/m_item_val.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_val.c -o ../objects/m_item_val$o
-
-../objects/m_item_vis$o : $(srcdir)/m_item_vis.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_item_vis.c -o ../objects/m_item_vis$o
-
-../objects/m_items$o : $(srcdir)/m_items.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_items.c -o ../objects/m_items$o
-
-../objects/m_new$o : $(srcdir)/m_new.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_new.c -o ../objects/m_new$o
-
-../objects/m_opts$o : $(srcdir)/m_opts.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_opts.c -o ../objects/m_opts$o
-
-../objects/m_pad$o : $(srcdir)/m_pad.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_pad.c -o ../objects/m_pad$o
-
-../objects/m_pattern$o : $(srcdir)/m_pattern.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_pattern.c -o ../objects/m_pattern$o
-
-../objects/m_post$o : $(srcdir)/m_post.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_post.c -o ../objects/m_post$o
-
-../objects/m_req_name$o : $(srcdir)/m_req_name.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_req_name.c -o ../objects/m_req_name$o
-
-../objects/m_scale$o : $(srcdir)/m_scale.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_scale.c -o ../objects/m_scale$o
-
-../objects/m_spacing$o : $(srcdir)/m_spacing.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_spacing.c -o ../objects/m_spacing$o
-
-../objects/m_sub$o : $(srcdir)/m_sub.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_sub.c -o ../objects/m_sub$o
-
-../objects/m_userptr$o : $(srcdir)/m_userptr.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_userptr.c -o ../objects/m_userptr$o
-
-../objects/m_win$o : $(srcdir)/m_win.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_win.c -o ../objects/m_win$o
-
-
-# generated by mk-1st.awk (subset=ticlib+termlib+ext_tinfo+base+ext_funcs)
-# name: menu
-# traces: DEBUG
-# MODEL: DEBUG
-# CXX_MODEL: DEBUG
-# model: obj_g
-# prefix: lib
-# suffix: _g.a
-# subset: ticlib+termlib+ext_tinfo+base+ext_funcs
-# driver: no
-# ShlibVer: rel
-# ShlibVerInfix: no
-# SymLink: ln -s -f
-# TermlibRoot: ncurses
-# TermlibSuffix: .a
-# ReLink: no
-# DoLinks: yes
-# rmSoLocs: no
-# ldconfig: :
-# overwrite: no
-# depend: ../include/ncurses_cfg.h ./menu.priv.h
-# host: arm-unknown-linux-androideabi
-
-DEBUG_OBJS = \
- ../obj_g/m_attribs$o \
- ../obj_g/m_cursor$o \
- ../obj_g/m_driver$o \
- ../obj_g/m_format$o \
- ../obj_g/m_global$o \
- ../obj_g/m_hook$o \
- ../obj_g/m_item_cur$o \
- ../obj_g/m_item_nam$o \
- ../obj_g/m_item_new$o \
- ../obj_g/m_item_opt$o \
- ../obj_g/m_item_top$o \
- ../obj_g/m_item_use$o \
- ../obj_g/m_item_val$o \
- ../obj_g/m_item_vis$o \
- ../obj_g/m_items$o \
- ../obj_g/m_new$o \
- ../obj_g/m_opts$o \
- ../obj_g/m_pad$o \
- ../obj_g/m_pattern$o \
- ../obj_g/m_post$o \
- ../obj_g/m_req_name$o \
- ../obj_g/m_scale$o \
- ../obj_g/m_spacing$o \
- ../obj_g/m_sub$o \
- ../obj_g/m_trace$o \
- ../obj_g/m_userptr$o \
- ../obj_g/m_win$o
-
-$(DEBUG_OBJS) : ../include/ncurses_cfg.h ./menu.priv.h
-
-../lib/libmenu_g.a : $(DEBUG_OBJS)
- $(AR) $(ARFLAGS) $@ $?
- $(RANLIB) $@
-
-install \
-install.libs \
-install.menu :: $(DESTDIR)$(libdir) ../lib/libmenu_g.a
- @echo installing ../lib/libmenu_g.a as $(DESTDIR)$(libdir)/libmenu_g.a
- $(INSTALL_DATA) ../lib/libmenu_g.a $(DESTDIR)$(libdir)/libmenu_g.a
- $(RANLIB) $(DESTDIR)$(libdir)/libmenu_g.a
-
-uninstall \
-uninstall.libs \
-uninstall.menu ::
- @echo uninstalling $(DESTDIR)$(libdir)/libmenu_g.a
- -@rm -f $(DESTDIR)$(libdir)/libmenu_g.a
-
-clean ::
- -rm -f ../lib/libmenu_g.a
-
-mostlyclean::
- -rm -f $(DEBUG_OBJS)
-
-# generated by mk-2nd.awk
-# model: obj_g
-# MODEL: DEBUG
-# echo: yes
-# subset: ticlib+termlib+ext_tinfo+base+ext_funcs
-# crenames: yes
-# cxxrenames:
-# traces: DEBUG
-# srcdir: .
-
-../obj_g/m_attribs$o : $(srcdir)/m_attribs.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_attribs.c -o ../obj_g/m_attribs$o
-
-../obj_g/m_cursor$o : $(srcdir)/m_cursor.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_cursor.c -o ../obj_g/m_cursor$o
-
-../obj_g/m_driver$o : $(srcdir)/m_driver.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_driver.c -o ../obj_g/m_driver$o
-
-../obj_g/m_format$o : $(srcdir)/m_format.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_format.c -o ../obj_g/m_format$o
-
-../obj_g/m_global$o : $(srcdir)/m_global.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_global.c -o ../obj_g/m_global$o
-
-../obj_g/m_hook$o : $(srcdir)/m_hook.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_hook.c -o ../obj_g/m_hook$o
-
-../obj_g/m_item_cur$o : $(srcdir)/m_item_cur.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_cur.c -o ../obj_g/m_item_cur$o
-
-../obj_g/m_item_nam$o : $(srcdir)/m_item_nam.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_nam.c -o ../obj_g/m_item_nam$o
-
-../obj_g/m_item_new$o : $(srcdir)/m_item_new.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_new.c -o ../obj_g/m_item_new$o
-
-../obj_g/m_item_opt$o : $(srcdir)/m_item_opt.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_opt.c -o ../obj_g/m_item_opt$o
-
-../obj_g/m_item_top$o : $(srcdir)/m_item_top.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_top.c -o ../obj_g/m_item_top$o
-
-../obj_g/m_item_use$o : $(srcdir)/m_item_use.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_use.c -o ../obj_g/m_item_use$o
-
-../obj_g/m_item_val$o : $(srcdir)/m_item_val.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_val.c -o ../obj_g/m_item_val$o
-
-../obj_g/m_item_vis$o : $(srcdir)/m_item_vis.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_item_vis.c -o ../obj_g/m_item_vis$o
-
-../obj_g/m_items$o : $(srcdir)/m_items.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_items.c -o ../obj_g/m_items$o
-
-../obj_g/m_new$o : $(srcdir)/m_new.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_new.c -o ../obj_g/m_new$o
-
-../obj_g/m_opts$o : $(srcdir)/m_opts.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_opts.c -o ../obj_g/m_opts$o
-
-../obj_g/m_pad$o : $(srcdir)/m_pad.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_pad.c -o ../obj_g/m_pad$o
-
-../obj_g/m_pattern$o : $(srcdir)/m_pattern.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_pattern.c -o ../obj_g/m_pattern$o
-
-../obj_g/m_post$o : $(srcdir)/m_post.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_post.c -o ../obj_g/m_post$o
-
-../obj_g/m_req_name$o : $(srcdir)/m_req_name.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_req_name.c -o ../obj_g/m_req_name$o
-
-../obj_g/m_scale$o : $(srcdir)/m_scale.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_scale.c -o ../obj_g/m_scale$o
-
-../obj_g/m_spacing$o : $(srcdir)/m_spacing.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_spacing.c -o ../obj_g/m_spacing$o
-
-../obj_g/m_sub$o : $(srcdir)/m_sub.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_sub.c -o ../obj_g/m_sub$o
-
-../obj_g/m_trace$o : $(srcdir)/m_trace.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_trace.c -o ../obj_g/m_trace$o
-
-../obj_g/m_userptr$o : $(srcdir)/m_userptr.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_userptr.c -o ../obj_g/m_userptr$o
-
-../obj_g/m_win$o : $(srcdir)/m_win.c \
- $(HEADER_DEPS)
- $(LIBTOOL_COMPILE) $(CC) $(CFLAGS_DEBUG) -c ../menu/m_win.c -o ../obj_g/m_win$o
-
-
-# generated by mk-hdr.awk
-# subset: ticlib+termlib+ext_tinfo+base+ext_funcs
-# compat: yes
-
-${INCLUDEDIR} :
- mkdir -p $@
-
-install \
-install.libs \
-install.includes :: ${AUTO_SRC} ${INCLUDEDIR} \
- $(srcdir)/eti.h \
- $(srcdir)/menu.h
- @ (cd ${INCLUDEDIR} && rm -f eti.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} $(srcdir)/eti.h
- @ (cd ${INCLUDEDIR} && rm -f menu.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} $(srcdir)/menu.h
-
-uninstall \
-uninstall.libs \
-uninstall.includes ::
- -@ (cd ${INCLUDEDIR} && rm -f eti.h)
- -@ (cd ${INCLUDEDIR} && rm -f menu.h)
-depend : ${AUTO_SRC}
- makedepend -- ${CPPFLAGS} -- ${C_SRC}
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/menu/Makefile.in b/menu/Makefile.in
index 9bf1fe3..b623bf0 100644
--- a/menu/Makefile.in
+++ b/menu/Makefile.in
@@ -1,6 +1,7 @@
-# $Id: Makefile.in,v 1.64 2015/08/05 23:15:41 tom Exp $
+# $Id: Makefile.in,v 1.71 2021/07/03 15:45:33 tom Exp $
##############################################################################
-# Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. #
+# Copyright 2020,2021 Thomas E. Dickey #
+# Copyright 1998-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"), #
@@ -75,7 +76,7 @@
INSTALL = @INSTALL@
INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
-INSTALL_PROG = @INSTALL_PROGRAM@
+INSTALL_PROG = @INSTALL_PROGRAM@ @INSTALL_OPT_S@
INSTALL_DATA = @INSTALL_DATA@
AR = @AR@
@@ -89,16 +90,18 @@
CC = @CC@
CPP = @CPP@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
+INCDIR = $(top_srcdir)/include
+BASE_DIR = $(top_srcdir)/ncurses
+CPPFLAGS = -I$(BASE_DIR) -DHAVE_CONFIG_H -DBUILDING_MENU @CPPFLAGS@
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CFLAGS_LIBTOOL = $(CCFLAGS)
-CFLAGS_NORMAL = $(CCFLAGS)
-CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
-CFLAGS_PROFILE = $(CCFLAGS) -pg
+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC
+CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
+CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
@@ -133,6 +136,19 @@
../include/mf_common.h
################################################################################
+
+@MAKE_PHONY@.PHONY : all
+@MAKE_PHONY@.PHONY : clean
+@MAKE_PHONY@.PHONY : distclean
+@MAKE_PHONY@.PHONY : install
+@MAKE_PHONY@.PHONY : install.libs
+@MAKE_PHONY@.PHONY : libs
+@MAKE_PHONY@.PHONY : mostlyclean
+@MAKE_PHONY@.PHONY : realclean
+@MAKE_PHONY@.PHONY : sources
+@MAKE_PHONY@.PHONY : uninstall
+@MAKE_PHONY@.PHONY : uninstall.libs
+
all \
libs \
install :: $(AUTO_SRC) $(LIBRARIES)
@@ -156,9 +172,22 @@
cp $(srcdir)/mf_common.h $@
HEADER_DEPS = \
+ ../include/curses.h \
+ ../include/ncurses_cfg.h \
+ ../include/ncurses_def.h \
+ ../include/ncurses_dll.h \
+ ../include/term.h \
+ ../include/unctrl.h \
+ $(BASE_DIR)/curses.priv.h \
+ $(BASE_DIR)/new_pair.h \
+ $(INCDIR)/nc_alloc.h \
+ $(INCDIR)/nc_panel.h \
+ $(INCDIR)/nc_string.h \
+ $(INCDIR)/nc_termios.h \
+ $(INCDIR)/nc_tparm.h \
+ $(INCDIR)/term_entry.h \
$(srcdir)/menu.priv.h \
- $(AUTO_SRC) \
- ../include/curses.h
+ $(AUTO_SRC)
tags:
$(CTAGS) *.[ch]
diff --git a/menu/READ.ME b/menu/READ.ME
index 10ff5b0..8c78037 100644
--- a/menu/READ.ME
+++ b/menu/READ.ME
@@ -1,5 +1,6 @@
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,2006 Free Software Foundation, Inc. --
+-- Copyright 2020,2021 Thomas E. Dickey --
+-- Copyright 1998-2003,2006 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 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: READ.ME,v 1.9 2006/04/22 23:13:05 tom Exp $
+-- $Id: READ.ME,v 1.11 2021/06/17 21:20:30 tom Exp $
-------------------------------------------------------------------------------
This is a clone of the menu library that is available with typical
@@ -36,7 +37,7 @@
The development environment was and is an ELF based Linux system.
-For things that still need doing, see the TO-DO file in the top-level
+For things that still need doing, see the TO-DO file in the top-level
directory.
Juergen Pfeifer
diff --git a/menu/eti.h b/menu/eti.h
index baa6190..3c3302d 100644
--- a/menu/eti.h
+++ b/menu/eti.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2002,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 *
@@ -30,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: eti.h,v 1.8 2003/10/25 15:24:29 tom Exp $ */
+/* $Id: eti.h,v 1.9 2020/02/02 23:34:34 tom Exp $ */
#ifndef NCURSES_ETI_H_incl
#define NCURSES_ETI_H_incl 1
diff --git a/menu/headers b/menu/headers
index 18c20af..2f058aa 100644
--- a/menu/headers
+++ b/menu/headers
@@ -1,5 +1,6 @@
##############################################################################
-# Copyright (c) 1998,2006 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 1998,2006 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"), #
diff --git a/menu/llib-lmenu b/menu/llib-lmenu
index 13ecaf8..67f6822 100644
--- a/menu/llib-lmenu
+++ b/menu/llib-lmenu
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1999-2005,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 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 *
@@ -27,7 +28,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 1996-2005,2010 *
+ * Author: Thomas E. Dickey 1996-on *
****************************************************************************/
/* LINTLIBRARY */
@@ -37,7 +38,7 @@
#undef set_menu_fore
int set_menu_fore(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -48,7 +49,7 @@
#undef set_menu_back
int set_menu_back(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -59,7 +60,7 @@
#undef set_menu_grey
int set_menu_grey(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -72,9 +73,9 @@
#undef _nc_menu_cursor_pos
int _nc_menu_cursor_pos(
- const MENU *menu,
- const ITEM *item,
- int *pY,
+ const MENU *menu,
+ const ITEM *item,
+ int *pY,
int *pX)
{ return(*(int *)0); }
@@ -87,14 +88,14 @@
#undef _nc_Match_Next_Character_In_Item_Name
int _nc_Match_Next_Character_In_Item_Name(
- MENU *menu,
- int ch,
+ MENU *menu,
+ int ch,
ITEM **item)
{ return(*(int *)0); }
#undef menu_driver
int menu_driver(
- MENU *menu,
+ MENU *menu,
int c)
{ return(*(int *)0); }
@@ -102,15 +103,15 @@
#undef set_menu_format
int set_menu_format(
- MENU *menu,
- int rows,
+ MENU *menu,
+ int rows,
int cols)
{ return(*(int *)0); }
#undef menu_format
void menu_format(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ /* void */ }
@@ -123,7 +124,7 @@
#undef _nc_Connect_Items
NCURSES_BOOL _nc_Connect_Items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(NCURSES_BOOL *)0); }
@@ -154,8 +155,8 @@
#undef _nc_New_TopRow_and_CurrentItem
void _nc_New_TopRow_and_CurrentItem(
- MENU *menu,
- int new_toprow,
+ MENU *menu,
+ int new_toprow,
ITEM *new_current_item)
{ /* void */ }
@@ -163,7 +164,7 @@
#undef set_menu_init
int set_menu_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -174,7 +175,7 @@
#undef set_menu_term
int set_menu_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -185,7 +186,7 @@
#undef set_item_init
int set_item_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -196,7 +197,7 @@
#undef set_item_term
int set_item_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -209,7 +210,7 @@
#undef set_current_item
int set_current_item(
- MENU *menu,
+ MENU *menu,
ITEM *item)
{ return(*(int *)0); }
@@ -239,7 +240,7 @@
#undef new_item
ITEM *new_item(
- const char *name,
+ const char *name,
const char *description)
{ return(*(ITEM **)0); }
@@ -250,7 +251,7 @@
#undef set_menu_mark
int set_menu_mark(
- MENU *menu,
+ MENU *menu,
const char *mark)
{ return(*(int *)0); }
@@ -263,19 +264,19 @@
#undef set_item_opts
int set_item_opts(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_off
int item_opts_off(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_on
int item_opts_on(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
@@ -288,7 +289,7 @@
#undef set_top_row
int set_top_row(
- MENU *menu,
+ MENU *menu,
int row)
{ return(*(int *)0); }
@@ -301,7 +302,7 @@
#undef set_item_userptr
int set_item_userptr(
- ITEM *item,
+ ITEM *item,
void *userptr)
{ return(*(int *)0); }
@@ -314,7 +315,7 @@
#undef set_item_value
int set_item_value(
- ITEM *item,
+ ITEM *item,
NCURSES_BOOL value)
{ return(*(int *)0); }
@@ -334,7 +335,7 @@
#undef set_menu_items
int set_menu_items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(int *)0); }
@@ -352,7 +353,7 @@
#undef new_menu_sp
MENU *new_menu_sp(
- SCREEN *sp,
+ SCREEN *sp,
ITEM **items)
{ return(*(MENU **)0); }
@@ -370,19 +371,19 @@
#undef set_menu_opts
int set_menu_opts(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_off
int menu_opts_off(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_on
int menu_opts_on(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
@@ -395,7 +396,7 @@
#undef set_menu_pad
int set_menu_pad(
- MENU *menu,
+ MENU *menu,
int pad)
{ return(*(int *)0); }
@@ -413,7 +414,7 @@
#undef set_menu_pattern
int set_menu_pattern(
- MENU *menu,
+ MENU *menu,
const char *p)
{ return(*(int *)0); }
@@ -421,7 +422,7 @@
#undef _nc_Post_Item
void _nc_Post_Item(
- const MENU *menu,
+ const MENU *menu,
const ITEM *item)
{ /* void */ }
@@ -456,8 +457,8 @@
#undef scale_menu
int scale_menu(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -465,17 +466,17 @@
#undef set_menu_spacing
int set_menu_spacing(
- MENU *menu,
- int s_desc,
- int s_row,
+ MENU *menu,
+ int s_desc,
+ int s_row,
int s_col)
{ return(*(int *)0); }
#undef menu_spacing
int menu_spacing(
- const MENU *menu,
- int *s_desc,
- int *s_row,
+ const MENU *menu,
+ int *s_desc,
+ int *s_row,
int *s_col)
{ return(*(int *)0); }
@@ -483,7 +484,7 @@
#undef set_menu_sub
int set_menu_sub(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
@@ -528,7 +529,7 @@
#undef set_menu_userptr
int set_menu_userptr(
- MENU *menu,
+ MENU *menu,
void *userptr)
{ return(*(int *)0); }
@@ -541,7 +542,7 @@
#undef set_menu_win
int set_menu_win(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
diff --git a/menu/llib-lmenut b/menu/llib-lmenut
index 951719f..0a0d059 100644
--- a/menu/llib-lmenut
+++ b/menu/llib-lmenut
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 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 *
@@ -27,7 +28,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 2010 *
+ * Author: Thomas E. Dickey 2010-on *
****************************************************************************/
/* LINTLIBRARY */
@@ -37,7 +38,7 @@
#undef set_menu_fore
int set_menu_fore(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -48,7 +49,7 @@
#undef set_menu_back
int set_menu_back(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -59,7 +60,7 @@
#undef set_menu_grey
int set_menu_grey(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -72,9 +73,9 @@
#undef _nc_menu_cursor_pos
int _nc_menu_cursor_pos(
- const MENU *menu,
- const ITEM *item,
- int *pY,
+ const MENU *menu,
+ const ITEM *item,
+ int *pY,
int *pX)
{ return(*(int *)0); }
@@ -87,14 +88,14 @@
#undef _nc_Match_Next_Character_In_Item_Name
int _nc_Match_Next_Character_In_Item_Name(
- MENU *menu,
- int ch,
+ MENU *menu,
+ int ch,
ITEM **item)
{ return(*(int *)0); }
#undef menu_driver
int menu_driver(
- MENU *menu,
+ MENU *menu,
int c)
{ return(*(int *)0); }
@@ -102,15 +103,15 @@
#undef set_menu_format
int set_menu_format(
- MENU *menu,
- int rows,
+ MENU *menu,
+ int rows,
int cols)
{ return(*(int *)0); }
#undef menu_format
void menu_format(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ /* void */ }
@@ -123,7 +124,7 @@
#undef _nc_Connect_Items
NCURSES_BOOL _nc_Connect_Items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(NCURSES_BOOL *)0); }
@@ -154,8 +155,8 @@
#undef _nc_New_TopRow_and_CurrentItem
void _nc_New_TopRow_and_CurrentItem(
- MENU *menu,
- int new_toprow,
+ MENU *menu,
+ int new_toprow,
ITEM *new_current_item)
{ /* void */ }
@@ -163,7 +164,7 @@
#undef set_menu_init
int set_menu_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -174,7 +175,7 @@
#undef set_menu_term
int set_menu_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -185,7 +186,7 @@
#undef set_item_init
int set_item_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -196,7 +197,7 @@
#undef set_item_term
int set_item_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -209,7 +210,7 @@
#undef set_current_item
int set_current_item(
- MENU *menu,
+ MENU *menu,
ITEM *item)
{ return(*(int *)0); }
@@ -239,7 +240,7 @@
#undef new_item
ITEM *new_item(
- const char *name,
+ const char *name,
const char *description)
{ return(*(ITEM **)0); }
@@ -250,7 +251,7 @@
#undef set_menu_mark
int set_menu_mark(
- MENU *menu,
+ MENU *menu,
const char *mark)
{ return(*(int *)0); }
@@ -263,19 +264,19 @@
#undef set_item_opts
int set_item_opts(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_off
int item_opts_off(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_on
int item_opts_on(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
@@ -288,7 +289,7 @@
#undef set_top_row
int set_top_row(
- MENU *menu,
+ MENU *menu,
int row)
{ return(*(int *)0); }
@@ -301,7 +302,7 @@
#undef set_item_userptr
int set_item_userptr(
- ITEM *item,
+ ITEM *item,
void *userptr)
{ return(*(int *)0); }
@@ -314,7 +315,7 @@
#undef set_item_value
int set_item_value(
- ITEM *item,
+ ITEM *item,
NCURSES_BOOL value)
{ return(*(int *)0); }
@@ -334,7 +335,7 @@
#undef set_menu_items
int set_menu_items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(int *)0); }
@@ -352,7 +353,7 @@
#undef new_menu_sp
MENU *new_menu_sp(
- SCREEN *sp,
+ SCREEN *sp,
ITEM **items)
{ return(*(MENU **)0); }
@@ -370,19 +371,19 @@
#undef set_menu_opts
int set_menu_opts(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_off
int menu_opts_off(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_on
int menu_opts_on(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
@@ -395,7 +396,7 @@
#undef set_menu_pad
int set_menu_pad(
- MENU *menu,
+ MENU *menu,
int pad)
{ return(*(int *)0); }
@@ -413,7 +414,7 @@
#undef set_menu_pattern
int set_menu_pattern(
- MENU *menu,
+ MENU *menu,
const char *p)
{ return(*(int *)0); }
@@ -421,7 +422,7 @@
#undef _nc_Post_Item
void _nc_Post_Item(
- const MENU *menu,
+ const MENU *menu,
const ITEM *item)
{ /* void */ }
@@ -456,8 +457,8 @@
#undef scale_menu
int scale_menu(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -465,17 +466,17 @@
#undef set_menu_spacing
int set_menu_spacing(
- MENU *menu,
- int s_desc,
- int s_row,
+ MENU *menu,
+ int s_desc,
+ int s_row,
int s_col)
{ return(*(int *)0); }
#undef menu_spacing
int menu_spacing(
- const MENU *menu,
- int *s_desc,
- int *s_row,
+ const MENU *menu,
+ int *s_desc,
+ int *s_row,
int *s_col)
{ return(*(int *)0); }
@@ -483,7 +484,7 @@
#undef set_menu_sub
int set_menu_sub(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
@@ -528,7 +529,7 @@
#undef set_menu_userptr
int set_menu_userptr(
- MENU *menu,
+ MENU *menu,
void *userptr)
{ return(*(int *)0); }
@@ -541,7 +542,7 @@
#undef set_menu_win
int set_menu_win(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
diff --git a/menu/llib-lmenutw b/menu/llib-lmenutw
index 0cd559e..0a0d059 100644
--- a/menu/llib-lmenutw
+++ b/menu/llib-lmenutw
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 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 *
@@ -27,7 +28,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 2010 *
+ * Author: Thomas E. Dickey 2010-on *
****************************************************************************/
/* LINTLIBRARY */
@@ -37,7 +38,7 @@
#undef set_menu_fore
int set_menu_fore(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -48,7 +49,7 @@
#undef set_menu_back
int set_menu_back(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -59,7 +60,7 @@
#undef set_menu_grey
int set_menu_grey(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -72,9 +73,9 @@
#undef _nc_menu_cursor_pos
int _nc_menu_cursor_pos(
- const MENU *menu,
- const ITEM *item,
- int *pY,
+ const MENU *menu,
+ const ITEM *item,
+ int *pY,
int *pX)
{ return(*(int *)0); }
@@ -87,14 +88,14 @@
#undef _nc_Match_Next_Character_In_Item_Name
int _nc_Match_Next_Character_In_Item_Name(
- MENU *menu,
- int ch,
+ MENU *menu,
+ int ch,
ITEM **item)
{ return(*(int *)0); }
#undef menu_driver
int menu_driver(
- MENU *menu,
+ MENU *menu,
int c)
{ return(*(int *)0); }
@@ -102,15 +103,15 @@
#undef set_menu_format
int set_menu_format(
- MENU *menu,
- int rows,
+ MENU *menu,
+ int rows,
int cols)
{ return(*(int *)0); }
#undef menu_format
void menu_format(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ /* void */ }
@@ -123,7 +124,7 @@
#undef _nc_Connect_Items
NCURSES_BOOL _nc_Connect_Items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(NCURSES_BOOL *)0); }
@@ -154,8 +155,8 @@
#undef _nc_New_TopRow_and_CurrentItem
void _nc_New_TopRow_and_CurrentItem(
- MENU *menu,
- int new_toprow,
+ MENU *menu,
+ int new_toprow,
ITEM *new_current_item)
{ /* void */ }
@@ -163,7 +164,7 @@
#undef set_menu_init
int set_menu_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -174,7 +175,7 @@
#undef set_menu_term
int set_menu_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -185,7 +186,7 @@
#undef set_item_init
int set_item_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -196,7 +197,7 @@
#undef set_item_term
int set_item_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -209,7 +210,7 @@
#undef set_current_item
int set_current_item(
- MENU *menu,
+ MENU *menu,
ITEM *item)
{ return(*(int *)0); }
@@ -237,11 +238,9 @@
/* ./m_item_new.c */
-#include <wctype.h>
-
#undef new_item
ITEM *new_item(
- const char *name,
+ const char *name,
const char *description)
{ return(*(ITEM **)0); }
@@ -252,7 +251,7 @@
#undef set_menu_mark
int set_menu_mark(
- MENU *menu,
+ MENU *menu,
const char *mark)
{ return(*(int *)0); }
@@ -265,19 +264,19 @@
#undef set_item_opts
int set_item_opts(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_off
int item_opts_off(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_on
int item_opts_on(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
@@ -290,7 +289,7 @@
#undef set_top_row
int set_top_row(
- MENU *menu,
+ MENU *menu,
int row)
{ return(*(int *)0); }
@@ -303,7 +302,7 @@
#undef set_item_userptr
int set_item_userptr(
- ITEM *item,
+ ITEM *item,
void *userptr)
{ return(*(int *)0); }
@@ -316,7 +315,7 @@
#undef set_item_value
int set_item_value(
- ITEM *item,
+ ITEM *item,
NCURSES_BOOL value)
{ return(*(int *)0); }
@@ -336,7 +335,7 @@
#undef set_menu_items
int set_menu_items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(int *)0); }
@@ -354,7 +353,7 @@
#undef new_menu_sp
MENU *new_menu_sp(
- SCREEN *sp,
+ SCREEN *sp,
ITEM **items)
{ return(*(MENU **)0); }
@@ -372,19 +371,19 @@
#undef set_menu_opts
int set_menu_opts(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_off
int menu_opts_off(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_on
int menu_opts_on(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
@@ -397,7 +396,7 @@
#undef set_menu_pad
int set_menu_pad(
- MENU *menu,
+ MENU *menu,
int pad)
{ return(*(int *)0); }
@@ -415,7 +414,7 @@
#undef set_menu_pattern
int set_menu_pattern(
- MENU *menu,
+ MENU *menu,
const char *p)
{ return(*(int *)0); }
@@ -423,7 +422,7 @@
#undef _nc_Post_Item
void _nc_Post_Item(
- const MENU *menu,
+ const MENU *menu,
const ITEM *item)
{ /* void */ }
@@ -458,8 +457,8 @@
#undef scale_menu
int scale_menu(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -467,17 +466,17 @@
#undef set_menu_spacing
int set_menu_spacing(
- MENU *menu,
- int s_desc,
- int s_row,
+ MENU *menu,
+ int s_desc,
+ int s_row,
int s_col)
{ return(*(int *)0); }
#undef menu_spacing
int menu_spacing(
- const MENU *menu,
- int *s_desc,
- int *s_row,
+ const MENU *menu,
+ int *s_desc,
+ int *s_row,
int *s_col)
{ return(*(int *)0); }
@@ -485,7 +484,7 @@
#undef set_menu_sub
int set_menu_sub(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
@@ -530,7 +529,7 @@
#undef set_menu_userptr
int set_menu_userptr(
- MENU *menu,
+ MENU *menu,
void *userptr)
{ return(*(int *)0); }
@@ -543,7 +542,7 @@
#undef set_menu_win
int set_menu_win(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
diff --git a/menu/llib-lmenuw b/menu/llib-lmenuw
index 0998f9b..d5566d4 100644
--- a/menu/llib-lmenuw
+++ b/menu/llib-lmenuw
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2002-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 *
@@ -27,7 +28,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 2002-2005,2010 *
+ * Author: Thomas E. Dickey 2002-on *
****************************************************************************/
/* LINTLIBRARY */
@@ -37,7 +38,7 @@
#undef set_menu_fore
int set_menu_fore(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -48,7 +49,7 @@
#undef set_menu_back
int set_menu_back(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -59,7 +60,7 @@
#undef set_menu_grey
int set_menu_grey(
- MENU *menu,
+ MENU *menu,
chtype attr)
{ return(*(int *)0); }
@@ -72,9 +73,9 @@
#undef _nc_menu_cursor_pos
int _nc_menu_cursor_pos(
- const MENU *menu,
- const ITEM *item,
- int *pY,
+ const MENU *menu,
+ const ITEM *item,
+ int *pY,
int *pX)
{ return(*(int *)0); }
@@ -87,14 +88,14 @@
#undef _nc_Match_Next_Character_In_Item_Name
int _nc_Match_Next_Character_In_Item_Name(
- MENU *menu,
- int ch,
+ MENU *menu,
+ int ch,
ITEM **item)
{ return(*(int *)0); }
#undef menu_driver
int menu_driver(
- MENU *menu,
+ MENU *menu,
int c)
{ return(*(int *)0); }
@@ -102,15 +103,15 @@
#undef set_menu_format
int set_menu_format(
- MENU *menu,
- int rows,
+ MENU *menu,
+ int rows,
int cols)
{ return(*(int *)0); }
#undef menu_format
void menu_format(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ /* void */ }
@@ -123,7 +124,7 @@
#undef _nc_Connect_Items
NCURSES_BOOL _nc_Connect_Items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(NCURSES_BOOL *)0); }
@@ -154,8 +155,8 @@
#undef _nc_New_TopRow_and_CurrentItem
void _nc_New_TopRow_and_CurrentItem(
- MENU *menu,
- int new_toprow,
+ MENU *menu,
+ int new_toprow,
ITEM *new_current_item)
{ /* void */ }
@@ -163,7 +164,7 @@
#undef set_menu_init
int set_menu_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -174,7 +175,7 @@
#undef set_menu_term
int set_menu_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -185,7 +186,7 @@
#undef set_item_init
int set_item_init(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -196,7 +197,7 @@
#undef set_item_term
int set_item_term(
- MENU *menu,
+ MENU *menu,
Menu_Hook func)
{ return(*(int *)0); }
@@ -209,7 +210,7 @@
#undef set_current_item
int set_current_item(
- MENU *menu,
+ MENU *menu,
ITEM *item)
{ return(*(int *)0); }
@@ -237,11 +238,9 @@
/* ./m_item_new.c */
-#include <wctype.h>
-
#undef new_item
ITEM *new_item(
- const char *name,
+ const char *name,
const char *description)
{ return(*(ITEM **)0); }
@@ -252,7 +251,7 @@
#undef set_menu_mark
int set_menu_mark(
- MENU *menu,
+ MENU *menu,
const char *mark)
{ return(*(int *)0); }
@@ -265,19 +264,19 @@
#undef set_item_opts
int set_item_opts(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_off
int item_opts_off(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
#undef item_opts_on
int item_opts_on(
- ITEM *item,
+ ITEM *item,
Item_Options opts)
{ return(*(int *)0); }
@@ -290,7 +289,7 @@
#undef set_top_row
int set_top_row(
- MENU *menu,
+ MENU *menu,
int row)
{ return(*(int *)0); }
@@ -303,7 +302,7 @@
#undef set_item_userptr
int set_item_userptr(
- ITEM *item,
+ ITEM *item,
void *userptr)
{ return(*(int *)0); }
@@ -316,7 +315,7 @@
#undef set_item_value
int set_item_value(
- ITEM *item,
+ ITEM *item,
NCURSES_BOOL value)
{ return(*(int *)0); }
@@ -336,7 +335,7 @@
#undef set_menu_items
int set_menu_items(
- MENU *menu,
+ MENU *menu,
ITEM **items)
{ return(*(int *)0); }
@@ -354,7 +353,7 @@
#undef new_menu_sp
MENU *new_menu_sp(
- SCREEN *sp,
+ SCREEN *sp,
ITEM **items)
{ return(*(MENU **)0); }
@@ -372,19 +371,19 @@
#undef set_menu_opts
int set_menu_opts(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_off
int menu_opts_off(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
#undef menu_opts_on
int menu_opts_on(
- MENU *menu,
+ MENU *menu,
Menu_Options opts)
{ return(*(int *)0); }
@@ -397,7 +396,7 @@
#undef set_menu_pad
int set_menu_pad(
- MENU *menu,
+ MENU *menu,
int pad)
{ return(*(int *)0); }
@@ -415,7 +414,7 @@
#undef set_menu_pattern
int set_menu_pattern(
- MENU *menu,
+ MENU *menu,
const char *p)
{ return(*(int *)0); }
@@ -423,7 +422,7 @@
#undef _nc_Post_Item
void _nc_Post_Item(
- const MENU *menu,
+ const MENU *menu,
const ITEM *item)
{ /* void */ }
@@ -458,8 +457,8 @@
#undef scale_menu
int scale_menu(
- const MENU *menu,
- int *rows,
+ const MENU *menu,
+ int *rows,
int *cols)
{ return(*(int *)0); }
@@ -467,17 +466,17 @@
#undef set_menu_spacing
int set_menu_spacing(
- MENU *menu,
- int s_desc,
- int s_row,
+ MENU *menu,
+ int s_desc,
+ int s_row,
int s_col)
{ return(*(int *)0); }
#undef menu_spacing
int menu_spacing(
- const MENU *menu,
- int *s_desc,
- int *s_row,
+ const MENU *menu,
+ int *s_desc,
+ int *s_row,
int *s_col)
{ return(*(int *)0); }
@@ -485,7 +484,7 @@
#undef set_menu_sub
int set_menu_sub(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
@@ -530,7 +529,7 @@
#undef set_menu_userptr
int set_menu_userptr(
- MENU *menu,
+ MENU *menu,
void *userptr)
{ return(*(int *)0); }
@@ -543,7 +542,7 @@
#undef set_menu_win
int set_menu_win(
- MENU *menu,
+ MENU *menu,
WINDOW *win)
{ return(*(int *)0); }
diff --git a/menu/m_attribs.c b/menu/m_attribs.c
index eff90d6..a9275d0 100644
--- a/menu/m_attribs.c
+++ b/menu/m_attribs.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_attribs.c,v 1.17 2012/03/10 23:43:41 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.20 2021/06/17 21:20:30 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
@@ -49,7 +50,7 @@
/* "Template" macro to generate a function to set a menus attribute */
#define GEN_MENU_ATTR_SET_FCT( name ) \
-NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
+MENU_EXPORT(int) NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
{\
T((T_CALLED("set_menu_" #name "(%p,%s)"), (void *) menu, _traceattr(attr))); \
if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
@@ -65,76 +66,76 @@
/* "Template" macro to generate a function to get a menu's attribute */
#define GEN_MENU_ATTR_GET_FCT( name ) \
-NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\
+MENU_EXPORT(chtype) NCURSES_API menu_ ## name (const MENU * menu)\
{\
T((T_CALLED("menu_" #name "(%p)"), (const void *) menu));\
returnAttr(Normalize_Menu( menu ) -> name);\
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_fore(MENU *menu, chtype attr)
-|
+|
| Description : Set the attribute for selectable items. In single-
| valued menus this is used to highlight the current
| item ((i.e. where the cursor is), in multi-valued
| menus this is used to highlight the selected items.
|
| Return Values : E_OK - success
-| E_BAD_ARGUMENT - an invalid value has been passed
+| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
GEN_MENU_ATTR_SET_FCT(fore)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : chtype menu_fore(const MENU* menu)
-|
+|
| Description : Return the attribute used for selectable items that
| are current (single-valued menu) or selected (multi-
-| valued menu).
+| valued menu).
|
| Return Values : Attribute value
+--------------------------------------------------------------------------*/
GEN_MENU_ATTR_GET_FCT(fore)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_back(MENU *menu, chtype attr)
-|
+|
| Description : Set the attribute for selectable but not yet selected
| items.
|
-| Return Values : E_OK - success
+| Return Values : E_OK - success
| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
GEN_MENU_ATTR_SET_FCT(back)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : chtype menu_back(const MENU *menu)
-|
+|
| Description : Return the attribute used for selectable but not yet
-| selected items.
+| selected items.
|
| Return Values : Attribute value
+--------------------------------------------------------------------------*/
GEN_MENU_ATTR_GET_FCT(back)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_grey(MENU *menu, chtype attr)
-|
+|
| Description : Set the attribute for unselectable items.
|
| Return Values : E_OK - success
-| E_BAD_ARGUMENT - an invalid value has been passed
+| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
GEN_MENU_ATTR_SET_FCT(grey)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : chtype menu_grey(const MENU *menu)
-|
+|
| Description : Return the attribute used for non-selectable items
|
| Return Values : Attribute value
diff --git a/menu/m_cursor.c b/menu/m_cursor.c
index 9891de4..b9b301d 100644
--- a/menu/m_cursor.c
+++ b/menu/m_cursor.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_cursor.c,v 1.22 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,16 +50,16 @@
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-_nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX)
+MENU_EXPORT(int)
+_nc_menu_cursor_pos(const MENU *menu, const ITEM *item, int *pY, int *pX)
{
if (!menu || !pX || !pY)
return (E_BAD_ARGUMENT);
else
{
- if ((ITEM *) 0 == item)
+ if ((ITEM *)0 == item)
item = menu->curitem;
- assert(item != (ITEM *) 0);
+ assert(item != (ITEM *)0);
if (!(menu->status & _POSTED))
return (E_NOT_POSTED);
@@ -79,19 +80,19 @@
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-pos_menu_cursor(const MENU * menu)
+MENU_EXPORT(int)
+pos_menu_cursor(const MENU *menu)
{
- WINDOW *win, *sub;
int x = 0, y = 0;
- int err = _nc_menu_cursor_pos(menu, (ITEM *) 0, &y, &x);
+ int err = _nc_menu_cursor_pos(menu, (ITEM *)0, &y, &x);
T((T_CALLED("pos_menu_cursor(%p)"), (const void *)menu));
if (E_OK == err)
{
- win = Get_Menu_UserWin(menu);
- sub = menu->usersub ? menu->usersub : win;
+ WINDOW *win = Get_Menu_UserWin(menu);
+ WINDOW *sub = menu->usersub ? menu->usersub : win;
+
assert(win && sub);
if ((menu->opt & O_SHOWMATCH) && (menu->pindex > 0))
diff --git a/menu/m_driver.c b/menu/m_driver.c
index 1a7a391..cf2ef2f 100644
--- a/menu/m_driver.c
+++ b/menu/m_driver.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_driver.c,v 1.31 2012/03/10 23:43:41 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.37 2021/03/27 23:46:29 tom Exp $")
/* Macros */
@@ -114,9 +115,9 @@
| Return Values : E_OK - an item matching the pattern was found
| E_NO_MATCH - nothing found
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+MENU_EXPORT(int)
_nc_Match_Next_Character_In_Item_Name
-(MENU * menu, int ch, ITEM ** item)
+(MENU *menu, int ch, ITEM **item)
{
bool found = FALSE, passed = FALSE;
int idx, last;
@@ -138,7 +139,7 @@
/* we artificially position one item back, because in the do...while
loop we start with the next item. This means, that with a new
pattern search we always start the scan with the actual item. If
- we do a NEXT_PATTERN oder PREV_PATTERN search, we start with the
+ we do a NEXT_PATTERN or PREV_PATTERN search, we start with the
one after or before the actual item. */
if (--idx < 0)
idx = menu->nitems - 1;
@@ -208,8 +209,8 @@
| E_BAD_STATE - menu is in user hook routine
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_driver(MENU * menu, int c)
+MENU_EXPORT(int)
+menu_driver(MENU *menu, int c)
{
#define NAVIGATE(dir) \
if (!item->dir)\
@@ -219,7 +220,7 @@
int result = E_OK;
ITEM *item;
- int my_top_row, rdiff;
+ int my_top_row;
T((T_CALLED("menu_driver(%p,%d)"), (void *)menu, c));
@@ -238,6 +239,8 @@
if ((c > KEY_MAX) && (c <= MAX_MENU_COMMAND))
{
+ int rdiff;
+
if (!((c == REQ_BACK_PATTERN)
|| (c == REQ_NEXT_MATCH) || (c == REQ_PREV_MATCH)))
{
@@ -488,16 +491,20 @@
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
- int i, x, y, err;
+ int x, y;
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
+ int i;
+
for (i = 0; i < menu->nitems; i++)
{
- err = _nc_menu_cursor_pos(menu, menu->items[i],
- &y, &x);
+ int err = _nc_menu_cursor_pos(menu,
+ menu->items[i],
+ &y, &x);
+
if (E_OK == err)
{
if ((ry == y) &&
@@ -530,7 +537,11 @@
}
}
else
- result = E_REQUEST_DENIED;
+ {
+ if (menu->opt & O_MOUSE_MENU)
+ ungetmouse(&event); /* let someone else handle this */
+ result = E_REQUEST_DENIED;
+ }
}
#endif /* NCURSES_MOUSE_VERSION */
else
diff --git a/menu/m_format.c b/menu/m_format.c
index 2d681a6..65adfc6 100644
--- a/menu/m_format.c
+++ b/menu/m_format.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_format.c,v 1.18 2012/06/09 23:54:02 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.22 2021/03/27 23:46:29 tom Exp $")
#define minimum(a,b) ((a)<(b) ? (a): (b))
@@ -55,10 +56,9 @@
| E_NOT_CONNECTED - there are no items connected
| E_POSTED - the menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_format(MENU * menu, int rows, int cols)
+MENU_EXPORT(int)
+set_menu_format(MENU *menu, int rows, int cols)
{
- int total_rows, total_cols;
T((T_CALLED("set_menu_format(%p,%d,%d)"), (void *)menu, rows, cols));
@@ -67,6 +67,8 @@
if (menu)
{
+ int total_rows, total_cols;
+
if (menu->status & _POSTED)
RETURN(E_POSTED);
@@ -119,8 +121,8 @@
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-menu_format(const MENU * menu, int *rows, int *cols)
+MENU_EXPORT(void)
+menu_format(const MENU *menu, int *rows, int *cols)
{
if (rows)
*rows = Normalize_Menu(menu)->frows;
diff --git a/menu/m_global.c b/menu/m_global.c
index fc4103c..4bc8ef8 100644
--- a/menu/m_global.c
+++ b/menu/m_global.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
+ * Copyright 1998-2012,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,11 +38,11 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.28 2014/03/15 20:37:22 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.34 2023/09/16 16:39:26 tom Exp $")
static char mark[] = "-";
/* *INDENT-OFF* */
-NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
+MENU_EXPORT_VAR(MENU) _nc_Default_Menu = {
16, /* Nr. of chars high */
1, /* Nr. of chars wide */
16, /* Nr. of items high */
@@ -53,7 +54,7 @@
0, /* length of widest description */
1, /* length of mark */
1, /* length of one item */
- 1, /* Spacing for descriptor */
+ 1, /* Spacing for descriptor */
1, /* Spacing for columns */
1, /* Spacing for rows */
(char *)0, /* buffer used to store match chars */
@@ -68,7 +69,7 @@
0, /* Top row of menu */
(chtype)A_REVERSE, /* Attribute for selection */
(chtype)A_NORMAL, /* Attribute for nonselection */
- (chtype)A_UNDERLINE, /* Attribute for inactive */
+ (chtype)A_UNDERLINE, /* Attribute for inactive */
' ', /* Pad character */
(Menu_Hook)0, /* Menu init */
(Menu_Hook)0, /* Menu term */
@@ -77,10 +78,10 @@
(void *)0, /* userptr */
mark, /* mark */
ALL_MENU_OPTS, /* options */
- 0 /* status */
+ 0 /* status */
};
-NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = {
+MENU_EXPORT_VAR(ITEM) _nc_Default_Item = {
{ (char *)0, 0 }, /* name */
{ (char *)0, 0 }, /* description */
(MENU *)0, /* Pointer to parent menu */
@@ -98,26 +99,26 @@
/* *INDENT-ON* */
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : static void ComputeMaximum_NameDesc_Lenths(MENU *menu)
-|
+|
| Description : Calculates the maximum name and description lengths
| of the items connected to the menu
|
| Return Values : -
+--------------------------------------------------------------------------*/
NCURSES_INLINE static void
-ComputeMaximum_NameDesc_Lengths(MENU * menu)
+ComputeMaximum_NameDesc_Lengths(MENU *menu)
{
unsigned MaximumNameLength = 0;
unsigned MaximumDescriptionLength = 0;
ITEM **items;
- unsigned check;
assert(menu && menu->items);
for (items = menu->items; *items; items++)
{
- check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+ unsigned check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+
if (check > MaximumNameLength)
MaximumNameLength = check;
@@ -132,16 +133,16 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : static void ResetConnectionInfo(MENU *, ITEM **)
-|
-| Description : Reset all informations in the menu and the items in
+|
+| Description : Reset all information in the menu and the items in
| the item array that indicates a connection
|
| Return Values : -
+--------------------------------------------------------------------------*/
NCURSES_INLINE static void
-ResetConnectionInfo(MENU * menu, ITEM ** items)
+ResetConnectionInfo(MENU *menu, ITEM **items)
{
ITEM **item;
@@ -149,18 +150,18 @@
for (item = items; *item; item++)
{
(*item)->index = 0;
- (*item)->imenu = (MENU *) 0;
+ (*item)->imenu = (MENU *)0;
}
if (menu->pattern)
free(menu->pattern);
menu->pattern = (char *)0;
menu->pindex = 0;
- menu->items = (ITEM **) 0;
+ menu->items = (ITEM **)0;
menu->nitems = 0;
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : bool _nc_Connect_Items(MENU *menu, ITEM **items)
|
| Description : Connect the items in the item array to the menu.
@@ -170,14 +171,15 @@
| Return Values : TRUE - successful connection
| FALSE - connection failed
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
-_nc_Connect_Items(MENU * menu, ITEM ** items)
+MENU_EXPORT(bool)
+_nc_Connect_Items(MENU *menu, ITEM **items)
{
- ITEM **item;
unsigned int ItemCount = 0;
if (menu && items)
{
+ ITEM **item;
+
for (item = items; *item; item++)
{
if ((*item)->imenu)
@@ -218,37 +220,37 @@
}
}
- /* If we fall through to this point, we have to reset all items connection
+ /* If we fall through to this point, we have to reset all items connection
and inform about a reject connection */
ResetConnectionInfo(menu, items);
return (FALSE);
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void _nc_Disconnect_Items(MENU *menu)
-|
+|
| Description : Disconnect the menus item array from the menu
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Disconnect_Items(MENU * menu)
+MENU_EXPORT(void)
+_nc_Disconnect_Items(MENU *menu)
{
if (menu && menu->items)
ResetConnectionInfo(menu, menu->items);
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int _nc_Calculate_Text_Width(const TEXT * item)
-|
+|
| Description : Calculate the number of columns for a TEXT.
|
| Return Values : the width
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-_nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ )
+MENU_EXPORT(int)
+_nc_Calculate_Text_Width(const TEXT *item /*FIXME: limit length */ )
{
#if USE_WIDEC_SUPPORT
int result = item->length;
@@ -288,26 +290,22 @@
*/
#if USE_WIDEC_SUPPORT
static int
-calculate_actual_width(MENU * menu, bool name)
+calculate_actual_width(MENU *menu, bool name)
{
int width = 0;
- int check = 0;
- ITEM **items;
assert(menu && menu->items);
if (menu->items != 0)
{
+ ITEM **items;
+
for (items = menu->items; *items; items++)
{
- if (name)
- {
- check = _nc_Calculate_Text_Width(&((*items)->name));
- }
- else
- {
- check = _nc_Calculate_Text_Width(&((*items)->description));
- }
+ int check = (name
+ ? _nc_Calculate_Text_Width(&((*items)->name))
+ : _nc_Calculate_Text_Width(&((*items)->description)));
+
if (check > width)
width = check;
}
@@ -328,16 +326,16 @@
#endif
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void _nc_Calculate_Item_Length_and_Width(MENU *menu)
-|
+|
| Description : Calculate the length of an item and the width of the
| whole menu.
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Calculate_Item_Length_and_Width(MENU * menu)
+MENU_EXPORT(void)
+_nc_Calculate_Item_Length_and_Width(MENU *menu)
{
int l;
@@ -366,21 +364,21 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void _nc_Link_Item(MENU *menu)
-|
+|
| Description : Statically calculate for every item its four neighbors.
| This depends on the orientation of the menu. This
| static approach simplifies navigation in the menu a lot.
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Link_Items(MENU * menu)
+MENU_EXPORT(void)
+_nc_Link_Items(MENU *menu)
{
if (menu && menu->items && *(menu->items))
{
- int i, j;
+ int i;
ITEM *item;
int Number_Of_Items = menu->nitems;
int col = 0, row = 0;
@@ -407,14 +405,14 @@
(cycle ? menu->items[(Last_in_Row >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Row] :
- (ITEM *) 0);
+ (ITEM *)0);
item->right = ((col < (Number_Of_Columns - 1)) &&
((i + 1) < Number_Of_Items)
)?
menu->items[i + 1] :
(cycle ? menu->items[row * Number_Of_Columns] :
- (ITEM *) 0
+ (ITEM *)0
);
Last_in_Column = (menu->rows - 1) * Number_Of_Columns + col;
@@ -423,14 +421,14 @@
(cycle ? menu->items[(Last_in_Column >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Column] :
- (ITEM *) 0);
+ (ITEM *)0);
item->down = ((i + Number_Of_Columns) < Number_Of_Items)
?
menu->items[i + Number_Of_Columns] :
(cycle ? menu->items[(row + 1) < menu->rows ?
Number_Of_Items - 1 : col] :
- (ITEM *) 0);
+ (ITEM *)0);
item->x = (short)col;
item->y = (short)row;
if (++col == Number_Of_Columns)
@@ -443,6 +441,7 @@
else
{
int Number_Of_Rows = menu->rows;
+ int j;
for (j = 0; j < Number_Of_Items; j++)
{
@@ -455,12 +454,12 @@
(cycle ? (Last_in_Column >= Number_Of_Items) ?
menu->items[Last_in_Column - Number_Of_Rows] :
menu->items[Last_in_Column] :
- (ITEM *) 0);
+ (ITEM *)0);
item->right = ((i + Number_Of_Rows) < Number_Of_Items)
?
menu->items[i + Number_Of_Rows] :
- (cycle ? menu->items[row] : (ITEM *) 0);
+ (cycle ? menu->items[row] : (ITEM *)0);
Last_in_Row = col * Number_Of_Rows + (Number_Of_Rows - 1);
@@ -470,7 +469,7 @@
menu->items[(Last_in_Row >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Row] :
- (ITEM *) 0);
+ (ITEM *)0);
item->down = (row < (Number_Of_Rows - 1))
?
@@ -479,7 +478,7 @@
(col - 1) * Number_Of_Rows + row + 1]) :
(cycle ?
menu->items[col * Number_Of_Rows] :
- (ITEM *) 0
+ (ITEM *)0
);
item->x = (short)col;
@@ -495,22 +494,22 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void _nc_Show_Menu(const MENU* menu)
-|
+|
| Description : Update the window that is associated with the menu
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Show_Menu(const MENU * menu)
+MENU_EXPORT(void)
+_nc_Show_Menu(const MENU *menu)
{
- WINDOW *win;
- int maxy, maxx;
-
assert(menu);
if ((menu->status & _POSTED) && !(menu->status & _IN_DRIVER))
{
+ WINDOW *win;
+ int maxy, maxx;
+
/* adjust the internal subwindow to start on the current top */
assert(menu->sub);
mvderwin(menu->sub, menu->spc_rows * menu->toprow, 0);
@@ -530,31 +529,31 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void _nc_New_TopRow_and_CurrentItem(
-| MENU *menu,
-| int new_toprow,
+| MENU *menu,
+| int new_toprow,
| ITEM *new_current_item)
-|
+|
| Description : Redisplay the menu so that the given row becomes the
| top row and the given item becomes the new current
| item.
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
+MENU_EXPORT(void)
_nc_New_TopRow_and_CurrentItem(
- MENU * menu,
+ MENU *menu,
int new_toprow,
- ITEM * new_current_item)
+ ITEM *new_current_item)
{
- ITEM *cur_item;
- bool mterm_called = FALSE;
- bool iterm_called = FALSE;
-
assert(menu);
if (menu->status & _POSTED)
{
+ ITEM *cur_item;
+ bool mterm_called = FALSE;
+ bool iterm_called = FALSE;
+
if (new_current_item != menu->curitem)
{
Call_Hook(menu, itemterm);
@@ -569,7 +568,7 @@
cur_item = menu->curitem;
assert(cur_item);
menu->toprow = (short)(((menu->rows - menu->frows) >= 0)
- ? min(menu->rows - menu->frows, new_toprow)
+ ? Min(menu->rows - menu->frows, new_toprow)
: 0);
menu->curitem = new_current_item;
@@ -593,7 +592,7 @@
else
{ /* if we are not posted, this is quite simple */
menu->toprow = (short)(((menu->rows - menu->frows) >= 0)
- ? min(menu->rows - menu->frows, new_toprow)
+ ? Min(menu->rows - menu->frows, new_toprow)
: 0);
menu->curitem = new_current_item;
}
diff --git a/menu/m_hook.c b/menu/m_hook.c
index 671fab6..c7d9fe9 100644
--- a/menu/m_hook.c
+++ b/menu/m_hook.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,29 +38,30 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_hook.c,v 1.16 2012/03/10 23:43:41 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.21 2021/06/17 21:26:02 tom Exp $")
/* "Template" macro to generate function to set application specific hook */
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
-NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
+MENU_EXPORT(int) NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
{\
- T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), (void *) menu, func));\
+ TR_FUNC_BFR(1);\
+ T((T_CALLED("set_" #typ "_" #name "(%p,%s)"), (void *) menu, TR_FUNC_ARG(0, func)));\
(Normalize_Menu(menu) -> typ ## name = func );\
RETURN(E_OK);\
}
/* "Template" macro to generate function to get application specific hook */
#define GEN_HOOK_GET_FUNCTION( typ, name ) \
-NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\
+MENU_EXPORT(Menu_Hook) NCURSES_API typ ## _ ## name ( const MENU *menu )\
{\
T((T_CALLED(#typ "_" #name "(%p)"), (const void *) menu));\
returnMenuHook(Normalize_Menu(menu) -> typ ## name);\
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_init(MENU *menu, void (*f)(MENU *))
-|
+|
| Description : Set user-exit which is called when menu is posted
| or just after the top row changes.
|
@@ -68,11 +70,11 @@
GEN_HOOK_SET_FUNCTION(menu, init)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void (*)(MENU *) menu_init(const MENU *menu)
-|
+|
| Description : Return address of user-exit function which is called
-| when a menu is posted or just after the top row
+| when a menu is posted or just after the top row
| changes.
|
| Return Values : Menu init function address or NULL
@@ -80,9 +82,9 @@
GEN_HOOK_GET_FUNCTION(menu, init)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_term (MENU *menu, void (*f)(MENU *))
-|
+|
| Description : Set user-exit which is called when menu is unposted
| or just before the top row changes.
|
@@ -91,11 +93,11 @@
GEN_HOOK_SET_FUNCTION(menu, term)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void (*)(MENU *) menu_term(const MENU *menu)
-|
+|
| Description : Return address of user-exit function which is called
-| when a menu is unposted or just before the top row
+| when a menu is unposted or just before the top row
| changes.
|
| Return Values : Menu finalization function address or NULL
@@ -103,9 +105,9 @@
GEN_HOOK_GET_FUNCTION(menu, term)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_item_init (MENU *menu, void (*f)(MENU *))
-|
+|
| Description : Set user-exit which is called when menu is posted
| or just after the current item changes.
|
@@ -114,11 +116,11 @@
GEN_HOOK_SET_FUNCTION(item, init)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void (*)(MENU *) item_init (const MENU *menu)
-|
+|
| Description : Return address of user-exit function which is called
-| when a menu is posted or just after the current item
+| when a menu is posted or just after the current item
| changes.
|
| Return Values : Item init function address or NULL
@@ -126,9 +128,9 @@
GEN_HOOK_GET_FUNCTION(item, init)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_item_term (MENU *menu, void (*f)(MENU *))
-|
+|
| Description : Set user-exit which is called when menu is unposted
| or just before the current item changes.
|
@@ -137,11 +139,11 @@
GEN_HOOK_SET_FUNCTION(item, term)
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void (*)(MENU *) item_init (const MENU *menu)
-|
+|
| Description : Return address of user-exit function which is called
-| when a menu is unposted or just before the current item
+| when a menu is unposted or just before the current item
| changes.
|
| Return Values : Item finalization function address or NULL
diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c
index 18b1a27..ed76518 100644
--- a/menu/m_item_cur.c
+++ b/menu/m_item_cur.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,18 +38,18 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_cur.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_cur.c,v 1.22 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_current_item(MENU *menu, const ITEM *item)
-|
+|
| Description : Make the item the current item
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_current_item(MENU * menu, ITEM * item)
+MENU_EXPORT(int)
+set_current_item(MENU *menu, ITEM *item)
{
T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item));
@@ -81,30 +82,30 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : ITEM *current_item(const MENU *menu)
-|
+|
| Description : Return the menus current item
|
| Return Values : Item pointer or NULL if failure
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(ITEM *)
-current_item(const MENU * menu)
+MENU_EXPORT(ITEM *)
+current_item(const MENU *menu)
{
T((T_CALLED("current_item(%p)"), (const void *)menu));
- returnItem((menu && menu->items) ? menu->curitem : (ITEM *) 0);
+ returnItem((menu && menu->items) ? menu->curitem : (ITEM *)0);
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int item_index(const ITEM *)
-|
+|
| Description : Return the logical index of this item.
|
| Return Values : The index or ERR if this is an invalid item pointer
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_index(const ITEM * item)
+MENU_EXPORT(int)
+item_index(const ITEM *item)
{
T((T_CALLED("item_index(%p)"), (const void *)item));
returnCode((item && item->imenu) ? item->index : ERR);
diff --git a/menu/m_item_nam.c b/menu/m_item_nam.c
index 3ed1d37..ce74531 100644
--- a/menu/m_item_nam.c
+++ b/menu/m_item_nam.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,33 +38,33 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_nam.c,v 1.15 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_nam.c,v 1.19 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : char *item_name(const ITEM *item)
-|
+|
| Description : Return name of menu item
|
| Return Values : See above; returns NULL if item is invalid
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
-item_name(const ITEM * item)
+MENU_EXPORT(const char *)
+item_name(const ITEM *item)
{
T((T_CALLED("item_name(%p)"), (const void *)item));
returnCPtr((item) ? item->name.str : (char *)0);
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : char *item_description(const ITEM *item)
-|
+|
| Description : Returns description of item
|
| Return Values : See above; Returns NULL if item is invalid
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
-item_description(const ITEM * item)
+MENU_EXPORT(const char *)
+item_description(const ITEM *item)
{
T((T_CALLED("item_description(%p)"), (const void *)item));
returnCPtr((item) ? item->description.str : (char *)0);
diff --git a/menu/m_item_new.c b/menu/m_item_new.c
index 710ef09..28b71ca 100644
--- a/menu/m_item_new.c
+++ b/menu/m_item_new.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020-2021 Thomas E. Dickey *
+ * Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -44,12 +45,12 @@
#endif
#endif
-MODULE_ID("$Id: m_item_new.c,v 1.33 2012/06/09 23:55:15 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.38 2021/06/17 21:26:02 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : bool Is_Printable_String(const char *s)
-|
+|
| Description : Checks whether or not the string contains only printable
| characters.
|
@@ -74,7 +75,7 @@
mbstowcs(temp, s, (unsigned)count);
for (n = 0; n < count; ++n)
- if (!iswprint((wint_t) temp[n]))
+ if (!iswprint((wint_t)temp[n]))
{
result = FALSE;
break;
@@ -97,16 +98,16 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : ITEM *new_item(char *name, char *description)
-|
+|
| Description : Create a new item with name and description. Return
| a pointer to this new item.
| N.B.: an item must(!) have a name.
|
| Return Values : The item pointer or NULL if creation failed.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(ITEM *)
+MENU_EXPORT(ITEM *)
new_item(const char *name, const char *description)
{
ITEM *item;
@@ -117,14 +118,16 @@
if (!name || (*name == '\0') || !Is_Printable_String(name))
{
- item = (ITEM *) 0;
+ item = (ITEM *)0;
SET_ERROR(E_BAD_ARGUMENT);
}
else
{
item = typeCalloc(ITEM, 1);
+
if (item)
{
+ T((T_CREATE("item %p"), (void *)item));
*item = _nc_Default_Item; /* hope we have struct assignment */
item->name.length = (unsigned short)strlen(name);
@@ -149,18 +152,18 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int free_item(ITEM *item)
-|
-| Description : Free the allocated storage for this item.
+|
+| Description : Free the allocated storage for this item.
| N.B.: a connected item can't be freed.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid value has been passed
-| E_CONNECTED - item is still connected to a menu
+| E_CONNECTED - item is still connected to a menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-free_item(ITEM * item)
+MENU_EXPORT(int)
+free_item(ITEM *item)
{
T((T_CALLED("free_item(%p)"), (void *)item));
@@ -176,24 +179,24 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_mark( MENU *menu, const char *mark )
-|
+|
| Description : Set the mark string used to indicate the current
| item (single-valued menu) or the selected items
| (multi-valued menu).
-| The mark argument may be NULL, in which case no
+| The mark argument may be NULL, in which case no
| marker is used.
-| This might be a little bit tricky, because this may
-| affect the geometry of the menu, which we don't allow
+| This might be a little bit tricky, because this may
+| affect the geometry of the menu, which we don't allow
| if it is already posted.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - an invalid value has been passed
| E_SYSTEM_ERROR - no memory to store mark
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_mark(MENU * menu, const char *mark)
+MENU_EXPORT(int)
+set_menu_mark(MENU *menu, const char *mark)
{
short l;
@@ -257,15 +260,15 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : char *menu_mark(const MENU *menu)
-|
+|
| Description : Return a pointer to the marker string
|
| Return Values : The marker string pointer or NULL if no marker defined
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
-menu_mark(const MENU * menu)
+MENU_EXPORT(const char *)
+menu_mark(const MENU *menu)
{
T((T_CALLED("menu_mark(%p)"), (const void *)menu));
returnPtr(Normalize_Menu(menu)->mark);
diff --git a/menu/m_item_opt.c b/menu/m_item_opt.c
index 91385da..495e409 100644
--- a/menu/m_item_opt.c
+++ b/menu/m_item_opt.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,12 +38,12 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_opt.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_opt.c,v 1.22 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : int set_item_opts(ITEM *item, Item_Options opts)
-|
+| Facility : libnmenu
+| Function : int set_item_opts(ITEM *item, Item_Options opts)
+|
| Description : Set the options of the item. If there are relevant
| changes, the item is connected and the menu is posted,
| the menu will be redisplayed.
@@ -50,8 +51,8 @@
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid item options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_item_opts(ITEM * item, Item_Options opts)
+MENU_EXPORT(int)
+set_item_opts(ITEM *item, Item_Options opts)
{
T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts));
@@ -85,16 +86,16 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : int item_opts_off(ITEM *item, Item_Options opts)
-|
+| Facility : libnmenu
+| Function : int item_opts_off(ITEM *item, Item_Options opts)
+|
| Description : Switch of the options for this item.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_opts_off(ITEM * item, Item_Options opts)
+MENU_EXPORT(int)
+item_opts_off(ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
@@ -113,16 +114,16 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : int item_opts_on(ITEM *item, Item_Options opts)
-|
+| Facility : libnmenu
+| Function : int item_opts_on(ITEM *item, Item_Options opts)
+|
| Description : Switch on the options for this item.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_opts_on(ITEM * item, Item_Options opts)
+MENU_EXPORT(int)
+item_opts_on(ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
@@ -142,15 +143,15 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : Item_Options item_opts(const ITEM *item)
-|
+| Facility : libnmenu
+| Function : Item_Options item_opts(const ITEM *item)
+|
| Description : Switch of the options for this item.
|
| Return Values : Items options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(Item_Options)
-item_opts(const ITEM * item)
+MENU_EXPORT(Item_Options)
+item_opts(const ITEM *item)
{
T((T_CALLED("item_opts(%p)"), (const void *)item));
returnItemOpts(ALL_ITEM_OPTS & Normalize_Item(item)->opt);
diff --git a/menu/m_item_top.c b/menu/m_item_top.c
index 752e20d..68303c7 100644
--- a/menu/m_item_top.c
+++ b/menu/m_item_top.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,30 +38,28 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_top.c,v 1.11 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.16 2021/06/17 21:11:08 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_top_row(MENU *menu, int row)
-|
+|
| Description : Makes the specified row the top row in the menu
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - not a menu pointer or invalid row
| E_NOT_CONNECTED - there are no items for the menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_top_row(MENU * menu, int row)
+MENU_EXPORT(int)
+set_top_row(MENU *menu, int row)
{
- ITEM *item;
-
T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row));
if (menu)
{
if (menu->status & _IN_DRIVER)
RETURN(E_BAD_STATE);
- if (menu->items == (ITEM **) 0)
+ if (menu->items == (ITEM **)0)
RETURN(E_NOT_CONNECTED);
if ((row < 0) || (row > (menu->rows - menu->arows)))
@@ -71,6 +70,8 @@
if (row != menu->toprow)
{
+ ITEM *item;
+
if (menu->status & _LINK_NEEDED)
_nc_Link_Items(menu);
@@ -84,15 +85,15 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int top_row(const MENU *)
-|
+|
| Description : Return the top row of the menu
|
| Return Values : The row number or ERR if there is no row
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-top_row(const MENU * menu)
+MENU_EXPORT(int)
+top_row(const MENU *menu)
{
T((T_CALLED("top_row(%p)"), (const void *)menu));
if (menu && menu->items && *(menu->items))
diff --git a/menu/m_item_use.c b/menu/m_item_use.c
index 8cf294b..52d087e 100644
--- a/menu/m_item_use.c
+++ b/menu/m_item_use.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,19 +38,19 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_use.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_use.c,v 1.21 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_item_userptr(ITEM *item, void *userptr)
-|
+|
| Description : Set the pointer that is reserved in any item to store
-| application relevant informations.
+| application relevant information.
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_item_userptr(ITEM * item, void *userptr)
+MENU_EXPORT(int)
+set_item_userptr(ITEM *item, void *userptr)
{
T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr));
Normalize_Item(item)->userptr = userptr;
@@ -57,17 +58,17 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void *item_userptr(const ITEM *item)
-|
+|
| Description : Return the pointer that is reserved in any item to store
-| application relevant informations.
+| application relevant information.
|
| Return Values : Value of the pointer. If no such pointer has been set,
| NULL is returned.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
-item_userptr(const ITEM * item)
+MENU_EXPORT(void *)
+item_userptr(const ITEM *item)
{
T((T_CALLED("item_userptr(%p)"), (const void *)item));
returnVoidPtr(Normalize_Item(item)->userptr);
diff --git a/menu/m_item_val.c b/menu/m_item_val.c
index 337dbfc..3163f4b 100644
--- a/menu/m_item_val.c
+++ b/menu/m_item_val.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,30 +38,28 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_val.c,v 1.15 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.20 2021/06/17 21:11:08 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_item_value(ITEM *item, int value)
-|
+|
| Description : Programmatically set the item's selection value. This is
| only allowed if the item is selectable at all and if
| it is not connected to a single-valued menu.
| If the item is connected to a posted menu, the menu
-| will be redisplayed.
+| will be redisplayed.
|
| Return Values : E_OK - success
| E_REQUEST_DENIED - not selectable or single valued menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_item_value(ITEM * item, bool value)
+MENU_EXPORT(int)
+set_item_value(ITEM *item, bool value)
{
- MENU *menu;
-
T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
if (item)
{
- menu = item->imenu;
+ MENU *menu = item->imenu;
if ((!(item->opt & O_SELECTABLE)) ||
(menu && (menu->opt & O_ONEVALUE)))
@@ -86,16 +85,16 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : bool item_value(const ITEM *item)
-|
+|
| Description : Return the selection value of the item
|
| Return Values : TRUE - if item is selected
| FALSE - if item is not selected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
-item_value(const ITEM * item)
+MENU_EXPORT(bool)
+item_value(const ITEM *item)
{
T((T_CALLED("item_value(%p)"), (const void *)item));
returnBool((Normalize_Item(item)->value) ? TRUE : FALSE);
diff --git a/menu/m_item_vis.c b/menu/m_item_vis.c
index ff84740..9ae4fdb 100644
--- a/menu/m_item_vis.c
+++ b/menu/m_item_vis.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,20 +38,20 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_vis.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_item_vis.c,v 1.20 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : bool item_visible(const ITEM *item)
-|
+|
| Description : A item is visible if it currently appears in the
| subwindow of a posted menu.
|
| Return Values : TRUE if visible
| FALSE if invisible
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
-item_visible(const ITEM * item)
+MENU_EXPORT(bool)
+item_visible(const ITEM *item)
{
MENU *menu;
diff --git a/menu/m_items.c b/menu/m_items.c
index 5397685..ecc5e2f 100644
--- a/menu/m_items.c
+++ b/menu/m_items.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2005,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,12 +38,12 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_items.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_items.c,v 1.21 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_items(MENU *menu, ITEM **items)
-|
+|
| Description : Sets the item pointer array connected to menu.
|
| Return Values : E_OK - success
@@ -52,8 +53,8 @@
| E_BAD_ARGUMENT - An incorrect menu or item array was
| passed to the function
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_items(MENU * menu, ITEM ** items)
+MENU_EXPORT(int)
+set_menu_items(MENU *menu, ITEM **items)
{
T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items));
@@ -77,31 +78,31 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : ITEM **menu_items(const MENU *menu)
-|
+|
| Description : Returns a pointer to the item pointer array of the menu
|
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(ITEM **)
-menu_items(const MENU * menu)
+MENU_EXPORT(ITEM **)
+menu_items(const MENU *menu)
{
T((T_CALLED("menu_items(%p)"), (const void *)menu));
- returnItemPtr(menu ? menu->items : (ITEM **) 0);
+ returnItemPtr(menu ? menu->items : (ITEM **)0);
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int item_count(const MENU *menu)
-|
+|
| Description : Get the number of items connected to the menu. If the
-| menu pointer is NULL we return -1.
+| menu pointer is NULL we return -1.
|
| Return Values : Number of items or -1 to indicate error.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_count(const MENU * menu)
+MENU_EXPORT(int)
+item_count(const MENU *menu)
{
T((T_CALLED("item_count(%p)"), (const void *)menu));
returnCode(menu ? menu->nitems : -1);
diff --git a/menu/m_new.c b/menu/m_new.c
index 79f9292..be17558 100644
--- a/menu/m_new.c
+++ b/menu/m_new.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,12 +38,12 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_new.c,v 1.21 2010/01/23 21:20:11 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.27 2021/06/17 21:26:02 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : MENU* _nc_new_menu(SCREEN*, ITEM **items)
-|
+|
| Description : Creates a new menu connected to the item pointer
| array items and returns a pointer to the new menu.
| The new menu is initialized with the values from the
@@ -50,8 +51,8 @@
|
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(MENU *)
-NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
+MENU_EXPORT(MENU *)
+NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM **items)
{
int err = E_SYSTEM_ERROR;
MENU *menu = typeCalloc(MENU, 1);
@@ -59,6 +60,7 @@
T((T_CALLED("new_menu(%p,%p)"), (void *)SP_PARM, (void *)items));
if (menu)
{
+ T((T_CREATE("menu %p"), (void *)menu));
*menu = _nc_Default_Menu;
menu->status = 0;
menu->rows = menu->frows;
@@ -76,7 +78,7 @@
{
err = E_NOT_CONNECTED;
free(menu);
- menu = (MENU *) 0;
+ menu = (MENU *)0;
}
else
err = E_OK;
@@ -90,9 +92,9 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : MENU *new_menu(ITEM **items)
-|
+|
| Description : Creates a new menu connected to the item pointer
| array items and returns a pointer to the new menu.
| The new menu is initialized with the values from the
@@ -101,26 +103,26 @@
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
#if NCURSES_SP_FUNCS
-NCURSES_EXPORT(MENU *)
-new_menu(ITEM ** items)
+MENU_EXPORT(MENU *)
+new_menu(ITEM **items)
{
return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items);
}
#endif
/*---------------------------------------------------------------------------
-| Facility : libnmenu
-| Function : int free_menu(MENU *menu)
-|
-| Description : Disconnects menu from its associated item pointer
+| Facility : libnmenu
+| Function : int free_menu(MENU *menu)
+|
+| Description : Disconnects menu from its associated item pointer
| array and frees the storage allocated for the menu.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - Invalid menu pointer passed
| E_POSTED - Menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-free_menu(MENU * menu)
+MENU_EXPORT(int)
+free_menu(MENU *menu)
{
T((T_CALLED("free_menu(%p)"), (void *)menu));
if (!menu)
diff --git a/menu/m_opts.c b/menu/m_opts.c
index bc6924b..bbf9459 100644
--- a/menu/m_opts.c
+++ b/menu/m_opts.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_opts.c,v 1.20 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_opts.c,v 1.23 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -52,8 +53,8 @@
| E_BAD_ARGUMENT - invalid menu options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_opts(MENU * menu, Menu_Options opts)
+MENU_EXPORT(int)
+set_menu_opts(MENU *menu, Menu_Options opts)
{
T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts));
@@ -85,7 +86,7 @@
{
ITEM **item;
- if (((item = menu->items) != (ITEM **) 0))
+ if (((item = menu->items) != (ITEM **)0))
for (; *item; item++)
(*item)->value = FALSE;
}
@@ -112,8 +113,8 @@
| E_BAD_ARGUMENT - invalid options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_opts_off(MENU * menu, Menu_Options opts)
+MENU_EXPORT(int)
+menu_opts_off(MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
@@ -145,8 +146,8 @@
| E_BAD_ARGUMENT - invalid menu options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_opts_on(MENU * menu, Menu_Options opts)
+MENU_EXPORT(int)
+menu_opts_on(MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
@@ -173,8 +174,8 @@
|
| Return Values : Menu options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(Menu_Options)
-menu_opts(const MENU * menu)
+MENU_EXPORT(Menu_Options)
+menu_opts(const MENU *menu)
{
T((T_CALLED("menu_opts(%p)"), (const void *)menu));
returnMenuOpts(ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
diff --git a/menu/m_pad.c b/menu/m_pad.c
index 0abaf67..008e19a 100644
--- a/menu/m_pad.c
+++ b/menu/m_pad.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_pad.c,v 1.13 2012/03/10 23:43:41 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.17 2021/06/17 21:20:30 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
@@ -48,20 +49,20 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_pad(MENU* menu, int pad)
-|
+|
| Description : Set the character to be used to separate the item name
-| from its description. This must be a printable
+| from its description. This must be a printable
| character.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_pad(MENU * menu, int pad)
+MENU_EXPORT(int)
+set_menu_pad(MENU *menu, int pad)
{
- bool do_refresh = (menu != (MENU *) 0);
+ bool do_refresh = (menu != (MENU *)0);
T((T_CALLED("set_menu_pad(%p,%d)"), (void *)menu, pad));
@@ -78,15 +79,15 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int menu_pad(const MENU *menu)
-|
+|
| Description : Return the value of the padding character
|
| Return Values : The pad character
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_pad(const MENU * menu)
+MENU_EXPORT(int)
+menu_pad(const MENU *menu)
{
T((T_CALLED("menu_pad(%p)"), (const void *)menu));
returnCode(Normalize_Menu(menu)->pad);
diff --git a/menu/m_pattern.c b/menu/m_pattern.c
index 1764d05..6fbef23 100644
--- a/menu/m_pattern.c
+++ b/menu/m_pattern.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2006,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,12 +38,12 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_pattern.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_pattern.c,v 1.20 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : char *menu_pattern(const MENU *menu)
-|
+|
| Description : Return the value of the pattern buffer.
|
| Return Values : NULL - if there is no pattern buffer allocated
@@ -50,8 +51,8 @@
| pattern is stored
| PatternString - as expected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(char *)
-menu_pattern(const MENU * menu)
+MENU_EXPORT(char *)
+menu_pattern(const MENU *menu)
{
static char empty[] = "";
@@ -60,9 +61,9 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_pattern(MENU *menu, const char *p)
-|
+|
| Description : Set the match pattern for a menu and position to the
| first item that matches.
|
@@ -72,8 +73,8 @@
| E_NOT_CONNECTED - no items connected to menu
| E_NO_MATCH - no item matches pattern
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_pattern(MENU * menu, const char *p)
+MENU_EXPORT(int)
+set_menu_pattern(MENU *menu, const char *p)
{
ITEM *matchitem;
int matchpos;
diff --git a/menu/m_post.c b/menu/m_post.c
index a26ba49..cb80230 100644
--- a/menu/m_post.c
+++ b/menu/m_post.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020-2021,2022 Thomas E. Dickey *
+ * Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.31 2012/06/09 23:54:35 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.38 2022/09/24 09:38:44 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -48,8 +49,8 @@
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Post_Item(const MENU * menu, const ITEM * item)
+MENU_EXPORT(void)
+_nc_Post_Item(const MENU *menu, const ITEM *item)
{
int i;
chtype ch;
@@ -57,7 +58,6 @@
int count = 0;
bool isfore = FALSE, isback = FALSE, isgrey = FALSE;
int name_len;
- int desc_len;
assert(menu->win);
@@ -131,6 +131,7 @@
{
int m = menu->spc_desc / 2;
int cy = -1, cx = -1;
+ int desc_len;
for (ch = ' ', i = 0; i < menu->spc_desc; i++)
{
@@ -196,13 +197,12 @@
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Draw_Menu(const MENU * menu)
+MENU_EXPORT(void)
+_nc_Draw_Menu(const MENU *menu)
{
ITEM *item = menu->items[0];
- ITEM *lasthor, *lastvert;
+ ITEM *lastvert;
ITEM *hitem;
- int y = 0;
chtype s_bkgd;
assert(item && menu->win);
@@ -212,45 +212,52 @@
werase(menu->win);
wbkgdset(menu->win, s_bkgd);
- lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *) 0 : item;
+ lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : item;
- do
+ if (item != NULL)
{
- wmove(menu->win, y, 0);
-
- hitem = item;
- lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *) 0 : hitem;
+ int y = 0;
do
{
- _nc_Post_Item(menu, hitem);
+ ITEM *lasthor;
- wattron(menu->win, (int)menu->back);
- if (((hitem = hitem->right) != lasthor) && hitem)
+ wmove(menu->win, y, 0);
+
+ hitem = item;
+ lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
+
+ do
{
- int i, j, cy, cx;
- chtype ch = ' ';
+ _nc_Post_Item(menu, hitem);
- getyx(menu->win, cy, cx);
- for (j = 0; j < menu->spc_rows; j++)
+ wattron(menu->win, (int)menu->back);
+ if (((hitem = hitem->right) != lasthor) && hitem)
{
- wmove(menu->win, cy + j, cx);
- for (i = 0; i < menu->spc_cols; i++)
+ int i, j, cy, cx;
+ chtype ch = ' ';
+
+ getyx(menu->win, cy, cx);
+ for (j = 0; j < menu->spc_rows; j++)
{
- waddch(menu->win, ch);
+ wmove(menu->win, cy + j, cx);
+ for (i = 0; i < menu->spc_cols; i++)
+ {
+ waddch(menu->win, ch);
+ }
}
+ wmove(menu->win, cy, cx + menu->spc_cols);
}
- wmove(menu->win, cy, cx + menu->spc_cols);
}
+ while (hitem && (hitem != lasthor));
+ wattroff(menu->win, (int)menu->back);
+
+ item = item->down;
+ y += menu->spc_rows;
+
}
- while (hitem && (hitem != lasthor));
- wattroff(menu->win, (int)menu->back);
-
- item = item->down;
- y += menu->spc_rows;
-
+ while (item && (item != lastvert));
}
- while (item && (item != lastvert));
}
/*---------------------------------------------------------------------------
@@ -266,8 +273,8 @@
| E_BAD_STATE - Menu in userexit routine
| E_POSTED - Menu already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-post_menu(MENU * menu)
+MENU_EXPORT(int)
+post_menu(MENU *menu)
{
T((T_CALLED("post_menu(%p)"), (void *)menu));
@@ -282,7 +289,6 @@
if (menu->items && *(menu->items))
{
- int y;
int h = 1 + menu->spc_rows * (menu->rows - 1);
WINDOW *win = Get_Menu_Window(menu);
@@ -290,7 +296,8 @@
if ((menu->win = newpad(h, menu->width)))
{
- y = (maxy >= h) ? h : maxy;
+ int y = (maxy >= h) ? h : maxy;
+
if (y >= menu->height)
y = menu->height;
if (!(menu->sub = subpad(menu->win, y, menu->width, 0, 0)))
@@ -338,8 +345,8 @@
| E_BAD_STATE - menu in userexit routine
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-unpost_menu(MENU * menu)
+MENU_EXPORT(int)
+unpost_menu(MENU *menu)
{
WINDOW *win;
diff --git a/menu/m_req_name.c b/menu/m_req_name.c
index cc0066d..c72116f 100644
--- a/menu/m_req_name.c
+++ b/menu/m_req_name.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2015 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2012,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 *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_req_name.c,v 1.23 2015/04/04 18:00:23 tom Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.27 2021/06/17 21:11:08 tom Exp $")
#define DATA(s) { s }
@@ -65,15 +66,15 @@
#define A_SIZE (sizeof(request_names)/sizeof(request_names[0]))
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : const char * menu_request_name (int request);
-|
+|
| Description : Get the external name of a menu request.
|
| Return Values : Pointer to name - on success
| NULL - on invalid request code
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
+MENU_EXPORT(const char *)
menu_request_name(int request)
{
T((T_CALLED("menu_request_name(%d)"), request));
@@ -87,27 +88,28 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int menu_request_by_name (const char *str);
-|
+|
| Description : Search for a request with this name.
|
| Return Values : Request Id - on success
| E_NO_MATCH - request not found
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+MENU_EXPORT(int)
menu_request_by_name(const char *str)
{
/* because the table is so small, it doesn't really hurt
to run sequentially through it.
*/
size_t i = 0;
- char buf[16];
T((T_CALLED("menu_request_by_name(%s)"), _nc_visbuf(str)));
if (str != 0 && (i = strlen(str)) != 0)
{
+ char buf[16];
+
if (i > sizeof(buf) - 2)
i = sizeof(buf) - 2;
memcpy(buf, str, i);
diff --git a/menu/m_scale.c b/menu/m_scale.c
index 068a1cc..9e7f81d 100644
--- a/menu/m_scale.c
+++ b/menu/m_scale.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,21 +38,21 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_scale.c,v 1.10 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_scale.c,v 1.14 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int scale_menu(const MENU *menu)
-|
+|
| Description : Returns the minimum window size necessary for the
-| subwindow of menu.
+| subwindow of menu.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid menu pointer
| E_NOT_CONNECTED - no items are connected to menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-scale_menu(const MENU * menu, int *rows, int *cols)
+MENU_EXPORT(int)
+scale_menu(const MENU *menu, int *rows, int *cols)
{
T((T_CALLED("scale_menu(%p,%p,%p)"),
(const void *)menu,
diff --git a/menu/m_spacing.c b/menu/m_spacing.c
index 01941f5..76f8d5c 100644
--- a/menu/m_spacing.c
+++ b/menu/m_spacing.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_spacing.c,v 1.19 2012/03/10 23:43:41 tom Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.22 2020/12/12 00:38:14 tom Exp $")
#define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
#define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
@@ -51,8 +52,8 @@
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col)
+MENU_EXPORT(int)
+set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col)
{
MENU *m; /* split for ATAC workaround */
@@ -86,8 +87,8 @@
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col)
+MENU_EXPORT(int)
+menu_spacing(const MENU *menu, int *s_desc, int *s_row, int *s_col)
{
const MENU *m; /* split for ATAC workaround */
diff --git a/menu/m_sub.c b/menu/m_sub.c
index 37529a0..a055245 100644
--- a/menu/m_sub.c
+++ b/menu/m_sub.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,19 +38,19 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_sub.c,v 1.12 2010/01/23 21:20:11 tom Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.16 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_sub(MENU *menu, WINDOW *win)
-|
+|
| Description : Sets the subwindow of the menu.
|
| Return Values : E_OK - success
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_sub(MENU * menu, WINDOW *win)
+MENU_EXPORT(int)
+set_menu_sub(MENU *menu, WINDOW *win)
{
T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win));
@@ -81,15 +82,15 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : WINDOW* menu_sub(const MENU *menu)
-|
+|
| Description : Returns a pointer to the subwindow of the menu
|
| Return Values : NULL on error, otherwise a pointer to the window
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
-menu_sub(const MENU * menu)
+MENU_EXPORT(WINDOW *)
+menu_sub(const MENU *menu)
{
const MENU *m = Normalize_Menu(menu);
diff --git a/menu/m_trace.c b/menu/m_trace.c
index 094ff86..331236c 100644
--- a/menu/m_trace.c
+++ b/menu/m_trace.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2004-2005,2010 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2004-2010,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -32,44 +33,45 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_trace.c,v 1.4 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_trace.c,v 1.9 2020/12/12 00:38:14 tom Exp $")
-NCURSES_EXPORT(ITEM *)
-_nc_retrace_item(ITEM * code)
+MENU_EXPORT(ITEM *)
+_nc_retrace_item(ITEM *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(ITEM **)
-_nc_retrace_item_ptr(ITEM ** code)
+MENU_EXPORT(ITEM **)
+_nc_retrace_item_ptr(ITEM **code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(Item_Options)
+MENU_EXPORT(Item_Options)
_nc_retrace_item_opts(Item_Options code)
{
T((T_RETURN("%d"), code));
return code;
}
-NCURSES_EXPORT(MENU *)
-_nc_retrace_menu(MENU * code)
+MENU_EXPORT(MENU *)
+_nc_retrace_menu(MENU *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(Menu_Hook)
+MENU_EXPORT(Menu_Hook)
_nc_retrace_menu_hook(Menu_Hook code)
{
- T((T_RETURN("%p"), code));
+ TR_FUNC_BFR(1);
+ T((T_RETURN("%s"), TR_FUNC_ARG(0, code)));
return code;
}
-NCURSES_EXPORT(Menu_Options)
+MENU_EXPORT(Menu_Options)
_nc_retrace_menu_opts(Menu_Options code)
{
T((T_RETURN("%d"), code));
diff --git a/menu/m_userptr.c b/menu/m_userptr.c
index a7359c9..72f2d4c 100644
--- a/menu/m_userptr.c
+++ b/menu/m_userptr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,19 +38,19 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_userptr.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_userptr.c,v 1.21 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_userptr(MENU *menu, void *userptr)
-|
+|
| Description : Set the pointer that is reserved in any menu to store
-| application relevant informations.
+| application relevant information.
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_userptr(MENU * menu, void *userptr)
+MENU_EXPORT(int)
+set_menu_userptr(MENU *menu, void *userptr)
{
T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr));
Normalize_Menu(menu)->userptr = userptr;
@@ -57,17 +58,17 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : void *menu_userptr(const MENU *menu)
-|
+|
| Description : Return the pointer that is reserved in any menu to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of the pointer. If no such pointer has been set,
| NULL is returned
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
-menu_userptr(const MENU * menu)
+MENU_EXPORT(void *)
+menu_userptr(const MENU *menu)
{
T((T_CALLED("menu_userptr(%p)"), (const void *)menu));
returnVoidPtr(Normalize_Menu(menu)->userptr);
diff --git a/menu/m_win.c b/menu/m_win.c
index d88fa67..4bb64e6 100644
--- a/menu/m_win.c
+++ b/menu/m_win.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -37,19 +38,19 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_win.c,v 1.17 2010/01/23 21:20:11 tom Exp $")
+MODULE_ID("$Id: m_win.c,v 1.21 2021/06/17 21:20:30 tom Exp $")
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : int set_menu_win(MENU *menu, WINDOW *win)
-|
+|
| Description : Sets the window of the menu.
|
| Return Values : E_OK - success
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_win(MENU * menu, WINDOW *win)
+MENU_EXPORT(int)
+set_menu_win(MENU *menu, WINDOW *win)
{
T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win));
@@ -81,15 +82,15 @@
}
/*---------------------------------------------------------------------------
-| Facility : libnmenu
+| Facility : libnmenu
| Function : WINDOW* menu_win(const MENU*)
-|
+|
| Description : Returns pointer to the window of the menu
|
| Return Values : NULL on error, otherwise pointer to window
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
-menu_win(const MENU * menu)
+MENU_EXPORT(WINDOW *)
+menu_win(const MENU *menu)
{
const MENU *m = Normalize_Menu(menu);
diff --git a/menu/menu.h b/menu/menu.h
index 4eeac01..e5a5372 100644
--- a/menu/menu.h
+++ b/menu/menu.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.h,v 1.20 2009/04/05 00:28:07 tom Exp $ */
+/* $Id: menu.h,v 1.26 2020/12/12 00:38:02 tom Exp $ */
#ifndef ETI_MENU
#define ETI_MENU
@@ -43,11 +44,23 @@
#include <eti.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
-typedef int Menu_Options;
-typedef int Item_Options;
+#if defined(BUILDING_MENU)
+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API
+#define MENU_EXPORT_VAR(type) MENU_IMPEXP type
+
+ typedef int Menu_Options;
+ typedef int Item_Options;
/* Menu options: */
#define O_ONEVALUE (0x01)
@@ -56,81 +69,91 @@
#define O_IGNORECASE (0x08)
#define O_SHOWMATCH (0x10)
#define O_NONCYCLIC (0x20)
+#define O_MOUSE_MENU (0x40)
/* Item options: */
#define O_SELECTABLE (0x01)
-typedef struct
-{
- const char* str;
- unsigned short length;
-} TEXT;
+#if !NCURSES_OPAQUE_MENU
+ typedef struct
+ {
+ const char *str;
+ unsigned short length;
+ }
+ TEXT;
+#endif /* !NCURSES_OPAQUE_MENU */
-typedef struct tagITEM
-{
- TEXT name; /* name of menu item */
- TEXT description; /* description of item, optional in display */
- struct tagMENU *imenu; /* Pointer to parent menu */
- void *userptr; /* Pointer to user defined per item data */
- Item_Options opt; /* Item options */
- short index; /* Item number if connected to a menu */
- short y; /* y and x location of item in menu */
- short x;
- bool value; /* Selection value */
-
- struct tagITEM *left; /* neighbor items */
- struct tagITEM *right;
- struct tagITEM *up;
- struct tagITEM *down;
+ struct tagMENU;
-} ITEM;
+ typedef struct tagITEM
+#if !NCURSES_OPAQUE_MENU
+ {
+ TEXT name; /* name of menu item */
+ TEXT description; /* description of item, optional in display */
+ struct tagMENU *imenu; /* Pointer to parent menu */
+ void *userptr; /* Pointer to user defined per item data */
+ Item_Options opt; /* Item options */
+ short index; /* Item number if connected to a menu */
+ short y; /* y and x location of item in menu */
+ short x;
+ bool value; /* Selection value */
-typedef void (*Menu_Hook)(struct tagMENU *);
+ struct tagITEM *left; /* neighbor items */
+ struct tagITEM *right;
+ struct tagITEM *up;
+ struct tagITEM *down;
-typedef struct tagMENU
-{
- short height; /* Nr. of chars high */
- short width; /* Nr. of chars wide */
- short rows; /* Nr. of items high */
- short cols; /* Nr. of items wide */
- short frows; /* Nr. of formatted items high */
- short fcols; /* Nr. of formatted items wide */
- short arows; /* Nr. of items high (actual) */
- short namelen; /* Max. name length */
- short desclen; /* Max. description length */
- short marklen; /* Length of mark, if any */
- short itemlen; /* Length of one item */
- short spc_desc; /* Spacing for descriptor */
- short spc_cols; /* Spacing for columns */
- short spc_rows; /* Spacing for rows */
- char *pattern; /* Buffer to store match chars */
- short pindex; /* Index into pattern buffer */
- WINDOW *win; /* Window containing menu */
- WINDOW *sub; /* Subwindow for menu display */
- WINDOW *userwin; /* User's window */
- WINDOW *usersub; /* User's subwindow */
- ITEM **items; /* array of items */
- short nitems; /* Nr. of items in menu */
- ITEM *curitem; /* Current item */
- short toprow; /* Top row of menu */
- chtype fore; /* Selection attribute */
- chtype back; /* Nonselection attribute */
- chtype grey; /* Inactive attribute */
- unsigned char pad; /* Pad character */
+ }
+#endif /* !NCURSES_OPAQUE_MENU */
+ ITEM;
- Menu_Hook menuinit; /* User hooks */
- Menu_Hook menuterm;
- Menu_Hook iteminit;
- Menu_Hook itemterm;
+ typedef void (*Menu_Hook) (struct tagMENU *);
- void *userptr; /* Pointer to menus user data */
- char *mark; /* Pointer to marker string */
+ typedef struct tagMENU
+#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
+ {
+ short height; /* Nr. of chars high */
+ short width; /* Nr. of chars wide */
+ short rows; /* Nr. of items high */
+ short cols; /* Nr. of items wide */
+ short frows; /* Nr. of formatted items high */
+ short fcols; /* Nr. of formatted items wide */
+ short arows; /* Nr. of items high (actual) */
+ short namelen; /* Max. name length */
+ short desclen; /* Max. description length */
+ short marklen; /* Length of mark, if any */
+ short itemlen; /* Length of one item */
+ short spc_desc; /* Spacing for descriptor */
+ short spc_cols; /* Spacing for columns */
+ short spc_rows; /* Spacing for rows */
+ char *pattern; /* Buffer to store match chars */
+ short pindex; /* Index into pattern buffer */
+ WINDOW *win; /* Window containing menu */
+ WINDOW *sub; /* Subwindow for menu display */
+ WINDOW *userwin; /* User's window */
+ WINDOW *usersub; /* User's subwindow */
+ ITEM **items; /* array of items */
+ short nitems; /* Nr. of items in menu */
+ ITEM *curitem; /* Current item */
+ short toprow; /* Top row of menu */
+ chtype fore; /* Selection attribute */
+ chtype back; /* Nonselection attribute */
+ chtype grey; /* Inactive attribute */
+ unsigned char pad; /* Pad character */
- Menu_Options opt; /* Menu options */
- unsigned short status; /* Internal state of menu */
+ Menu_Hook menuinit; /* User hooks */
+ Menu_Hook menuterm;
+ Menu_Hook iteminit;
+ Menu_Hook itemterm;
-} MENU;
+ void *userptr; /* Pointer to menus user data */
+ char *mark; /* Pointer to marker string */
+ Menu_Options opt; /* Menu options */
+ unsigned short status; /* Internal state of menu */
+ }
+#endif /* !NCURSES_OPAQUE_MENU */
+ MENU;
/* Define keys */
@@ -169,92 +192,90 @@
# define MAX_COMMAND (KEY_MAX + 128)
#endif
-
/* --------- prototypes for libmenu functions ----------------------------- */
-extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *);
-extern NCURSES_EXPORT(ITEM *) current_item (const MENU *);
-extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *);
+ extern MENU_EXPORT(ITEM **) menu_items(const MENU *);
+ extern MENU_EXPORT(ITEM *) current_item(const MENU *);
+ extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);
-extern NCURSES_EXPORT(MENU *) new_menu (ITEM **);
+ extern MENU_EXPORT(MENU *) new_menu(ITEM **);
-extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *);
-extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *);
+ extern MENU_EXPORT(Item_Options) item_opts(const ITEM *);
+ extern MENU_EXPORT(Menu_Options) menu_opts(const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *);
+ extern MENU_EXPORT(Menu_Hook) item_init(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) item_term(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) menu_init(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) menu_term(const MENU *);
-extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *);
-extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *);
+ extern MENU_EXPORT(WINDOW *) menu_sub(const MENU *);
+ extern MENU_EXPORT(WINDOW *) menu_win(const MENU *);
-extern NCURSES_EXPORT(const char *) item_description (const ITEM *);
-extern NCURSES_EXPORT(const char *) item_name (const ITEM *);
-extern NCURSES_EXPORT(const char *) menu_mark (const MENU *);
-extern NCURSES_EXPORT(const char *) menu_request_name (int);
+ extern MENU_EXPORT(const char *) item_description(const ITEM *);
+ extern MENU_EXPORT(const char *) item_name(const ITEM *);
+ extern MENU_EXPORT(const char *) menu_mark(const MENU *);
+ extern MENU_EXPORT(const char *) menu_request_name(int);
-extern NCURSES_EXPORT(char *) menu_pattern (const MENU *);
+ extern MENU_EXPORT(char *) menu_pattern(const MENU *);
-extern NCURSES_EXPORT(void *) menu_userptr (const MENU *);
-extern NCURSES_EXPORT(void *) item_userptr (const ITEM *);
+ extern MENU_EXPORT(void *) menu_userptr(const MENU *);
+ extern MENU_EXPORT(void *) item_userptr(const ITEM *);
-extern NCURSES_EXPORT(chtype) menu_back (const MENU *);
-extern NCURSES_EXPORT(chtype) menu_fore (const MENU *);
-extern NCURSES_EXPORT(chtype) menu_grey (const MENU *);
+ extern MENU_EXPORT(chtype) menu_back(const MENU *);
+ extern MENU_EXPORT(chtype) menu_fore(const MENU *);
+ extern MENU_EXPORT(chtype) menu_grey(const MENU *);
-extern NCURSES_EXPORT(int) free_item (ITEM *);
-extern NCURSES_EXPORT(int) free_menu (MENU *);
-extern NCURSES_EXPORT(int) item_count (const MENU *);
-extern NCURSES_EXPORT(int) item_index (const ITEM *);
-extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) menu_driver (MENU *,int);
-extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options);
-extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options);
-extern NCURSES_EXPORT(int) menu_pad (const MENU *);
-extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *);
-extern NCURSES_EXPORT(int) post_menu (MENU *);
-extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *);
-extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item);
-extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *);
-extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool);
-extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int);
-extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **);
-extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *);
-extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options);
-extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int);
-extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *);
-extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *);
-extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *);
-extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *);
-extern NCURSES_EXPORT(int) set_top_row (MENU *,int);
-extern NCURSES_EXPORT(int) top_row (const MENU *);
-extern NCURSES_EXPORT(int) unpost_menu (MENU *);
-extern NCURSES_EXPORT(int) menu_request_by_name (const char *);
-extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int);
-extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *);
+ extern MENU_EXPORT(int) free_item(ITEM *);
+ extern MENU_EXPORT(int) free_menu(MENU *);
+ extern MENU_EXPORT(int) item_count(const MENU *);
+ extern MENU_EXPORT(int) item_index(const ITEM *);
+ extern MENU_EXPORT(int) item_opts_off(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) item_opts_on(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) menu_driver(MENU *, int);
+ extern MENU_EXPORT(int) menu_opts_off(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) menu_opts_on(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) menu_pad(const MENU *);
+ extern MENU_EXPORT(int) pos_menu_cursor(const MENU *);
+ extern MENU_EXPORT(int) post_menu(MENU *);
+ extern MENU_EXPORT(int) scale_menu(const MENU *, int *, int *);
+ extern MENU_EXPORT(int) set_current_item(MENU *menu, ITEM *item);
+ extern MENU_EXPORT(int) set_item_init(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_item_opts(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) set_item_term(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_item_userptr(ITEM *, void *);
+ extern MENU_EXPORT(int) set_item_value(ITEM *, bool);
+ extern MENU_EXPORT(int) set_menu_back(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_fore(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_format(MENU *, int, int);
+ extern MENU_EXPORT(int) set_menu_grey(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_init(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_menu_items(MENU *, ITEM **);
+ extern MENU_EXPORT(int) set_menu_mark(MENU *, const char *);
+ extern MENU_EXPORT(int) set_menu_opts(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) set_menu_pad(MENU *, int);
+ extern MENU_EXPORT(int) set_menu_pattern(MENU *, const char *);
+ extern MENU_EXPORT(int) set_menu_sub(MENU *, WINDOW *);
+ extern MENU_EXPORT(int) set_menu_term(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_menu_userptr(MENU *, void *);
+ extern MENU_EXPORT(int) set_menu_win(MENU *, WINDOW *);
+ extern MENU_EXPORT(int) set_top_row(MENU *, int);
+ extern MENU_EXPORT(int) top_row(const MENU *);
+ extern MENU_EXPORT(int) unpost_menu(MENU *);
+ extern MENU_EXPORT(int) menu_request_by_name(const char *);
+ extern MENU_EXPORT(int) set_menu_spacing(MENU *, int, int, int);
+ extern MENU_EXPORT(int) menu_spacing(const MENU *, int *, int *, int *);
+ extern MENU_EXPORT(bool) item_value(const ITEM *);
+ extern MENU_EXPORT(bool) item_visible(const ITEM *);
-extern NCURSES_EXPORT(bool) item_value (const ITEM *);
-extern NCURSES_EXPORT(bool) item_visible (const ITEM *);
-
-extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *);
+ extern MENU_EXPORT(void) menu_format(const MENU *, int *, int *);
#if NCURSES_SP_FUNCS
-extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+ extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN *, ITEM **);
#endif
#ifdef __cplusplus
- }
+}
#endif
-#endif /* ETI_MENU */
+#endif /* ETI_MENU */
diff --git a/menu/menu.priv.h b/menu/menu.priv.h
index b54b195..0bc6147 100644
--- a/menu/menu.priv.h
+++ b/menu/menu.priv.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.priv.h,v 1.25 2014/11/01 14:47:00 tom Exp $ */
+/* $Id: menu.priv.h,v 1.29 2020/05/24 01:40:20 anonymous.maarten Exp $ */
/***************************************************************************
* Module menu.priv.h *
@@ -42,14 +43,17 @@
/* *INDENT-OFF* */
#include "curses.priv.h"
+
+#define NCURSES_OPAQUE_MENU 0
+
#include "mf_common.h"
#include "menu.h"
/* Backspace code */
#define BS (8)
-extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item;
-extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
+extern MENU_EXPORT_VAR(ITEM) _nc_Default_Item;
+extern MENU_EXPORT_VAR(MENU) _nc_Default_Menu;
/* Normalize item to default if none was given */
#define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item)
@@ -78,7 +82,8 @@
O_ROWMAJOR | \
O_IGNORECASE | \
O_SHOWMATCH | \
- O_NONCYCLIC )
+ O_NONCYCLIC | \
+ O_MOUSE_MENU )
#define ALL_ITEM_OPTS (O_SELECTABLE)
@@ -115,17 +120,17 @@
#define UChar(c) ((unsigned char)(c))
/* Internal functions. */
-extern NCURSES_EXPORT(void) _nc_Draw_Menu (const MENU *);
-extern NCURSES_EXPORT(void) _nc_Show_Menu (const MENU *);
-extern NCURSES_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *);
-extern NCURSES_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *);
-extern NCURSES_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *);
-extern NCURSES_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **);
-extern NCURSES_EXPORT(void) _nc_Disconnect_Items (MENU *);
-extern NCURSES_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *);
-extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *);
-extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**);
-extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item,
+extern MENU_EXPORT(void) _nc_Draw_Menu (const MENU *);
+extern MENU_EXPORT(void) _nc_Show_Menu (const MENU *);
+extern MENU_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *);
+extern MENU_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *);
+extern MENU_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *);
+extern MENU_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **);
+extern MENU_EXPORT(void) _nc_Disconnect_Items (MENU *);
+extern MENU_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *);
+extern MENU_EXPORT(void) _nc_Link_Items (MENU *);
+extern MENU_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**);
+extern MENU_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item,
int* pY, int* pX);
#ifdef TRACE
@@ -137,12 +142,12 @@
#define returnMenuHook(code) TRACE_RETURN1(code,menu_hook)
#define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts)
-extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *);
-extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **);
-extern NCURSES_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options);
-extern NCURSES_EXPORT(MENU *) _nc_retrace_menu (MENU *);
-extern NCURSES_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook);
-extern NCURSES_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options);
+extern MENU_EXPORT(ITEM *) _nc_retrace_item (ITEM *);
+extern MENU_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **);
+extern MENU_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options);
+extern MENU_EXPORT(MENU *) _nc_retrace_menu (MENU *);
+extern MENU_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook);
+extern MENU_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options);
#else /* !TRACE */
diff --git a/menu/mf_common.h b/menu/mf_common.h
index cff6563..fcbd565 100644
--- a/menu/mf_common.h
+++ b/menu/mf_common.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2005,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: mf_common.h,v 0.24 2012/06/10 00:06:54 tom Exp $ */
+/* $Id: mf_common.h,v 0.25 2020/02/02 23:34:34 tom Exp $ */
/* Common internal header for menu and form library */
diff --git a/menu/modules b/menu/modules
index fac8fce..80ffb35 100644
--- a/menu/modules
+++ b/menu/modules
@@ -1,6 +1,7 @@
-# $Id: modules,v 1.18 2010/01/23 16:36:23 tom Exp $
+# $Id: modules,v 1.19 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 1998-2006,2010 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #