aboutsummaryrefslogtreecommitdiff
path: root/menu
diff options
context:
space:
mode:
Diffstat (limited to 'menu')
-rw-r--r--menu/Makefile.in31
-rw-r--r--menu/m_attribs.c6
-rw-r--r--menu/m_cursor.c16
-rw-r--r--menu/m_driver.c10
-rw-r--r--menu/m_format.c10
-rw-r--r--menu/m_global.c62
-rw-r--r--menu/m_hook.c6
-rw-r--r--menu/m_item_cur.c16
-rw-r--r--menu/m_item_nam.c10
-rw-r--r--menu/m_item_new.c24
-rw-r--r--menu/m_item_opt.c18
-rw-r--r--menu/m_item_top.c12
-rw-r--r--menu/m_item_use.c10
-rw-r--r--menu/m_item_val.c10
-rw-r--r--menu/m_item_vis.c6
-rw-r--r--menu/m_items.c16
-rw-r--r--menu/m_new.c19
-rw-r--r--menu/m_opts.c20
-rw-r--r--menu/m_pad.c12
-rw-r--r--menu/m_pattern.c10
-rw-r--r--menu/m_post.c22
-rw-r--r--menu/m_req_name.c6
-rw-r--r--menu/m_scale.c6
-rw-r--r--menu/m_spacing.c10
-rw-r--r--menu/m_sub.c10
-rw-r--r--menu/m_trace.c20
-rw-r--r--menu/m_userptr.c10
-rw-r--r--menu/m_win.c10
-rw-r--r--menu/menu.h330
-rw-r--r--menu/menu.priv.h40
30 files changed, 408 insertions, 380 deletions
diff --git a/menu/Makefile.in b/menu/Makefile.in
index 495651c2084d..fb13eb07c8ef 100644
--- a/menu/Makefile.in
+++ b/menu/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.66 2020/02/02 23:34:34 tom Exp $
+# $Id: Makefile.in,v 1.70 2020/08/29 14:50:45 tom Exp $
##############################################################################
# Copyright 2020 Thomas E. Dickey #
# Copyright 1998-2015,2018 Free Software Foundation, Inc. #
@@ -90,16 +90,18 @@ ETAGS = @ETAGS@
CC = @CC@
CPP = @CPP@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
-CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
+INCDIR = $(top_srcdir)/include
+BASE_DIR = $(top_srcdir)/ncurses
+CPPFLAGS = -I$(BASE_DIR) -DHAVE_CONFIG_H -DBUILDING_MENU @CPPFLAGS@
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CFLAGS_LIBTOOL = $(CCFLAGS)
-CFLAGS_NORMAL = $(CCFLAGS)
-CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
-CFLAGS_PROFILE = $(CCFLAGS) -pg
+CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC
+CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
+CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
@@ -157,9 +159,22 @@ $(DESTDIR)$(libdir) :
cp $(srcdir)/mf_common.h $@
HEADER_DEPS = \
+ ../include/curses.h \
+ ../include/ncurses_cfg.h \
+ ../include/ncurses_def.h \
+ ../include/ncurses_dll.h \
+ ../include/term.h \
+ ../include/unctrl.h \
+ $(BASE_DIR)/curses.priv.h \
+ $(BASE_DIR)/new_pair.h \
+ $(INCDIR)/nc_alloc.h \
+ $(INCDIR)/nc_panel.h \
+ $(INCDIR)/nc_string.h \
+ $(INCDIR)/nc_termios.h \
+ $(INCDIR)/nc_tparm.h \
+ $(INCDIR)/term_entry.h \
$(srcdir)/menu.priv.h \
- $(AUTO_SRC) \
- ../include/curses.h
+ $(AUTO_SRC)
tags:
$(CTAGS) *.[ch]
diff --git a/menu/m_attribs.c b/menu/m_attribs.c
index e3c88ac420f3..5cd94d342475 100644
--- a/menu/m_attribs.c
+++ b/menu/m_attribs.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_attribs.c,v 1.18 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.19 2020/07/04 19:44:58 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
@@ -50,7 +50,7 @@ MODULE_ID("$Id: m_attribs.c,v 1.18 2020/02/02 23:34:34 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) \
+MENU_EXPORT(int) NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
{\
T((T_CALLED("set_menu_" #name "(%p,%s)"), (void *) menu, _traceattr(attr))); \
if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
@@ -66,7 +66,7 @@ NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
/* "Template" macro to generate a function to get a menu's attribute */
#define GEN_MENU_ATTR_GET_FCT( name ) \
-NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\
+MENU_EXPORT(chtype) NCURSES_API menu_ ## name (const MENU * menu)\
{\
T((T_CALLED("menu_" #name "(%p)"), (const void *) menu));\
returnAttr(Normalize_Menu( menu ) -> name);\
diff --git a/menu/m_cursor.c b/menu/m_cursor.c
index 3f8e54809137..8cf15ce51335 100644
--- a/menu/m_cursor.c
+++ b/menu/m_cursor.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_cursor.c,v 1.23 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.25 2020/12/12 00:38:02 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,16 +50,16 @@ MODULE_ID("$Id: m_cursor.c,v 1.23 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-_nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX)
+MENU_EXPORT(int)
+_nc_menu_cursor_pos(const MENU *menu, const ITEM *item, int *pY, int *pX)
{
if (!menu || !pX || !pY)
return (E_BAD_ARGUMENT);
else
{
- if ((ITEM *) 0 == item)
+ if ((ITEM *)0 == item)
item = menu->curitem;
- assert(item != (ITEM *) 0);
+ assert(item != (ITEM *)0);
if (!(menu->status & _POSTED))
return (E_NOT_POSTED);
@@ -80,12 +80,12 @@ _nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX)
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-pos_menu_cursor(const MENU * menu)
+MENU_EXPORT(int)
+pos_menu_cursor(const MENU *menu)
{
WINDOW *win, *sub;
int x = 0, y = 0;
- int err = _nc_menu_cursor_pos(menu, (ITEM *) 0, &y, &x);
+ int err = _nc_menu_cursor_pos(menu, (ITEM *)0, &y, &x);
T((T_CALLED("pos_menu_cursor(%p)"), (const void *)menu));
diff --git a/menu/m_driver.c b/menu/m_driver.c
index e592bab4e368..b1d7c3541b53 100644
--- a/menu/m_driver.c
+++ b/menu/m_driver.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_driver.c,v 1.34 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.36 2020/12/12 00:38:02 tom Exp $")
/* Macros */
@@ -115,9 +115,9 @@ Is_Sub_String(
| Return Values : E_OK - an item matching the pattern was found
| E_NO_MATCH - nothing found
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+MENU_EXPORT(int)
_nc_Match_Next_Character_In_Item_Name
-(MENU * menu, int ch, ITEM ** item)
+(MENU *menu, int ch, ITEM **item)
{
bool found = FALSE, passed = FALSE;
int idx, last;
@@ -209,8 +209,8 @@ _nc_Match_Next_Character_In_Item_Name
| E_BAD_STATE - menu is in user hook routine
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_driver(MENU * menu, int c)
+MENU_EXPORT(int)
+menu_driver(MENU *menu, int c)
{
#define NAVIGATE(dir) \
if (!item->dir)\
diff --git a/menu/m_format.c b/menu/m_format.c
index 9738dbf25d2d..848de0b21118 100644
--- a/menu/m_format.c
+++ b/menu/m_format.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_format.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
#define minimum(a,b) ((a)<(b) ? (a): (b))
@@ -56,8 +56,8 @@ MODULE_ID("$Id: m_format.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
| E_NOT_CONNECTED - there are no items connected
| E_POSTED - the menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_format(MENU * menu, int rows, int cols)
+MENU_EXPORT(int)
+set_menu_format(MENU *menu, int rows, int cols)
{
int total_rows, total_cols;
@@ -120,8 +120,8 @@ set_menu_format(MENU * menu, int rows, int cols)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-menu_format(const MENU * menu, int *rows, int *cols)
+MENU_EXPORT(void)
+menu_format(const MENU *menu, int *rows, int *cols)
{
if (rows)
*rows = Normalize_Menu(menu)->frows;
diff --git a/menu/m_global.c b/menu/m_global.c
index 489987febaa1..2e5211468a86 100644
--- a/menu/m_global.c
+++ b/menu/m_global.c
@@ -38,11 +38,11 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.30 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.32 2020/12/12 00:38:02 tom Exp $")
static char mark[] = "-";
/* *INDENT-OFF* */
-NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
+MENU_EXPORT_VAR(MENU) _nc_Default_Menu = {
16, /* Nr. of chars high */
1, /* Nr. of chars wide */
16, /* Nr. of items high */
@@ -81,7 +81,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
0 /* status */
};
-NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = {
+MENU_EXPORT_VAR(ITEM) _nc_Default_Item = {
{ (char *)0, 0 }, /* name */
{ (char *)0, 0 }, /* description */
(MENU *)0, /* Pointer to parent menu */
@@ -108,7 +108,7 @@ NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = {
| Return Values : -
+--------------------------------------------------------------------------*/
NCURSES_INLINE static void
-ComputeMaximum_NameDesc_Lengths(MENU * menu)
+ComputeMaximum_NameDesc_Lengths(MENU *menu)
{
unsigned MaximumNameLength = 0;
unsigned MaximumDescriptionLength = 0;
@@ -142,7 +142,7 @@ ComputeMaximum_NameDesc_Lengths(MENU * menu)
| Return Values : -
+--------------------------------------------------------------------------*/
NCURSES_INLINE static void
-ResetConnectionInfo(MENU * menu, ITEM ** items)
+ResetConnectionInfo(MENU *menu, ITEM **items)
{
ITEM **item;
@@ -150,13 +150,13 @@ ResetConnectionInfo(MENU * menu, ITEM ** items)
for (item = items; *item; item++)
{
(*item)->index = 0;
- (*item)->imenu = (MENU *) 0;
+ (*item)->imenu = (MENU *)0;
}
if (menu->pattern)
free(menu->pattern);
menu->pattern = (char *)0;
menu->pindex = 0;
- menu->items = (ITEM **) 0;
+ menu->items = (ITEM **)0;
menu->nitems = 0;
}
@@ -171,8 +171,8 @@ ResetConnectionInfo(MENU * menu, ITEM ** items)
| Return Values : TRUE - successful connection
| FALSE - connection failed
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
-_nc_Connect_Items(MENU * menu, ITEM ** items)
+MENU_EXPORT(bool)
+_nc_Connect_Items(MENU *menu, ITEM **items)
{
ITEM **item;
unsigned int ItemCount = 0;
@@ -233,8 +233,8 @@ _nc_Connect_Items(MENU * menu, ITEM ** items)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Disconnect_Items(MENU * menu)
+MENU_EXPORT(void)
+_nc_Disconnect_Items(MENU *menu)
{
if (menu && menu->items)
ResetConnectionInfo(menu, menu->items);
@@ -248,8 +248,8 @@ _nc_Disconnect_Items(MENU * menu)
|
| Return Values : the width
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-_nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ )
+MENU_EXPORT(int)
+_nc_Calculate_Text_Width(const TEXT *item /*FIXME: limit length */ )
{
#if USE_WIDEC_SUPPORT
int result = item->length;
@@ -289,7 +289,7 @@ _nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ )
*/
#if USE_WIDEC_SUPPORT
static int
-calculate_actual_width(MENU * menu, bool name)
+calculate_actual_width(MENU *menu, bool name)
{
int width = 0;
int check = 0;
@@ -337,8 +337,8 @@ calculate_actual_width(MENU * menu, bool name)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Calculate_Item_Length_and_Width(MENU * menu)
+MENU_EXPORT(void)
+_nc_Calculate_Item_Length_and_Width(MENU *menu)
{
int l;
@@ -376,8 +376,8 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Link_Items(MENU * menu)
+MENU_EXPORT(void)
+_nc_Link_Items(MENU *menu)
{
if (menu && menu->items && *(menu->items))
{
@@ -408,14 +408,14 @@ _nc_Link_Items(MENU * menu)
(cycle ? menu->items[(Last_in_Row >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Row] :
- (ITEM *) 0);
+ (ITEM *)0);
item->right = ((col < (Number_Of_Columns - 1)) &&
((i + 1) < Number_Of_Items)
)?
menu->items[i + 1] :
(cycle ? menu->items[row * Number_Of_Columns] :
- (ITEM *) 0
+ (ITEM *)0
);
Last_in_Column = (menu->rows - 1) * Number_Of_Columns + col;
@@ -424,14 +424,14 @@ _nc_Link_Items(MENU * menu)
(cycle ? menu->items[(Last_in_Column >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Column] :
- (ITEM *) 0);
+ (ITEM *)0);
item->down = ((i + Number_Of_Columns) < Number_Of_Items)
?
menu->items[i + Number_Of_Columns] :
(cycle ? menu->items[(row + 1) < menu->rows ?
Number_Of_Items - 1 : col] :
- (ITEM *) 0);
+ (ITEM *)0);
item->x = (short)col;
item->y = (short)row;
if (++col == Number_Of_Columns)
@@ -456,12 +456,12 @@ _nc_Link_Items(MENU * menu)
(cycle ? (Last_in_Column >= Number_Of_Items) ?
menu->items[Last_in_Column - Number_Of_Rows] :
menu->items[Last_in_Column] :
- (ITEM *) 0);
+ (ITEM *)0);
item->right = ((i + Number_Of_Rows) < Number_Of_Items)
?
menu->items[i + Number_Of_Rows] :
- (cycle ? menu->items[row] : (ITEM *) 0);
+ (cycle ? menu->items[row] : (ITEM *)0);
Last_in_Row = col * Number_Of_Rows + (Number_Of_Rows - 1);
@@ -471,7 +471,7 @@ _nc_Link_Items(MENU * menu)
menu->items[(Last_in_Row >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Row] :
- (ITEM *) 0);
+ (ITEM *)0);
item->down = (row < (Number_Of_Rows - 1))
?
@@ -480,7 +480,7 @@ _nc_Link_Items(MENU * menu)
(col - 1) * Number_Of_Rows + row + 1]) :
(cycle ?
menu->items[col * Number_Of_Rows] :
- (ITEM *) 0
+ (ITEM *)0
);
item->x = (short)col;
@@ -503,8 +503,8 @@ _nc_Link_Items(MENU * menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Show_Menu(const MENU * menu)
+MENU_EXPORT(void)
+_nc_Show_Menu(const MENU *menu)
{
WINDOW *win;
int maxy, maxx;
@@ -543,11 +543,11 @@ _nc_Show_Menu(const MENU * menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
+MENU_EXPORT(void)
_nc_New_TopRow_and_CurrentItem(
- MENU * menu,
+ MENU *menu,
int new_toprow,
- ITEM * new_current_item)
+ ITEM *new_current_item)
{
ITEM *cur_item;
bool mterm_called = FALSE;
diff --git a/menu/m_hook.c b/menu/m_hook.c
index c98aede7969d..916b9fc7ce7d 100644
--- a/menu/m_hook.c
+++ b/menu/m_hook.c
@@ -38,11 +38,11 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_hook.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.20 2020/07/04 19:45:16 tom Exp $")
/* "Template" macro to generate function to set application specific hook */
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
-NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
+MENU_EXPORT(int) NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
{\
TR_FUNC_BFR(1);\
T((T_CALLED("set_" #typ "_" #name "(%p,%s)"), (void *) menu, TR_FUNC_ARG(0, func)));\
@@ -52,7 +52,7 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook f
/* "Template" macro to generate function to get application specific hook */
#define GEN_HOOK_GET_FUNCTION( typ, name ) \
-NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\
+MENU_EXPORT(Menu_Hook) NCURSES_API typ ## _ ## name ( const MENU *menu )\
{\
T((T_CALLED(#typ "_" #name "(%p)"), (const void *) menu));\
returnMenuHook(Normalize_Menu(menu) -> typ ## name);\
diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c
index c09bf31125f9..dcb0be156ac5 100644
--- a/menu/m_item_cur.c
+++ b/menu/m_item_cur.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_cur.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_cur.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -48,8 +48,8 @@ MODULE_ID("$Id: m_item_cur.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_current_item(MENU * menu, ITEM * item)
+MENU_EXPORT(int)
+set_current_item(MENU *menu, ITEM *item)
{
T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item));
@@ -89,11 +89,11 @@ set_current_item(MENU * menu, ITEM * item)
|
| Return Values : Item pointer or NULL if failure
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(ITEM *)
-current_item(const MENU * menu)
+MENU_EXPORT(ITEM *)
+current_item(const MENU *menu)
{
T((T_CALLED("current_item(%p)"), (const void *)menu));
- returnItem((menu && menu->items) ? menu->curitem : (ITEM *) 0);
+ returnItem((menu && menu->items) ? menu->curitem : (ITEM *)0);
}
/*---------------------------------------------------------------------------
@@ -104,8 +104,8 @@ current_item(const MENU * menu)
|
| Return Values : The index or ERR if this is an invalid item pointer
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_index(const ITEM * item)
+MENU_EXPORT(int)
+item_index(const ITEM *item)
{
T((T_CALLED("item_index(%p)"), (const void *)item));
returnCode((item && item->imenu) ? item->index : ERR);
diff --git a/menu/m_item_nam.c b/menu/m_item_nam.c
index aaf54e0a3352..92966270454d 100644
--- a/menu/m_item_nam.c
+++ b/menu/m_item_nam.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_nam.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_nam.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -48,8 +48,8 @@ MODULE_ID("$Id: m_item_nam.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : See above; returns NULL if item is invalid
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
-item_name(const ITEM * item)
+MENU_EXPORT(const char *)
+item_name(const ITEM *item)
{
T((T_CALLED("item_name(%p)"), (const void *)item));
returnCPtr((item) ? item->name.str : (char *)0);
@@ -63,8 +63,8 @@ item_name(const ITEM * item)
|
| Return Values : See above; Returns NULL if item is invalid
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
-item_description(const ITEM * item)
+MENU_EXPORT(const char *)
+item_description(const ITEM *item)
{
T((T_CALLED("item_description(%p)"), (const void *)item));
returnCPtr((item) ? item->description.str : (char *)0);
diff --git a/menu/m_item_new.c b/menu/m_item_new.c
index 1e7950db2f51..4e3f67bacdd0 100644
--- a/menu/m_item_new.c
+++ b/menu/m_item_new.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -45,7 +45,7 @@
#endif
#endif
-MODULE_ID("$Id: m_item_new.c,v 1.34 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.37 2021/02/13 19:40:51 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -75,7 +75,7 @@ Is_Printable_String(const char *s)
mbstowcs(temp, s, (unsigned)count);
for (n = 0; n < count; ++n)
- if (!iswprint((wint_t) temp[n]))
+ if (!iswprint((wint_t)temp[n]))
{
result = FALSE;
break;
@@ -107,7 +107,7 @@ Is_Printable_String(const char *s)
|
| Return Values : The item pointer or NULL if creation failed.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(ITEM *)
+MENU_EXPORT(ITEM *)
new_item(const char *name, const char *description)
{
ITEM *item;
@@ -118,14 +118,16 @@ new_item(const char *name, const char *description)
if (!name || (*name == '\0') || !Is_Printable_String(name))
{
- item = (ITEM *) 0;
+ item = (ITEM *)0;
SET_ERROR(E_BAD_ARGUMENT);
}
else
{
item = typeCalloc(ITEM, 1);
+
if (item)
{
+ T((T_CREATE("item %p"), (void *)item));
*item = _nc_Default_Item; /* hope we have struct assignment */
item->name.length = (unsigned short)strlen(name);
@@ -160,8 +162,8 @@ new_item(const char *name, const char *description)
| E_BAD_ARGUMENT - invalid value has been passed
| E_CONNECTED - item is still connected to a menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-free_item(ITEM * item)
+MENU_EXPORT(int)
+free_item(ITEM *item)
{
T((T_CALLED("free_item(%p)"), (void *)item));
@@ -193,8 +195,8 @@ free_item(ITEM * item)
| E_BAD_ARGUMENT - an invalid value has been passed
| E_SYSTEM_ERROR - no memory to store mark
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_mark(MENU * menu, const char *mark)
+MENU_EXPORT(int)
+set_menu_mark(MENU *menu, const char *mark)
{
short l;
@@ -265,8 +267,8 @@ set_menu_mark(MENU * menu, const char *mark)
|
| Return Values : The marker string pointer or NULL if no marker defined
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
-menu_mark(const MENU * menu)
+MENU_EXPORT(const char *)
+menu_mark(const MENU *menu)
{
T((T_CALLED("menu_mark(%p)"), (const void *)menu));
returnPtr(Normalize_Menu(menu)->mark);
diff --git a/menu/m_item_opt.c b/menu/m_item_opt.c
index f8df220552eb..985fd2988c37 100644
--- a/menu/m_item_opt.c
+++ b/menu/m_item_opt.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_opt.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_opt.c,v 1.21 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,8 +51,8 @@ MODULE_ID("$Id: m_item_opt.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid item options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_item_opts(ITEM * item, Item_Options opts)
+MENU_EXPORT(int)
+set_item_opts(ITEM *item, Item_Options opts)
{
T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts));
@@ -94,8 +94,8 @@ set_item_opts(ITEM * item, Item_Options opts)
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_opts_off(ITEM * item, Item_Options opts)
+MENU_EXPORT(int)
+item_opts_off(ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
@@ -122,8 +122,8 @@ item_opts_off(ITEM * item, Item_Options opts)
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_opts_on(ITEM * item, Item_Options opts)
+MENU_EXPORT(int)
+item_opts_on(ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
@@ -150,8 +150,8 @@ item_opts_on(ITEM * item, Item_Options opts)
|
| Return Values : Items options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(Item_Options)
-item_opts(const ITEM * item)
+MENU_EXPORT(Item_Options)
+item_opts(const ITEM *item)
{
T((T_CALLED("item_opts(%p)"), (const void *)item));
returnItemOpts(ALL_ITEM_OPTS & Normalize_Item(item)->opt);
diff --git a/menu/m_item_top.c b/menu/m_item_top.c
index 9417e72bb561..ee0d17b43dd5 100644
--- a/menu/m_item_top.c
+++ b/menu/m_item_top.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_top.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,8 +50,8 @@ MODULE_ID("$Id: m_item_top.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - not a menu pointer or invalid row
| E_NOT_CONNECTED - there are no items for the menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_top_row(MENU * menu, int row)
+MENU_EXPORT(int)
+set_top_row(MENU *menu, int row)
{
ITEM *item;
@@ -61,7 +61,7 @@ set_top_row(MENU * menu, int row)
{
if (menu->status & _IN_DRIVER)
RETURN(E_BAD_STATE);
- if (menu->items == (ITEM **) 0)
+ if (menu->items == (ITEM **)0)
RETURN(E_NOT_CONNECTED);
if ((row < 0) || (row > (menu->rows - menu->arows)))
@@ -92,8 +92,8 @@ set_top_row(MENU * menu, int row)
|
| Return Values : The row number or ERR if there is no row
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-top_row(const MENU * menu)
+MENU_EXPORT(int)
+top_row(const MENU *menu)
{
T((T_CALLED("top_row(%p)"), (const void *)menu));
if (menu && menu->items && *(menu->items))
diff --git a/menu/m_item_use.c b/menu/m_item_use.c
index 308143275199..52d087e91df3 100644
--- a/menu/m_item_use.c
+++ b/menu/m_item_use.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_use.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_use.c,v 1.21 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,8 +49,8 @@ MODULE_ID("$Id: m_item_use.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_item_userptr(ITEM * item, void *userptr)
+MENU_EXPORT(int)
+set_item_userptr(ITEM *item, void *userptr)
{
T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr));
Normalize_Item(item)->userptr = userptr;
@@ -67,8 +67,8 @@ set_item_userptr(ITEM * item, void *userptr)
| Return Values : Value of the pointer. If no such pointer has been set,
| NULL is returned.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
-item_userptr(const ITEM * item)
+MENU_EXPORT(void *)
+item_userptr(const ITEM *item)
{
T((T_CALLED("item_userptr(%p)"), (const void *)item));
returnVoidPtr(Normalize_Item(item)->userptr);
diff --git a/menu/m_item_val.c b/menu/m_item_val.c
index d8d11f211765..a5c38e2716dc 100644
--- a/menu/m_item_val.c
+++ b/menu/m_item_val.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_val.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -53,8 +53,8 @@ MODULE_ID("$Id: m_item_val.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_REQUEST_DENIED - not selectable or single valued menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_item_value(ITEM * item, bool value)
+MENU_EXPORT(int)
+set_item_value(ITEM *item, bool value)
{
MENU *menu;
@@ -95,8 +95,8 @@ set_item_value(ITEM * item, bool value)
| Return Values : TRUE - if item is selected
| FALSE - if item is not selected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
-item_value(const ITEM * item)
+MENU_EXPORT(bool)
+item_value(const ITEM *item)
{
T((T_CALLED("item_value(%p)"), (const void *)item));
returnBool((Normalize_Item(item)->value) ? TRUE : FALSE);
diff --git a/menu/m_item_vis.c b/menu/m_item_vis.c
index 8e9934134b16..8e409cb864ad 100644
--- a/menu/m_item_vis.c
+++ b/menu/m_item_vis.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_vis.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_item_vis.c,v 1.19 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,8 +50,8 @@ MODULE_ID("$Id: m_item_vis.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
| Return Values : TRUE if visible
| FALSE if invisible
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
-item_visible(const ITEM * item)
+MENU_EXPORT(bool)
+item_visible(const ITEM *item)
{
MENU *menu;
diff --git a/menu/m_items.c b/menu/m_items.c
index 9f46c8be2b53..5b24cb76a01d 100644
--- a/menu/m_items.c
+++ b/menu/m_items.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_items.c,v 1.18 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_items.c,v 1.20 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -53,8 +53,8 @@ MODULE_ID("$Id: m_items.c,v 1.18 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - An incorrect menu or item array was
| passed to the function
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_items(MENU * menu, ITEM ** items)
+MENU_EXPORT(int)
+set_menu_items(MENU *menu, ITEM **items)
{
T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items));
@@ -85,11 +85,11 @@ set_menu_items(MENU * menu, ITEM ** items)
|
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(ITEM **)
-menu_items(const MENU * menu)
+MENU_EXPORT(ITEM **)
+menu_items(const MENU *menu)
{
T((T_CALLED("menu_items(%p)"), (const void *)menu));
- returnItemPtr(menu ? menu->items : (ITEM **) 0);
+ returnItemPtr(menu ? menu->items : (ITEM **)0);
}
/*---------------------------------------------------------------------------
@@ -101,8 +101,8 @@ menu_items(const MENU * menu)
|
| Return Values : Number of items or -1 to indicate error.
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-item_count(const MENU * menu)
+MENU_EXPORT(int)
+item_count(const MENU *menu)
{
T((T_CALLED("item_count(%p)"), (const void *)menu));
returnCode(menu ? menu->nitems : -1);
diff --git a/menu/m_new.c b/menu/m_new.c
index cf89196abd83..82c410c6a96a 100644
--- a/menu/m_new.c
+++ b/menu/m_new.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_new.c,v 1.22 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.26 2021/02/13 19:43:10 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,8 +51,8 @@ MODULE_ID("$Id: m_new.c,v 1.22 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(MENU *)
-NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
+MENU_EXPORT(MENU *)
+NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM **items)
{
int err = E_SYSTEM_ERROR;
MENU *menu = typeCalloc(MENU, 1);
@@ -60,6 +60,7 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
T((T_CALLED("new_menu(%p,%p)"), (void *)SP_PARM, (void *)items));
if (menu)
{
+ T((T_CREATE("menu %p"), (void *)menu));
*menu = _nc_Default_Menu;
menu->status = 0;
menu->rows = menu->frows;
@@ -77,7 +78,7 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
{
err = E_NOT_CONNECTED;
free(menu);
- menu = (MENU *) 0;
+ menu = (MENU *)0;
}
else
err = E_OK;
@@ -102,8 +103,8 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
#if NCURSES_SP_FUNCS
-NCURSES_EXPORT(MENU *)
-new_menu(ITEM ** items)
+MENU_EXPORT(MENU *)
+new_menu(ITEM **items)
{
return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items);
}
@@ -120,8 +121,8 @@ new_menu(ITEM ** items)
| E_BAD_ARGUMENT - Invalid menu pointer passed
| E_POSTED - Menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-free_menu(MENU * menu)
+MENU_EXPORT(int)
+free_menu(MENU *menu)
{
T((T_CALLED("free_menu(%p)"), (void *)menu));
if (!menu)
diff --git a/menu/m_opts.c b/menu/m_opts.c
index 4c29f333bec7..bbf9459c9484 100644
--- a/menu/m_opts.c
+++ b/menu/m_opts.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_opts.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_opts.c,v 1.23 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -53,8 +53,8 @@ MODULE_ID("$Id: m_opts.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - invalid menu options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_opts(MENU * menu, Menu_Options opts)
+MENU_EXPORT(int)
+set_menu_opts(MENU *menu, Menu_Options opts)
{
T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts));
@@ -86,7 +86,7 @@ set_menu_opts(MENU * menu, Menu_Options opts)
{
ITEM **item;
- if (((item = menu->items) != (ITEM **) 0))
+ if (((item = menu->items) != (ITEM **)0))
for (; *item; item++)
(*item)->value = FALSE;
}
@@ -113,8 +113,8 @@ set_menu_opts(MENU * menu, Menu_Options opts)
| E_BAD_ARGUMENT - invalid options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_opts_off(MENU * menu, Menu_Options opts)
+MENU_EXPORT(int)
+menu_opts_off(MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
@@ -146,8 +146,8 @@ menu_opts_off(MENU * menu, Menu_Options opts)
| E_BAD_ARGUMENT - invalid menu options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_opts_on(MENU * menu, Menu_Options opts)
+MENU_EXPORT(int)
+menu_opts_on(MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
@@ -174,8 +174,8 @@ menu_opts_on(MENU * menu, Menu_Options opts)
|
| Return Values : Menu options
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(Menu_Options)
-menu_opts(const MENU * menu)
+MENU_EXPORT(Menu_Options)
+menu_opts(const MENU *menu)
{
T((T_CALLED("menu_opts(%p)"), (const void *)menu));
returnMenuOpts(ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
diff --git a/menu/m_pad.c b/menu/m_pad.c
index 3d5702ae96f4..88dad151d6ff 100644
--- a/menu/m_pad.c
+++ b/menu/m_pad.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_pad.c,v 1.14 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.16 2020/12/12 00:38:14 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
@@ -59,10 +59,10 @@ MODULE_ID("$Id: m_pad.c,v 1.14 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_pad(MENU * menu, int pad)
+MENU_EXPORT(int)
+set_menu_pad(MENU *menu, int pad)
{
- bool do_refresh = (menu != (MENU *) 0);
+ bool do_refresh = (menu != (MENU *)0);
T((T_CALLED("set_menu_pad(%p,%d)"), (void *)menu, pad));
@@ -86,8 +86,8 @@ set_menu_pad(MENU * menu, int pad)
|
| Return Values : The pad character
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_pad(const MENU * menu)
+MENU_EXPORT(int)
+menu_pad(const MENU *menu)
{
T((T_CALLED("menu_pad(%p)"), (const void *)menu));
returnCode(Normalize_Menu(menu)->pad);
diff --git a/menu/m_pattern.c b/menu/m_pattern.c
index 9ff02304892d..58047df218d4 100644
--- a/menu/m_pattern.c
+++ b/menu/m_pattern.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_pattern.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_pattern.c,v 1.19 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,8 +51,8 @@ MODULE_ID("$Id: m_pattern.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
| pattern is stored
| PatternString - as expected
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(char *)
-menu_pattern(const MENU * menu)
+MENU_EXPORT(char *)
+menu_pattern(const MENU *menu)
{
static char empty[] = "";
@@ -73,8 +73,8 @@ menu_pattern(const MENU * menu)
| E_NOT_CONNECTED - no items connected to menu
| E_NO_MATCH - no item matches pattern
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_pattern(MENU * menu, const char *p)
+MENU_EXPORT(int)
+set_menu_pattern(MENU *menu, const char *p)
{
ITEM *matchitem;
int matchpos;
diff --git a/menu/m_post.c b/menu/m_post.c
index 2cc0ea09d5fe..bfc633164b49 100644
--- a/menu/m_post.c
+++ b/menu/m_post.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.32 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.34 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,8 +49,8 @@ MODULE_ID("$Id: m_post.c,v 1.32 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Post_Item(const MENU * menu, const ITEM * item)
+MENU_EXPORT(void)
+_nc_Post_Item(const MENU *menu, const ITEM *item)
{
int i;
chtype ch;
@@ -197,8 +197,8 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void)
-_nc_Draw_Menu(const MENU * menu)
+MENU_EXPORT(void)
+_nc_Draw_Menu(const MENU *menu)
{
ITEM *item = menu->items[0];
ITEM *lasthor, *lastvert;
@@ -213,14 +213,14 @@ _nc_Draw_Menu(const MENU * menu)
werase(menu->win);
wbkgdset(menu->win, s_bkgd);
- lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *) 0 : item;
+ lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : item;
do
{
wmove(menu->win, y, 0);
hitem = item;
- lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *) 0 : hitem;
+ lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
do
{
@@ -267,8 +267,8 @@ _nc_Draw_Menu(const MENU * menu)
| E_BAD_STATE - Menu in userexit routine
| E_POSTED - Menu already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-post_menu(MENU * menu)
+MENU_EXPORT(int)
+post_menu(MENU *menu)
{
T((T_CALLED("post_menu(%p)"), (void *)menu));
@@ -339,8 +339,8 @@ post_menu(MENU * menu)
| E_BAD_STATE - menu in userexit routine
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-unpost_menu(MENU * menu)
+MENU_EXPORT(int)
+unpost_menu(MENU *menu)
{
WINDOW *win;
diff --git a/menu/m_req_name.c b/menu/m_req_name.c
index d3f04c1d35a2..7d1e7bf5d106 100644
--- a/menu/m_req_name.c
+++ b/menu/m_req_name.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_req_name.c,v 1.24 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.25 2020/05/24 01:40:20 anonymous.maarten Exp $")
#define DATA(s) { s }
@@ -74,7 +74,7 @@ static const char request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1][14] =
| Return Values : Pointer to name - on success
| NULL - on invalid request code
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(const char *)
+MENU_EXPORT(const char *)
menu_request_name(int request)
{
T((T_CALLED("menu_request_name(%d)"), request));
@@ -96,7 +96,7 @@ menu_request_name(int request)
| Return Values : Request Id - on success
| E_NO_MATCH - request not found
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
+MENU_EXPORT(int)
menu_request_by_name(const char *str)
{
/* because the table is so small, it doesn't really hurt
diff --git a/menu/m_scale.c b/menu/m_scale.c
index e013acd8441a..0067ae76a1c9 100644
--- a/menu/m_scale.c
+++ b/menu/m_scale.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_scale.c,v 1.13 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,8 +51,8 @@ MODULE_ID("$Id: m_scale.c,v 1.11 2020/02/02 23:34:34 tom Exp $")
| E_BAD_ARGUMENT - invalid menu pointer
| E_NOT_CONNECTED - no items are connected to menu
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-scale_menu(const MENU * menu, int *rows, int *cols)
+MENU_EXPORT(int)
+scale_menu(const MENU *menu, int *rows, int *cols)
{
T((T_CALLED("scale_menu(%p,%p,%p)"),
(const void *)menu,
diff --git a/menu/m_spacing.c b/menu/m_spacing.c
index 9bb746a0810b..76f8d5caa2d2 100644
--- a/menu/m_spacing.c
+++ b/menu/m_spacing.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_spacing.c,v 1.20 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.22 2020/12/12 00:38:14 tom Exp $")
#define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
#define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
@@ -52,8 +52,8 @@ MODULE_ID("$Id: m_spacing.c,v 1.20 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col)
+MENU_EXPORT(int)
+set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col)
{
MENU *m; /* split for ATAC workaround */
@@ -87,8 +87,8 @@ set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col)
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col)
+MENU_EXPORT(int)
+menu_spacing(const MENU *menu, int *s_desc, int *s_row, int *s_col)
{
const MENU *m; /* split for ATAC workaround */
diff --git a/menu/m_sub.c b/menu/m_sub.c
index 4658e90e5a07..5f898b0f7766 100644
--- a/menu/m_sub.c
+++ b/menu/m_sub.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.15 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,8 +49,8 @@ MODULE_ID("$Id: m_sub.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_sub(MENU * menu, WINDOW *win)
+MENU_EXPORT(int)
+set_menu_sub(MENU *menu, WINDOW *win)
{
T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win));
@@ -89,8 +89,8 @@ set_menu_sub(MENU * menu, WINDOW *win)
|
| Return Values : NULL on error, otherwise a pointer to the window
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
-menu_sub(const MENU * menu)
+MENU_EXPORT(WINDOW *)
+menu_sub(const MENU *menu)
{
const MENU *m = Normalize_Menu(menu);
diff --git a/menu/m_trace.c b/menu/m_trace.c
index f5332b189166..331236c51268 100644
--- a/menu/m_trace.c
+++ b/menu/m_trace.c
@@ -33,37 +33,37 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_trace.c,v 1.7 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_trace.c,v 1.9 2020/12/12 00:38:14 tom Exp $")
-NCURSES_EXPORT(ITEM *)
-_nc_retrace_item(ITEM * code)
+MENU_EXPORT(ITEM *)
+_nc_retrace_item(ITEM *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(ITEM **)
-_nc_retrace_item_ptr(ITEM ** code)
+MENU_EXPORT(ITEM **)
+_nc_retrace_item_ptr(ITEM **code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(Item_Options)
+MENU_EXPORT(Item_Options)
_nc_retrace_item_opts(Item_Options code)
{
T((T_RETURN("%d"), code));
return code;
}
-NCURSES_EXPORT(MENU *)
-_nc_retrace_menu(MENU * code)
+MENU_EXPORT(MENU *)
+_nc_retrace_menu(MENU *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
-NCURSES_EXPORT(Menu_Hook)
+MENU_EXPORT(Menu_Hook)
_nc_retrace_menu_hook(Menu_Hook code)
{
TR_FUNC_BFR(1);
@@ -71,7 +71,7 @@ _nc_retrace_menu_hook(Menu_Hook code)
return code;
}
-NCURSES_EXPORT(Menu_Options)
+MENU_EXPORT(Menu_Options)
_nc_retrace_menu_opts(Menu_Options code)
{
T((T_RETURN("%d"), code));
diff --git a/menu/m_userptr.c b/menu/m_userptr.c
index df3a45f89d3a..72f2d4ca8f24 100644
--- a/menu/m_userptr.c
+++ b/menu/m_userptr.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_userptr.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_userptr.c,v 1.21 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,8 +49,8 @@ MODULE_ID("$Id: m_userptr.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_userptr(MENU * menu, void *userptr)
+MENU_EXPORT(int)
+set_menu_userptr(MENU *menu, void *userptr)
{
T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr));
Normalize_Menu(menu)->userptr = userptr;
@@ -67,8 +67,8 @@ set_menu_userptr(MENU * menu, void *userptr)
| Return Values : Value of the pointer. If no such pointer has been set,
| NULL is returned
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(void *)
-menu_userptr(const MENU * menu)
+MENU_EXPORT(void *)
+menu_userptr(const MENU *menu)
{
T((T_CALLED("menu_userptr(%p)"), (const void *)menu));
returnVoidPtr(Normalize_Menu(menu)->userptr);
diff --git a/menu/m_win.c b/menu/m_win.c
index f06c58083d9b..72f72ad0cc90 100644
--- a/menu/m_win.c
+++ b/menu/m_win.c
@@ -38,7 +38,7 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_win.c,v 1.18 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: m_win.c,v 1.20 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,8 +49,8 @@ MODULE_ID("$Id: m_win.c,v 1.18 2020/02/02 23:34:34 tom Exp $")
| Return Values : E_OK - success
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(int)
-set_menu_win(MENU * menu, WINDOW *win)
+MENU_EXPORT(int)
+set_menu_win(MENU *menu, WINDOW *win)
{
T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win));
@@ -89,8 +89,8 @@ set_menu_win(MENU * menu, WINDOW *win)
|
| Return Values : NULL on error, otherwise pointer to window
+--------------------------------------------------------------------------*/
-NCURSES_EXPORT(WINDOW *)
-menu_win(const MENU * menu)
+MENU_EXPORT(WINDOW *)
+menu_win(const MENU *menu)
{
const MENU *m = Normalize_Menu(menu);
diff --git a/menu/menu.h b/menu/menu.h
index b2e845c6fa45..e5a53729d65f 100644
--- a/menu/menu.h
+++ b/menu/menu.h
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.h,v 1.24 2020/02/02 23:34:34 tom Exp $ */
+/* $Id: menu.h,v 1.26 2020/12/12 00:38:02 tom Exp $ */
#ifndef ETI_MENU
#define ETI_MENU
@@ -44,11 +44,23 @@
#include <eti.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
-typedef int Menu_Options;
-typedef int Item_Options;
+#if defined(BUILDING_MENU)
+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API
+#define MENU_EXPORT_VAR(type) MENU_IMPEXP type
+
+ typedef int Menu_Options;
+ typedef int Item_Options;
/* Menu options: */
#define O_ONEVALUE (0x01)
@@ -63,85 +75,85 @@ typedef int Item_Options;
#define O_SELECTABLE (0x01)
#if !NCURSES_OPAQUE_MENU
-typedef struct
-{
- const char* str;
- unsigned short length;
-} TEXT;
-#endif /* !NCURSES_OPAQUE_MENU */
+ typedef struct
+ {
+ const char *str;
+ unsigned short length;
+ }
+ TEXT;
+#endif /* !NCURSES_OPAQUE_MENU */
-struct tagMENU;
+ struct tagMENU;
-typedef struct tagITEM
+ typedef struct tagITEM
#if !NCURSES_OPAQUE_MENU
-{
- TEXT name; /* name of menu item */
- TEXT description; /* description of item, optional in display */
- struct tagMENU *imenu; /* Pointer to parent menu */
- void *userptr; /* Pointer to user defined per item data */
- Item_Options opt; /* Item options */
- short index; /* Item number if connected to a menu */
- short y; /* y and x location of item in menu */
- short x;
- bool value; /* Selection value */
-
- struct tagITEM *left; /* neighbor items */
- struct tagITEM *right;
- struct tagITEM *up;
- struct tagITEM *down;
-
-}
-#endif /* !NCURSES_OPAQUE_MENU */
-ITEM;
-
-typedef void (*Menu_Hook)(struct tagMENU *);
-
-typedef struct tagMENU
-#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
-{
- short height; /* Nr. of chars high */
- short width; /* Nr. of chars wide */
- short rows; /* Nr. of items high */
- short cols; /* Nr. of items wide */
- short frows; /* Nr. of formatted items high */
- short fcols; /* Nr. of formatted items wide */
- short arows; /* Nr. of items high (actual) */
- short namelen; /* Max. name length */
- short desclen; /* Max. description length */
- short marklen; /* Length of mark, if any */
- short itemlen; /* Length of one item */
- short spc_desc; /* Spacing for descriptor */
- short spc_cols; /* Spacing for columns */
- short spc_rows; /* Spacing for rows */
- char *pattern; /* Buffer to store match chars */
- short pindex; /* Index into pattern buffer */
- WINDOW *win; /* Window containing menu */
- WINDOW *sub; /* Subwindow for menu display */
- WINDOW *userwin; /* User's window */
- WINDOW *usersub; /* User's subwindow */
- ITEM **items; /* array of items */
- short nitems; /* Nr. of items in menu */
- ITEM *curitem; /* Current item */
- short toprow; /* Top row of menu */
- chtype fore; /* Selection attribute */
- chtype back; /* Nonselection attribute */
- chtype grey; /* Inactive attribute */
- unsigned char pad; /* Pad character */
-
- Menu_Hook menuinit; /* User hooks */
- Menu_Hook menuterm;
- Menu_Hook iteminit;
- Menu_Hook itemterm;
-
- void *userptr; /* Pointer to menus user data */
- char *mark; /* Pointer to marker string */
-
- Menu_Options opt; /* Menu options */
- unsigned short status; /* Internal state of menu */
-}
-#endif /* !NCURSES_OPAQUE_MENU */
-MENU;
-
+ {
+ TEXT name; /* name of menu item */
+ TEXT description; /* description of item, optional in display */
+ struct tagMENU *imenu; /* Pointer to parent menu */
+ void *userptr; /* Pointer to user defined per item data */
+ Item_Options opt; /* Item options */
+ short index; /* Item number if connected to a menu */
+ short y; /* y and x location of item in menu */
+ short x;
+ bool value; /* Selection value */
+
+ struct tagITEM *left; /* neighbor items */
+ struct tagITEM *right;
+ struct tagITEM *up;
+ struct tagITEM *down;
+
+ }
+#endif /* !NCURSES_OPAQUE_MENU */
+ ITEM;
+
+ typedef void (*Menu_Hook) (struct tagMENU *);
+
+ typedef struct tagMENU
+#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
+ {
+ short height; /* Nr. of chars high */
+ short width; /* Nr. of chars wide */
+ short rows; /* Nr. of items high */
+ short cols; /* Nr. of items wide */
+ short frows; /* Nr. of formatted items high */
+ short fcols; /* Nr. of formatted items wide */
+ short arows; /* Nr. of items high (actual) */
+ short namelen; /* Max. name length */
+ short desclen; /* Max. description length */
+ short marklen; /* Length of mark, if any */
+ short itemlen; /* Length of one item */
+ short spc_desc; /* Spacing for descriptor */
+ short spc_cols; /* Spacing for columns */
+ short spc_rows; /* Spacing for rows */
+ char *pattern; /* Buffer to store match chars */
+ short pindex; /* Index into pattern buffer */
+ WINDOW *win; /* Window containing menu */
+ WINDOW *sub; /* Subwindow for menu display */
+ WINDOW *userwin; /* User's window */
+ WINDOW *usersub; /* User's subwindow */
+ ITEM **items; /* array of items */
+ short nitems; /* Nr. of items in menu */
+ ITEM *curitem; /* Current item */
+ short toprow; /* Top row of menu */
+ chtype fore; /* Selection attribute */
+ chtype back; /* Nonselection attribute */
+ chtype grey; /* Inactive attribute */
+ unsigned char pad; /* Pad character */
+
+ Menu_Hook menuinit; /* User hooks */
+ Menu_Hook menuterm;
+ Menu_Hook iteminit;
+ Menu_Hook itemterm;
+
+ void *userptr; /* Pointer to menus user data */
+ char *mark; /* Pointer to marker string */
+
+ Menu_Options opt; /* Menu options */
+ unsigned short status; /* Internal state of menu */
+ }
+#endif /* !NCURSES_OPAQUE_MENU */
+ MENU;
/* Define keys */
@@ -180,92 +192,90 @@ MENU;
# define MAX_COMMAND (KEY_MAX + 128)
#endif
-
/* --------- prototypes for libmenu functions ----------------------------- */
-extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *);
-extern NCURSES_EXPORT(ITEM *) current_item (const MENU *);
-extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *);
-
-extern NCURSES_EXPORT(MENU *) new_menu (ITEM **);
-
-extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *);
-extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *);
-
-extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *);
-extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *);
-
-extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *);
-extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *);
-
-extern NCURSES_EXPORT(const char *) item_description (const ITEM *);
-extern NCURSES_EXPORT(const char *) item_name (const ITEM *);
-extern NCURSES_EXPORT(const char *) menu_mark (const MENU *);
-extern NCURSES_EXPORT(const char *) menu_request_name (int);
-
-extern NCURSES_EXPORT(char *) menu_pattern (const MENU *);
-
-extern NCURSES_EXPORT(void *) menu_userptr (const MENU *);
-extern NCURSES_EXPORT(void *) item_userptr (const ITEM *);
-
-extern NCURSES_EXPORT(chtype) menu_back (const MENU *);
-extern NCURSES_EXPORT(chtype) menu_fore (const MENU *);
-extern NCURSES_EXPORT(chtype) menu_grey (const MENU *);
-
-extern NCURSES_EXPORT(int) free_item (ITEM *);
-extern NCURSES_EXPORT(int) free_menu (MENU *);
-extern NCURSES_EXPORT(int) item_count (const MENU *);
-extern NCURSES_EXPORT(int) item_index (const ITEM *);
-extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) menu_driver (MENU *,int);
-extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options);
-extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options);
-extern NCURSES_EXPORT(int) menu_pad (const MENU *);
-extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *);
-extern NCURSES_EXPORT(int) post_menu (MENU *);
-extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *);
-extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item);
-extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *);
-extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool);
-extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int);
-extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **);
-extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *);
-extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options);
-extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int);
-extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *);
-extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *);
-extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook);
-extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *);
-extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *);
-extern NCURSES_EXPORT(int) set_top_row (MENU *,int);
-extern NCURSES_EXPORT(int) top_row (const MENU *);
-extern NCURSES_EXPORT(int) unpost_menu (MENU *);
-extern NCURSES_EXPORT(int) menu_request_by_name (const char *);
-extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int);
-extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *);
-
-
-extern NCURSES_EXPORT(bool) item_value (const ITEM *);
-extern NCURSES_EXPORT(bool) item_visible (const ITEM *);
-
-extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *);
+ extern MENU_EXPORT(ITEM **) menu_items(const MENU *);
+ extern MENU_EXPORT(ITEM *) current_item(const MENU *);
+ extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);
+
+ extern MENU_EXPORT(MENU *) new_menu(ITEM **);
+
+ extern MENU_EXPORT(Item_Options) item_opts(const ITEM *);
+ extern MENU_EXPORT(Menu_Options) menu_opts(const MENU *);
+
+ extern MENU_EXPORT(Menu_Hook) item_init(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) item_term(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) menu_init(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) menu_term(const MENU *);
+
+ extern MENU_EXPORT(WINDOW *) menu_sub(const MENU *);
+ extern MENU_EXPORT(WINDOW *) menu_win(const MENU *);
+
+ extern MENU_EXPORT(const char *) item_description(const ITEM *);
+ extern MENU_EXPORT(const char *) item_name(const ITEM *);
+ extern MENU_EXPORT(const char *) menu_mark(const MENU *);
+ extern MENU_EXPORT(const char *) menu_request_name(int);
+
+ extern MENU_EXPORT(char *) menu_pattern(const MENU *);
+
+ extern MENU_EXPORT(void *) menu_userptr(const MENU *);
+ extern MENU_EXPORT(void *) item_userptr(const ITEM *);
+
+ extern MENU_EXPORT(chtype) menu_back(const MENU *);
+ extern MENU_EXPORT(chtype) menu_fore(const MENU *);
+ extern MENU_EXPORT(chtype) menu_grey(const MENU *);
+
+ extern MENU_EXPORT(int) free_item(ITEM *);
+ extern MENU_EXPORT(int) free_menu(MENU *);
+ extern MENU_EXPORT(int) item_count(const MENU *);
+ extern MENU_EXPORT(int) item_index(const ITEM *);
+ extern MENU_EXPORT(int) item_opts_off(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) item_opts_on(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) menu_driver(MENU *, int);
+ extern MENU_EXPORT(int) menu_opts_off(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) menu_opts_on(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) menu_pad(const MENU *);
+ extern MENU_EXPORT(int) pos_menu_cursor(const MENU *);
+ extern MENU_EXPORT(int) post_menu(MENU *);
+ extern MENU_EXPORT(int) scale_menu(const MENU *, int *, int *);
+ extern MENU_EXPORT(int) set_current_item(MENU *menu, ITEM *item);
+ extern MENU_EXPORT(int) set_item_init(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_item_opts(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) set_item_term(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_item_userptr(ITEM *, void *);
+ extern MENU_EXPORT(int) set_item_value(ITEM *, bool);
+ extern MENU_EXPORT(int) set_menu_back(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_fore(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_format(MENU *, int, int);
+ extern MENU_EXPORT(int) set_menu_grey(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_init(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_menu_items(MENU *, ITEM **);
+ extern MENU_EXPORT(int) set_menu_mark(MENU *, const char *);
+ extern MENU_EXPORT(int) set_menu_opts(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) set_menu_pad(MENU *, int);
+ extern MENU_EXPORT(int) set_menu_pattern(MENU *, const char *);
+ extern MENU_EXPORT(int) set_menu_sub(MENU *, WINDOW *);
+ extern MENU_EXPORT(int) set_menu_term(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_menu_userptr(MENU *, void *);
+ extern MENU_EXPORT(int) set_menu_win(MENU *, WINDOW *);
+ extern MENU_EXPORT(int) set_top_row(MENU *, int);
+ extern MENU_EXPORT(int) top_row(const MENU *);
+ extern MENU_EXPORT(int) unpost_menu(MENU *);
+ extern MENU_EXPORT(int) menu_request_by_name(const char *);
+ extern MENU_EXPORT(int) set_menu_spacing(MENU *, int, int, int);
+ extern MENU_EXPORT(int) menu_spacing(const MENU *, int *, int *, int *);
+
+ extern MENU_EXPORT(bool) item_value(const ITEM *);
+ extern MENU_EXPORT(bool) item_visible(const ITEM *);
+
+ extern MENU_EXPORT(void) menu_format(const MENU *, int *, int *);
#if NCURSES_SP_FUNCS
-extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+ extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN *, ITEM **);
#endif
#ifdef __cplusplus
- }
+}
#endif
-#endif /* ETI_MENU */
+#endif /* ETI_MENU */
diff --git a/menu/menu.priv.h b/menu/menu.priv.h
index d084565a6267..0bc6147e07d9 100644
--- a/menu/menu.priv.h
+++ b/menu/menu.priv.h
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.priv.h,v 1.28 2020/02/02 23:34:34 tom Exp $ */
+/* $Id: menu.priv.h,v 1.29 2020/05/24 01:40:20 anonymous.maarten Exp $ */
/***************************************************************************
* Module menu.priv.h *
@@ -52,8 +52,8 @@
/* Backspace code */
#define BS (8)
-extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item;
-extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
+extern MENU_EXPORT_VAR(ITEM) _nc_Default_Item;
+extern MENU_EXPORT_VAR(MENU) _nc_Default_Menu;
/* Normalize item to default if none was given */
#define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item)
@@ -120,17 +120,17 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
#define UChar(c) ((unsigned char)(c))
/* Internal functions. */
-extern NCURSES_EXPORT(void) _nc_Draw_Menu (const MENU *);
-extern NCURSES_EXPORT(void) _nc_Show_Menu (const MENU *);
-extern NCURSES_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *);
-extern NCURSES_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *);
-extern NCURSES_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *);
-extern NCURSES_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **);
-extern NCURSES_EXPORT(void) _nc_Disconnect_Items (MENU *);
-extern NCURSES_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *);
-extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *);
-extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**);
-extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item,
+extern MENU_EXPORT(void) _nc_Draw_Menu (const MENU *);
+extern MENU_EXPORT(void) _nc_Show_Menu (const MENU *);
+extern MENU_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *);
+extern MENU_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *);
+extern MENU_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *);
+extern MENU_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **);
+extern MENU_EXPORT(void) _nc_Disconnect_Items (MENU *);
+extern MENU_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *);
+extern MENU_EXPORT(void) _nc_Link_Items (MENU *);
+extern MENU_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**);
+extern MENU_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item,
int* pY, int* pX);
#ifdef TRACE
@@ -142,12 +142,12 @@ extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* i
#define returnMenuHook(code) TRACE_RETURN1(code,menu_hook)
#define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts)
-extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *);
-extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **);
-extern NCURSES_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options);
-extern NCURSES_EXPORT(MENU *) _nc_retrace_menu (MENU *);
-extern NCURSES_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook);
-extern NCURSES_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options);
+extern MENU_EXPORT(ITEM *) _nc_retrace_item (ITEM *);
+extern MENU_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **);
+extern MENU_EXPORT(Item_Options) _nc_retrace_item_opts (Item_Options);
+extern MENU_EXPORT(MENU *) _nc_retrace_menu (MENU *);
+extern MENU_EXPORT(Menu_Hook) _nc_retrace_menu_hook (Menu_Hook);
+extern MENU_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options);
#else /* !TRACE */