Update to ncurses-6.0

Change-Id: I98ab2ea8a5e13cca9f8b7cf6277b9b14a4da4299
diff --git a/menu/Makefile b/menu/Makefile
deleted file mode 100644
index 9d8a73f..0000000
--- a/menu/Makefile
+++ /dev/null
@@ -1,630 +0,0 @@
-# $Id: Makefile.in,v 1.48 2007/04/28 14:56:11 tom Exp $
-##############################################################################
-# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
-#                                                                            #
-# Permission is hereby granted, free of charge, to any person obtaining a    #
-# copy of this software and associated documentation files (the "Software"), #
-# 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		= 
-srcdir		= .
-prefix		= /usr/local
-exec_prefix	= ${prefix}
-bindir		= ${exec_prefix}/bin
-libdir		= ${exec_prefix}/lib
-includedir	= ${prefix}/include/ncurses
-
-LIBTOOL		= 
-LIBTOOL_CLEAN	= 
-LIBTOOL_COMPILE	= 
-LIBTOOL_LINK	= ${CC}
-LIBTOOL_INSTALL	= 
-LIBTOOL_UNINSTALL = 
-
-INSTALL		= /usr/bin/install -c
-INSTALL_LIB	= /usr/bin/install -c -m 644
-INSTALL_PROG	= ${INSTALL}
-INSTALL_DATA	= ${INSTALL} -m 644
-
-AR		= arm-eabi-ar
-AR_OPTS		= rv
-AWK		= mawk
-LD		= arm-eabi-ld
-LN_S		= ln -s
-
-CC		= agcc.pl
-CPP		= agcc.pl -E
-CFLAGS		= -O2 --param max-inline-insns-single=1200
-
-CPPFLAGS	= -I../ncurses -DHAVE_CONFIG_H -I. -I../include  -U_XOPEN_SOURCE -D_XOPEN_SOURCE=500 -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=199506L -DNDEBUG -I${includedir}
-
-CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
-
-CFLAGS_LIBTOOL	= $(CCFLAGS)
-CFLAGS_NORMAL	= $(CCFLAGS)
-CFLAGS_DEBUG	= $(CCFLAGS) -g -DTRACE
-CFLAGS_PROFILE	= $(CCFLAGS) -pg
-CFLAGS_SHARED	= $(CCFLAGS) unknown
-
-CFLAGS_DEFAULT	= $(CFLAGS_NORMAL)
-
-LINK		= $(LIBTOOL_LINK)
-LDFLAGS		=   
-
-SHLIB_DIRS	= -L../lib
-SHLIB_LIST	= $(SHLIB_DIRS) -lncurses 
-
-MK_SHARED_LIB	= echo unknown
-
-NCURSES_MAJOR	= 5
-NCURSES_MINOR	= 7
-REL_VERSION	= 5.7
-ABI_VERSION	= 5
-
-RANLIB		= arm-eabi-ranlib
-
-LIBRARIES	=  ../lib/libmenu.a ../lib/libmenu_g.a
-
-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) :
-	sh $(srcdir)/../mkdirs.sh $@
-
-# 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 $@
-
-MENU_PRIV_H = \
-	$(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)
-
-distclean :: clean
-	-rm -f Makefile
-
-realclean :: distclean
-
-###############################################################################
-# The remainder of this file is automatically generated during configuration
-###############################################################################
-
-# 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.
-clean ::
-	rm -f llib-lmenu.*
-
-realclean ::
-	rm -f llib-lmenu
-
-llib-lmenu : $(C_SRC)
-	cproto -a -l -DNCURSES_ENABLE_STDBOOL_H=0 -DLINT $(CPPFLAGS) $(C_SRC) >$@
-
-lintlib :
-	sh $(srcdir)/../misc/makellib menu $(CPPFLAGS)
-lint :
-	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(C_SRC) $(LINT_LIBS)
-
-# generated by mk-1st.awk (subset=ticlib+termlib+ext_tinfo+base+ext_funcs)
-#  name:          menu
-#  traces:        DEBUG
-#  MODEL:         NORMAL
-#  model:         objects
-#  prefix:        lib
-#  suffix:        .a
-#  subset:        ticlib+termlib+ext_tinfo+base+ext_funcs
-#  ShlibVer:      auto
-#  ShlibVerInfix: no
-#  TermlibRoot:   ncurses
-#  TermlibSuffix: .a
-#  ReLink:        
-#  DoLinks:       no
-#  rmSoLocs:      no
-#  ldconfig:      :
-#  overwrite:     no
-#  depend:        ../include/ncurses_cfg.h ./menu.priv.h
-#  host:          arm-unknown-eabi
-
-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) $(AR_OPTS) $@ $?
-	$(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: no
-#   traces:     DEBUG
-#   srcdir:     .
-
-../objects/m_attribs$o :	$(srcdir)/m_attribs.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_attribs.c -o ../objects/m_attribs$o
-
-../objects/m_cursor$o :	$(srcdir)/m_cursor.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_cursor.c -o ../objects/m_cursor$o
-
-../objects/m_driver$o :	$(srcdir)/m_driver.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_driver.c -o ../objects/m_driver$o
-
-../objects/m_format$o :	$(srcdir)/m_format.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_format.c -o ../objects/m_format$o
-
-../objects/m_global$o :	$(srcdir)/m_global.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_global.c -o ../objects/m_global$o
-
-../objects/m_hook$o :	$(srcdir)/m_hook.c \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_items.c -o ../objects/m_items$o
-
-../objects/m_new$o :	$(srcdir)/m_new.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_new.c -o ../objects/m_new$o
-
-../objects/m_opts$o :	$(srcdir)/m_opts.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_opts.c -o ../objects/m_opts$o
-
-../objects/m_pad$o :	$(srcdir)/m_pad.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_pad.c -o ../objects/m_pad$o
-
-../objects/m_pattern$o :	$(srcdir)/m_pattern.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_pattern.c -o ../objects/m_pattern$o
-
-../objects/m_post$o :	$(srcdir)/m_post.c \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_scale.c -o ../objects/m_scale$o
-
-../objects/m_spacing$o :	$(srcdir)/m_spacing.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_spacing.c -o ../objects/m_spacing$o
-
-../objects/m_sub$o :	$(srcdir)/m_sub.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_sub.c -o ../objects/m_sub$o
-
-../objects/m_userptr$o :	$(srcdir)/m_userptr.c \
-			$(MENU_PRIV_H)
-	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS_NORMAL) -c ../menu/m_userptr.c -o ../objects/m_userptr$o
-
-../objects/m_win$o :	$(srcdir)/m_win.c \
-			$(MENU_PRIV_H)
-	$(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
-#  model:         obj_g
-#  prefix:        lib
-#  suffix:        _g.a
-#  subset:        ticlib+termlib+ext_tinfo+base+ext_funcs
-#  ShlibVer:      auto
-#  ShlibVerInfix: no
-#  TermlibRoot:   ncurses
-#  TermlibSuffix: .a
-#  ReLink:        
-#  DoLinks:       no
-#  rmSoLocs:      no
-#  ldconfig:      :
-#  overwrite:     no
-#  depend:        ../include/ncurses_cfg.h ./menu.priv.h
-#  host:          arm-unknown-eabi
-
-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) $(AR_OPTS) $@ $?
-	$(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: no
-#   traces:     DEBUG
-#   srcdir:     .
-
-../obj_g/m_attribs$o :	$(srcdir)/m_attribs.c \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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 \
-			$(MENU_PRIV_H)
-	$(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
-
-${DESTDIR}${includedir} :
-	sh ${srcdir}/../mkdirs.sh $@
-
-install \
-install.libs \
-install.includes :: ${AUTO_SRC} ${DESTDIR}${includedir} \
-		$(srcdir)/eti.h \
-		$(srcdir)/menu.h
-	@ (cd ${DESTDIR}${includedir} && rm -f eti.h) ; ../headers.sh ${INSTALL_DATA} ${DESTDIR}${includedir} ${srcdir} $(srcdir)/eti.h
-	@ (cd ${DESTDIR}${includedir} && rm -f menu.h) ; ../headers.sh ${INSTALL_DATA} ${DESTDIR}${includedir} ${srcdir} $(srcdir)/menu.h
-
-uninstall \
-uninstall.libs \
-uninstall.includes ::
-	-@ (cd ${DESTDIR}${includedir} && rm -f eti.h)
-	-@ (cd ${DESTDIR}${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 fc33dc7..9bf1fe3 100644
--- a/menu/Makefile.in
+++ b/menu/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.48 2007/04/28 14:56:11 tom Exp $
+# $Id: Makefile.in,v 1.64 2015/08/05 23:15:41 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -42,7 +42,8 @@
 # turn off _all_ suffix rules; we'll generate our own
 .SUFFIXES:
 
-SHELL		= /bin/sh
+SHELL		= @SHELL@
+VPATH		= @srcdir@
 THIS		= Makefile
 
 x		= @EXEEXT@
@@ -50,19 +51,27 @@
 
 MODEL		= @DFT_LWR_MODEL@
 DESTDIR		= @DESTDIR@
+top_srcdir	= @top_srcdir@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
 libdir		= @libdir@
 includedir	= @includedir@
+includesubdir	= @includesubdir@
+
+INCLUDEDIR	= $(DESTDIR)$(includedir)$(includesubdir)
+
+PACKAGE		= @PACKAGE@
 
 LIBTOOL		= @LIBTOOL@
+LIBTOOL_OPTS	= @LIBTOOL_OPTS@ @EXPORT_SYMS@
 LIBTOOL_CLEAN	= @LIB_CLEAN@
 LIBTOOL_COMPILE	= @LIB_COMPILE@
 LIBTOOL_LINK	= @LIB_LINK@
 LIBTOOL_INSTALL	= @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LT_UNDEF	= @LT_UNDEF@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -70,16 +79,19 @@
 INSTALL_DATA	= @INSTALL_DATA@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 AWK		= @AWK@
 LD		= @LD@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
 
-CPPFLAGS	= -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
+CPPFLAGS	= -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
@@ -95,8 +107,11 @@
 LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
 
 SHLIB_DIRS	= -L../lib
-SHLIB_LIST	= $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
+SHLIB_LIST	= $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@
 
+RPATH_LIST	= @RPATH_LIST@
+RESULTING_SYMS	= @RESULTING_SYMS@
+VERSIONED_SYMS	= @VERSIONED_SYMS@
 MK_SHARED_LIB	= @MK_SHARED_LIB@
 
 NCURSES_MAJOR	= @NCURSES_MAJOR@
@@ -106,7 +121,7 @@
 
 RANLIB		= @LIB_PREP@
 
-LIBRARIES	= @LIBS_TO_MAKE@
+LIBRARIES	= @Libs_To_Make@
 
 LINT		= @LINT@
 LINT_OPTS	= @LINT_OPTS@
@@ -126,7 +141,7 @@
 
 $(DESTDIR)$(bindir) \
 $(DESTDIR)$(libdir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 # make copies to simplify include-paths while still keeping menu's include
 # file in this directory.
@@ -140,22 +155,23 @@
 	-rm -f $@
 	cp $(srcdir)/mf_common.h $@
 
-MENU_PRIV_H = \
+HEADER_DEPS = \
 	$(srcdir)/menu.priv.h \
 	$(AUTO_SRC) \
 	../include/curses.h
 
 tags:
-	ctags *.[ch]
+	$(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
 
 clean :: mostlyclean
 	-rm -f $(AUTO_SRC)
+	-rm -rf .libs *.dSYM
 
 distclean :: clean
 	-rm -f Makefile
diff --git a/menu/llib-lmenu b/menu/llib-lmenu
index fc17cc3..13ecaf8 100644
--- a/menu/llib-lmenu
+++ b/menu/llib-lmenu
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2002,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey        1996-2002,2005                          *
+ *  Author: Thomas E. Dickey        1996-2005,2010                          *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./m_attribs.c */
 
-#include "menu.priv.h"
+#include <menu.priv.h>
 
 #undef set_menu_fore
 int	set_menu_fore(
@@ -350,6 +350,12 @@
 
 /* ./m_new.c */
 
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
 #undef new_menu
 MENU	*new_menu(
 		ITEM	**items)
diff --git a/menu/llib-lmenut b/menu/llib-lmenut
new file mode 100644
index 0000000..951719f
--- /dev/null
+++ b/menu/llib-lmenut
@@ -0,0 +1,551 @@
+/****************************************************************************
+ * Copyright (c) 2010 Free Software Foundation, Inc.                        *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey        2010                                    *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./m_attribs.c */
+
+#include <menu.priv.h>
+
+#undef set_menu_fore
+int	set_menu_fore(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_fore
+chtype	menu_fore(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_back
+int	set_menu_back(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_back
+chtype	menu_back(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_grey
+int	set_menu_grey(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_grey
+chtype	menu_grey(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+/* ./m_cursor.c */
+
+#undef _nc_menu_cursor_pos
+int	_nc_menu_cursor_pos(
+		const MENU *menu, 
+		const ITEM *item, 
+		int	*pY, 
+		int	*pX)
+		{ return(*(int *)0); }
+
+#undef pos_menu_cursor
+int	pos_menu_cursor(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_driver.c */
+
+#undef _nc_Match_Next_Character_In_Item_Name
+int	_nc_Match_Next_Character_In_Item_Name(
+		MENU	*menu, 
+		int	ch, 
+		ITEM	**item)
+		{ return(*(int *)0); }
+
+#undef menu_driver
+int	menu_driver(
+		MENU	*menu, 
+		int	c)
+		{ return(*(int *)0); }
+
+/* ./m_format.c */
+
+#undef set_menu_format
+int	set_menu_format(
+		MENU	*menu, 
+		int	rows, 
+		int	cols)
+		{ return(*(int *)0); }
+
+#undef menu_format
+void	menu_format(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ /* void */ }
+
+/* ./m_global.c */
+
+#undef _nc_Default_Menu
+MENU	_nc_Default_Menu;
+#undef _nc_Default_Item
+ITEM	_nc_Default_Item;
+
+#undef _nc_Connect_Items
+NCURSES_BOOL _nc_Connect_Items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_Disconnect_Items
+void	_nc_Disconnect_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Calculate_Text_Width
+int	_nc_Calculate_Text_Width(
+		const TEXT *item)
+		{ return(*(int *)0); }
+
+#undef _nc_Calculate_Item_Length_and_Width
+void	_nc_Calculate_Item_Length_and_Width(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Link_Items
+void	_nc_Link_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Show_Menu
+void	_nc_Show_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef _nc_New_TopRow_and_CurrentItem
+void	_nc_New_TopRow_and_CurrentItem(
+		MENU	*menu, 
+		int	new_toprow, 
+		ITEM	*new_current_item)
+		{ /* void */ }
+
+/* ./m_hook.c */
+
+#undef set_menu_init
+int	set_menu_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_init
+Menu_Hook menu_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_menu_term
+int	set_menu_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_term
+Menu_Hook menu_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_init
+int	set_item_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_init
+Menu_Hook item_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_term
+int	set_item_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_term
+Menu_Hook item_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+/* ./m_item_cur.c */
+
+#undef set_current_item
+int	set_current_item(
+		MENU	*menu, 
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef current_item
+ITEM	*current_item(
+		const MENU *menu)
+		{ return(*(ITEM **)0); }
+
+#undef item_index
+int	item_index(
+		const ITEM *item)
+		{ return(*(int *)0); }
+
+/* ./m_item_nam.c */
+
+#undef item_name
+const char *item_name(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+#undef item_description
+const char *item_description(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+/* ./m_item_new.c */
+
+#undef new_item
+ITEM	*new_item(
+		const char *name, 
+		const char *description)
+		{ return(*(ITEM **)0); }
+
+#undef free_item
+int	free_item(
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef set_menu_mark
+int	set_menu_mark(
+		MENU	*menu, 
+		const char *mark)
+		{ return(*(int *)0); }
+
+#undef menu_mark
+const char *menu_mark(
+		const MENU *menu)
+		{ return(*(const char **)0); }
+
+/* ./m_item_opt.c */
+
+#undef set_item_opts
+int	set_item_opts(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_off
+int	item_opts_off(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_on
+int	item_opts_on(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts
+Item_Options item_opts(
+		const ITEM *item)
+		{ return(*(Item_Options *)0); }
+
+/* ./m_item_top.c */
+
+#undef set_top_row
+int	set_top_row(
+		MENU	*menu, 
+		int	row)
+		{ return(*(int *)0); }
+
+#undef top_row
+int	top_row(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_item_use.c */
+
+#undef set_item_userptr
+int	set_item_userptr(
+		ITEM	*item, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef item_userptr
+void	*item_userptr(
+		const ITEM *item)
+		{ return(*(void **)0); }
+
+/* ./m_item_val.c */
+
+#undef set_item_value
+int	set_item_value(
+		ITEM	*item, 
+		NCURSES_BOOL value)
+		{ return(*(int *)0); }
+
+#undef item_value
+NCURSES_BOOL item_value(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_item_vis.c */
+
+#undef item_visible
+NCURSES_BOOL item_visible(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_items.c */
+
+#undef set_menu_items
+int	set_menu_items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(int *)0); }
+
+#undef menu_items
+ITEM	**menu_items(
+		const MENU *menu)
+		{ return(*(ITEM ***)0); }
+
+#undef item_count
+int	item_count(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_new.c */
+
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef new_menu
+MENU	*new_menu(
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef free_menu
+int	free_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_opts.c */
+
+#undef set_menu_opts
+int	set_menu_opts(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_off
+int	menu_opts_off(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_on
+int	menu_opts_on(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts
+Menu_Options menu_opts(
+		const MENU *menu)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_pad.c */
+
+#undef set_menu_pad
+int	set_menu_pad(
+		MENU	*menu, 
+		int	pad)
+		{ return(*(int *)0); }
+
+#undef menu_pad
+int	menu_pad(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_pattern.c */
+
+#undef menu_pattern
+char	*menu_pattern(
+		const MENU *menu)
+		{ return(*(char **)0); }
+
+#undef set_menu_pattern
+int	set_menu_pattern(
+		MENU	*menu, 
+		const char *p)
+		{ return(*(int *)0); }
+
+/* ./m_post.c */
+
+#undef _nc_Post_Item
+void	_nc_Post_Item(
+		const MENU *menu, 
+		const ITEM *item)
+		{ /* void */ }
+
+#undef _nc_Draw_Menu
+void	_nc_Draw_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef post_menu
+int	post_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+#undef unpost_menu
+int	unpost_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_req_name.c */
+
+#undef menu_request_name
+const char *menu_request_name(
+		int	request)
+		{ return(*(const char **)0); }
+
+#undef menu_request_by_name
+int	menu_request_by_name(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./m_scale.c */
+
+#undef scale_menu
+int	scale_menu(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ return(*(int *)0); }
+
+/* ./m_spacing.c */
+
+#undef set_menu_spacing
+int	set_menu_spacing(
+		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, 
+		int	*s_col)
+		{ return(*(int *)0); }
+
+/* ./m_sub.c */
+
+#undef set_menu_sub
+int	set_menu_sub(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_sub
+WINDOW	*menu_sub(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
+
+/* ./m_trace.c */
+
+#undef _nc_retrace_item
+ITEM	*_nc_retrace_item(
+		ITEM	*code)
+		{ return(*(ITEM **)0); }
+
+#undef _nc_retrace_item_ptr
+ITEM	**_nc_retrace_item_ptr(
+		ITEM	**code)
+		{ return(*(ITEM ***)0); }
+
+#undef _nc_retrace_item_opts
+Item_Options _nc_retrace_item_opts(
+		Item_Options code)
+		{ return(*(Item_Options *)0); }
+
+#undef _nc_retrace_menu
+MENU	*_nc_retrace_menu(
+		MENU	*code)
+		{ return(*(MENU **)0); }
+
+#undef _nc_retrace_menu_hook
+Menu_Hook _nc_retrace_menu_hook(
+		Menu_Hook code)
+		{ return(*(Menu_Hook *)0); }
+
+#undef _nc_retrace_menu_opts
+Menu_Options _nc_retrace_menu_opts(
+		Menu_Options code)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_userptr.c */
+
+#undef set_menu_userptr
+int	set_menu_userptr(
+		MENU	*menu, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef menu_userptr
+void	*menu_userptr(
+		const MENU *menu)
+		{ return(*(void **)0); }
+
+/* ./m_win.c */
+
+#undef set_menu_win
+int	set_menu_win(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_win
+WINDOW	*menu_win(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
diff --git a/menu/llib-lmenutw b/menu/llib-lmenutw
new file mode 100644
index 0000000..0cd559e
--- /dev/null
+++ b/menu/llib-lmenutw
@@ -0,0 +1,553 @@
+/****************************************************************************
+ * Copyright (c) 2010 Free Software Foundation, Inc.                        *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                    2010                        *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./m_attribs.c */
+
+#include <menu.priv.h>
+
+#undef set_menu_fore
+int	set_menu_fore(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_fore
+chtype	menu_fore(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_back
+int	set_menu_back(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_back
+chtype	menu_back(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_grey
+int	set_menu_grey(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_grey
+chtype	menu_grey(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+/* ./m_cursor.c */
+
+#undef _nc_menu_cursor_pos
+int	_nc_menu_cursor_pos(
+		const MENU *menu, 
+		const ITEM *item, 
+		int	*pY, 
+		int	*pX)
+		{ return(*(int *)0); }
+
+#undef pos_menu_cursor
+int	pos_menu_cursor(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_driver.c */
+
+#undef _nc_Match_Next_Character_In_Item_Name
+int	_nc_Match_Next_Character_In_Item_Name(
+		MENU	*menu, 
+		int	ch, 
+		ITEM	**item)
+		{ return(*(int *)0); }
+
+#undef menu_driver
+int	menu_driver(
+		MENU	*menu, 
+		int	c)
+		{ return(*(int *)0); }
+
+/* ./m_format.c */
+
+#undef set_menu_format
+int	set_menu_format(
+		MENU	*menu, 
+		int	rows, 
+		int	cols)
+		{ return(*(int *)0); }
+
+#undef menu_format
+void	menu_format(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ /* void */ }
+
+/* ./m_global.c */
+
+#undef _nc_Default_Menu
+MENU	_nc_Default_Menu;
+#undef _nc_Default_Item
+ITEM	_nc_Default_Item;
+
+#undef _nc_Connect_Items
+NCURSES_BOOL _nc_Connect_Items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_Disconnect_Items
+void	_nc_Disconnect_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Calculate_Text_Width
+int	_nc_Calculate_Text_Width(
+		const TEXT *item)
+		{ return(*(int *)0); }
+
+#undef _nc_Calculate_Item_Length_and_Width
+void	_nc_Calculate_Item_Length_and_Width(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Link_Items
+void	_nc_Link_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Show_Menu
+void	_nc_Show_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef _nc_New_TopRow_and_CurrentItem
+void	_nc_New_TopRow_and_CurrentItem(
+		MENU	*menu, 
+		int	new_toprow, 
+		ITEM	*new_current_item)
+		{ /* void */ }
+
+/* ./m_hook.c */
+
+#undef set_menu_init
+int	set_menu_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_init
+Menu_Hook menu_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_menu_term
+int	set_menu_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_term
+Menu_Hook menu_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_init
+int	set_item_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_init
+Menu_Hook item_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_term
+int	set_item_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_term
+Menu_Hook item_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+/* ./m_item_cur.c */
+
+#undef set_current_item
+int	set_current_item(
+		MENU	*menu, 
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef current_item
+ITEM	*current_item(
+		const MENU *menu)
+		{ return(*(ITEM **)0); }
+
+#undef item_index
+int	item_index(
+		const ITEM *item)
+		{ return(*(int *)0); }
+
+/* ./m_item_nam.c */
+
+#undef item_name
+const char *item_name(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+#undef item_description
+const char *item_description(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+/* ./m_item_new.c */
+
+#include <wctype.h>
+
+#undef new_item
+ITEM	*new_item(
+		const char *name, 
+		const char *description)
+		{ return(*(ITEM **)0); }
+
+#undef free_item
+int	free_item(
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef set_menu_mark
+int	set_menu_mark(
+		MENU	*menu, 
+		const char *mark)
+		{ return(*(int *)0); }
+
+#undef menu_mark
+const char *menu_mark(
+		const MENU *menu)
+		{ return(*(const char **)0); }
+
+/* ./m_item_opt.c */
+
+#undef set_item_opts
+int	set_item_opts(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_off
+int	item_opts_off(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_on
+int	item_opts_on(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts
+Item_Options item_opts(
+		const ITEM *item)
+		{ return(*(Item_Options *)0); }
+
+/* ./m_item_top.c */
+
+#undef set_top_row
+int	set_top_row(
+		MENU	*menu, 
+		int	row)
+		{ return(*(int *)0); }
+
+#undef top_row
+int	top_row(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_item_use.c */
+
+#undef set_item_userptr
+int	set_item_userptr(
+		ITEM	*item, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef item_userptr
+void	*item_userptr(
+		const ITEM *item)
+		{ return(*(void **)0); }
+
+/* ./m_item_val.c */
+
+#undef set_item_value
+int	set_item_value(
+		ITEM	*item, 
+		NCURSES_BOOL value)
+		{ return(*(int *)0); }
+
+#undef item_value
+NCURSES_BOOL item_value(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_item_vis.c */
+
+#undef item_visible
+NCURSES_BOOL item_visible(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_items.c */
+
+#undef set_menu_items
+int	set_menu_items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(int *)0); }
+
+#undef menu_items
+ITEM	**menu_items(
+		const MENU *menu)
+		{ return(*(ITEM ***)0); }
+
+#undef item_count
+int	item_count(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_new.c */
+
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef new_menu
+MENU	*new_menu(
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef free_menu
+int	free_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_opts.c */
+
+#undef set_menu_opts
+int	set_menu_opts(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_off
+int	menu_opts_off(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_on
+int	menu_opts_on(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts
+Menu_Options menu_opts(
+		const MENU *menu)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_pad.c */
+
+#undef set_menu_pad
+int	set_menu_pad(
+		MENU	*menu, 
+		int	pad)
+		{ return(*(int *)0); }
+
+#undef menu_pad
+int	menu_pad(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_pattern.c */
+
+#undef menu_pattern
+char	*menu_pattern(
+		const MENU *menu)
+		{ return(*(char **)0); }
+
+#undef set_menu_pattern
+int	set_menu_pattern(
+		MENU	*menu, 
+		const char *p)
+		{ return(*(int *)0); }
+
+/* ./m_post.c */
+
+#undef _nc_Post_Item
+void	_nc_Post_Item(
+		const MENU *menu, 
+		const ITEM *item)
+		{ /* void */ }
+
+#undef _nc_Draw_Menu
+void	_nc_Draw_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef post_menu
+int	post_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+#undef unpost_menu
+int	unpost_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_req_name.c */
+
+#undef menu_request_name
+const char *menu_request_name(
+		int	request)
+		{ return(*(const char **)0); }
+
+#undef menu_request_by_name
+int	menu_request_by_name(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./m_scale.c */
+
+#undef scale_menu
+int	scale_menu(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ return(*(int *)0); }
+
+/* ./m_spacing.c */
+
+#undef set_menu_spacing
+int	set_menu_spacing(
+		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, 
+		int	*s_col)
+		{ return(*(int *)0); }
+
+/* ./m_sub.c */
+
+#undef set_menu_sub
+int	set_menu_sub(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_sub
+WINDOW	*menu_sub(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
+
+/* ./m_trace.c */
+
+#undef _nc_retrace_item
+ITEM	*_nc_retrace_item(
+		ITEM	*code)
+		{ return(*(ITEM **)0); }
+
+#undef _nc_retrace_item_ptr
+ITEM	**_nc_retrace_item_ptr(
+		ITEM	**code)
+		{ return(*(ITEM ***)0); }
+
+#undef _nc_retrace_item_opts
+Item_Options _nc_retrace_item_opts(
+		Item_Options code)
+		{ return(*(Item_Options *)0); }
+
+#undef _nc_retrace_menu
+MENU	*_nc_retrace_menu(
+		MENU	*code)
+		{ return(*(MENU **)0); }
+
+#undef _nc_retrace_menu_hook
+Menu_Hook _nc_retrace_menu_hook(
+		Menu_Hook code)
+		{ return(*(Menu_Hook *)0); }
+
+#undef _nc_retrace_menu_opts
+Menu_Options _nc_retrace_menu_opts(
+		Menu_Options code)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_userptr.c */
+
+#undef set_menu_userptr
+int	set_menu_userptr(
+		MENU	*menu, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef menu_userptr
+void	*menu_userptr(
+		const MENU *menu)
+		{ return(*(void **)0); }
+
+/* ./m_win.c */
+
+#undef set_menu_win
+int	set_menu_win(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_win
+WINDOW	*menu_win(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
diff --git a/menu/llib-lmenuw b/menu/llib-lmenuw
index d21fb94..0998f9b 100644
--- a/menu/llib-lmenuw
+++ b/menu/llib-lmenuw
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002,2005 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2002-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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                    2002,2005                   *
+ *  Author: Thomas E. Dickey                    2002-2005,2010              *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./m_attribs.c */
 
-#include "menu.priv.h"
+#include <menu.priv.h>
 
 #undef set_menu_fore
 int	set_menu_fore(
@@ -352,6 +352,12 @@
 
 /* ./m_new.c */
 
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
 #undef new_menu
 MENU	*new_menu(
 		ITEM	**items)
diff --git a/menu/m_attribs.c b/menu/m_attribs.c
index 1126ffb..eff90d6 100644
--- a/menu/m_attribs.c
+++ b/menu/m_attribs.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_attribs.c,v 1.14 2004/12/11 23:29:12 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.17 2012/03/10 23:43:41 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
@@ -49,9 +49,9 @@
 
 /* "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)\
+NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
 {\
-   T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr)));\
+  T((T_CALLED("set_menu_" #name "(%p,%s)"), (void *) menu, _traceattr(attr))); \
    if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
       RETURN(E_BAD_ARGUMENT);\
    if (menu && ( menu -> name != attr))\
@@ -67,7 +67,7 @@
 #define GEN_MENU_ATTR_GET_FCT( name ) \
 NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\
 {\
-   T((T_CALLED("menu_" #name "(%p)"), menu));\
+   T((T_CALLED("menu_" #name "(%p)"), (const void *) menu));\
    returnAttr(Normalize_Menu( menu ) -> name);\
 }
 
@@ -140,4 +140,5 @@
 |   Return Values :  Attribute value
 +--------------------------------------------------------------------------*/
 GEN_MENU_ATTR_GET_FCT(grey)
+
 /* m_attribs.c ends here */
diff --git a/menu/m_cursor.c b/menu/m_cursor.c
index 0293f90..9891de4 100644
--- a/menu/m_cursor.c
+++ b/menu/m_cursor.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_cursor.c,v 1.20 2005/10/22 23:03:32 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.22 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -86,11 +86,11 @@
   int x = 0, y = 0;
   int err = _nc_menu_cursor_pos(menu, (ITEM *) 0, &y, &x);
 
-  T((T_CALLED("pos_menu_cursor(%p)"), menu));
+  T((T_CALLED("pos_menu_cursor(%p)"), (const void *)menu));
 
   if (E_OK == err)
     {
-      win = menu->userwin ? menu->userwin : stdscr;
+      win = Get_Menu_UserWin(menu);
       sub = menu->usersub ? menu->usersub : win;
       assert(win && sub);
 
diff --git a/menu/m_driver.c b/menu/m_driver.c
index d418e6a..1a7a391 100644
--- a/menu/m_driver.c
+++ b/menu/m_driver.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_driver.c,v 1.27 2008/08/03 22:08:22 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.31 2012/03/10 23:43:41 tom Exp $")
 
 /* Macros */
 
@@ -47,7 +47,7 @@
 
 /* Add a new character to the match pattern buffer */
 #define Add_Character_To_Pattern(menu,ch) \
-  { (menu)->pattern[((menu)->pindex)++] = (ch);\
+  { (menu)->pattern[((menu)->pindex)++] = (char) (ch);\
     (menu)->pattern[(menu)->pindex] = '\0'; }
 
 /*---------------------------------------------------------------------------
@@ -121,7 +121,8 @@
   bool found = FALSE, passed = FALSE;
   int idx, last;
 
-  T((T_CALLED("_nc_Match_Next_Character(%p,%d,%p)"), menu, ch, item));
+  T((T_CALLED("_nc_Match_Next_Character(%p,%d,%p)"),
+     (void *)menu, ch, (void *)item));
 
   assert(menu && item && *item);
   idx = (*item)->index;
@@ -197,7 +198,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int menu_driver(MENU *menu, int c)
+|   Function      :  int menu_driver(MENU* menu, int c)
 |
 |   Description   :  Central dispatcher for the menu. Translates the logical
 |                    request 'c' into a menu action.
@@ -220,7 +221,7 @@
   ITEM *item;
   int my_top_row, rdiff;
 
-  T((T_CALLED("menu_driver(%p,%d)"), menu, c));
+  T((T_CALLED("menu_driver(%p,%d)"), (void *)menu, c));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
@@ -536,7 +537,11 @@
 	result = E_UNKNOWN_COMMAND;
     }
 
-  if (E_OK == result)
+  if (item == 0)
+    {
+      result = E_BAD_STATE;
+    }
+  else if (E_OK == result)
     {
       /* Adjust the top row if it turns out that the current item unfortunately
          doesn't appear in the menu window */
diff --git a/menu/m_format.c b/menu/m_format.c
index 773cb27..2d681a6 100644
--- a/menu/m_format.c
+++ b/menu/m_format.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_format.c,v 1.15 2004/12/11 23:11:21 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.18 2012/06/09 23:54:02 tom Exp $")
 
 #define minimum(a,b) ((a)<(b) ? (a): (b))
 
@@ -60,7 +60,7 @@
 {
   int total_rows, total_cols;
 
-  T((T_CALLED("set_menu_format(%p,%d,%d)"), menu, rows, cols));
+  T((T_CALLED("set_menu_format(%p,%d,%d)"), (void *)menu, rows, cols));
 
   if (rows < 0 || cols < 0)
     RETURN(E_BAD_ARGUMENT);
@@ -81,8 +81,8 @@
       if (menu->pattern)
 	Reset_Pattern(menu);
 
-      menu->frows = rows;
-      menu->fcols = cols;
+      menu->frows = (short)rows;
+      menu->fcols = (short)cols;
 
       assert(rows > 0 && cols > 0);
       total_rows = (menu->nitems - 1) / cols + 1;
@@ -90,21 +90,21 @@
 	minimum(menu->nitems, cols) :
 	(menu->nitems - 1) / total_rows + 1;
 
-      menu->rows = total_rows;
-      menu->cols = total_cols;
-      menu->arows = minimum(total_rows, rows);
+      menu->rows = (short)total_rows;
+      menu->cols = (short)total_cols;
+      menu->arows = (short)minimum(total_rows, rows);
       menu->toprow = 0;
       menu->curitem = *(menu->items);
       assert(menu->curitem);
-      menu->status |= _LINK_NEEDED;
+      SetStatus(menu, _LINK_NEEDED);
       _nc_Calculate_Item_Length_and_Width(menu);
     }
   else
     {
       if (rows > 0)
-	_nc_Default_Menu.frows = rows;
+	_nc_Default_Menu.frows = (short)rows;
       if (cols > 0)
-	_nc_Default_Menu.fcols = cols;
+	_nc_Default_Menu.fcols = (short)cols;
     }
 
   RETURN(E_OK);
diff --git a/menu/m_global.c b/menu/m_global.c
index 28e836d..fc4103c 100644
--- a/menu/m_global.c
+++ b/menu/m_global.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 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,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.23 2005/12/31 21:51:52 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.28 2014/03/15 20:37:22 tom Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -117,17 +117,17 @@
   assert(menu && menu->items);
   for (items = menu->items; *items; items++)
     {
-      check = _nc_Calculate_Text_Width(&((*items)->name));
+      check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
       if (check > MaximumNameLength)
 	MaximumNameLength = check;
 
-      check = _nc_Calculate_Text_Width(&((*items)->description));
+      check = (unsigned)_nc_Calculate_Text_Width(&((*items)->description));
       if (check > MaximumDescriptionLength)
 	MaximumDescriptionLength = check;
     }
 
-  menu->namelen = MaximumNameLength;
-  menu->desclen = MaximumDescriptionLength;
+  menu->namelen = (short)MaximumNameLength;
+  menu->desclen = (short)MaximumDescriptionLength;
   T(("ComputeMaximum_NameDesc_Lengths %d,%d", menu->namelen, menu->desclen));
 }
 
@@ -195,7 +195,7 @@
 		{
 		  (*item)->value = FALSE;
 		}
-	      (*item)->index = ItemCount++;
+	      (*item)->index = (short)ItemCount++;
 	      (*item)->imenu = menu;
 	    }
 	}
@@ -206,7 +206,7 @@
   if (ItemCount != 0)
     {
       menu->items = items;
-      menu->nitems = ItemCount;
+      menu->nitems = (short)ItemCount;
       ComputeMaximum_NameDesc_Lengths(menu);
       if ((menu->pattern = typeMalloc(char, (unsigned)(1 + menu->namelen))))
 	{
@@ -253,10 +253,10 @@
 #if USE_WIDEC_SUPPORT
   int result = item->length;
 
-  T((T_CALLED("_nc_menu_text_width(%p)"), item));
+  T((T_CALLED("_nc_menu_text_width(%p)"), (const void *)item));
   if (result != 0 && item->str != 0)
     {
-      int count = mbstowcs(0, item->str, 0);
+      int count = (int)mbstowcs(0, item->str, 0);
       wchar_t *temp = 0;
 
       if (count > 0
@@ -343,7 +343,7 @@
 
   assert(menu);
 
-  menu->height = 1 + menu->spc_rows * (menu->arows - 1);
+  menu->height = (short)(1 + menu->spc_rows * (menu->arows - 1));
 
   l = calculate_actual_width(menu, TRUE);
   l += menu->marklen;
@@ -354,10 +354,10 @@
       l += menu->spc_desc;
     }
 
-  menu->itemlen = l;
+  menu->itemlen = (short)l;
   l *= menu->cols;
   l += (menu->cols - 1) * menu->spc_cols;	/* for the padding between the columns */
-  menu->width = l;
+  menu->width = (short)l;
 
   T(("_nc_CalculateItem_Length_and_Width columns %d, item %d, width %d",
      menu->cols,
@@ -388,7 +388,7 @@
       int Last_in_Column;
       bool cycle = (menu->opt & O_NONCYCLIC) ? FALSE : TRUE;
 
-      menu->status &= ~_LINK_NEEDED;
+      ClrStatus(menu, _LINK_NEEDED);
 
       if (menu->opt & O_ROWMAJOR)
 	{
@@ -431,8 +431,8 @@
 		(cycle ? menu->items[(row + 1) < menu->rows ?
 				     Number_Of_Items - 1 : col] :
 		 (ITEM *) 0);
-	      item->x = col;
-	      item->y = row;
+	      item->x = (short)col;
+	      item->y = (short)row;
 	      if (++col == Number_Of_Columns)
 		{
 		  row++;
@@ -482,8 +482,8 @@
 		 (ITEM *) 0
 		);
 
-	      item->x = col;
-	      item->y = row;
+	      item->x = (short)col;
+	      item->y = (short)row;
 	      if ((++row) == Number_Of_Rows)
 		{
 		  col++;
@@ -496,7 +496,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  void _nc_Show_Menu(const MENU *menu)
+|   Function      :  void _nc_Show_Menu(const MENU* menu)
 |   
 |   Description   :  Update the window that is associated with the menu
 |
@@ -543,8 +543,10 @@
 |   Return Values :  -
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(void)
-  _nc_New_TopRow_and_CurrentItem
-  (MENU * menu, int new_toprow, ITEM * new_current_item)
+_nc_New_TopRow_and_CurrentItem(
+				MENU * menu,
+				int new_toprow,
+				ITEM * new_current_item)
 {
   ITEM *cur_item;
   bool mterm_called = FALSE;
@@ -566,7 +568,9 @@
 
       cur_item = menu->curitem;
       assert(cur_item);
-      menu->toprow = new_toprow;
+      menu->toprow = (short)(((menu->rows - menu->frows) >= 0)
+			     ? min(menu->rows - menu->frows, new_toprow)
+			     : 0);
       menu->curitem = new_current_item;
 
       if (mterm_called)
@@ -588,7 +592,9 @@
     }
   else
     {				/* if we are not posted, this is quite simple */
-      menu->toprow = new_toprow;
+      menu->toprow = (short)(((menu->rows - menu->frows) >= 0)
+			     ? 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 8d768a3..671fab6 100644
--- a/menu/m_hook.c
+++ b/menu/m_hook.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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,13 +37,13 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_hook.c,v 1.14 2004/12/25 21:39:52 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.16 2012/03/10 23:43:41 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 )\
 {\
-   T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), menu, func));\
+   T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), (void *) menu, func));\
    (Normalize_Menu(menu) -> typ ## name = func );\
    RETURN(E_OK);\
 }
@@ -52,7 +52,7 @@
 #define GEN_HOOK_GET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\
 {\
-   T((T_CALLED(#typ "_" #name "(%p)"), menu));\
+   T((T_CALLED(#typ "_" #name "(%p)"), (const void *) menu));\
    returnMenuHook(Normalize_Menu(menu) -> typ ## name);\
 }
 
diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c
index dac12ed..18b1a27 100644
--- a/menu/m_item_cur.c
+++ b/menu/m_item_cur.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_cur.c,v 1.17 2004/12/25 21:57:38 tom Exp $")
+MODULE_ID("$Id: m_item_cur.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -50,7 +50,7 @@
 NCURSES_EXPORT(int)
 set_current_item(MENU * menu, ITEM * item)
 {
-  T((T_CALLED("set_current_item(%p,%p)"), menu, item));
+  T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item));
 
   if (menu && item && (item->imenu == menu))
     {
@@ -91,7 +91,7 @@
 NCURSES_EXPORT(ITEM *)
 current_item(const MENU * menu)
 {
-  T((T_CALLED("current_item(%p)"), menu));
+  T((T_CALLED("current_item(%p)"), (const void *)menu));
   returnItem((menu && menu->items) ? menu->curitem : (ITEM *) 0);
 }
 
@@ -106,7 +106,7 @@
 NCURSES_EXPORT(int)
 item_index(const ITEM * item)
 {
-  T((T_CALLED("item_index(%p)"), 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 05a1693..3ed1d37 100644
--- a/menu/m_item_nam.c
+++ b/menu/m_item_nam.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_nam.c,v 1.14 2004/12/25 21:41:54 tom Exp $")
+MODULE_ID("$Id: m_item_nam.c,v 1.15 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -50,7 +50,7 @@
 NCURSES_EXPORT(const char *)
 item_name(const ITEM * item)
 {
-  T((T_CALLED("item_name(%p)"), item));
+  T((T_CALLED("item_name(%p)"), (const void *)item));
   returnCPtr((item) ? item->name.str : (char *)0);
 }
 
@@ -65,7 +65,7 @@
 NCURSES_EXPORT(const char *)
 item_description(const ITEM * item)
 {
-  T((T_CALLED("item_description(%p)"), 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 d7fe1f8..710ef09 100644
--- a/menu/m_item_new.c
+++ b/menu/m_item_new.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 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,7 +44,7 @@
 #endif
 #endif
 
-MODULE_ID("$Id: m_item_new.c,v 1.27 2006/12/17 19:47:09 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.33 2012/06/09 23:55:15 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -62,7 +62,7 @@
   int result = TRUE;
 
 #if USE_WIDEC_SUPPORT
-  int count = mbstowcs(0, s, 0);
+  int count = (int)mbstowcs(0, s, 0);
   wchar_t *temp = 0;
 
   assert(s);
@@ -122,18 +122,18 @@
     }
   else
     {
-      item = (ITEM *) calloc(1, sizeof(ITEM));
+      item = typeCalloc(ITEM, 1);
       if (item)
 	{
 	  *item = _nc_Default_Item;	/* hope we have struct assignment */
 
-	  item->name.length = strlen(name);
+	  item->name.length = (unsigned short)strlen(name);
 	  item->name.str = name;
 
 	  if (description && (*description != '\0') &&
 	      Is_Printable_String(description))
 	    {
-	      item->description.length = strlen(description);
+	      item->description.length = (unsigned short)strlen(description);
 	      item->description.str = description;
 	    }
 	  else
@@ -162,7 +162,7 @@
 NCURSES_EXPORT(int)
 free_item(ITEM * item)
 {
-  T((T_CALLED("free_item(%p)"), item));
+  T((T_CALLED("free_item(%p)"), (void *)item));
 
   if (!item)
     RETURN(E_BAD_ARGUMENT);
@@ -195,12 +195,12 @@
 NCURSES_EXPORT(int)
 set_menu_mark(MENU * menu, const char *mark)
 {
-  unsigned l;
+  short l;
 
-  T((T_CALLED("set_menu_mark(%p,%s)"), menu, _nc_visbuf(mark)));
+  T((T_CALLED("set_menu_mark(%p,%s)"), (void *)menu, _nc_visbuf(mark)));
 
   if (mark && (*mark != '\0') && Is_Printable_String(mark))
-    l = strlen(mark);
+    l = (short)strlen(mark);
   else
     l = 0;
 
@@ -213,22 +213,22 @@
 	{
 	  /* If the menu is already posted, the geometry is fixed. Then
 	     we can only accept a mark with exactly the same length */
-	  if (menu->marklen != (int)l)
+	  if (menu->marklen != l)
 	    RETURN(E_BAD_ARGUMENT);
 	}
       menu->marklen = l;
       if (l)
 	{
-	  menu->mark = (char *)malloc(l + 1);
+	  menu->mark = strdup(mark);
 	  if (menu->mark)
 	    {
-	      strcpy(menu->mark, mark);
 	      if (menu != &_nc_Default_Menu)
-		menu->status |= _MARK_ALLOCATED;
+		SetStatus(menu, _MARK_ALLOCATED);
 	    }
 	  else
 	    {
 	      menu->mark = old_mark;
+	      menu->marklen = (short)((old_mark != 0) ? strlen(old_mark) : 0);
 	      RETURN(E_SYSTEM_ERROR);
 	    }
 	}
@@ -267,7 +267,7 @@
 NCURSES_EXPORT(const char *)
 menu_mark(const MENU * menu)
 {
-  T((T_CALLED("menu_mark(%p)"), 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 cfe7b75..91385da 100644
--- a/menu/m_item_opt.c
+++ b/menu/m_item_opt.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_opt.c,v 1.17 2004/12/25 21:32:54 tom Exp $")
+MODULE_ID("$Id: m_item_opt.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,7 +53,7 @@
 NCURSES_EXPORT(int)
 set_item_opts(ITEM * item, Item_Options opts)
 {
-  T((T_CALLED("set_menu_opts(%p,%d)"), item, opts));
+  T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts));
 
   opts &= ALL_ITEM_OPTS;
 
@@ -100,7 +100,7 @@
 
 				   NULL item itself to adjust its behavior */
 
-  T((T_CALLED("item_opts_off(%p,%d)"), item, opts));
+  T((T_CALLED("item_opts_off(%p,%d)"), (void *)item, opts));
 
   if (opts & ~ALL_ITEM_OPTS)
     RETURN(E_BAD_ARGUMENT);
@@ -128,7 +128,7 @@
 
 				   NULL item itself to adjust its behavior */
 
-  T((T_CALLED("item_opts_on(%p,%d)"), item, opts));
+  T((T_CALLED("item_opts_on(%p,%d)"), (void *)item, opts));
 
   opts &= ALL_ITEM_OPTS;
   if (opts & ~ALL_ITEM_OPTS)
@@ -152,7 +152,7 @@
 NCURSES_EXPORT(Item_Options)
 item_opts(const ITEM * item)
 {
-  T((T_CALLED("item_opts(%p)"), 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 7268a0e..752e20d 100644
--- a/menu/m_item_top.c
+++ b/menu/m_item_top.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_top.c,v 1.10 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.11 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -54,7 +54,7 @@
 {
   ITEM *item;
 
-  T((T_CALLED("set_top_row(%p,%d)"), menu, row));
+  T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row));
 
   if (menu)
     {
@@ -94,7 +94,7 @@
 NCURSES_EXPORT(int)
 top_row(const MENU * menu)
 {
-  T((T_CALLED("top_row(%p)"), menu));
+  T((T_CALLED("top_row(%p)"), (const void *)menu));
   if (menu && menu->items && *(menu->items))
     {
       assert((menu->toprow >= 0) && (menu->toprow < menu->rows));
diff --git a/menu/m_item_use.c b/menu/m_item_use.c
index 06a5baf..8cf294b 100644
--- a/menu/m_item_use.c
+++ b/menu/m_item_use.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_use.c,v 1.16 2004/12/25 21:33:31 tom Exp $")
+MODULE_ID("$Id: m_item_use.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,7 +51,7 @@
 NCURSES_EXPORT(int)
 set_item_userptr(ITEM * item, void *userptr)
 {
-  T((T_CALLED("set_item_userptr(%p,%p)"), item, userptr));
+  T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr));
   Normalize_Item(item)->userptr = userptr;
   RETURN(E_OK);
 }
@@ -69,7 +69,7 @@
 NCURSES_EXPORT(void *)
 item_userptr(const ITEM * item)
 {
-  T((T_CALLED("item_userptr(%p)"), 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 cebf693..337dbfc 100644
--- a/menu/m_item_val.c
+++ b/menu/m_item_val.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_val.c,v 1.14 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.15 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -57,7 +57,7 @@
 {
   MENU *menu;
 
-  T((T_CALLED("set_item_value(%p,%d)"), item, value));
+  T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
   if (item)
     {
       menu = item->imenu;
@@ -97,7 +97,7 @@
 NCURSES_EXPORT(bool)
 item_value(const ITEM * item)
 {
-  T((T_CALLED("item_value(%p)"), 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 f8fb97f..ff84740 100644
--- a/menu/m_item_vis.c
+++ b/menu/m_item_vis.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_vis.c,v 1.15 2004/12/25 21:40:09 tom Exp $")
+MODULE_ID("$Id: m_item_vis.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -54,7 +54,7 @@
 {
   MENU *menu;
 
-  T((T_CALLED("item_visible(%p)"), item));
+  T((T_CALLED("item_visible(%p)"), (const void *)item));
   if (item &&
       (menu = item->imenu) &&
       (menu->status & _POSTED) &&
diff --git a/menu/m_items.c b/menu/m_items.c
index 3e8f70b..5397685 100644
--- a/menu/m_items.c
+++ b/menu/m_items.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 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,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_items.c,v 1.16 2005/01/16 01:02:23 tom Exp $")
+MODULE_ID("$Id: m_items.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -55,7 +55,7 @@
 NCURSES_EXPORT(int)
 set_menu_items(MENU * menu, ITEM ** items)
 {
-  T((T_CALLED("set_menu_items(%p,%p)"), menu, items));
+  T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items));
 
   if (!menu || (items && !(*items)))
     RETURN(E_BAD_ARGUMENT);
@@ -87,7 +87,7 @@
 NCURSES_EXPORT(ITEM **)
 menu_items(const MENU * menu)
 {
-  T((T_CALLED("menu_items(%p)"), menu));
+  T((T_CALLED("menu_items(%p)"), (const void *)menu));
   returnItemPtr(menu ? menu->items : (ITEM **) 0);
 }
 
@@ -103,7 +103,7 @@
 NCURSES_EXPORT(int)
 item_count(const MENU * menu)
 {
-  T((T_CALLED("item_count(%p)"), 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 c20c665..79f9292 100644
--- a/menu/m_new.c
+++ b/menu/m_new.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,57 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_new.c,v 1.18 2006/11/04 19:04:06 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.21 2010/01/23 21:20:11 tom Exp $")
+
+/*---------------------------------------------------------------------------
+|   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
+|                    default menu.
+|
+|   Return Values :  NULL on error
++--------------------------------------------------------------------------*/
+NCURSES_EXPORT(MENU *)
+NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
+{
+  int err = E_SYSTEM_ERROR;
+  MENU *menu = typeCalloc(MENU, 1);
+
+  T((T_CALLED("new_menu(%p,%p)"), (void *)SP_PARM, (void *)items));
+  if (menu)
+    {
+      *menu = _nc_Default_Menu;
+      menu->status = 0;
+      menu->rows = menu->frows;
+      menu->cols = menu->fcols;
+#if NCURSES_SP_FUNCS
+      /* This ensures userwin and usersub are always non-null,
+         so we can derive always the SCREEN that this menu is
+         running on. */
+      menu->userwin = SP_PARM->_stdscr;
+      menu->usersub = SP_PARM->_stdscr;
+#endif
+      if (items && *items)
+	{
+	  if (!_nc_Connect_Items(menu, items))
+	    {
+	      err = E_NOT_CONNECTED;
+	      free(menu);
+	      menu = (MENU *) 0;
+	    }
+	  else
+	    err = E_OK;
+	}
+    }
+
+  if (!menu)
+    SET_ERROR(err);
+
+  returnMenu(menu);
+}
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -50,35 +100,13 @@
 |
 |   Return Values :  NULL on error
 +--------------------------------------------------------------------------*/
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(MENU *)
 new_menu(ITEM ** items)
 {
-  int err = E_SYSTEM_ERROR;
-  MENU *menu = (MENU *) calloc(1, sizeof(MENU));
-
-  T((T_CALLED("new_menu(%p)"), items));
-  if (menu)
-    {
-      *menu = _nc_Default_Menu;
-      menu->status = 0;
-      menu->rows = menu->frows;
-      menu->cols = menu->fcols;
-      if (items && *items)
-	{
-	  if (!_nc_Connect_Items(menu, items))
-	    {
-	      err = E_NOT_CONNECTED;
-	      free(menu);
-	      menu = (MENU *) 0;
-	    }
-	}
-    }
-
-  if (!menu)
-    SET_ERROR(err);
-
-  returnMenu(menu);
+  return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items);
 }
+#endif
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -94,7 +122,7 @@
 NCURSES_EXPORT(int)
 free_menu(MENU * menu)
 {
-  T((T_CALLED("free_menu(%p)"), menu));
+  T((T_CALLED("free_menu(%p)"), (void *)menu));
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
 
diff --git a/menu/m_opts.c b/menu/m_opts.c
index a7370b0..bc6924b 100644
--- a/menu/m_opts.c
+++ b/menu/m_opts.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_opts.c,v 1.19 2004/12/25 21:36:12 tom Exp $")
+MODULE_ID("$Id: m_opts.c,v 1.20 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -55,7 +55,7 @@
 NCURSES_EXPORT(int)
 set_menu_opts(MENU * menu, Menu_Options opts)
 {
-  T((T_CALLED("set_menu_opts(%p,%d)"), menu, opts));
+  T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts));
 
   opts &= ALL_MENU_OPTS;
 
@@ -119,7 +119,7 @@
 
 				   NULL menu itself to adjust its behavior */
 
-  T((T_CALLED("menu_opts_off(%p,%d)"), menu, opts));
+  T((T_CALLED("menu_opts_off(%p,%d)"), (void *)menu, opts));
 
   opts &= ALL_MENU_OPTS;
   if (opts & ~ALL_MENU_OPTS)
@@ -152,7 +152,7 @@
 
 				   NULL menu itself to adjust its behavior */
 
-  T((T_CALLED("menu_opts_on(%p,%d)"), menu, opts));
+  T((T_CALLED("menu_opts_on(%p,%d)"), (void *)menu, opts));
 
   opts &= ALL_MENU_OPTS;
   if (opts & ~ALL_MENU_OPTS)
@@ -176,7 +176,7 @@
 NCURSES_EXPORT(Menu_Options)
 menu_opts(const MENU * menu)
 {
-  T((T_CALLED("menu_opts(%p)"), 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 76083ba..0abaf67 100644
--- a/menu/m_pad.c
+++ b/menu/m_pad.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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,19 +37,19 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pad.c,v 1.10 2004/12/25 21:40:58 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.13 2012/03/10 23:43:41 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
    if ( (menu) && ((menu)->status & _POSTED) )\
    {\
       _nc_Draw_Menu( menu );\
-      _nc_Show_Menu( menu );\
+      _nc_Show_Menu( menu ); \
    }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  int set_menu_pad(MENU *menu, int pad)
+|   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 
@@ -63,13 +63,13 @@
 {
   bool do_refresh = (menu != (MENU *) 0);
 
-  T((T_CALLED("set_menu_pad(%p,%d)"), menu, pad));
+  T((T_CALLED("set_menu_pad(%p,%d)"), (void *)menu, pad));
 
   if (!isprint(UChar(pad)))
     RETURN(E_BAD_ARGUMENT);
 
   Normalize_Menu(menu);
-  menu->pad = pad;
+  menu->pad = (unsigned char)pad;
 
   if (do_refresh)
     Refresh_Menu(menu);
@@ -88,7 +88,7 @@
 NCURSES_EXPORT(int)
 menu_pad(const MENU * menu)
 {
-  T((T_CALLED("menu_pad(%p)"), 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 1171390..1764d05 100644
--- a/menu/m_pattern.c
+++ b/menu/m_pattern.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pattern.c,v 1.15 2006/11/04 18:46:39 tom Exp $")
+MODULE_ID("$Id: m_pattern.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -55,7 +55,7 @@
 {
   static char empty[] = "";
 
-  T((T_CALLED("menu_pattern(%p)"), menu));
+  T((T_CALLED("menu_pattern(%p)"), (const void *)menu));
   returnPtr(menu ? (menu->pattern ? menu->pattern : empty) : 0);
 }
 
@@ -78,7 +78,7 @@
   ITEM *matchitem;
   int matchpos;
 
-  T((T_CALLED("set_menu_pattern(%p,%s)"), menu, _nc_visbuf(p)));
+  T((T_CALLED("set_menu_pattern(%p,%s)"), (void *)menu, _nc_visbuf(p)));
 
   if (!menu || !p)
     RETURN(E_BAD_ARGUMENT);
diff --git a/menu/m_post.c b/menu/m_post.c
index 657d0f1..a26ba49 100644
--- a/menu/m_post.c
+++ b/menu/m_post.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.26 2004/12/25 23:57:04 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.31 2012/06/09 23:54:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -67,7 +67,7 @@
      - it is a onevalued menu and it is the current item
      - or it has a selection value
    */
-  wattron(menu->win, menu->back);
+  wattron(menu->win, (int)menu->back);
   if (item->value || (item == menu->curitem))
     {
       if (menu->marklen)
@@ -79,13 +79,13 @@
 	     item. */
 	  if (!(menu->opt & O_ONEVALUE) && item->value && item != menu->curitem)
 	    {
-	      wattron(menu->win, menu->fore);
+	      wattron(menu->win, (int)menu->fore);
 	      isfore = TRUE;
 	    }
 	  waddstr(menu->win, menu->mark);
 	  if (isfore)
 	    {
-	      wattron(menu->win, menu->fore);
+	      wattron(menu->win, (int)menu->fore);
 	      isfore = FALSE;
 	    }
 	}
@@ -93,7 +93,7 @@
   else				/* otherwise we have to wipe out the marker area */
     for (ch = ' ', i = menu->marklen; i > 0; i--)
       waddch(menu->win, ch);
-  wattroff(menu->win, menu->back);
+  wattroff(menu->win, (int)menu->back);
   count += menu->marklen;
 
   /* First we have to calculate the attribute depending on selectability
@@ -101,19 +101,19 @@
    */
   if (!(item->opt & O_SELECTABLE))
     {
-      wattron(menu->win, menu->grey);
+      wattron(menu->win, (int)menu->grey);
       isgrey = TRUE;
     }
   else
     {
       if (item->value || item == menu->curitem)
 	{
-	  wattron(menu->win, menu->fore);
+	  wattron(menu->win, (int)menu->fore);
 	  isfore = TRUE;
 	}
       else
 	{
-	  wattron(menu->win, menu->back);
+	  wattron(menu->win, (int)menu->back);
 	  isback = TRUE;
 	}
     }
@@ -158,10 +158,10 @@
 	  assert(cx >= 0 && cy >= 0);
 	  getyx(menu->win, ncy, ncx);
 	  if (isgrey)
-	    wattroff(menu->win, menu->grey);
+	    wattroff(menu->win, (int)menu->grey);
 	  else if (isfore)
-	    wattroff(menu->win, menu->fore);
-	  wattron(menu->win, menu->back);
+	    wattroff(menu->win, (int)menu->fore);
+	  wattron(menu->win, (int)menu->back);
 	  for (j = 1; j < menu->spc_rows; j++)
 	    {
 	      if ((item_y + j) < getmaxy(menu->win))
@@ -171,21 +171,21 @@
 		    waddch(menu->win, ' ');
 		}
 	      if ((cy + j) < getmaxy(menu->win))
-		mvwaddch(menu->win, cy + j, cx - 1, menu->pad);
+		(void)mvwaddch(menu->win, cy + j, cx - 1, menu->pad);
 	    }
 	  wmove(menu->win, ncy, ncx);
 	  if (!isback)
-	    wattroff(menu->win, menu->back);
+	    wattroff(menu->win, (int)menu->back);
 	}
     }
 
   /* Remove attributes */
   if (isfore)
-    wattroff(menu->win, menu->fore);
+    wattroff(menu->win, (int)menu->fore);
   if (isback)
-    wattroff(menu->win, menu->back);
+    wattroff(menu->win, (int)menu->back);
   if (isgrey)
-    wattroff(menu->win, menu->grey);
+    wattroff(menu->win, (int)menu->grey);
 }
 
 /*---------------------------------------------------------------------------
@@ -225,7 +225,7 @@
 	{
 	  _nc_Post_Item(menu, hitem);
 
-	  wattron(menu->win, menu->back);
+	  wattron(menu->win, (int)menu->back);
 	  if (((hitem = hitem->right) != lasthor) && hitem)
 	    {
 	      int i, j, cy, cx;
@@ -244,7 +244,7 @@
 	    }
 	}
       while (hitem && (hitem != lasthor));
-      wattroff(menu->win, menu->back);
+      wattroff(menu->win, (int)menu->back);
 
       item = item->down;
       y += menu->spc_rows;
@@ -255,7 +255,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int post_menu(MENU *)
+|   Function      :  int post_menu(MENU* menu)
 |
 |   Description   :  Post a menu to the screen. This makes it visible.
 |
@@ -269,7 +269,7 @@
 NCURSES_EXPORT(int)
 post_menu(MENU * menu)
 {
-  T((T_CALLED("post_menu(%p)"), menu));
+  T((T_CALLED("post_menu(%p)"), (void *)menu));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
@@ -305,7 +305,7 @@
   else
     RETURN(E_NOT_CONNECTED);
 
-  menu->status |= _POSTED;
+  SetStatus(menu, _POSTED);
 
   if (!(menu->opt & O_ONEVALUE))
     {
@@ -329,7 +329,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int unpost_menu(MENU *)
+|   Function      :  int unpost_menu(MENU*)
 |
 |   Description   :  Detach menu from screen
 |
@@ -343,7 +343,7 @@
 {
   WINDOW *win;
 
-  T((T_CALLED("unpost_menu(%p)"), menu));
+  T((T_CALLED("unpost_menu(%p)"), (void *)menu));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
@@ -369,7 +369,7 @@
   delwin(menu->win);
   menu->win = (WINDOW *)0;
 
-  menu->status &= ~_POSTED;
+  ClrStatus(menu, _POSTED);
 
   RETURN(E_OK);
 }
diff --git a/menu/m_req_name.c b/menu/m_req_name.c
index 6fd51b1..cc0066d 100644
--- a/menu/m_req_name.c
+++ b/menu/m_req_name.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 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,27 +37,29 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_req_name.c,v 1.20 2008/09/13 18:59:17 tom Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.23 2015/04/04 18:00:23 tom Exp $")
 
-static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] =
+#define DATA(s) { s }
+
+static const char request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1][14] =
 {
-  "LEFT_ITEM",
-  "RIGHT_ITEM",
-  "UP_ITEM",
-  "DOWN_ITEM",
-  "SCR_ULINE",
-  "SCR_DLINE",
-  "SCR_DPAGE",
-  "SCR_UPAGE",
-  "FIRST_ITEM",
-  "LAST_ITEM",
-  "NEXT_ITEM",
-  "PREV_ITEM",
-  "TOGGLE_ITEM",
-  "CLEAR_PATTERN",
-  "BACK_PATTERN",
-  "NEXT_MATCH",
-  "PREV_MATCH"
+  DATA("LEFT_ITEM"),
+  DATA("RIGHT_ITEM"),
+  DATA("UP_ITEM"),
+  DATA("DOWN_ITEM"),
+  DATA("SCR_ULINE"),
+  DATA("SCR_DLINE"),
+  DATA("SCR_DPAGE"),
+  DATA("SCR_UPAGE"),
+  DATA("FIRST_ITEM"),
+  DATA("LAST_ITEM"),
+  DATA("NEXT_ITEM"),
+  DATA("PREV_ITEM"),
+  DATA("TOGGLE_ITEM"),
+  DATA("CLEAR_PATTERN"),
+  DATA("BACK_PATTERN"),
+  DATA("NEXT_MATCH"),
+  DATA("PREV_MATCH")
 };
 
 #define A_SIZE (sizeof(request_names)/sizeof(request_names[0]))
@@ -99,23 +101,26 @@
   /* because the table is so small, it doesn't really hurt
      to run sequentially through it.
    */
-  unsigned int i = 0;
+  size_t i = 0;
   char buf[16];
 
   T((T_CALLED("menu_request_by_name(%s)"), _nc_visbuf(str)));
 
-  if (str)
+  if (str != 0 && (i = strlen(str)) != 0)
     {
-      strncpy(buf, str, sizeof(buf));
-      while ((i < sizeof(buf)) && (buf[i] != '\0'))
+      if (i > sizeof(buf) - 2)
+	i = sizeof(buf) - 2;
+      memcpy(buf, str, i);
+      buf[i] = '\0';
+
+      for (i = 0; buf[i] != '\0'; ++i)
 	{
-	  buf[i] = toupper(UChar(buf[i]));
-	  i++;
+	  buf[i] = (char)toupper(UChar(buf[i]));
 	}
 
       for (i = 0; i < A_SIZE; i++)
 	{
-	  if (strncmp(request_names[i], buf, sizeof(buf)) == 0)
+	  if (strcmp(request_names[i], buf) == 0)
 	    returnCode(MIN_MENU_COMMAND + (int)i);
 	}
     }
diff --git a/menu/m_scale.c b/menu/m_scale.c
index 96c2d84..068a1cc 100644
--- a/menu/m_scale.c
+++ b/menu/m_scale.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_scale.c,v 1.9 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_scale.c,v 1.10 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,7 +53,10 @@
 NCURSES_EXPORT(int)
 scale_menu(const MENU * menu, int *rows, int *cols)
 {
-  T((T_CALLED("scale_menu(%p,%p,%p)"), menu, rows, cols));
+  T((T_CALLED("scale_menu(%p,%p,%p)"),
+     (const void *)menu,
+     (void *)rows,
+     (void *)cols));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
diff --git a/menu/m_spacing.c b/menu/m_spacing.c
index 039bbe4..01941f5 100644
--- a/menu/m_spacing.c
+++ b/menu/m_spacing.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_spacing.c,v 1.17 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.19 2012/03/10 23:43:41 tom Exp $")
 
 #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
 #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
@@ -56,7 +56,8 @@
 {
   MENU *m;			/* split for ATAC workaround */
 
-  T((T_CALLED("set_menu_spacing(%p,%d,%d,%d)"), menu, s_desc, s_row, s_col));
+  T((T_CALLED("set_menu_spacing(%p,%d,%d,%d)"),
+     (void *)menu, s_desc, s_row, s_col));
 
   m = Normalize_Menu(menu);
 
@@ -69,9 +70,9 @@
       ((s_col < 0) || (s_col > MAX_SPC_COLS)))
     RETURN(E_BAD_ARGUMENT);
 
-  m->spc_desc = s_desc ? s_desc : 1;
-  m->spc_rows = s_row ? s_row : 1;
-  m->spc_cols = s_col ? s_col : 1;
+  m->spc_desc = (short)(s_desc ? s_desc : 1);
+  m->spc_rows = (short)(s_row ? s_row : 1);
+  m->spc_cols = (short)(s_col ? s_col : 1);
   _nc_Calculate_Item_Length_and_Width(m);
 
   RETURN(E_OK);
@@ -90,7 +91,11 @@
 {
   const MENU *m;		/* split for ATAC workaround */
 
-  T((T_CALLED("menu_spacing(%p,%p,%p,%p)"), menu, s_desc, s_row, s_col));
+  T((T_CALLED("menu_spacing(%p,%p,%p,%p)"),
+     (const void *)menu,
+     (void *)s_desc,
+     (void *)s_row,
+     (void *)s_col));
 
   m = Normalize_Menu(menu);
 
diff --git a/menu/m_sub.c b/menu/m_sub.c
index 82649c5..37529a0 100644
--- a/menu/m_sub.c
+++ b/menu/m_sub.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_sub.c,v 1.10 2004/12/25 21:38:31 tom Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.12 2010/01/23 21:20:11 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,14 +51,28 @@
 NCURSES_EXPORT(int)
 set_menu_sub(MENU * menu, WINDOW *win)
 {
-  T((T_CALLED("set_menu_sub(%p,%p)"), menu, win));
+  T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win));
 
   if (menu)
     {
       if (menu->status & _POSTED)
 	RETURN(E_POSTED);
-      menu->usersub = win;
-      _nc_Calculate_Item_Length_and_Width(menu);
+      else
+#if NCURSES_SP_FUNCS
+	{
+	  /* We ensure that usersub is never null. So even if a null
+	     WINDOW parameter is passed, we store the SCREENS stdscr.
+	     The only MENU that can have a null usersub is the static
+	     _nc_default_Menu.
+	   */
+	  SCREEN *sp = _nc_screen_of(menu->usersub);
+
+	  menu->usersub = win ? win : sp->_stdscr;
+	  _nc_Calculate_Item_Length_and_Width(menu);
+	}
+#else
+	menu->usersub = win;
+#endif
     }
   else
     _nc_Default_Menu.usersub = win;
@@ -68,7 +82,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  WINDOW *menu_sub(const MENU *menu)
+|   Function      :  WINDOW* menu_sub(const MENU *menu)
 |   
 |   Description   :  Returns a pointer to the subwindow of the menu
 |
@@ -79,7 +93,7 @@
 {
   const MENU *m = Normalize_Menu(menu);
 
-  T((T_CALLED("menu_sub(%p)"), menu));
+  T((T_CALLED("menu_sub(%p)"), (const void *)menu));
   returnWin(Get_Menu_Window(m));
 }
 
diff --git a/menu/m_trace.c b/menu/m_trace.c
index 0f9f902..094ff86 100644
--- a/menu/m_trace.c
+++ b/menu/m_trace.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004,2005 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2004-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            *
@@ -32,19 +32,19 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_trace.c,v 1.3 2005/01/16 01:06:11 tom Exp $")
+MODULE_ID("$Id: m_trace.c,v 1.4 2010/01/23 21:20:10 tom Exp $")
 
 NCURSES_EXPORT(ITEM *)
 _nc_retrace_item(ITEM * code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
 NCURSES_EXPORT(ITEM **)
 _nc_retrace_item_ptr(ITEM ** code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
@@ -58,7 +58,7 @@
 NCURSES_EXPORT(MENU *)
 _nc_retrace_menu(MENU * code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
diff --git a/menu/m_userptr.c b/menu/m_userptr.c
index 7b178b2..a7359c9 100644
--- a/menu/m_userptr.c
+++ b/menu/m_userptr.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_userptr.c,v 1.16 2004/12/25 21:38:55 tom Exp $")
+MODULE_ID("$Id: m_userptr.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,7 +51,7 @@
 NCURSES_EXPORT(int)
 set_menu_userptr(MENU * menu, void *userptr)
 {
-  T((T_CALLED("set_menu_userptr(%p,%p)"), menu, userptr));
+  T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr));
   Normalize_Menu(menu)->userptr = userptr;
   RETURN(E_OK);
 }
@@ -69,7 +69,7 @@
 NCURSES_EXPORT(void *)
 menu_userptr(const MENU * menu)
 {
-  T((T_CALLED("menu_userptr(%p)"), 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 c3f857f..d88fa67 100644
--- a/menu/m_win.c
+++ b/menu/m_win.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 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 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_win.c,v 1.15 2004/12/25 21:39:20 tom Exp $")
+MODULE_ID("$Id: m_win.c,v 1.17 2010/01/23 21:20:11 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,14 +51,28 @@
 NCURSES_EXPORT(int)
 set_menu_win(MENU * menu, WINDOW *win)
 {
-  T((T_CALLED("set_menu_win(%p,%p)"), menu, win));
+  T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win));
 
   if (menu)
     {
       if (menu->status & _POSTED)
 	RETURN(E_POSTED);
-      menu->userwin = win;
-      _nc_Calculate_Item_Length_and_Width(menu);
+      else
+#if NCURSES_SP_FUNCS
+	{
+	  /* We ensure that userwin is never null. So even if a null
+	     WINDOW parameter is passed, we store the SCREENS stdscr.
+	     The only MENU that can have a null userwin is the static
+	     _nc_default_Menu.
+	   */
+	  SCREEN *sp = _nc_screen_of(menu->userwin);
+
+	  menu->userwin = win ? win : sp->_stdscr;
+	  _nc_Calculate_Item_Length_and_Width(menu);
+	}
+#else
+	menu->userwin = win;
+#endif
     }
   else
     _nc_Default_Menu.userwin = win;
@@ -68,7 +82,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  WINDOW *menu_win(const MENU *)
+|   Function      :  WINDOW* menu_win(const MENU*)
 |   
 |   Description   :  Returns pointer to the window of the menu
 |
@@ -79,8 +93,8 @@
 {
   const MENU *m = Normalize_Menu(menu);
 
-  T((T_CALLED("menu_win(%p)"), menu));
-  returnWin(m->userwin ? m->userwin : stdscr);
+  T((T_CALLED("menu_win(%p)"), (const void *)menu));
+  returnWin(Get_Menu_UserWin(m));
 }
 
 /* m_win.c ends here */
diff --git a/menu/menu.h b/menu/menu.h
index 84352eb..4eeac01 100644
--- a/menu/menu.h
+++ b/menu/menu.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.h,v 1.19 2007/02/24 17:32:13 tom Exp $ */
+/* $Id: menu.h,v 1.20 2009/04/05 00:28:07 tom Exp $ */
 
 #ifndef ETI_MENU
 #define ETI_MENU
@@ -249,6 +249,10 @@
 
 extern NCURSES_EXPORT(void)	menu_format (const MENU *,int *,int *);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(MENU *)	NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+#endif
+
 #ifdef __cplusplus
   }
 #endif
diff --git a/menu/menu.priv.h b/menu/menu.priv.h
index 10d3537..b54b195 100644
--- a/menu/menu.priv.h
+++ b/menu/menu.priv.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 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            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.priv.h,v 1.22 2005/01/16 01:02:23 tom Exp $ */
+/* $Id: menu.priv.h,v 1.25 2014/11/01 14:47:00 tom Exp $ */
 
 /***************************************************************************
 * Module menu.priv.h                                                       *
@@ -39,6 +39,7 @@
 
 #ifndef MENU_PRIV_H_incl
 #define MENU_PRIV_H_incl 1
+/* *INDENT-OFF* */
 
 #include "curses.priv.h"
 #include "mf_common.h"
@@ -56,8 +57,12 @@
 /* Normalize menu to default if none was given */
 #define Normalize_Menu( menu ) ((menu)=(menu)?(menu):&_nc_Default_Menu)
 
+#define Get_Menu_Screen( menu ) (menu->userwin ? \
+				 _nc_screen_of(menu->userwin) : CURRENT_SCREEN)
+
 /* Get the user defined (framing) window of the menu */
-#define Get_Menu_UserWin(menu) ((menu)->userwin ? (menu)->userwin : stdscr)
+#define Get_Menu_UserWin(menu) ((menu)->userwin ? \
+    (menu)->userwin : CURRENT_SCREEN->_stdscr)
 
 /* Normalize menu window */
 #define Get_Menu_Window(  menu ) \
@@ -95,10 +100,11 @@
 */
 #define Adjust_Current_Item(menu,row,item) \
   { if ((item)->y < row) \
-      row = (item)->y;\
-    if ( (item)->y >= (row + (menu)->arows) )\
-      row = ( (item)->y < ((menu)->rows - row) ) ? \
-            (item)->y : (menu)->rows - (menu)->arows;\
+      row = (short) (item)->y; \
+    if ( (item)->y >= (row + (menu)->arows) ) \
+      row = (short) (( (item)->y < ((menu)->rows - row) ) \
+                     ? (item)->y \
+		     : (menu)->rows - (menu)->arows); \
     _nc_New_TopRow_and_CurrentItem(menu,row,item); }
 
 /* Reset the match pattern buffer */
@@ -124,12 +130,12 @@
 
 #ifdef TRACE
 
-#define returnItem(code)	TRACE_RETURN(code,item)
-#define returnItemPtr(code)	TRACE_RETURN(code,item_ptr)
-#define returnItemOpts(code)	TRACE_RETURN(code,item_opts)
-#define returnMenu(code)	TRACE_RETURN(code,menu)
-#define returnMenuHook(code)	TRACE_RETURN(code,menu_hook)
-#define returnMenuOpts(code)	TRACE_RETURN(code,menu_opts)
+#define returnItem(code)	TRACE_RETURN1(code,item)
+#define returnItemPtr(code)	TRACE_RETURN1(code,item_ptr)
+#define returnItemOpts(code)	TRACE_RETURN1(code,item_opts)
+#define returnMenu(code)	TRACE_RETURN1(code,menu)
+#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 **);
@@ -148,5 +154,6 @@
 #define returnMenuOpts(code)	return code
 
 #endif /* TRACE/!TRACE */
+/* *INDENT-ON* */
 
 #endif /* MENU_PRIV_H_incl */
diff --git a/menu/mf_common.h b/menu/mf_common.h
index 681672d..cff6563 100644
--- a/menu/mf_common.h
+++ b/menu/mf_common.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,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 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: mf_common.h,v 0.22 2005/11/26 15:26:52 tom Exp $ */
+/* $Id: mf_common.h,v 0.24 2012/06/10 00:06:54 tom Exp $ */
 
 /* Common internal header for menu and form library */
 
@@ -63,10 +63,9 @@
 #if USE_RCS_IDS
 #define MODULE_ID(id) static const char Ident[] = id;
 #else
-#define MODULE_ID(id) /*nothing*/
+#define MODULE_ID(id)		/*nothing */
 #endif
 
-
 /* Maximum regular 8-bit character code */
 #define MAX_REGULAR_CHARACTER (0xff)
 
@@ -80,16 +79,19 @@
 #endif
 
 /* The few common values in the status fields for menus and forms */
-#define _POSTED         (0x01U)  /* menu or form is posted                  */
-#define _IN_DRIVER      (0x02U)  /* menu or form is processing hook routine */
+#define _POSTED         (0x01U)	/* menu or form is posted                  */
+#define _IN_DRIVER      (0x02U)	/* menu or form is processing hook routine */
+
+#define SetStatus(target,mask) (target)->status |= (unsigned short) (mask)
+#define ClrStatus(target,mask) (target)->status = (unsigned short) (target->status & (~mask))
 
 /* Call object hook */
 #define Call_Hook( object, handler ) \
    if ( (object) != 0 && ((object)->handler) != (void *) 0 )\
    {\
-	(object)->status |= _IN_DRIVER;\
+	SetStatus(object, _IN_DRIVER);\
 	(object)->handler(object);\
-	(object)->status &= ~_IN_DRIVER;\
+	ClrStatus(object, _IN_DRIVER);\
    }
 
 #endif /* MF_COMMON_H_incl */
diff --git a/menu/modules b/menu/modules
index abc4cf0..fac8fce 100644
--- a/menu/modules
+++ b/menu/modules
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.17 2006/12/24 00:52:39 tom Exp $
+# $Id: modules,v 1.18 2010/01/23 16:36:23 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -32,32 +32,32 @@
 
 @ base
 # Library objects
-m_attribs	lib		$(srcdir)	$(MENU_PRIV_H)
-m_cursor	lib		$(srcdir)	$(MENU_PRIV_H)
-m_driver	lib		$(srcdir)	$(MENU_PRIV_H)
-m_format	lib		$(srcdir)	$(MENU_PRIV_H)
-m_global	lib		$(srcdir)	$(MENU_PRIV_H)
-m_hook		lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_cur	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_nam	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_new	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_opt	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_top	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_use	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_val	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_vis	lib		$(srcdir)	$(MENU_PRIV_H)
-m_items		lib		$(srcdir)	$(MENU_PRIV_H)
-m_new		lib		$(srcdir)	$(MENU_PRIV_H)
-m_opts		lib		$(srcdir)	$(MENU_PRIV_H)
-m_pad		lib		$(srcdir)	$(MENU_PRIV_H)
-m_pattern	lib		$(srcdir)	$(MENU_PRIV_H)
-m_post		lib		$(srcdir)	$(MENU_PRIV_H)
-m_req_name	lib		$(srcdir)	$(MENU_PRIV_H)
-m_scale		lib		$(srcdir)	$(MENU_PRIV_H)
-m_spacing	lib		$(srcdir)	$(MENU_PRIV_H)
-m_sub		lib		$(srcdir)	$(MENU_PRIV_H)
-m_trace		lib		$(srcdir)	$(MENU_PRIV_H)
-m_userptr	lib		$(srcdir)	$(MENU_PRIV_H)
-m_win		lib		$(srcdir)	$(MENU_PRIV_H)
+m_attribs	lib		$(srcdir)	$(HEADER_DEPS)
+m_cursor	lib		$(srcdir)	$(HEADER_DEPS)
+m_driver	lib		$(srcdir)	$(HEADER_DEPS)
+m_format	lib		$(srcdir)	$(HEADER_DEPS)
+m_global	lib		$(srcdir)	$(HEADER_DEPS)
+m_hook		lib		$(srcdir)	$(HEADER_DEPS)
+m_item_cur	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_nam	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_new	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_opt	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_top	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_use	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_val	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_vis	lib		$(srcdir)	$(HEADER_DEPS)
+m_items		lib		$(srcdir)	$(HEADER_DEPS)
+m_new		lib		$(srcdir)	$(HEADER_DEPS)
+m_opts		lib		$(srcdir)	$(HEADER_DEPS)
+m_pad		lib		$(srcdir)	$(HEADER_DEPS)
+m_pattern	lib		$(srcdir)	$(HEADER_DEPS)
+m_post		lib		$(srcdir)	$(HEADER_DEPS)
+m_req_name	lib		$(srcdir)	$(HEADER_DEPS)
+m_scale		lib		$(srcdir)	$(HEADER_DEPS)
+m_spacing	lib		$(srcdir)	$(HEADER_DEPS)
+m_sub		lib		$(srcdir)	$(HEADER_DEPS)
+m_trace		lib		$(srcdir)	$(HEADER_DEPS)
+m_userptr	lib		$(srcdir)	$(HEADER_DEPS)
+m_win		lib		$(srcdir)	$(HEADER_DEPS)
 
 # vile:makemode