diff options
Diffstat (limited to 'menu')
-rw-r--r-- | menu/Makefile.in | 19 | ||||
-rw-r--r-- | menu/llib-lmenu | 12 | ||||
-rw-r--r-- | menu/llib-lmenut | 551 | ||||
-rw-r--r-- | menu/llib-lmenutw | 553 | ||||
-rw-r--r-- | menu/llib-lmenuw | 12 | ||||
-rw-r--r-- | menu/m_attribs.c | 11 | ||||
-rw-r--r-- | menu/m_cursor.c | 8 | ||||
-rw-r--r-- | menu/m_driver.c | 11 | ||||
-rw-r--r-- | menu/m_format.c | 6 | ||||
-rw-r--r-- | menu/m_global.c | 14 | ||||
-rw-r--r-- | menu/m_hook.c | 6 | ||||
-rw-r--r-- | menu/m_item_cur.c | 10 | ||||
-rw-r--r-- | menu/m_item_nam.c | 8 | ||||
-rw-r--r-- | menu/m_item_new.c | 15 | ||||
-rw-r--r-- | menu/m_item_opt.c | 12 | ||||
-rw-r--r-- | menu/m_item_top.c | 8 | ||||
-rw-r--r-- | menu/m_item_use.c | 8 | ||||
-rw-r--r-- | menu/m_item_val.c | 8 | ||||
-rw-r--r-- | menu/m_item_vis.c | 6 | ||||
-rw-r--r-- | menu/m_items.c | 10 | ||||
-rw-r--r-- | menu/m_new.c | 42 | ||||
-rw-r--r-- | menu/m_opts.c | 12 | ||||
-rw-r--r-- | menu/m_pad.c | 12 | ||||
-rw-r--r-- | menu/m_pattern.c | 8 | ||||
-rw-r--r-- | menu/m_post.c | 14 | ||||
-rw-r--r-- | menu/m_req_name.c | 6 | ||||
-rw-r--r-- | menu/m_scale.c | 9 | ||||
-rw-r--r-- | menu/m_spacing.c | 13 | ||||
-rw-r--r-- | menu/m_sub.c | 28 | ||||
-rw-r--r-- | menu/m_trace.c | 10 | ||||
-rw-r--r-- | menu/m_userptr.c | 8 | ||||
-rw-r--r-- | menu/m_win.c | 30 | ||||
-rw-r--r-- | menu/menu.h | 8 | ||||
-rw-r--r-- | menu/menu.priv.h | 10 | ||||
-rw-r--r-- | menu/modules | 58 |
35 files changed, 1377 insertions, 179 deletions
diff --git a/menu/Makefile.in b/menu/Makefile.in index fc33dc7d64e8..253ff4f64194 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.54 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 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 "Software"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ @@ -63,6 +64,7 @@ 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,11 +72,14 @@ INSTALL_PROG = @INSTALL_PROGRAM@ 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@ @@ -126,7 +131,7 @@ sources : $(AUTO_SRC) $(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,16 +145,16 @@ $(DESTDIR)$(libdir) : -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 diff --git a/menu/llib-lmenu b/menu/llib-lmenu index fc17cc364d42..13ecaf8bdd79 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 @@ int item_count( /* ./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 000000000000..951719f41e6e --- /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 000000000000..0cd559ebd269 --- /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 d21fb9488499..0998f9b0b866 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 @@ int item_count( /* ./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 1126ffb84f5a..c41d558ec994 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-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_attribs.c,v 1.14 2004/12/11 23:29:12 tom Exp $") +MODULE_ID("$Id: m_attribs.c,v 1.16 2010/01/23 21:16:54 tom Exp $") /* Macro to redraw menu if it is posted and changed */ #define Refresh_Menu(menu) \ @@ -49,9 +49,9 @@ MODULE_ID("$Id: m_attribs.c,v 1.14 2004/12/11 23:29:12 tom Exp $") /* "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)"), menu, _traceattr(attr))); \ if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\ RETURN(E_BAD_ARGUMENT);\ if (menu && ( menu -> name != attr))\ @@ -67,7 +67,7 @@ NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU * menu, chtype attr)\ #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 @@ GEN_MENU_ATTR_SET_FCT(grey) | 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 0293f9073c32..9891de4a9450 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 @@ pos_menu_cursor(const MENU * menu) 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 d418e6a22557..deeff4710c08 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-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_driver.c,v 1.27 2008/08/03 22:08:22 tom Exp $") +MODULE_ID("$Id: m_driver.c,v 1.29 2010/01/23 21:20:10 tom Exp $") /* Macros */ @@ -121,7 +121,8 @@ _nc_Match_Next_Character_In_Item_Name 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 @@ _nc_Match_Next_Character_In_Item_Name /*--------------------------------------------------------------------------- | 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 @@ menu_driver(MENU * menu, int c) 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); diff --git a/menu/m_format.c b/menu/m_format.c index 773cb27e774f..8e68a036ee2e 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-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_format.c,v 1.15 2004/12/11 23:11:21 tom Exp $") +MODULE_ID("$Id: m_format.c,v 1.16 2010/01/23 21:20:10 tom Exp $") #define minimum(a,b) ((a)<(b) ? (a): (b)) @@ -60,7 +60,7 @@ set_menu_format(MENU * menu, int rows, int cols) { 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); diff --git a/menu/m_global.c b/menu/m_global.c index 28e836dd644e..90f6f25925b7 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-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_global.c,v 1.23 2005/12/31 21:51:52 tom Exp $") +MODULE_ID("$Id: m_global.c,v 1.25 2010/01/23 21:20:10 tom Exp $") static char mark[] = "-"; /* *INDENT-OFF* */ @@ -253,7 +253,7 @@ _nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ ) #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); @@ -496,7 +496,7 @@ _nc_Link_Items(MENU * menu) /*--------------------------------------------------------------------------- | 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 @@ _nc_Show_Menu(const MENU * menu) | 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; diff --git a/menu/m_hook.c b/menu/m_hook.c index 8d768a303ffc..6125d052e7a2 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-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_hook.c,v 1.14 2004/12/25 21:39:52 tom Exp $") +MODULE_ID("$Id: m_hook.c,v 1.15 2010/01/23 21:16:54 tom Exp $") /* "Template" macro to generate function to set application specific hook */ #define GEN_HOOK_SET_FUNCTION( typ, name ) \ @@ -52,7 +52,7 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook f #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 dac12ed91c5e..18b1a2726af6 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 @@ MODULE_ID("$Id: m_item_cur.c,v 1.17 2004/12/25 21:57:38 tom Exp $") 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 @@ set_current_item(MENU * menu, ITEM * item) 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 @@ current_item(const MENU * menu) 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 05a169340b45..3ed1d37668a2 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 @@ MODULE_ID("$Id: m_item_nam.c,v 1.14 2004/12/25 21:41:54 tom Exp $") 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 @@ item_name(const ITEM * item) 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 d7fe1f8542c2..1debc2b34401 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-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 * @@ -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.30 2010/01/23 21:20:11 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -122,7 +122,7 @@ new_item(const char *name, const char *description) } else { - item = (ITEM *) calloc(1, sizeof(ITEM)); + item = typeCalloc(ITEM, 1); if (item) { *item = _nc_Default_Item; /* hope we have struct assignment */ @@ -162,7 +162,7 @@ new_item(const char *name, const char *description) 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); @@ -197,7 +197,7 @@ set_menu_mark(MENU * menu, const char *mark) { unsigned 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); @@ -219,7 +219,7 @@ set_menu_mark(MENU * menu, const char *mark) menu->marklen = l; if (l) { - menu->mark = (char *)malloc(l + 1); + menu->mark = strdup(mark); if (menu->mark) { strcpy(menu->mark, mark); @@ -229,6 +229,7 @@ set_menu_mark(MENU * menu, const char *mark) else { menu->mark = old_mark; + menu->marklen = (old_mark != 0) ? strlen(old_mark) : 0; RETURN(E_SYSTEM_ERROR); } } @@ -267,7 +268,7 @@ set_menu_mark(MENU * menu, const char *mark) 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 cfe7b75db392..91385da1217c 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 @@ MODULE_ID("$Id: m_item_opt.c,v 1.17 2004/12/25 21:32:54 tom Exp $") 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 @@ item_opts_off(ITEM * item, Item_Options opts) 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 @@ item_opts_on(ITEM * item, Item_Options opts) 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 @@ item_opts_on(ITEM * item, Item_Options opts) 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 7268a0e49f15..752e20d9edbb 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 @@ set_top_row(MENU * menu, int row) { 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 @@ set_top_row(MENU * menu, int row) 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 06a5baf984e8..8cf294bc29e3 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 @@ MODULE_ID("$Id: m_item_use.c,v 1.16 2004/12/25 21:33:31 tom Exp $") 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 @@ set_item_userptr(ITEM * item, void *userptr) 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 cebf693fbd34..337dbfcc6808 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 @@ set_item_value(ITEM * item, bool value) { 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 @@ set_item_value(ITEM * item, bool value) 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 f8fb97f028cb..ff8474054370 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 @@ item_visible(const ITEM * item) { 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 3e8f70b0fa7d..539768551d80 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 @@ MODULE_ID("$Id: m_items.c,v 1.16 2005/01/16 01:02:23 tom Exp $") 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 @@ set_menu_items(MENU * menu, ITEM ** items) 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 @@ menu_items(const MENU * menu) 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 c20c66517790..79f9292a7b3c 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,11 +37,11 @@ #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 *new_menu(ITEM **items) +| 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. @@ -51,18 +51,25 @@ MODULE_ID("$Id: m_new.c,v 1.18 2006/11/04 19:04:06 tom Exp $") | Return Values : NULL on error +--------------------------------------------------------------------------*/ NCURSES_EXPORT(MENU *) -new_menu(ITEM ** items) +NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items) { int err = E_SYSTEM_ERROR; - MENU *menu = (MENU *) calloc(1, sizeof(MENU)); + MENU *menu = typeCalloc(MENU, 1); - T((T_CALLED("new_menu(%p)"), items)); + 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)) @@ -71,6 +78,8 @@ new_menu(ITEM ** items) free(menu); menu = (MENU *) 0; } + else + err = E_OK; } } @@ -82,6 +91,25 @@ new_menu(ITEM ** items) /*--------------------------------------------------------------------------- | Facility : libnmenu +| Function : MENU *new_menu(ITEM **items) +| +| Description : Creates a new menu connected to the item pointer +| array items and returns a pointer to the new menu. +| The new menu is initialized with the values from the +| default menu. +| +| Return Values : NULL on error ++--------------------------------------------------------------------------*/ +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(MENU *) +new_menu(ITEM ** items) +{ + return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items); +} +#endif + +/*--------------------------------------------------------------------------- +| Facility : libnmenu | Function : int free_menu(MENU *menu) | | Description : Disconnects menu from its associated item pointer @@ -94,7 +122,7 @@ new_menu(ITEM ** items) 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 a7370b06f8e5..bc6924b65149 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 @@ MODULE_ID("$Id: m_opts.c,v 1.19 2004/12/25 21:36:12 tom Exp $") 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 @@ menu_opts_off(MENU * menu, Menu_Options opts) 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 @@ menu_opts_on(MENU * menu, Menu_Options opts) 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 @@ menu_opts_on(MENU * menu, Menu_Options opts) 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 76083ba36d34..caa2f9e207b1 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-2004,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,19 +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.12 2010/01/23 21:20:10 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,7 +63,7 @@ set_menu_pad(MENU * menu, int pad) { 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); @@ -88,7 +88,7 @@ set_menu_pad(MENU * menu, int pad) 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 1171390e214c..1764d05fbc0c 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 @@ menu_pattern(const MENU * menu) { 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 @@ set_menu_pattern(MENU * menu, const char *p) 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 657d0f18420b..1f0b623ed456 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-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_post.c,v 1.26 2004/12/25 23:57:04 tom Exp $") +MODULE_ID("$Id: m_post.c,v 1.29 2010/05/01 19:18:27 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -171,7 +171,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item) 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) @@ -255,7 +255,7 @@ _nc_Draw_Menu(const MENU * menu) /*--------------------------------------------------------------------------- | 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 @@ _nc_Draw_Menu(const MENU * menu) 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); @@ -329,7 +329,7 @@ post_menu(MENU * menu) /*--------------------------------------------------------------------------- | Facility : libnmenu -| Function : int unpost_menu(MENU *) +| Function : int unpost_menu(MENU*) | | Description : Detach menu from screen | @@ -343,7 +343,7 @@ unpost_menu(MENU * menu) { WINDOW *win; - T((T_CALLED("unpost_menu(%p)"), menu)); + T((T_CALLED("unpost_menu(%p)"), (void *)menu)); if (!menu) RETURN(E_BAD_ARGUMENT); diff --git a/menu/m_req_name.c b/menu/m_req_name.c index 6fd51b1c361e..cad875802071 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-2008,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 * @@ -37,7 +37,7 @@ #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.21 2009/10/10 16:17:23 tom Exp $") static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] = { @@ -109,7 +109,7 @@ menu_request_by_name(const char *str) strncpy(buf, str, sizeof(buf)); while ((i < sizeof(buf)) && (buf[i] != '\0')) { - buf[i] = toupper(UChar(buf[i])); + buf[i] = (char)toupper(UChar(buf[i])); i++; } diff --git a/menu/m_scale.c b/menu/m_scale.c index 96c2d84eb3af..068a1cc8c538 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 @@ MODULE_ID("$Id: m_scale.c,v 1.9 2004/12/11 23:29:34 tom Exp $") 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 039bbe4d59b1..1cfa2e166571 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-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_spacing.c,v 1.17 2004/12/11 23:29:34 tom Exp $") +MODULE_ID("$Id: m_spacing.c,v 1.18 2010/01/23 21:20:10 tom Exp $") #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8) #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8) @@ -56,7 +56,8 @@ set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) { 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); @@ -90,7 +91,11 @@ menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col) { 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 82649c57b130..37529a08b295 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 @@ MODULE_ID("$Id: m_sub.c,v 1.10 2004/12/25 21:38:31 tom Exp $") 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 @@ set_menu_sub(MENU * menu, WINDOW *win) /*--------------------------------------------------------------------------- | 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 @@ menu_sub(const MENU * menu) { 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 0f9f90273a6a..094ff86c67a9 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 @@ _nc_retrace_item_opts(Item_Options code) 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 7b178b25a175..a7359c99d0eb 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 @@ MODULE_ID("$Id: m_userptr.c,v 1.16 2004/12/25 21:38:55 tom Exp $") 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 @@ set_menu_userptr(MENU * menu, void *userptr) 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 c3f857f71688..d88fa674c608 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 @@ MODULE_ID("$Id: m_win.c,v 1.15 2004/12/25 21:39:20 tom Exp $") 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 @@ set_menu_win(MENU * menu, WINDOW *win) /*--------------------------------------------------------------------------- | 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 @@ menu_win(const MENU * menu) { 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 84352eb5d2f6..4eeac018bdb3 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(bool) item_visible (const ITEM *); 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 10d3537594da..99580a38d1c2 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-2005,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.priv.h,v 1.22 2005/01/16 01:02:23 tom Exp $ */ +/* $Id: menu.priv.h,v 1.23 2009/02/28 21:02:57 juergen Exp $ */ /*************************************************************************** * Module menu.priv.h * @@ -56,8 +56,12 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; /* 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 ) \ diff --git a/menu/modules b/menu/modules index abc4cf0afa49..fac8fceba1e4 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 |