Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37769207
en ru br
ALT Linux repos
S:6.3.20220618-alt4
5.0: 5.7-alt1
4.1: 5.6-alt4
4.0: 5.6-alt3
3.0: 5.4.20050108-alt3

Group :: System/Base
RPM: ncurses

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: ncurses-5.4-20041225.patch
Download


# ncurses 5.4 - patch 20041225 - T.Dickey
#
# ------------------------------------------------------------------------------
#
# Ncurses 5.4 is at
# 	ftp.gnu.org:/pub/gnu
#
# Patches for ncurses 5.4 are in the subdirectory
# 	ftp://invisible-island.net/ncurses/5.4
#
# ------------------------------------------------------------------------------
# MANIFEST                            |    2 
# NEWS                                |    8 ++
# dist.mk                             |    4 -
# form/fld_arg.c                      |    5 +
# form/fld_current.c                  |    8 +-
# form/fld_def.c                      |    7 +-
# form/fld_dup.c                      |    7 +-
# form/fld_ftlink.c                   |    5 +
# form/fld_link.c                     |    7 +-
# form/fld_newftyp.c                  |    5 +
# form/fld_type.c                     |    5 +
# form/fld_user.c                     |    5 +
# form/form.priv.h                    |   26 +++++++++
# form/frm_def.c                      |    8 +-
# form/frm_hook.c                     |    5 +
# form/frm_user.c                     |    5 +
# form/modules                        |    7 +-
# menu/m_cursor.c                     |    5 -
# menu/m_global.c                     |   94 ++++++++++++++++++++++++++++++++--
# menu/m_hook.c                       |    5 +
# menu/m_item_cur.c                   |    8 +-
# menu/m_item_nam.c                   |    8 +-
# menu/m_item_new.c                   |   13 +++-
# menu/m_item_opt.c                   |    5 +
# menu/m_item_use.c                   |    5 +
# menu/m_item_vis.c                   |    7 +-
# menu/m_items.c                      |    8 +-
# menu/m_new.c                        |    5 +
# menu/m_opts.c                       |    5 +
# menu/m_pad.c                        |    5 +
# menu/m_pattern.c                    |    5 +
# menu/m_post.c                       |   38 +------------
# menu/m_req_name.c                   |    9 +--
# menu/m_sub.c                        |    5 +
# menu/m_userptr.c                    |    5 +
# menu/m_win.c                        |    5 +
# menu/menu.priv.h                    |   27 +++++++++
# menu/modules                        |    5 +
# ncurses-5.4-20041225/form/f_trace.c |   70 +++++++++++++++++++++++++
# ncurses-5.4-20041225/menu/m_trace.c |   70 +++++++++++++++++++++++++
# ncurses/curses.priv.h               |   47 +++++++++--------
# ncurses/trace/lib_trace.c           |   14 +++--
# test/ncurses.c                      |   14 ++---
# 43 files changed, 454 insertions(+), 152 deletions(-)
# ------------------------------------------------------------------------------
Index: MANIFEST
--- ncurses-5.4-20041218+/MANIFEST	2004-07-11 15:12:53.000000000 +0000
+++ ncurses-5.4-20041225/MANIFEST	2004-12-26 01:08:58.000000000 +0000
@@ -433,6 +433,7 @@
 ./doc/ncurses-intro.doc
 ./form/Makefile.in
 ./form/READ.ME
+./form/f_trace.c
 ./form/fld_arg.c
 ./form/fld_attr.c
 ./form/fld_current.c
@@ -663,6 +664,7 @@
 ./menu/m_scale.c
 ./menu/m_spacing.c
 ./menu/m_sub.c
+./menu/m_trace.c
 ./menu/m_userptr.c
 ./menu/m_win.c
 ./menu/menu.h
Index: NEWS
Prereq:  1.851 
--- ncurses-5.4-20041218+/NEWS	2004-12-19 00:49:27.000000000 +0000
+++ ncurses-5.4-20041225/NEWS	2004-12-25 23:31:56.000000000 +0000
@@ -1,4 +1,4 @@
--- $Id: NEWS,v 1.851 2004/12/19 00:49:27 tom Exp $
+-- $Id: NEWS,v 1.852 2004/12/25 23:31:56 tom Exp $
 
 This is a log of changes that ncurses has gone through since Zeyd started
 working with Pavel Curtis' original work, pcurses, in 1992.
@@ -6,6 +6,12 @@
 Changes through 1.9.9e are recorded by Zeyd M. Ben-Halim.
 Changes since 1.9.9e are recorded by Thomas Dickey.
 
+20041225
+	+ add trace calls to remaining public functions in form and menu
+	  libraries.
+	+ fix check for numeric digits in test/ncurses.c 'b' and 'B' tests.
+	+ fix typo in test/ncurses.c 'c' test from 20041218.
+
 20041218
 	+ revise test/ncurses.c 'c' color test to improve use for xterm-88color
 	  and xterm-256color, added 'C' test using the wide-character color_set
Index: dist.mk
Prereq:  1.447 
--- ncurses-5.4-20041218+/dist.mk	2004-12-18 16:37:16.000000000 +0000
+++ ncurses-5.4-20041225/dist.mk	2004-12-25 13:09:58.000000000 +0000
@@ -1,4 +1,4 @@
-# $Id: dist.mk,v 1.447 2004/12/18 16:37:16 tom Exp $
+# $Id: dist.mk,v 1.448 2004/12/25 13:09:58 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -10,7 +10,7 @@
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 4
-NCURSES_PATCH = 20041218
+NCURSES_PATCH = 20041225
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
Index: form/f_trace.c
--- /dev/null	2004-09-12 00:40:36.000000000 +0000
+++ ncurses-5.4-20041225/form/f_trace.c	2004-12-25 23:28:49.000000000 +0000
@@ -0,0 +1,70 @@
+/****************************************************************************
+ * Copyright (c) 2004 Free Software Foundation, Inc.                        *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *   Author:  Thomas E. Dickey                                              *
+ ****************************************************************************/
+
+#include "form.priv.h"
+
+MODULE_ID("$Id: f_trace.c,v 1.1 2004/12/25 23:28:49 tom Exp $")
+
+NCURSES_EXPORT(FIELD **)
+_nc_retrace_field_ptr(FIELD **code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_EXPORT(FIELD *)
+_nc_retrace_field(FIELD *code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_retrace_field_type(FIELDTYPE *code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_EXPORT(FORM *)
+_nc_retrace_form(FORM *code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_EXPORT(Form_Hook)
+_nc_retrace_form_hook(Form_Hook code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
Index: form/fld_arg.c
Prereq:  1.10 
--- ncurses-5.4-20041218+/form/fld_arg.c	2004-12-11 21:35:46.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_arg.c	2004-12-25 22:20:18.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_arg.c,v 1.10 2004/12/11 21:35:46 tom Exp $")
+MODULE_ID("$Id: fld_arg.c,v 1.11 2004/12/25 22:20:18 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -91,7 +91,8 @@
 NCURSES_EXPORT(void *)
 field_arg(const FIELD *field)
 {
-  return Normalize_Field(field)->arg;
+  T((T_CALLED("field_arg(%p)"), field));
+  returnVoidPtr(Normalize_Field(field)->arg);
 }
 
 /* fld_arg.c ends here */
Index: form/fld_current.c
Prereq:  1.10 
--- ncurses-5.4-20041218+/form/fld_current.c	2004-12-11 21:36:09.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_current.c	2004-12-25 22:40:13.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_current.c,v 1.10 2004/12/11 21:36:09 tom Exp $")
+MODULE_ID("$Id: fld_current.c,v 1.11 2004/12/25 22:40:13 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -113,7 +113,8 @@
 NCURSES_EXPORT(FIELD *)
 current_field(const FORM *form)
 {
-  return Normalize_Form(form)->current;
+  T((T_CALLED("current_field(%p)"), form));
+  returnField(Normalize_Form(form)->current);
 }
 
 /*---------------------------------------------------------------------------
@@ -129,7 +130,8 @@
 NCURSES_EXPORT(int)
 field_index(const FIELD *field)
 {
-  return ((field != 0 && field->form != 0) ? (int)field->index : -1);
+  T((T_CALLED("field_index(%p)"), field));
+  returnCode((field != 0 && field->form != 0) ? (int)field->index : -1);
 }
 
 /* fld_current.c ends here */
Index: form/fld_def.c
Prereq:  1.30 
--- ncurses-5.4-20041218+/form/fld_def.c	2004-12-11 21:38:48.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_def.c	2004-12-25 22:24:10.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_def.c,v 1.30 2004/12/11 21:38:48 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.31 2004/12/25 22:24:10 tom Exp $")
 
 /* this can't be readonly */
 static FIELD default_field =
@@ -281,6 +281,7 @@
   FIELD *New_Field = (FIELD *)0;
   int err = E_BAD_ARGUMENT;
 
+  T((T_CALLED("new_field(%d,%d,%d,%d,%d,%d)"), rows, cols, frow, fcol, nrow, nbuf));
   if (rows > 0 &&
       cols > 0 &&
       frow >= 0 &&
@@ -328,7 +329,7 @@
 		    }
 		  buffer[j] = zeros;
 		}
-	      return New_Field;
+	      returnField(New_Field);
 	    }
 	}
     }
@@ -337,7 +338,7 @@
     free_field(New_Field);
 
   SET_ERROR(err);
-  return (FIELD *)0;
+  returnField((FIELD *)0);
 }
 
 /*---------------------------------------------------------------------------
Index: form/fld_dup.c
Prereq:  1.9 
--- ncurses-5.4-20041218+/form/fld_dup.c	2004-05-29 19:16:58.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_dup.c	2004-12-25 22:24:10.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_dup.c,v 1.9 2004/05/29 19:16:58 tom Exp $")
+MODULE_ID("$Id: fld_dup.c,v 1.10 2004/12/25 22:24:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -53,6 +53,7 @@
   FIELD *New_Field = (FIELD *)0;
   int err = E_BAD_ARGUMENT;
 
+  T((T_CALLED("dup_field(%p,%d,%d)"), field, frow, fcol));
   if (field && (frow >= 0) && (fcol >= 0) &&
       ((err = E_SYSTEM_ERROR) != 0) &&	/* trick : this resets the default error */
       (New_Field = (FIELD *)malloc(sizeof(FIELD))))
@@ -84,7 +85,7 @@
 	    {
 	      for (i = 0; i < len; ++i)
 		New_Field->buf[i] = field->buf[i];
-	      return New_Field;
+	      returnField(New_Field);
 	    }
 	}
     }
@@ -93,7 +94,7 @@
     free_field(New_Field);
 
   SET_ERROR(err);
-  return (FIELD *)0;
+  returnField((FIELD *)0);
 }
 
 /* fld_dup.c ends here */
Index: form/fld_ftlink.c
Prereq:  1.10 
--- ncurses-5.4-20041218+/form/fld_ftlink.c	2004-05-29 20:51:38.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_ftlink.c	2004-12-25 22:24:10.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_ftlink.c,v 1.10 2004/05/29 20:51:38 tom Exp $")
+MODULE_ID("$Id: fld_ftlink.c,v 1.11 2004/12/25 22:24:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,6 +53,7 @@
 {
   FIELDTYPE *nftyp = (FIELDTYPE *)0;
 
+  T((T_CALLED("link_fieldtype(%p,%p)"), type1, type2));
   if (type1 && type2)
     {
       nftyp = (FIELDTYPE *)malloc(sizeof(FIELDTYPE));
@@ -79,7 +80,7 @@
     {
       SET_ERROR(E_BAD_ARGUMENT);
     }
-  return nftyp;
+  returnFieldType(nftyp);
 }
 
 /* fld_ftlink.c ends here */
Index: form/fld_link.c
Prereq:  1.8 
--- ncurses-5.4-20041218+/form/fld_link.c	2004-05-29 20:46:51.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_link.c	2004-12-25 22:24:10.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_link.c,v 1.8 2004/05/29 20:46:51 tom Exp $")
+MODULE_ID("$Id: fld_link.c,v 1.9 2004/12/25 22:24:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -54,6 +54,7 @@
   FIELD *New_Field = (FIELD *)0;
   int err = E_BAD_ARGUMENT;
 
+  T((T_CALLED("link_field(%p,%d,%d)"), field, frow, fcol));
   if (field && (frow >= 0) && (fcol >= 0) &&
       ((err = E_SYSTEM_ERROR) != 0) &&	/* trick: this resets the default error */
       (New_Field = (FIELD *)malloc(sizeof(FIELD))))
@@ -81,14 +82,14 @@
       New_Field->usrptr = field->usrptr;
 
       if (_nc_Copy_Type(New_Field, field))
-	return New_Field;
+	returnField(New_Field);
     }
 
   if (New_Field)
     free_field(New_Field);
 
   SET_ERROR(err);
-  return (FIELD *)0;
+  returnField((FIELD *)0);
 }
 
 /* fld_link.c ends here */
Index: form/fld_newftyp.c
Prereq:  1.12 
--- ncurses-5.4-20041218+/form/fld_newftyp.c	2004-12-11 21:45:07.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_newftyp.c	2004-12-25 22:24:10.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_newftyp.c,v 1.12 2004/12/11 21:45:07 tom Exp $")
+MODULE_ID("$Id: fld_newftyp.c,v 1.13 2004/12/25 22:24:10 tom Exp $")
 
 static FIELDTYPE const default_fieldtype =
 {
@@ -73,6 +73,7 @@
 {
   FIELDTYPE *nftyp = (FIELDTYPE *)0;
 
+  T((T_CALLED("new_fieldtype(%p,%p)"), field_check, char_check));
   if ((field_check) || (char_check))
     {
       nftyp = (FIELDTYPE *)malloc(sizeof(FIELDTYPE));
@@ -92,7 +93,7 @@
     {
       SET_ERROR(E_BAD_ARGUMENT);
     }
-  return nftyp;
+  returnFieldType(nftyp);
 }
 
 /*---------------------------------------------------------------------------
Index: form/fld_type.c
Prereq:  1.14 
--- ncurses-5.4-20041218+/form/fld_type.c	2004-12-11 22:17:49.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_type.c	2004-12-25 22:24:10.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_type.c,v 1.14 2004/12/11 22:17:49 tom Exp $")
+MODULE_ID("$Id: fld_type.c,v 1.15 2004/12/25 22:24:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -90,7 +90,8 @@
 NCURSES_EXPORT(FIELDTYPE *)
 field_type(const FIELD *field)
 {
-  return Normalize_Field(field)->type;
+  T((T_CALLED("field_type(%p)"), field));
+  returnFieldType(Normalize_Field(field)->type);
 }
 
 /* fld_type.c ends here */
Index: form/fld_user.c
Prereq:  1.14 
--- ncurses-5.4-20041218+/form/fld_user.c	2004-12-11 22:25:07.000000000 +0000
+++ ncurses-5.4-20041225/form/fld_user.c	2004-12-25 22:24:50.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_user.c,v 1.14 2004/12/11 22:25:07 tom Exp $")
+MODULE_ID("$Id: fld_user.c,v 1.15 2004/12/25 22:24:50 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -65,7 +65,8 @@
 NCURSES_EXPORT(void *)
 field_userptr(const FIELD *field)
 {
-  return Normalize_Field(field)->usrptr;
+  T((T_CALLED("field_userptr(%p)"), field));
+  returnVoidPtr(Normalize_Field(field)->usrptr);
 }
 
 /* fld_user.c ends here */
Index: form/form.priv.h
Prereq:  0.20 
--- ncurses-5.4-20041218+/form/form.priv.h	2004-12-04 22:50:01.000000000 +0000
+++ ncurses-5.4-20041225/form/form.priv.h	2004-12-25 22:52:17.000000000 +0000
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: form.priv.h,v 0.20 2004/12/04 22:50:01 tom Exp $ */
+/* $Id: form.priv.h,v 0.21 2004/12/25 22:52:17 tom Exp $ */
 
 #ifndef FORM_PRIV_H
 #define FORM_PRIV_H 1
@@ -164,4 +164,28 @@
 extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
 #endif
 
+#ifdef TRACE
+
+#define returnField(code)	TRACE_RETURN(code,field)
+#define returnFieldPtr(code)	TRACE_RETURN(code,field_ptr)
+#define returnForm(code)	TRACE_RETURN(code,form)
+#define returnFieldType(code)	TRACE_RETURN(code,field_type)
+#define returnFormHook(code)	TRACE_RETURN(code,form_hook)
+
+extern NCURSES_EXPORT(FIELD **)	    _nc_retrace_field_ptr (FIELD **);
+extern NCURSES_EXPORT(FIELD *)	    _nc_retrace_field (FIELD *);
+extern NCURSES_EXPORT(FIELDTYPE *)  _nc_retrace_field_type (FIELDTYPE *);
+extern NCURSES_EXPORT(FORM *)  _nc_retrace_form (FORM *);
+extern NCURSES_EXPORT(Form_Hook)  _nc_retrace_form_hook (Form_Hook);
+
+#else /* !TRACE */
+
+#define returnFieldPtr(code)	return code
+#define returnFieldType(code)	return code
+#define returnField(code)	return code
+#define returnForm(code)	return code
+#define returnFormHook(code)	return code
+
+#endif /* TRACE/!TRACE */
+
 #endif /* FORM_PRIV_H */
Index: form/frm_def.c
Prereq:  1.16 
--- ncurses-5.4-20041218+/form/frm_def.c	2004-12-11 22:26:58.000000000 +0000
+++ ncurses-5.4-20041225/form/frm_def.c	2004-12-25 22:26:01.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_def.c,v 1.16 2004/12/11 22:26:58 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.17 2004/12/25 22:26:01 tom Exp $")
 
 /* this can't be readonly */
 static FORM default_form =
@@ -285,6 +285,7 @@
 
   FORM *form = (FORM *)malloc(sizeof(FORM));
 
+  T((T_CALLED("new_form(%p)"), fields));
   if (form)
     {
       *form = *_nc_Default_Form;
@@ -298,7 +299,7 @@
   if (!form)
     SET_ERROR(err);
 
-  return (form);
+  returnForm(form);
 }
 
 /*---------------------------------------------------------------------------
@@ -374,7 +375,8 @@
 NCURSES_EXPORT(FIELD **)
 form_fields(const FORM *form)
 {
-  return (Normalize_Form(form)->field);
+  T((T_CALLED("form_field(%p)"), form));
+  returnFieldPtr(Normalize_Form(form)->field);
 }
 
 /*---------------------------------------------------------------------------
Index: form/frm_hook.c
Prereq:  1.13 
--- ncurses-5.4-20041218+/form/frm_hook.c	2004-12-11 22:04:21.000000000 +0000
+++ ncurses-5.4-20041225/form/frm_hook.c	2004-12-25 22:37:27.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_hook.c,v 1.13 2004/12/11 22:04:21 tom Exp $")
+MODULE_ID("$Id: frm_hook.c,v 1.14 2004/12/25 22:37:27 tom Exp $")
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
@@ -47,7 +47,8 @@
 #define GEN_HOOK_GET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\
 {\
-   return ( Normalize_Form( form ) -> typ ## name );\
+   T((T_CALLED(#typ "_" #name "(%p)"), form));\
+   returnFormHook( Normalize_Form( form ) -> typ ## name );\
 }
 
 /*---------------------------------------------------------------------------
Index: form/frm_user.c
Prereq:  1.13 
--- ncurses-5.4-20041218+/form/frm_user.c	2004-12-11 22:14:36.000000000 +0000
+++ ncurses-5.4-20041225/form/frm_user.c	2004-12-25 22:37:56.000000000 +0000
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_user.c,v 1.13 2004/12/11 22:14:36 tom Exp $")
+MODULE_ID("$Id: frm_user.c,v 1.14 2004/12/25 22:37:56 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -65,7 +65,8 @@
 NCURSES_EXPORT(void *)
 form_userptr(const FORM *form)
 {
-  return Normalize_Form(form)->usrptr;
+  T((T_CALLED("form_userptr(%p)"), form));
+  returnVoidPtr(Normalize_Form(form)->usrptr);
 }
 
 /* frm_user.c ends here */
Index: form/modules
Prereq:  1.13 
--- ncurses-5.4-20041218+/form/modules	1999-02-19 00:27:47.000000000 +0000
+++ ncurses-5.4-20041225/form/modules	2004-12-25 23:29:22.000000000 +0000
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.13 1999/02/19 00:27:47 juergen Exp $
+# $Id: modules,v 1.14 2004/12/25 23:29:22 tom Exp $
 ##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc.                          #
+# Copyright (c) 1998,2004 Free Software Foundation, Inc.                     #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -27,11 +27,12 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
+# Author: Thomas E. Dickey
 #
 
 @ base
 # Library objects
+f_trace		lib		$(srcdir)	$(FORM_PRIV_H)
 fld_arg		lib		$(srcdir)	$(FORM_PRIV_H)
 fld_attr	lib		$(srcdir)	$(FORM_PRIV_H)
 fld_current	lib		$(srcdir)	$(FORM_PRIV_H)
Index: menu/m_cursor.c
Prereq:  1.18 
--- ncurses-5.4-20041218+/menu/m_cursor.c	2004-12-11 23:09:57.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_cursor.c	2004-12-25 22:03:00.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_cursor.c,v 1.18 2004/12/11 23:09:57 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.19 2004/12/25 22:03:00 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -50,8 +50,7 @@
 |                    E_NOT_POSTED    - Menu is not posted
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(int)
-  _nc_menu_cursor_pos
-  (const MENU * menu, const ITEM * item, int *pY, int *pX)
+_nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX)
 {
   if (!menu || !pX || !pY)
     return (E_BAD_ARGUMENT);
Index: menu/m_global.c
Prereq:  1.17 
--- ncurses-5.4-20041218+/menu/m_global.c	2004-12-11 23:06:56.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_global.c	2004-12-26 00:57:50.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.17 2004/12/11 23:06:56 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.18 2004/12/26 00:57:50 tom Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -125,6 +125,7 @@
 
   menu->namelen = MaximumNameLength;
   menu->desclen = MaximumDescriptionLength;
+  T(("ComputeMaximum_NameDesc_Lengths %d,%d", menu->namelen, menu->desclen));
 }
 
 /*---------------------------------------------------------------------------
@@ -237,6 +238,83 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
+|   Function      :  int _nc_Calculate_Text_Width(const TEXT * item)
+|   
+|   Description   :  Calculate the number of columns for a TEXT.
+|
+|   Return Values :  the width
++--------------------------------------------------------------------------*/
+NCURSES_EXPORT(int)
+_nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ )
+{
+#if USE_WIDEC_SUPPORT
+  int result = item->length;
+  int count = mbstowcs(0, item->str, 0);
+  wchar_t *temp = 0;
+
+  T((T_CALLED("_nc_menu_text_width(%p)"), item));
+  if (count > 0
+      && (temp = malloc(sizeof(*temp) * (2 + count))) != 0)
+    {
+      int n;
+
+      result = 0;
+      mbstowcs(temp, item->str, count);
+      for (n = 0; n < count; ++n)
+	{
+	  int test = wcwidth(temp[n]);
+
+	  if (test <= 0)
+	    test = 1;
+	  result += test;
+	}
+      free(temp);
+    }
+  returnCode(result);
+#else
+  return item->length;
+#endif
+}
+
+/* FIXME: this is experimental, should cache the results but don't want to
+ * modify the MENU struct to do this until it's complete.
+ */
+#if 0				/* USE_WIDEC_SUPPORT */
+static int
+calculate_actual_width(MENU * menu, bool name)
+{
+  int width = 0;
+  int check = 0;
+  ITEM **items;
+
+  assert(menu && menu->items);
+  for (items = menu->items; *items; items++)
+    {
+      if (name)
+	{
+	  check = _nc_Calculate_Text_Width(&((*items)->name));
+	}
+      else
+	{
+	  check = _nc_Calculate_Text_Width(&((*items)->description));
+	}
+      if (check > width)
+	width = check;
+    }
+
+  T(("calculate_actual_width %s = %d/%d",
+     name ? "name" : "desc",
+     width,
+     name ? menu->namelen : menu->desclen));
+  width += 2;			/* FIXME - need this? */
+  return width;
+}
+#else
+#define calculate_actual_width(menu, name) (name ? menu->namelen : menu->desclen)
+#endif
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnmenu  
 |   Function      :  void _nc_Calculate_Item_Length_and_Width(MENU *menu)
 |   
 |   Description   :  Calculate the length of an item and the width of the
@@ -253,14 +331,24 @@
 
   menu->height = 1 + menu->spc_rows * (menu->arows - 1);
 
-  l = menu->namelen + menu->marklen;
+  l = calculate_actual_width(menu, TRUE);
+  l += menu->marklen;
+
   if ((menu->opt & O_SHOWDESC) && (menu->desclen > 0))
-    l += (menu->desclen + menu->spc_desc);
+    {
+      l += calculate_actual_width(menu, FALSE);
+      l += menu->spc_desc;
+    }
 
   menu->itemlen = l;
   l *= menu->cols;
   l += (menu->cols - 1) * menu->spc_cols;	/* for the padding between the columns */
   menu->width = l;
+
+  T(("_nc_CalculateItem_Length_and_Width columns %d, item %d, width %d",
+     menu->cols,
+     menu->itemlen,
+     menu->width));
 }
 
 /*---------------------------------------------------------------------------
Index: menu/m_hook.c
Prereq:  1.13 
--- ncurses-5.4-20041218+/menu/m_hook.c	2004-12-11 23:12:01.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_hook.c	2004-12-25 21:39:52.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_hook.c,v 1.13 2004/12/11 23:12:01 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.14 2004/12/25 21:39:52 tom Exp $")
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
@@ -52,7 +52,8 @@
 #define GEN_HOOK_GET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\
 {\
-   return (Normalize_Menu(menu) -> typ ## name);\
+   T((T_CALLED(#typ "_" #name "(%p)"), menu));\
+   returnMenuHook(Normalize_Menu(menu) -> typ ## name);\
 }
 
 /*---------------------------------------------------------------------------
Index: menu/m_item_cur.c
Prereq:  1.16 
--- ncurses-5.4-20041218+/menu/m_item_cur.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_item_cur.c	2004-12-25 21:57:38.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_cur.c,v 1.16 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_cur.c,v 1.17 2004/12/25 21:57:38 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -91,7 +91,8 @@
 NCURSES_EXPORT(ITEM *)
 current_item(const MENU * menu)
 {
-  return (menu && menu->items) ? menu->curitem : (ITEM *) 0;
+  T((T_CALLED("current_item(%p)"), menu));
+  returnItem((menu && menu->items) ? menu->curitem : (ITEM *) 0);
 }
 
 /*---------------------------------------------------------------------------
@@ -105,7 +106,8 @@
 NCURSES_EXPORT(int)
 item_index(const ITEM * item)
 {
-  return (item && item->imenu) ? item->index : ERR;
+  T((T_CALLED("item_index(%p)"), item));
+  returnCode((item && item->imenu) ? item->index : ERR);
 }
 
 /* m_item_cur.c ends here */
Index: menu/m_item_nam.c
Prereq:  1.13 
--- ncurses-5.4-20041218+/menu/m_item_nam.c	2004-12-11 23:06:56.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_item_nam.c	2004-12-25 21:41:54.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_nam.c,v 1.13 2004/12/11 23:06:56 tom Exp $")
+MODULE_ID("$Id: m_item_nam.c,v 1.14 2004/12/25 21:41:54 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -50,7 +50,8 @@
 NCURSES_EXPORT(const char *)
 item_name(const ITEM * item)
 {
-  return ((item) ? item->name.str : (char *)0);
+  T((T_CALLED("item_name(%p)"), item));
+  returnCPtr((item) ? item->name.str : (char *)0);
 }
 
 /*---------------------------------------------------------------------------
@@ -64,7 +65,8 @@
 NCURSES_EXPORT(const char *)
 item_description(const ITEM * item)
 {
-  return ((item) ? item->description.str : (char *)0);
+  T((T_CALLED("item_description(%p)"), item));
+  returnCPtr((item) ? item->description.str : (char *)0);
 }
 
 /* m_item_nam.c ends here */
Index: menu/m_item_new.c
Prereq:  1.19 
--- ncurses-5.4-20041218+/menu/m_item_new.c	2004-12-11 23:29:33.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_item_new.c	2004-12-26 00:59:45.000000000 +0000
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_new.c,v 1.19 2004/12/11 23:29:33 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.21 2004/12/26 00:59:45 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -109,6 +109,10 @@
 {
   ITEM *item;
 
+  T((T_CALLED("new_item(\"%s\", \"%s\")"),
+     name ? name : "",
+     description ? description : ""));
+
   if (!name || (*name == '\0') || !Is_Printable_String(name))
     {
       item = (ITEM *) 0;
@@ -139,7 +143,7 @@
       else
 	SET_ERROR(E_SYSTEM_ERROR);
     }
-  return (item);
+  returnItem(item);
 }
 
 /*---------------------------------------------------------------------------
@@ -245,7 +249,7 @@
     }
   else
     {
-      return set_menu_mark(&_nc_Default_Menu, mark);
+      returnCode(set_menu_mark(&_nc_Default_Menu, mark));
     }
   RETURN(E_OK);
 }
@@ -261,7 +265,8 @@
 NCURSES_EXPORT(const char *)
 menu_mark(const MENU * menu)
 {
-  return Normalize_Menu(menu)->mark;
+  T((T_CALLED("menu_mark(%p)"), menu));
+  returnPtr(Normalize_Menu(menu)->mark);
 }
 
 /* m_item_new.c */
Index: menu/m_item_opt.c
Prereq:  1.16 
--- ncurses-5.4-20041218+/menu/m_item_opt.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_item_opt.c	2004-12-25 21:32:54.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_opt.c,v 1.16 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_opt.c,v 1.17 2004/12/25 21:32:54 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -152,7 +152,8 @@
 NCURSES_EXPORT(Item_Options)
 item_opts(const ITEM * item)
 {
-  return (ALL_ITEM_OPTS & Normalize_Item(item)->opt);
+  T((T_CALLED("item_opts(%p)"), item));
+  returnItemOpts(ALL_ITEM_OPTS & Normalize_Item(item)->opt);
 }
 
 /* m_item_opt.c ends here */
Index: menu/m_item_use.c
Prereq:  1.15 
--- ncurses-5.4-20041218+/menu/m_item_use.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_item_use.c	2004-12-25 21:33:31.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_use.c,v 1.15 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_use.c,v 1.16 2004/12/25 21:33:31 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -69,7 +69,8 @@
 NCURSES_EXPORT(void *)
 item_userptr(const ITEM * item)
 {
-  return Normalize_Item(item)->userptr;
+  T((T_CALLED("item_userptr(%p)"), item));
+  returnVoidPtr(Normalize_Item(item)->userptr);
 }
 
 /* m_item_use.c */
Index: menu/m_item_vis.c
Prereq:  1.14 
--- ncurses-5.4-20041218+/menu/m_item_vis.c	2004-12-11 23:06:56.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_item_vis.c	2004-12-25 21:40:09.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_vis.c,v 1.14 2004/12/11 23:06:56 tom Exp $")
+MODULE_ID("$Id: m_item_vis.c,v 1.15 2004/12/25 21:40:09 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -54,14 +54,15 @@
 {
   MENU *menu;
 
+  T((T_CALLED("item_visible(%p)"), item));
   if (item &&
       (menu = item->imenu) &&
       (menu->status & _POSTED) &&
       ((menu->toprow + menu->arows) > (item->y)) &&
       (item->y >= menu->toprow))
-    return TRUE;
+    returnBool(TRUE);
   else
-    return FALSE;
+    returnBool(FALSE);
 }
 
 /* m_item_vis.c ends here */
Index: menu/m_items.c
Prereq:  1.14 
--- ncurses-5.4-20041218+/menu/m_items.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_items.c	2004-12-25 21:35:09.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_items.c,v 1.14 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_items.c,v 1.15 2004/12/25 21:35:09 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -87,7 +87,8 @@
 NCURSES_EXPORT(ITEM **)
 menu_items(const MENU * menu)
 {
-  return (menu ? menu->items : (ITEM **) 0);
+  T((T_CALLED("menu_items(%p)"), menu));
+  returnVoidPtr(menu ? menu->items : (ITEM **) 0);
 }
 
 /*---------------------------------------------------------------------------
@@ -102,7 +103,8 @@
 NCURSES_EXPORT(int)
 item_count(const MENU * menu)
 {
-  return (menu ? menu->nitems : -1);
+  T((T_CALLED("item_count(%p)"), menu));
+  returnCode(menu ? menu->nitems : -1);
 }
 
 /* m_items.c ends here */
Index: menu/m_new.c
Prereq:  1.15 
--- ncurses-5.4-20041218+/menu/m_new.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_new.c	2004-12-25 21:57:53.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_new.c,v 1.15 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.16 2004/12/25 21:57:53 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -55,6 +55,7 @@
 {
   MENU *menu = (MENU *) calloc(1, sizeof(MENU));
 
+  T((T_CALLED("new_menu(%p)"), items));
   if (menu)
     {
       *menu = _nc_Default_Menu;
@@ -74,7 +75,7 @@
   if (!menu)
     SET_ERROR(E_SYSTEM_ERROR);
 
-  return (menu);
+  returnMenu(menu);
 }
 
 /*---------------------------------------------------------------------------
Index: menu/m_opts.c
Prereq:  1.18 
--- ncurses-5.4-20041218+/menu/m_opts.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_opts.c	2004-12-25 21:36:12.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_opts.c,v 1.18 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_opts.c,v 1.19 2004/12/25 21:36:12 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -176,7 +176,8 @@
 NCURSES_EXPORT(Menu_Options)
 menu_opts(const MENU * menu)
 {
-  return (ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
+  T((T_CALLED("menu_opts(%p)"), menu));
+  returnMenuOpts(ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
 }
 
 /* m_opts.c ends here */
Index: menu/m_pad.c
Prereq:  1.9 
--- ncurses-5.4-20041218+/menu/m_pad.c	2004-12-11 23:29:33.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_pad.c	2004-12-25 21:40:58.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pad.c,v 1.9 2004/12/11 23:29:33 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.10 2004/12/25 21:40:58 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
@@ -88,7 +88,8 @@
 NCURSES_EXPORT(int)
 menu_pad(const MENU * menu)
 {
-  return (Normalize_Menu(menu)->pad);
+  T((T_CALLED("menu_pad(%p)"), menu));
+  returnCode(Normalize_Menu(menu)->pad);
 }
 
 /* m_pad.c ends here */
Index: menu/m_pattern.c
Prereq:  1.12 
--- ncurses-5.4-20041218+/menu/m_pattern.c	2004-12-11 23:29:33.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_pattern.c	2004-12-25 21:41:37.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pattern.c,v 1.12 2004/12/11 23:29:33 tom Exp $")
+MODULE_ID("$Id: m_pattern.c,v 1.13 2004/12/25 21:41:37 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,7 +53,8 @@
 NCURSES_EXPORT(char *)
 menu_pattern(const MENU * menu)
 {
-  return (char *)(menu ? (menu->pattern ? menu->pattern : "") : 0);
+  T((T_CALLED("menu_pattern(%p)"), menu));
+  returnPtr((char *)(menu ? (menu->pattern ? menu->pattern : "") : 0));
 }
 
 /*---------------------------------------------------------------------------
Index: menu/m_post.c
Prereq:  1.25 
--- ncurses-5.4-20041218+/menu/m_post.c	2004-12-11 23:29:33.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_post.c	2004-12-25 23:57:04.000000000 +0000
@@ -37,39 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.25 2004/12/11 23:29:33 tom Exp $")
-
-#if USE_WIDEC_SUPPORT
-static int
-text_columns(const TEXT * item)
-{
-  int result = item->length;
-  int count = mbstowcs(0, item->str, 0);
-  wchar_t *temp = 0;
-
-  if (count > 0
-      && (temp = malloc(sizeof(*temp) * (2 + count))) != 0)
-    {
-      int n;
-
-      result = 0;
-      mbstowcs(temp, item->str, count);
-      for (n = 0; n < count; ++n)
-	{
-	  int test = wcwidth(temp[n]);
-
-	  if (test <= 0)
-	    test = 1;
-	  result += test;
-	}
-      free(temp);
-    }
-  return result;
-}
-#define TEXT_COLS(item) text_columns(&(item))
-#else
-#define TEXT_COLS(item) item.length
-#endif
+MODULE_ID("$Id: m_post.c,v 1.26 2004/12/25 23:57:04 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -151,7 +119,7 @@
     }
 
   waddnstr(menu->win, item->name.str, item->name.length);
-  name_len = TEXT_COLS(item->name);
+  name_len = _nc_Calculate_Text_Width(&(item->name));
   for (ch = ' ', i = menu->namelen - name_len; i > 0; i--)
     {
       waddch(menu->win, ch);
@@ -176,7 +144,7 @@
 	}
       if (item->description.length)
 	waddnstr(menu->win, item->description.str, item->description.length);
-      desc_len = TEXT_COLS(item->description);
+      desc_len = _nc_Calculate_Text_Width(&(item->description));
       for (ch = ' ', i = menu->desclen - desc_len; i > 0; i--)
 	{
 	  waddch(menu->win, ch);
Index: menu/m_req_name.c
Prereq:  1.17 
--- ncurses-5.4-20041218+/menu/m_req_name.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_req_name.c	2004-12-25 21:42:21.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_req_name.c,v 1.17 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.18 2004/12/25 21:42:21 tom Exp $")
 
 static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] =
 {
@@ -74,13 +74,14 @@
 NCURSES_EXPORT(const char *)
 menu_request_name(int request)
 {
+  T((T_CALLED("menu_request_name(%d)"), request));
   if ((request < MIN_MENU_COMMAND) || (request > MAX_MENU_COMMAND))
     {
       SET_ERROR(E_BAD_ARGUMENT);
-      return (const char *)0;
+      returnCPtr((const char *)0);
     }
   else
-    return request_names[request - MIN_MENU_COMMAND];
+    returnCPtr(request_names[request - MIN_MENU_COMMAND]);
 }
 
 /*---------------------------------------------------------------------------
@@ -115,7 +116,7 @@
       for (i = 0; i < A_SIZE; i++)
 	{
 	  if (strncmp(request_names[i], buf, sizeof(buf)) == 0)
-	    return MIN_MENU_COMMAND + i;
+	    returnCode(MIN_MENU_COMMAND + i);
 	}
     }
   RETURN(E_NO_MATCH);
Index: menu/m_sub.c
Prereq:  1.9 
--- ncurses-5.4-20041218+/menu/m_sub.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_sub.c	2004-12-25 21:38:31.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_sub.c,v 1.9 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.10 2004/12/25 21:38:31 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -79,7 +79,8 @@
 {
   const MENU *m = Normalize_Menu(menu);
 
-  return Get_Menu_Window(m);
+  T((T_CALLED("menu_sub(%p)"), menu));
+  returnWin(Get_Menu_Window(m));
 }
 
 /* m_sub.c ends here */
Index: menu/m_trace.c
--- /dev/null	2004-09-12 00:40:36.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_trace.c	2004-12-25 22:44:30.000000000 +0000
@@ -0,0 +1,70 @@
+/****************************************************************************
+ * Copyright (c) 2004 Free Software Foundation, Inc.                        *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *   Author:  Thomas E. Dickey                                              *
+ ****************************************************************************/
+
+#include "menu.priv.h"
+
+MODULE_ID("$Id: m_trace.c,v 1.2 2004/12/25 22:44:30 tom Exp $")
+
+NCURSES_EXPORT(ITEM *)
+_nc_retrace_item(ITEM * code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_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)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_EXPORT(Menu_Hook)
+_nc_retrace_menu_hook(Menu_Hook code)
+{
+  T((T_RETURN("%p"), code));
+  return code;
+}
+
+NCURSES_EXPORT(Menu_Options)
+_nc_retrace_menu_opts(Menu_Options code)
+{
+  T((T_RETURN("%d"), code));
+  return code;
+}
Index: menu/m_userptr.c
Prereq:  1.15 
--- ncurses-5.4-20041218+/menu/m_userptr.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_userptr.c	2004-12-25 21:38:55.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_userptr.c,v 1.15 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_userptr.c,v 1.16 2004/12/25 21:38:55 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -69,7 +69,8 @@
 NCURSES_EXPORT(void *)
 menu_userptr(const MENU * menu)
 {
-  return (Normalize_Menu(menu)->userptr);
+  T((T_CALLED("menu_userptr(%p)"), menu));
+  returnVoidPtr(Normalize_Menu(menu)->userptr);
 }
 
 /* m_userptr.c ends here */
Index: menu/m_win.c
Prereq:  1.14 
--- ncurses-5.4-20041218+/menu/m_win.c	2004-12-11 23:29:34.000000000 +0000
+++ ncurses-5.4-20041225/menu/m_win.c	2004-12-25 21:39:20.000000000 +0000
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_win.c,v 1.14 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_win.c,v 1.15 2004/12/25 21:39:20 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -79,7 +79,8 @@
 {
   const MENU *m = Normalize_Menu(menu);
 
-  return (m->userwin ? m->userwin : stdscr);
+  T((T_CALLED("menu_win(%p)"), menu));
+  returnWin(m->userwin ? m->userwin : stdscr);
 }
 
 /* m_win.c ends here */
Index: menu/menu.priv.h
Prereq:  1.18 
--- ncurses-5.4-20041218+/menu/menu.priv.h	2004-12-11 22:42:52.000000000 +0000
+++ ncurses-5.4-20041225/menu/menu.priv.h	2004-12-25 23:56:42.000000000 +0000
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.priv.h,v 1.18 2004/12/11 22:42:52 tom Exp $ */
+/* $Id: menu.priv.h,v 1.21 2004/12/25 23:56:42 tom Exp $ */
 
 /***************************************************************************
 * Module menu.priv.h                                                       *
@@ -112,6 +112,7 @@
 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 *);
@@ -121,4 +122,28 @@
 extern NCURSES_EXPORT(int)  _nc_menu_cursor_pos (const MENU* menu, const ITEM* item,
 				int* pY, int* pX);
 
+#ifdef TRACE
+
+#define returnItem(code)	TRACE_RETURN(code,item)
+#define returnItemOpts(code)	TRACE_RETURN(code,item_opts)
+#define returnMenu(code)	TRACE_RETURN(code,menu)
+#define returnMenuHook(code)	TRACE_RETURN(code,menu_hook)
+#define returnMenuOpts(code)	TRACE_RETURN(code,menu_opts)
+
+extern NCURSES_EXPORT(ITEM *)	    _nc_retrace_item (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);
+
+#else /* !TRACE */
+
+#define returnItem(code)	return code
+#define returnItemOpts(code)	return code
+#define returnMenu(code)	return code
+#define returnMenuHook(code)	return code
+#define returnMenuOpts(code)	return code
+
+#endif /* TRACE/!TRACE */
+
 #endif /* MENU_PRIV_H_incl */
Index: menu/modules
Prereq:  1.14 
--- ncurses-5.4-20041218+/menu/modules	1999-02-18 22:39:04.000000000 +0000
+++ ncurses-5.4-20041225/menu/modules	2004-12-25 22:06:33.000000000 +0000
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.14 1999/02/18 22:39:04 juergen Exp $
+# $Id: modules,v 1.16 2004/12/25 22:06:33 tom Exp $
 ##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc.                          #
+# Copyright (c) 1998,2004 Free Software Foundation, Inc.                     #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -56,5 +56,6 @@
 m_scale		lib		$(srcdir)	$(MENU_PRIV_H)
 m_spacing	lib		$(srcdir)	$(MENU_PRIV_H)
 m_sub		lib		$(srcdir)	$(MENU_PRIV_H)
+m_trace		lib		$(srcdir)	$(MENU_PRIV_H)
 m_userptr	lib		$(srcdir)	$(MENU_PRIV_H)
 m_win		lib		$(srcdir)	$(MENU_PRIV_H)
Index: ncurses/curses.priv.h
Prereq:  1.268 
--- ncurses-5.4-20041218+/ncurses/curses.priv.h	2004-12-11 23:50:46.000000000 +0000
+++ ncurses-5.4-20041225/ncurses/curses.priv.h	2004-12-26 00:56:58.000000000 +0000
@@ -34,7 +34,7 @@
 
 
 /*
- * $Id: curses.priv.h,v 1.268 2004/12/11 23:50:46 tom Exp $
+ * $Id: curses.priv.h,v 1.269 2004/12/26 00:56:58 tom Exp $
  *
  *	curses.priv.h
  *
@@ -645,7 +645,7 @@
 
 	/*
 	 * Wide characters cannot be represented in the A_CHARTEXT mask of
-	 * attr_t's but an application might have set a narrow character there. 
+	 * attr_t's but an application might have set a narrow character there.
 	 * But even in that case, it would only be a printable character, or
 	 * zero.  Otherwise we can use those bits to tell if a cell is the
 	 * first or extension part of a wide character.
@@ -760,16 +760,17 @@
 #define TPUTS_TRACE(s)	_nc_tputs_trace = s;
 #define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
 
-#define returnAttr(code) TRACE_RETURN(code,attr_t)
-#define returnChar(code) TRACE_RETURN(code,chtype)
-#define returnBool(code) TRACE_RETURN(code,bool)
-#define returnBits(code) TRACE_RETURN(code,unsigned)
-#define returnCode(code) TRACE_RETURN(code,int)
-#define returnCPtr(code) TRACE_RETURN(code,cptr)
-#define returnPtr(code)  TRACE_RETURN(code,ptr)
-#define returnSP(code)   TRACE_RETURN(code,sp)
-#define returnVoid       T((T_RETURN(""))); return
-#define returnWin(code)  TRACE_RETURN(code,win)
+#define returnAttr(code) 	TRACE_RETURN(code,attr_t)
+#define returnChar(code) 	TRACE_RETURN(code,chtype)
+#define returnBool(code) 	TRACE_RETURN(code,bool)
+#define returnBits(code) 	TRACE_RETURN(code,unsigned)
+#define returnCode(code) 	TRACE_RETURN(code,int)
+#define returnCPtr(code) 	TRACE_RETURN(code,cptr)
+#define returnPtr(code)  	TRACE_RETURN(code,ptr)
+#define returnSP(code)   	TRACE_RETURN(code,sp)
+#define returnVoid       	T((T_RETURN(""))); return
+#define returnVoidPtr(code)	TRACE_RETURN(code,void_ptr)
+#define returnWin(code)  	TRACE_RETURN(code,win)
 
 extern NCURSES_EXPORT(NCURSES_BOOL)     _nc_retrace_bool (NCURSES_BOOL);
 extern NCURSES_EXPORT(SCREEN *)         _nc_retrace_sp (SCREEN *);
@@ -784,6 +785,7 @@
 extern NCURSES_EXPORT(int)              _nc_retrace_int (int);
 extern NCURSES_EXPORT(unsigned)         _nc_retrace_unsigned (unsigned);
 extern NCURSES_EXPORT(void)             _nc_fifo_dump (void);
+extern NCURSES_EXPORT(void *)           _nc_retrace_void_ptr (void *);
 extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace;
 extern NCURSES_EXPORT_VAR(long)         _nc_outchars;
 extern NCURSES_EXPORT_VAR(unsigned)     _nc_tracing;
@@ -803,16 +805,17 @@
 #define TR(n, a)
 #define TPUTS_TRACE(s)
 
-#define returnAttr(code) return code
-#define returnBits(code) return code
-#define returnBool(code) return code
-#define returnChar(code) return code
-#define returnCode(code) return code
-#define returnCPtr(code) return code
-#define returnPtr(code)  return code
-#define returnSP(code)   return code
-#define returnVoid       return
-#define returnWin(code)  return code
+#define returnAttr(code)	return code
+#define returnBits(code)	return code
+#define returnBool(code)	return code
+#define returnChar(code)	return code
+#define returnCode(code)	return code
+#define returnCPtr(code)	return code
+#define returnPtr(code)		return code
+#define returnSP(code)		return code
+#define returnVoid		return
+#define returnVoidPtr(code)	return code
+#define returnWin(code)		return code
 
 #endif /* TRACE/!TRACE */
 
Index: ncurses/trace/lib_trace.c
Prereq:  1.54 
--- ncurses-5.4-20041218+/ncurses/trace/lib_trace.c	2004-12-11 23:52:43.000000000 +0000
+++ ncurses-5.4-20041225/ncurses/trace/lib_trace.c	2004-12-26 01:00:28.000000000 +0000
@@ -41,9 +41,9 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_trace.c,v 1.54 2004/12/11 23:52:43 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.55 2004/12/26 01:00:28 tom Exp $")
 
-NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0;	/* always define this */
+NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
 
 #ifdef TRACE
 NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace = "";
@@ -188,9 +188,17 @@
     return code;
 }
 
+/* Trace 'void*' return-values */
+NCURSES_EXPORT(void *)
+_nc_retrace_void_ptr(void *code)
+{
+    T((T_RETURN("%p"), _nc_visbuf(code)));
+    return code;
+}
+
 /* Trace 'SCREEN *' return-values */
 NCURSES_EXPORT(SCREEN *)
-_nc_retrace_sp(SCREEN * code)
+_nc_retrace_sp(SCREEN *code)
 {
     T((T_RETURN("%p"), code));
     return code;
Index: test/ncurses.c
Prereq:  1.235 
--- ncurses-5.4-20041218+/test/ncurses.c	2004-12-19 01:12:16.000000000 +0000
+++ ncurses-5.4-20041225/test/ncurses.c	2004-12-25 20:52:17.000000000 +0000
@@ -40,7 +40,7 @@
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.235 2004/12/19 01:12:16 tom Exp $
+$Id: ncurses.c,v 1.238 2004/12/25 20:52:17 tom Exp $
 
 ***************************************************************************/
 
@@ -1210,7 +1210,7 @@
 	int ch = Getchar();
 
 	error = FALSE;
-	if (isdigit(ch)) {
+	if (ch < 256 && isdigit(ch)) {
 	    *skip = (ch - '0');
 	} else {
 	    switch (ch) {
@@ -1488,7 +1488,7 @@
 	int ch = Getchar();
 
 	error = FALSE;
-	if (isdigit(ch)) {
+	if (ch < 256 && isdigit(ch)) {
 	    *skip = (ch - '0');
 	} else {
 	    switch (ch) {
@@ -1739,7 +1739,7 @@
 	for (i = (base_row * per_row); i < pairs_max; i++) {
 	    int row = grid_top + (i / per_row) - base_row;
 	    int col = (i % per_row + 1) * width;
-	    int pair = i + 1;
+	    int pair = i;
 
 	    if (move(row, col) != ERR) {
 		init_pair(pair, i % COLORS, i / COLORS);
@@ -1869,7 +1869,7 @@
 	for (i = (base_row * per_row); i < pairs_max; i++) {
 	    int row = grid_top + (i / per_row) - base_row;
 	    int col = (i % per_row + 1) * width;
-	    int pair = i + 1;
+	    int pair = i;
 
 	    if (move(row, col) != ERR) {
 		init_pair(pair, i % COLORS, i / COLORS);
@@ -2051,7 +2051,7 @@
 
 	last_c = this_c;
 	this_c = Getchar();
-	if (isdigit(this_c) && !isdigit(last_c))
+	if (this_c < 256 && isdigit(this_c) && !isdigit(last_c))
 	    value = 0;
 
 	switch (this_c) {
@@ -2819,7 +2819,7 @@
 	    show_utf8_chars();
 	    break;
 	default:
-	    if (isdigit(c))
+	    if (c < 256 && isdigit(c))
 		digit = (c - '0');
 	    else if (c == '+')
 		++digit;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin