summaryrefslogtreecommitdiffstats
path: root/lib/libmenu
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-01-22 18:01:32 +0000
committermillert <millert@openbsd.org>2001-01-22 18:01:32 +0000
commit84af20cee44481ef9eb2070c76702603863c1a4c (patch)
treeb232b1727be5b5b1854432f2b87c149f7522cb9d /lib/libmenu
parentfix memory leaks in SSH2 key exchange; ok markus@ (diff)
downloadwireguard-openbsd-84af20cee44481ef9eb2070c76702603863c1a4c.tar.xz
wireguard-openbsd-84af20cee44481ef9eb2070c76702603863c1a4c.zip
Update to ncurses-5.2-20010114
Diffstat (limited to 'lib/libmenu')
-rw-r--r--lib/libmenu/m_attribs.c10
-rw-r--r--lib/libmenu/m_cursor.c15
-rw-r--r--lib/libmenu/m_driver.c13
-rw-r--r--lib/libmenu/m_format.c12
-rw-r--r--lib/libmenu/m_global.c30
-rw-r--r--lib/libmenu/m_hook.c10
-rw-r--r--lib/libmenu/m_item_cur.c15
-rw-r--r--lib/libmenu/m_item_nam.c12
-rw-r--r--lib/libmenu/m_item_new.c18
-rw-r--r--lib/libmenu/m_item_opt.c18
-rw-r--r--lib/libmenu/m_item_top.c12
-rw-r--r--lib/libmenu/m_item_use.c12
-rw-r--r--lib/libmenu/m_item_val.c12
-rw-r--r--lib/libmenu/m_item_vis.c9
-rw-r--r--lib/libmenu/m_items.c15
-rw-r--r--lib/libmenu/m_new.c12
-rw-r--r--lib/libmenu/m_opts.c18
-rw-r--r--lib/libmenu/m_pad.c12
-rw-r--r--lib/libmenu/m_pattern.c14
-rw-r--r--lib/libmenu/m_post.c18
-rw-r--r--lib/libmenu/m_req_name.c12
-rw-r--r--lib/libmenu/m_scale.c9
-rw-r--r--lib/libmenu/m_spacing.c13
-rw-r--r--lib/libmenu/m_sub.c12
-rw-r--r--lib/libmenu/m_userptr.c12
-rw-r--r--lib/libmenu/m_win.c12
-rw-r--r--lib/libmenu/menu.h156
-rw-r--r--lib/libmenu/menu.priv.h28
28 files changed, 301 insertions, 240 deletions
diff --git a/lib/libmenu/m_attribs.c b/lib/libmenu/m_attribs.c
index 053e50071f2..2008b8ec113 100644
--- a/lib/libmenu/m_attribs.c
+++ b/lib/libmenu/m_attribs.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_attribs.c,v 1.5 1999/05/17 03:04:18 millert Exp $ */
+/* $OpenBSD: m_attribs.c,v 1.6 2001/01/22 18:02:02 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_attribs.c,v 1.8 1999/05/16 17:24:24 juergen Exp $")
+MODULE_ID("$From: m_attribs.c,v 1.9 2000/12/10 02:16:48 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
@@ -51,7 +51,7 @@ MODULE_ID("$From: m_attribs.c,v 1.8 1999/05/16 17:24:24 juergen Exp $")
/* "Template" macro to generate a function to set a menus attribute */
#define GEN_MENU_ATTR_SET_FCT( name ) \
-int set_menu_ ## name (MENU * menu, chtype attr)\
+NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU * menu, chtype attr)\
{\
if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
RETURN(E_BAD_ARGUMENT);\
@@ -66,7 +66,7 @@ int set_menu_ ## name (MENU * menu, chtype attr)\
/* "Template" macro to generate a function to get a menus attribute */
#define GEN_MENU_ATTR_GET_FCT( name ) \
-chtype menu_ ## name (const MENU * menu)\
+NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\
{\
return (Normalize_Menu( menu ) -> name);\
}
diff --git a/lib/libmenu/m_cursor.c b/lib/libmenu/m_cursor.c
index 166a01d58af..4562a46efec 100644
--- a/lib/libmenu/m_cursor.c
+++ b/lib/libmenu/m_cursor.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_cursor.c,v 1.6 1999/05/17 03:04:19 millert Exp $ */
+/* $OpenBSD: m_cursor.c,v 1.7 2001/01/22 18:02:03 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_cursor.c,v 1.13 1999/05/16 17:24:43 juergen Exp $")
+MODULE_ID("$From: m_cursor.c,v 1.14 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,9 +51,9 @@ MODULE_ID("$From: m_cursor.c,v 1.13 1999/05/16 17:24:43 juergen Exp $")
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-int _nc_menu_cursor_pos(const MENU* menu,
- const ITEM* item,
- int* pY, int* pX)
+NCURSES_EXPORT(int)
+_nc_menu_cursor_pos
+(const MENU* menu, const ITEM* item, int* pY, int* pX)
{
if (!menu || !pX || !pY)
return(E_BAD_ARGUMENT);
@@ -82,7 +82,8 @@ int _nc_menu_cursor_pos(const MENU* menu,
| E_BAD_ARGUMENT - invalid menu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
-int pos_menu_cursor(const MENU * menu)
+NCURSES_EXPORT(int)
+pos_menu_cursor (const MENU * menu)
{
WINDOW *win, *sub;
int x, y;
diff --git a/lib/libmenu/m_driver.c b/lib/libmenu/m_driver.c
index 7fb3f079772..ccf9a82c9c8 100644
--- a/lib/libmenu/m_driver.c
+++ b/lib/libmenu/m_driver.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_driver.c,v 1.6 1999/05/17 03:04:20 millert Exp $ */
+/* $OpenBSD: m_driver.c,v 1.7 2001/01/22 18:02:03 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_driver.c,v 1.17 1999/05/16 17:24:55 juergen Exp $")
+MODULE_ID("$From: m_driver.c,v 1.18 2000/12/10 02:16:48 tom Exp $")
/* Macros */
@@ -113,7 +113,9 @@ static bool Is_Sub_String(
| Return Values : E_OK - an item matching the pattern was found
| E_NO_MATCH - nothing found
+--------------------------------------------------------------------------*/
-int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item)
+NCURSES_EXPORT(int)
+_nc_Match_Next_Character_In_Item_Name
+(MENU *menu, int ch, ITEM **item)
{
bool found = FALSE, passed = FALSE;
int idx, last;
@@ -200,7 +202,8 @@ int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item)
| E_BAD_STATE - menu is in user hook routine
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
-int menu_driver(MENU * menu, int c)
+NCURSES_EXPORT(int)
+menu_driver (MENU * menu, int c)
{
#define NAVIGATE(dir) \
if (!item->dir)\
diff --git a/lib/libmenu/m_format.c b/lib/libmenu/m_format.c
index 128954ada1b..8a16f001b9a 100644
--- a/lib/libmenu/m_format.c
+++ b/lib/libmenu/m_format.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_format.c,v 1.5 1999/05/17 03:04:21 millert Exp $ */
+/* $OpenBSD: m_format.c,v 1.6 2001/01/22 18:02:03 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_format.c,v 1.9 1999/05/16 17:25:04 juergen Exp $")
+MODULE_ID("$From: m_format.c,v 1.10 2000/12/10 02:16:48 tom Exp $")
#define minimum(a,b) ((a)<(b) ? (a): (b))
@@ -57,7 +57,8 @@ MODULE_ID("$From: m_format.c,v 1.9 1999/05/16 17:25:04 juergen Exp $")
| E_NOT_CONNECTED - there are no items connected
| E_POSTED - the menu is already posted
+--------------------------------------------------------------------------*/
-int set_menu_format(MENU *menu, int rows, int cols)
+NCURSES_EXPORT(int)
+set_menu_format (MENU *menu, int rows, int cols)
{
int total_rows, total_cols;
@@ -116,7 +117,8 @@ int set_menu_format(MENU *menu, int rows, int cols)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void menu_format(const MENU *menu, int *rows, int *cols)
+NCURSES_EXPORT(void)
+menu_format (const MENU *menu, int *rows, int *cols)
{
if (rows)
*rows = Normalize_Menu(menu)->frows;
diff --git a/lib/libmenu/m_global.c b/lib/libmenu/m_global.c
index 9ae284b2f47..fa7392cdd2c 100644
--- a/lib/libmenu/m_global.c
+++ b/lib/libmenu/m_global.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_global.c,v 1.5 1999/05/17 03:04:22 millert Exp $ */
+/* $OpenBSD: m_global.c,v 1.6 2001/01/22 18:02:03 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,9 +39,9 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_global.c,v 1.11 1999/05/16 17:25:14 juergen Exp $")
+MODULE_ID("$From: m_global.c,v 1.12 2000/12/10 02:16:48 tom Exp $")
-MENU _nc_Default_Menu = {
+NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
16, /* Nr. of chars high */
1, /* Nr. of chars wide */
16, /* Nr. of items high */
@@ -80,7 +80,7 @@ MENU _nc_Default_Menu = {
0 /* status */
};
-ITEM _nc_Default_Item = {
+NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = {
{ (char *)0, 0 }, /* name */
{ (char *)0, 0 }, /* description */
(MENU *)0, /* Pointer to parent menu */
@@ -163,7 +163,8 @@ INLINE static void ResetConnectionInfo(MENU *menu, ITEM **items)
| Return Values : TRUE - successfull connection
| FALSE - connection failed
+--------------------------------------------------------------------------*/
-bool _nc_Connect_Items(MENU *menu, ITEM **items)
+NCURSES_EXPORT(bool)
+_nc_Connect_Items (MENU *menu, ITEM **items)
{
ITEM **item;
unsigned int ItemCount = 0;
@@ -224,7 +225,8 @@ bool _nc_Connect_Items(MENU *menu, ITEM **items)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_Disconnect_Items(MENU * menu)
+NCURSES_EXPORT(void)
+_nc_Disconnect_Items (MENU * menu)
{
if (menu && menu->items)
ResetConnectionInfo( menu, menu->items );
@@ -239,7 +241,8 @@ void _nc_Disconnect_Items(MENU * menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_Calculate_Item_Length_and_Width(MENU * menu)
+NCURSES_EXPORT(void)
+_nc_Calculate_Item_Length_and_Width (MENU * menu)
{
int l;
@@ -267,7 +270,8 @@ void _nc_Calculate_Item_Length_and_Width(MENU * menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_Link_Items(MENU * menu)
+NCURSES_EXPORT(void)
+_nc_Link_Items (MENU * menu)
{
if (menu && menu->items && *(menu->items))
{
@@ -393,7 +397,8 @@ void _nc_Link_Items(MENU * menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_Show_Menu(const MENU *menu)
+NCURSES_EXPORT(void)
+_nc_Show_Menu (const MENU *menu)
{
WINDOW *win;
int maxy, maxx;
@@ -432,8 +437,9 @@ void _nc_Show_Menu(const MENU *menu)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_New_TopRow_and_CurrentItem(MENU *menu, int new_toprow,
- ITEM *new_current_item)
+NCURSES_EXPORT(void)
+_nc_New_TopRow_and_CurrentItem
+(MENU *menu, int new_toprow, ITEM *new_current_item)
{
ITEM *cur_item;
bool mterm_called = FALSE;
diff --git a/lib/libmenu/m_hook.c b/lib/libmenu/m_hook.c
index 539b946d7fd..11b62354d13 100644
--- a/lib/libmenu/m_hook.c
+++ b/lib/libmenu/m_hook.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_hook.c,v 1.5 1999/05/17 03:04:23 millert Exp $ */
+/* $OpenBSD: m_hook.c,v 1.6 2001/01/22 18:02:03 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,11 +39,11 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_hook.c,v 1.8 1999/05/16 17:25:24 juergen Exp $")
+MODULE_ID("$From: m_hook.c,v 1.9 2000/12/10 02:16:48 tom Exp $")
/* "Template" macro to generate function to set application specific hook */
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
-int set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
+NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
{\
(Normalize_Menu(menu) -> typ ## name = func );\
RETURN(E_OK);\
@@ -51,7 +51,7 @@ int set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
/* "Template" macro to generate function to get application specific hook */
#define GEN_HOOK_GET_FUNCTION( typ, name ) \
-Menu_Hook typ ## _ ## name ( const MENU *menu )\
+NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\
{\
return (Normalize_Menu(menu) -> typ ## name);\
}
diff --git a/lib/libmenu/m_item_cur.c b/lib/libmenu/m_item_cur.c
index 43e0969ac3e..25be32ff9f0 100644
--- a/lib/libmenu/m_item_cur.c
+++ b/lib/libmenu/m_item_cur.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_cur.c,v 1.5 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_cur.c,v 1.6 2001/01/22 18:02:03 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_cur.c,v 1.11 1999/05/16 17:25:34 juergen Exp $")
+MODULE_ID("$From: m_item_cur.c,v 1.12 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,7 +49,8 @@ MODULE_ID("$From: m_item_cur.c,v 1.11 1999/05/16 17:25:34 juergen Exp $")
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-int set_current_item(MENU * menu, ITEM * item)
+NCURSES_EXPORT(int)
+set_current_item (MENU * menu, ITEM * item)
{
if (menu && item && (item->imenu==menu))
{
@@ -87,7 +88,8 @@ int set_current_item(MENU * menu, ITEM * item)
|
| Return Values : Item pointer or NULL if failure
+--------------------------------------------------------------------------*/
-ITEM *current_item(const MENU * menu)
+NCURSES_EXPORT(ITEM *)
+current_item (const MENU * menu)
{
return (menu && menu->items) ? menu->curitem : (ITEM *)0;
}
@@ -100,7 +102,8 @@ ITEM *current_item(const MENU * menu)
|
| Return Values : The index or ERR if this is an invalid item pointer
+--------------------------------------------------------------------------*/
-int item_index(const ITEM *item)
+NCURSES_EXPORT(int)
+item_index (const ITEM *item)
{
return (item && item->imenu) ? item->index : ERR;
}
diff --git a/lib/libmenu/m_item_nam.c b/lib/libmenu/m_item_nam.c
index 75ff466fb6b..2a882146737 100644
--- a/lib/libmenu/m_item_nam.c
+++ b/lib/libmenu/m_item_nam.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_nam.c,v 1.5 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_nam.c,v 1.6 2001/01/22 18:02:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_nam.c,v 1.9 1999/05/16 17:25:43 juergen Exp $")
+MODULE_ID("$From: m_item_nam.c,v 1.10 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -49,7 +49,8 @@ MODULE_ID("$From: m_item_nam.c,v 1.9 1999/05/16 17:25:43 juergen Exp $")
|
| Return Values : See above; returns NULL if item is invalid
+--------------------------------------------------------------------------*/
-const char *item_name(const ITEM * item)
+NCURSES_EXPORT(const char *)
+item_name (const ITEM * item)
{
return ((item) ? item->name.str : (char *)0);
}
@@ -62,7 +63,8 @@ const char *item_name(const ITEM * item)
|
| Return Values : See above; Returns NULL if item is invalid
+--------------------------------------------------------------------------*/
-const char *item_description(const ITEM * item)
+NCURSES_EXPORT(const char *)
+item_description (const ITEM * item)
{
return ((item) ? item->description.str : (char *)0);
}
diff --git a/lib/libmenu/m_item_new.c b/lib/libmenu/m_item_new.c
index 112390bdd8a..fd3dc1c07b5 100644
--- a/lib/libmenu/m_item_new.c
+++ b/lib/libmenu/m_item_new.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_new.c,v 1.6 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_new.c,v 1.7 2001/01/22 18:02:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -40,7 +40,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_new.c,v 1.11 1999/05/16 17:28:49 juergen Exp $")
+MODULE_ID("$From: m_item_new.c,v 1.12 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -74,7 +74,8 @@ static bool Is_Printable_String(const char *s)
|
| Return Values : The item pointer or NULL if creation failed.
+--------------------------------------------------------------------------*/
-ITEM *new_item(const char *name, const char *description)
+NCURSES_EXPORT(ITEM *)
+new_item (const char *name, const char *description)
{
ITEM *item;
@@ -122,7 +123,8 @@ ITEM *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
+--------------------------------------------------------------------------*/
-int free_item(ITEM * item)
+NCURSES_EXPORT(int)
+free_item (ITEM * item)
{
if (!item)
RETURN( E_BAD_ARGUMENT );
@@ -152,7 +154,8 @@ int free_item(ITEM * item)
| E_BAD_ARGUMENT - an invalid value has been passed
| E_SYSTEM_ERROR - no memory to store mark
+--------------------------------------------------------------------------*/
-int set_menu_mark(MENU * menu, const char * mark)
+NCURSES_EXPORT(int)
+set_menu_mark (MENU * menu, const char * mark)
{
int l;
@@ -221,7 +224,8 @@ int set_menu_mark(MENU * menu, const char * mark)
|
| Return Values : The marker string pointer or NULL if no marker defined
+--------------------------------------------------------------------------*/
-const char *menu_mark(const MENU * menu)
+NCURSES_EXPORT(const char *)
+menu_mark (const MENU * menu)
{
return Normalize_Menu( menu )->mark;
}
diff --git a/lib/libmenu/m_item_opt.c b/lib/libmenu/m_item_opt.c
index 1d3375b61db..1ee8f030f18 100644
--- a/lib/libmenu/m_item_opt.c
+++ b/lib/libmenu/m_item_opt.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_opt.c,v 1.7 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_opt.c,v 1.8 2001/01/22 18:02:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_opt.c,v 1.10 1999/05/16 17:25:52 juergen Exp $")
+MODULE_ID("$From: m_item_opt.c,v 1.11 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -52,7 +52,8 @@ MODULE_ID("$From: m_item_opt.c,v 1.10 1999/05/16 17:25:52 juergen Exp $")
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid item options
+--------------------------------------------------------------------------*/
-int set_item_opts(ITEM *item, Item_Options opts)
+NCURSES_EXPORT(int)
+set_item_opts (ITEM *item, Item_Options opts)
{
opts &= ALL_ITEM_OPTS;
@@ -92,7 +93,8 @@ int set_item_opts(ITEM *item, Item_Options opts)
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-int item_opts_off(ITEM *item, Item_Options opts)
+NCURSES_EXPORT(int)
+item_opts_off (ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
NULL item itself to adjust its behaviour */
@@ -116,7 +118,8 @@ int item_opts_off(ITEM *item, Item_Options opts)
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
-int item_opts_on(ITEM *item, Item_Options opts)
+NCURSES_EXPORT(int)
+item_opts_on (ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
NULL item itself to adjust its behaviour */
@@ -140,7 +143,8 @@ int item_opts_on(ITEM *item, Item_Options opts)
|
| Return Values : Items options
+--------------------------------------------------------------------------*/
-Item_Options item_opts(const ITEM * item)
+NCURSES_EXPORT(Item_Options)
+item_opts (const ITEM * item)
{
return (ALL_ITEM_OPTS & Normalize_Item(item)->opt);
}
diff --git a/lib/libmenu/m_item_top.c b/lib/libmenu/m_item_top.c
index 1cce5f31d89..2a492ad986c 100644
--- a/lib/libmenu/m_item_top.c
+++ b/lib/libmenu/m_item_top.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_top.c,v 1.3 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_top.c,v 1.4 2001/01/22 18:02:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_top.c,v 1.4 1999/05/16 17:26:01 juergen Exp $")
+MODULE_ID("$From: m_item_top.c,v 1.5 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,7 +51,8 @@ MODULE_ID("$From: m_item_top.c,v 1.4 1999/05/16 17:26:01 juergen Exp $")
| E_BAD_ARGUMENT - not a menu pointer or invalid row
| E_NOT_CONNECTED - there are no items for the menu
+--------------------------------------------------------------------------*/
-int set_top_row(MENU * menu, int row)
+NCURSES_EXPORT(int)
+set_top_row (MENU * menu, int row)
{
ITEM *item;
@@ -90,7 +91,8 @@ int set_top_row(MENU * menu, int row)
|
| Return Values : The row number or ERR if there is no row
+--------------------------------------------------------------------------*/
-int top_row(const MENU * menu)
+NCURSES_EXPORT(int)
+top_row (const MENU * menu)
{
if (menu && menu->items && *(menu->items))
{
diff --git a/lib/libmenu/m_item_use.c b/lib/libmenu/m_item_use.c
index e6c5ce9dc41..b7fcd8633b0 100644
--- a/lib/libmenu/m_item_use.c
+++ b/lib/libmenu/m_item_use.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_use.c,v 1.5 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_use.c,v 1.6 2001/01/22 18:02:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_use.c,v 1.10 1999/05/16 17:26:11 juergen Exp $")
+MODULE_ID("$From: m_item_use.c,v 1.11 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,7 +50,8 @@ MODULE_ID("$From: m_item_use.c,v 1.10 1999/05/16 17:26:11 juergen Exp $")
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-int set_item_userptr(ITEM * item, void * userptr)
+NCURSES_EXPORT(int)
+set_item_userptr (ITEM * item, void * userptr)
{
Normalize_Item(item)->userptr = userptr;
RETURN( E_OK );
@@ -66,7 +67,8 @@ int set_item_userptr(ITEM * item, void * userptr)
| Return Values : Value of the pointer. If no such pointer has been set,
| NULL is returned.
+--------------------------------------------------------------------------*/
-void *item_userptr(const ITEM * item)
+NCURSES_EXPORT(void *)
+item_userptr (const ITEM * item)
{
return Normalize_Item(item)->userptr;
}
diff --git a/lib/libmenu/m_item_val.c b/lib/libmenu/m_item_val.c
index cda27fbeeae..939ebd76fb5 100644
--- a/lib/libmenu/m_item_val.c
+++ b/lib/libmenu/m_item_val.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_val.c,v 1.5 1999/05/17 03:04:24 millert Exp $ */
+/* $OpenBSD: m_item_val.c,v 1.6 2001/01/22 18:02:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_val.c,v 1.8 1999/05/16 17:26:20 juergen Exp $")
+MODULE_ID("$From: m_item_val.c,v 1.9 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -54,7 +54,8 @@ MODULE_ID("$From: m_item_val.c,v 1.8 1999/05/16 17:26:20 juergen Exp $")
| Return Values : E_OK - success
| E_REQUEST_DENIED - not selectable or single valued menu
+--------------------------------------------------------------------------*/
-int set_item_value(ITEM *item, bool value)
+NCURSES_EXPORT(int)
+set_item_value (ITEM *item, bool value)
{
MENU *menu;
@@ -94,7 +95,8 @@ int set_item_value(ITEM *item, bool value)
| Return Values : TRUE - if item is selected
| FALSE - if item is not selected
+--------------------------------------------------------------------------*/
-bool item_value(const ITEM *item)
+NCURSES_EXPORT(bool)
+item_value (const ITEM *item)
{
return ((Normalize_Item(item)->value) ? TRUE : FALSE);
}
diff --git a/lib/libmenu/m_item_vis.c b/lib/libmenu/m_item_vis.c
index 2dcf21a15a9..9fbe0fcc874 100644
--- a/lib/libmenu/m_item_vis.c
+++ b/lib/libmenu/m_item_vis.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_item_vis.c,v 1.5 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_item_vis.c,v 1.6 2001/01/22 18:02:05 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_item_vis.c,v 1.10 1999/05/16 17:26:34 juergen Exp $")
+MODULE_ID("$From: m_item_vis.c,v 1.11 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -51,7 +51,8 @@ MODULE_ID("$From: m_item_vis.c,v 1.10 1999/05/16 17:26:34 juergen Exp $")
| Return Values : TRUE if visible
| FALSE if invisible
+--------------------------------------------------------------------------*/
-bool item_visible(const ITEM * item)
+NCURSES_EXPORT(bool)
+item_visible (const ITEM * item)
{
MENU *menu;
diff --git a/lib/libmenu/m_items.c b/lib/libmenu/m_items.c
index be6682562f9..133b1534003 100644
--- a/lib/libmenu/m_items.c
+++ b/lib/libmenu/m_items.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_items.c,v 1.5 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_items.c,v 1.6 2001/01/22 18:02:05 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_items.c,v 1.8 1999/05/16 17:26:50 juergen Exp $")
+MODULE_ID("$From: m_items.c,v 1.9 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -54,7 +54,8 @@ MODULE_ID("$From: m_items.c,v 1.8 1999/05/16 17:26:50 juergen Exp $")
| E_BAD_ARGUMENT - An incorrect menu or item array was
| passed to the function
+--------------------------------------------------------------------------*/
-int set_menu_items(MENU * menu, ITEM ** items)
+NCURSES_EXPORT(int)
+set_menu_items (MENU * menu, ITEM ** items)
{
if (!menu || (items && !(*items)))
RETURN(E_BAD_ARGUMENT);
@@ -83,7 +84,8 @@ int set_menu_items(MENU * menu, ITEM ** items)
|
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
-ITEM **menu_items(const MENU *menu)
+NCURSES_EXPORT(ITEM **)
+menu_items (const MENU *menu)
{
return(menu ? menu->items : (ITEM **)0);
}
@@ -97,7 +99,8 @@ ITEM **menu_items(const MENU *menu)
|
| Return Values : Number of items or -1 to indicate error.
+--------------------------------------------------------------------------*/
-int item_count(const MENU *menu)
+NCURSES_EXPORT(int)
+item_count (const MENU *menu)
{
return(menu ? menu->nitems : -1);
}
diff --git a/lib/libmenu/m_new.c b/lib/libmenu/m_new.c
index 127ecb06c94..c237cb976fa 100644
--- a/lib/libmenu/m_new.c
+++ b/lib/libmenu/m_new.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_new.c,v 1.6 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_new.c,v 1.7 2001/01/22 18:02:05 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_new.c,v 1.10 1999/05/16 17:26:59 juergen Exp $")
+MODULE_ID("$From: m_new.c,v 1.11 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -52,7 +52,8 @@ MODULE_ID("$From: m_new.c,v 1.10 1999/05/16 17:26:59 juergen Exp $")
|
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
-MENU *new_menu(ITEM ** items)
+NCURSES_EXPORT(MENU *)
+new_menu (ITEM ** items)
{
MENU *menu = (MENU *)calloc(1,sizeof(MENU));
@@ -89,7 +90,8 @@ MENU *new_menu(ITEM ** items)
| E_BAD_ARGUMENT - Invalid menu pointer passed
| E_POSTED - Menu is already posted
+--------------------------------------------------------------------------*/
-int free_menu(MENU * menu)
+NCURSES_EXPORT(int)
+free_menu (MENU * menu)
{
if (!menu)
RETURN(E_BAD_ARGUMENT);
diff --git a/lib/libmenu/m_opts.c b/lib/libmenu/m_opts.c
index 02f9afe837c..9ca1078e27b 100644
--- a/lib/libmenu/m_opts.c
+++ b/lib/libmenu/m_opts.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_opts.c,v 1.6 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_opts.c,v 1.7 2001/01/22 18:02:05 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_opts.c,v 1.12 1999/05/16 17:27:08 juergen Exp $")
+MODULE_ID("$From: m_opts.c,v 1.13 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -54,7 +54,8 @@ MODULE_ID("$From: m_opts.c,v 1.12 1999/05/16 17:27:08 juergen Exp $")
| E_BAD_ARGUMENT - invalid menu options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-int set_menu_opts(MENU * menu, Menu_Options opts)
+NCURSES_EXPORT(int)
+set_menu_opts (MENU * menu, Menu_Options opts)
{
opts &= ALL_MENU_OPTS;
@@ -111,7 +112,8 @@ int set_menu_opts(MENU * menu, Menu_Options opts)
| E_BAD_ARGUMENT - invalid options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-int menu_opts_off(MENU *menu, Menu_Options opts)
+NCURSES_EXPORT(int)
+menu_opts_off (MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
NULL menu itself to adjust its behaviour */
@@ -140,7 +142,8 @@ int menu_opts_off(MENU *menu, Menu_Options opts)
| E_BAD_ARGUMENT - invalid menu options
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-int menu_opts_on(MENU * menu, Menu_Options opts)
+NCURSES_EXPORT(int)
+menu_opts_on (MENU * menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
NULL menu itself to adjust its behaviour */
@@ -164,7 +167,8 @@ int menu_opts_on(MENU * menu, Menu_Options opts)
|
| Return Values : Menu options
+--------------------------------------------------------------------------*/
-Menu_Options menu_opts(const MENU *menu)
+NCURSES_EXPORT(Menu_Options)
+menu_opts (const MENU *menu)
{
return (ALL_MENU_OPTS & Normalize_Menu( menu )->opt);
}
diff --git a/lib/libmenu/m_pad.c b/lib/libmenu/m_pad.c
index 1b60dfd54a7..78122817642 100644
--- a/lib/libmenu/m_pad.c
+++ b/lib/libmenu/m_pad.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_pad.c,v 1.3 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_pad.c,v 1.4 2001/01/22 18:02:05 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_pad.c,v 1.4 1999/05/16 17:27:17 juergen Exp $")
+MODULE_ID("$From: m_pad.c,v 1.5 2000/12/10 02:16:48 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
@@ -60,7 +60,8 @@ MODULE_ID("$From: m_pad.c,v 1.4 1999/05/16 17:27:17 juergen Exp $")
| Return Values : E_OK - success
| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
-int set_menu_pad(MENU *menu, int pad)
+NCURSES_EXPORT(int)
+set_menu_pad (MENU *menu, int pad)
{
bool do_refresh = (menu != (MENU*)0);
@@ -84,7 +85,8 @@ int set_menu_pad(MENU *menu, int pad)
|
| Return Values : The pad character
+--------------------------------------------------------------------------*/
-int menu_pad(const MENU * menu)
+NCURSES_EXPORT(int)
+menu_pad (const MENU * menu)
{
return (Normalize_Menu( menu ) -> pad);
}
diff --git a/lib/libmenu/m_pattern.c b/lib/libmenu/m_pattern.c
index 682111ee40e..f750c02aae3 100644
--- a/lib/libmenu/m_pattern.c
+++ b/lib/libmenu/m_pattern.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_pattern.c,v 1.3 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_pattern.c,v 1.4 2001/01/22 18:02:05 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_pattern.c,v 1.4 1999/05/16 17:27:28 juergen Exp $")
+MODULE_ID("$From: m_pattern.c,v 1.6 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -52,7 +52,8 @@ MODULE_ID("$From: m_pattern.c,v 1.4 1999/05/16 17:27:28 juergen Exp $")
| pattern is stored
| PatternString - as expected
+--------------------------------------------------------------------------*/
-char *menu_pattern(const MENU * menu)
+NCURSES_EXPORT(char *)
+menu_pattern (const MENU * menu)
{
return (menu ? (menu->pattern ? menu->pattern : "") : (char *)0);
}
@@ -70,7 +71,8 @@ char *menu_pattern(const MENU * menu)
| E_BAD_STATE - menu in user hook routine
| E_NO_MATCH - no item matches pattern
+--------------------------------------------------------------------------*/
-int set_menu_pattern(MENU *menu, const char *p)
+NCURSES_EXPORT(int)
+set_menu_pattern (MENU *menu, const char *p)
{
ITEM *matchitem;
int matchpos;
@@ -101,7 +103,7 @@ int set_menu_pattern(MENU *menu, const char *p)
while(*p)
{
- if ( !isprint(*p) ||
+ if ( !isprint((unsigned char)(*p)) ||
(_nc_Match_Next_Character_In_Item_Name(menu,*p,&matchitem) != E_OK) )
{
Reset_Pattern(menu);
diff --git a/lib/libmenu/m_post.c b/lib/libmenu/m_post.c
index 37f6485bf75..828177fe568 100644
--- a/lib/libmenu/m_post.c
+++ b/lib/libmenu/m_post.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_post.c,v 1.5 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_post.c,v 1.6 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_post.c,v 1.16 1999/05/16 17:27:38 juergen Exp $")
+MODULE_ID("$From: m_post.c,v 1.17 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,7 +50,8 @@ MODULE_ID("$From: m_post.c,v 1.16 1999/05/16 17:27:38 juergen Exp $")
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_Post_Item(const MENU * menu, const ITEM * item)
+NCURSES_EXPORT(void)
+_nc_Post_Item (const MENU * menu, const ITEM * item)
{
int i;
chtype ch;
@@ -191,7 +192,8 @@ void _nc_Post_Item(const MENU * menu, const ITEM * item)
|
| Return Values : -
+--------------------------------------------------------------------------*/
-void _nc_Draw_Menu(const MENU * menu)
+NCURSES_EXPORT(void)
+_nc_Draw_Menu (const MENU * menu)
{
ITEM *item = menu->items[0];
ITEM *lasthor, *lastvert;
@@ -259,7 +261,8 @@ void _nc_Draw_Menu(const MENU * menu)
| E_BAD_STATE - Menu in userexit routine
| E_POSTED - Menu already posted
+--------------------------------------------------------------------------*/
-int post_menu(MENU * menu)
+NCURSES_EXPORT(int)
+post_menu (MENU * menu)
{
if (!menu)
RETURN(E_BAD_ARGUMENT);
@@ -332,7 +335,8 @@ int post_menu(MENU * menu)
| E_BAD_STATE - menu in userexit routine
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
-int unpost_menu(MENU * menu)
+NCURSES_EXPORT(int)
+unpost_menu (MENU * menu)
{
WINDOW *win;
diff --git a/lib/libmenu/m_req_name.c b/lib/libmenu/m_req_name.c
index c421cf06d10..23951eb9c3c 100644
--- a/lib/libmenu/m_req_name.c
+++ b/lib/libmenu/m_req_name.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_req_name.c,v 1.4 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_req_name.c,v 1.5 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_req_name.c,v 1.12 1999/05/16 17:27:47 juergen Exp $")
+MODULE_ID("$From: m_req_name.c,v 1.13 2000/12/10 02:16:48 tom Exp $")
static const char *request_names[ MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1 ] = {
"LEFT_ITEM" ,
@@ -71,7 +71,8 @@ static const char *request_names[ MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1 ] = {
| Return Values : Pointer to name - on success
| NULL - on invalid request code
+--------------------------------------------------------------------------*/
-const char *menu_request_name( int request )
+NCURSES_EXPORT(const char *)
+menu_request_name ( int request )
{
if ( (request < MIN_MENU_COMMAND) || (request > MAX_MENU_COMMAND) )
{
@@ -92,7 +93,8 @@ const char *menu_request_name( int request )
| Return Values : Request Id - on success
| E_NO_MATCH - request not found
+--------------------------------------------------------------------------*/
-int menu_request_by_name( const char *str )
+NCURSES_EXPORT(int)
+menu_request_by_name ( const char *str )
{
/* because the table is so small, it doesn't really hurt
to run sequentially through it.
diff --git a/lib/libmenu/m_scale.c b/lib/libmenu/m_scale.c
index 431fc3a9b9a..ebd8801e9ec 100644
--- a/lib/libmenu/m_scale.c
+++ b/lib/libmenu/m_scale.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_scale.c,v 1.3 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_scale.c,v 1.4 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_scale.c,v 1.4 1999/05/16 17:28:00 juergen Exp $")
+MODULE_ID("$From: m_scale.c,v 1.5 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -52,7 +52,8 @@ MODULE_ID("$From: m_scale.c,v 1.4 1999/05/16 17:28:00 juergen Exp $")
| E_BAD_ARGUMENT - invalid menu pointer
| E_NOT_CONNECTED - no items are connected to menu
+--------------------------------------------------------------------------*/
-int scale_menu(const MENU *menu, int *rows, int *cols)
+NCURSES_EXPORT(int)
+scale_menu (const MENU *menu, int *rows, int *cols)
{
if (!menu)
RETURN( E_BAD_ARGUMENT );
diff --git a/lib/libmenu/m_spacing.c b/lib/libmenu/m_spacing.c
index 082f1008eab..f31f928d3ae 100644
--- a/lib/libmenu/m_spacing.c
+++ b/lib/libmenu/m_spacing.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_spacing.c,v 1.4 1999/05/17 03:04:25 millert Exp $ */
+/* $OpenBSD: m_spacing.c,v 1.5 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_spacing.c,v 1.11 1999/05/16 17:28:09 juergen Exp $")
+MODULE_ID("$From: m_spacing.c,v 1.12 2000/12/10 02:16:48 tom Exp $")
#define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
#define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
@@ -53,7 +53,9 @@ MODULE_ID("$From: m_spacing.c,v 1.11 1999/05/16 17:28:09 juergen Exp $")
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-int set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col )
+NCURSES_EXPORT(int)
+set_menu_spacing
+(MENU *menu, int s_desc, int s_row, int s_col )
{
MENU *m; /* split for ATAC workaround */
m = Normalize_Menu(menu);
@@ -84,7 +86,8 @@ int set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col )
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
-int menu_spacing( const MENU *menu, int* s_desc, int* s_row, int* s_col)
+NCURSES_EXPORT(int)
+menu_spacing ( const MENU *menu, int* s_desc, int* s_row, int* s_col)
{
const MENU *m; /* split for ATAC workaround */
m = Normalize_Menu(menu);
diff --git a/lib/libmenu/m_sub.c b/lib/libmenu/m_sub.c
index 6b3eee9892c..d91658f057d 100644
--- a/lib/libmenu/m_sub.c
+++ b/lib/libmenu/m_sub.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_sub.c,v 1.3 1999/05/17 03:04:26 millert Exp $ */
+/* $OpenBSD: m_sub.c,v 1.4 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_sub.c,v 1.4 1999/05/16 17:28:20 juergen Exp $")
+MODULE_ID("$From: m_sub.c,v 1.5 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,7 +50,8 @@ MODULE_ID("$From: m_sub.c,v 1.4 1999/05/16 17:28:20 juergen Exp $")
| Return Values : E_OK - success
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-int set_menu_sub(MENU *menu, WINDOW *win)
+NCURSES_EXPORT(int)
+set_menu_sub (MENU *menu, WINDOW *win)
{
if (menu)
{
@@ -73,7 +74,8 @@ int set_menu_sub(MENU *menu, WINDOW *win)
|
| Return Values : NULL on error, otherwise a pointer to the window
+--------------------------------------------------------------------------*/
-WINDOW *menu_sub(const MENU * menu)
+NCURSES_EXPORT(WINDOW *)
+menu_sub (const MENU * menu)
{
const MENU* m = Normalize_Menu(menu);
return Get_Menu_Window(m);
diff --git a/lib/libmenu/m_userptr.c b/lib/libmenu/m_userptr.c
index 308b98832bb..1e8894e0ca8 100644
--- a/lib/libmenu/m_userptr.c
+++ b/lib/libmenu/m_userptr.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_userptr.c,v 1.5 1999/05/17 03:04:26 millert Exp $ */
+/* $OpenBSD: m_userptr.c,v 1.6 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_userptr.c,v 1.10 1999/05/16 17:28:29 juergen Exp $")
+MODULE_ID("$From: m_userptr.c,v 1.11 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,7 +50,8 @@ MODULE_ID("$From: m_userptr.c,v 1.10 1999/05/16 17:28:29 juergen Exp $")
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
-int set_menu_userptr(MENU * menu, void * userptr)
+NCURSES_EXPORT(int)
+set_menu_userptr (MENU * menu, void * userptr)
{
Normalize_Menu(menu)->userptr = userptr;
RETURN( E_OK );
@@ -66,7 +67,8 @@ int set_menu_userptr(MENU * menu, void * userptr)
| Return Values : Value of the pointer. If no such pointer has been set,
| NULL is returned
+--------------------------------------------------------------------------*/
-void *menu_userptr(const MENU * menu)
+NCURSES_EXPORT(void *)
+menu_userptr (const MENU * menu)
{
return( Normalize_Menu(menu)->userptr);
}
diff --git a/lib/libmenu/m_win.c b/lib/libmenu/m_win.c
index 90bd20c20b0..988e9695f18 100644
--- a/lib/libmenu/m_win.c
+++ b/lib/libmenu/m_win.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: m_win.c,v 1.5 1999/05/17 03:04:26 millert Exp $ */
+/* $OpenBSD: m_win.c,v 1.6 2001/01/22 18:02:06 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -39,7 +39,7 @@
#include "menu.priv.h"
-MODULE_ID("$From: m_win.c,v 1.9 1999/05/16 17:28:37 juergen Exp $")
+MODULE_ID("$From: m_win.c,v 1.10 2000/12/10 02:16:48 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
@@ -50,7 +50,8 @@ MODULE_ID("$From: m_win.c,v 1.9 1999/05/16 17:28:37 juergen Exp $")
| Return Values : E_OK - success
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
-int set_menu_win(MENU *menu, WINDOW *win)
+NCURSES_EXPORT(int)
+set_menu_win (MENU *menu, WINDOW *win)
{
if (menu)
{
@@ -73,7 +74,8 @@ int set_menu_win(MENU *menu, WINDOW *win)
|
| Return Values : NULL on error, otherwise pointer to window
+--------------------------------------------------------------------------*/
-WINDOW *menu_win(const MENU *menu)
+NCURSES_EXPORT(WINDOW *)
+menu_win (const MENU *menu)
{
const MENU* m = Normalize_Menu(menu);
return (m->userwin ? m->userwin : stdscr);
diff --git a/lib/libmenu/menu.h b/lib/libmenu/menu.h
index 519a1a1335e..19d0ab5fe51 100644
--- a/lib/libmenu/menu.h
+++ b/lib/libmenu/menu.h
@@ -1,7 +1,7 @@
-/* $OpenBSD: menu.h,v 1.6 2000/07/24 04:06:12 millert Exp $ */
+/* $OpenBSD: menu.h,v 1.7 2001/01/22 18:02:07 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -172,82 +172,82 @@ typedef struct tagMENU
/* --------- prototypes for libmenu functions ----------------------------- */
-extern ITEM **menu_items(const MENU *),
- *current_item(const MENU *),
- *new_item(const char *,const char *);
-
-extern MENU *new_menu(ITEM **);
-
-extern Item_Options item_opts(const ITEM *);
-extern Menu_Options menu_opts(const MENU *);
-
-Menu_Hook item_init(const MENU *),
- item_term(const MENU *),
- menu_init(const MENU *),
- menu_term(const MENU *);
-
-extern WINDOW *menu_sub(const MENU *),
- *menu_win(const MENU *);
-
-extern const char *item_description(const ITEM *),
- *item_name(const ITEM *),
- *menu_mark(const MENU *),
- *menu_request_name(int);
-
-extern char *menu_pattern(const MENU *);
-
-extern void *menu_userptr(const MENU *),
- *item_userptr(const ITEM *);
-
-extern chtype menu_back(const MENU *),
- menu_fore(const MENU *),
- menu_grey(const MENU *);
-
-extern int free_item(ITEM *),
- free_menu(MENU *),
- item_count(const MENU *),
- item_index(const ITEM *),
- item_opts_off(ITEM *,Item_Options),
- item_opts_on(ITEM *,Item_Options),
- menu_driver(MENU *,int),
- menu_opts_off(MENU *,Menu_Options),
- menu_opts_on(MENU *,Menu_Options),
- menu_pad(const MENU *),
- pos_menu_cursor(const MENU *),
- post_menu(MENU *),
- scale_menu(const MENU *,int *,int *),
- set_current_item(MENU *menu,ITEM *item),
- set_item_init(MENU *,void(*)(MENU *)),
- set_item_opts(ITEM *,Item_Options),
- set_item_term(MENU *,void(*)(MENU *)),
- set_item_userptr(ITEM *, void *),
- set_item_value(ITEM *,bool),
- set_menu_back(MENU *,chtype),
- set_menu_fore(MENU *,chtype),
- set_menu_format(MENU *,int,int),
- set_menu_grey(MENU *,chtype),
- set_menu_init(MENU *,void(*)(MENU *)),
- set_menu_items(MENU *,ITEM **),
- set_menu_mark(MENU *, const char *),
- set_menu_opts(MENU *,Menu_Options),
- set_menu_pad(MENU *,int),
- set_menu_pattern(MENU *,const char *),
- set_menu_sub(MENU *,WINDOW *),
- set_menu_term(MENU *,void(*)(MENU *)),
- set_menu_userptr(MENU *,void *),
- set_menu_win(MENU *,WINDOW *),
- set_top_row(MENU *,int),
- top_row(const MENU *),
- unpost_menu(MENU *),
- menu_request_by_name(const char *),
- set_menu_spacing(MENU *,int,int,int),
- menu_spacing(const MENU *,int *,int *,int *);
-
-
-extern bool item_value(const ITEM *),
- item_visible(const ITEM *);
-
-void menu_format(const MENU *,int *,int *);
+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 *,void(*)(MENU *));
+extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options);
+extern NCURSES_EXPORT(int) set_item_term (MENU *,void(*)(MENU *));
+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 *,void(*)(MENU *));
+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 *,void(*)(MENU *));
+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 *);
#ifdef __cplusplus
}
diff --git a/lib/libmenu/menu.priv.h b/lib/libmenu/menu.priv.h
index cad0fde6c47..3d7527c6b07 100644
--- a/lib/libmenu/menu.priv.h
+++ b/lib/libmenu/menu.priv.h
@@ -1,7 +1,7 @@
-/* $OpenBSD: menu.priv.h,v 1.6 1999/05/17 03:04:26 millert Exp $ */
+/* $OpenBSD: menu.priv.h,v 1.7 2001/01/22 18:02:07 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 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 *
@@ -43,8 +43,8 @@
/* Backspace code */
#define BS (8)
-extern ITEM _nc_Default_Item;
-extern MENU _nc_Default_Menu;
+extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item;
+extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
/* Normalize item to default if none was given */
#define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item)
@@ -103,14 +103,14 @@ extern MENU _nc_Default_Menu;
(menu)->pattern[0] = '\0'; }
/* Internal functions. */
-extern void _nc_Draw_Menu(const MENU *);
-extern void _nc_Show_Menu(const MENU *);
-extern void _nc_Calculate_Item_Length_and_Width(MENU *);
-extern void _nc_Post_Item(const MENU *, const ITEM *);
-extern bool _nc_Connect_Items(MENU *, ITEM **);
-extern void _nc_Disconnect_Items(MENU *);
-extern void _nc_New_TopRow_and_CurrentItem(MENU *,int, ITEM *);
-extern void _nc_Link_Items(MENU *);
-extern int _nc_Match_Next_Character_In_Item_Name(MENU*,int,ITEM**);
-extern int _nc_menu_cursor_pos(const MENU* menu, const ITEM* item,
+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(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,
int* pY, int* pX);