#
# Author: Juergen Pfeifer, 1996
#
-# $Id: Makefile.in,v 1.54 2007/03/31 21:53:14 tom Exp $
+# $Id: Makefile.in,v 1.56 2007/04/07 21:45:46 tom Exp $
#
.SUFFIXES:
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
+bindir = @bindir@
+
ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@
ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@
INSTALL = @INSTALL@
+INSTALL_PROG = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
AWK = @AWK@
M4 = m4
M4FLAGS =
+ADACURSES_CONFIG = adacurses-config
+
GENERATE = ./gen$x '@DFT_ARG_SUFFIX@'
DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
$(ADA_INCLUDE) \
$(ADA_OBJECTS) :
- $(top_srcdir)/mkinstalldirs $@
+ sh $(top_srcdir)/mkdirs.sh $@
install \
install.libs :: $(ADA_INCLUDE)
@$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
@-chmod u+x $(ADA_SRCDIR)/*.ali
+install \
+install.libs :: $(DESTDIR)$(bindir) adacurses-config
+ $(INSTALL_PROG) adacurses-config $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
+
uninstall \
uninstall.libs ::
@echo removing package $(ALIB) from $(ADA_INCLUDE)
@echo removing package $(ALIB) from $(ADA_OBJECTS)
-@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
+uninstall \
+uninstall.libs ::
+ -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
+
gen$x: gen.o
@ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
tags:
ctags *.[ch]
-TAGS:
- etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@ etags *.[ch]
mostlyclean ::
-rm -f a.out core gen$x *.o
-rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
distclean :: clean
- rm -f Makefile
+ -rm -f adacurses-config
+ -rm -f Makefile
realclean :: distclean
--- /dev/null
+#! /bin/sh
+# $Id: adacurses-config.in,v 1.2 2007/04/07 21:06:50 tom Exp $
+#
+# This script will return the option to add to `gnatmake' for using
+# AdaCurses.
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+libdir="@libdir@"
+
+VERSION="@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
+
+CFLAGS="-I$libdir/adacurses -L$libdir/adacurses"
+LIBS="-L$prefix/lib -lAdaCurses"
+
+case "x$1" in
+ x--version)
+ echo AdaCurses $VERSION
+ ;;
+ x--cflags)
+ echo $CFLAGS
+ ;;
+ x--libs)
+ echo $LIBS
+ ;;
+ x)
+ # if no parameter is given, give what gnatmake needs
+ echo $CFLAGS -largs $LIBS
+ ;;
+ *)
+ echo 'Usage: adacurses-config [--version | --cflags | --libs]' >&2
+ exit 1
+ ;;
+esac
/*
Version Control
- $Id: gen.c,v 1.46 2007/03/31 23:39:15 tom Exp $
+ $Id: gen.c,v 1.47 2007/04/07 22:29:23 tom Exp $
--------------------------------------------------------------------------*/
/*
This program generates various record structures and constants from the
printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n");
printf(" of Attributed_Character;\n");
#if USE_REENTRANT
- printf(" function ACS_Map return C_ACS_Map;\n");
+ printf(" type C_ACS_Ptr is access C_ACS_Map;\n");
+ printf(" function ACS_Map return C_ACS_Ptr;\n");
printf(" pragma Import (C, ACS_Map, \"_nc_acs_map\");\n");
#else
printf(" ACS_Map : C_ACS_Map;\n");
./Ada95/README
./Ada95/TODO
./Ada95/gen/Makefile.in
+./Ada95/gen/adacurses-config.in
./Ada95/gen/gen.c
./Ada95/gen/html.m4
./Ada95/gen/normal.m4
./man/curs_instr.3x
./man/curs_inwstr.3x
./man/curs_kernel.3x
+./man/curs_legacy.3x
./man/curs_mouse.3x
./man/curs_move.3x
+./man/curs_opaque.3x
./man/curs_outopts.3x
./man/curs_overlay.3x
./man/curs_pad.3x
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1109 2007/04/01 00:30:22 tom Exp $
+-- $Id: NEWS,v 1.1115 2007/04/07 23:08:57 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20060407
+ + add man/curs_legacy.3x, man/curs_opaque.3x
+ + fix acs_map binding for Ada95 when --enable-reentrant is used.
+ + add adacurses-config to the Ada95 install, based on version from
+ FreeBSD port, in turn by Juergen Pfeifer in 2000 (prompted by
+ comment on comp.lang.ada newsgroup).
+ + fix includes in c++ binding to build with Intel compiler
+ (cf: 20061209).
+ + update install rule in Ada95 to use mkdirs.sh
+ > other fixes prompted by inspection for Coverity report:
+ + modify ifdef's for c++ binding to use try/catch/throw statements
+ + add a null-pointer check in tack/ansi.c request_cfss()
+ + fix a memory leak in ncurses/base/wresize.c
+ + corrected check for valid memu/meml capabilities in
+ progs/dump_entry.c when handling V_HPUX case.
+ > fixes based on Coverity report:
+ + remove dead code in test/bs.c
+ + remove dead code in test/demo_defkey.c
+ + remove an unused assignment in progs/infocmp.c
+ + fix a limit check in tack/ansi.c tools_charset()
+ + fix tack/ansi.c tools_status() to perform the VT320/VT420
+ tests in request_cfss(). The function had exited too soon.
+ + fix a memory leak in tic.c's make_namelist()
+ + fix a couple of places in tack/output.c which did not check for EOF.
+ + fix a loop-condition in test/bs.c
+ + add index checks in lib_color.c for color palettes
+ + add index checks in progs/dump_entry.c for version_filter() handling
+ of V_BSD case.
+ + fix a possible null-pointer dereference in copywin()
+ + fix a possible null-pointer dereference in waddchnstr()
+ + add a null-pointer check in _nc_expand_try()
+ + add a null-pointer check in tic.c's make_namelist()
+ + add a null-pointer check in _nc_expand_try()
+ + add null-pointer checks in test/cardfile.c
+ + fix a double-free in ncurses/tinfo/trim_sgr0.c
+ + fix a double-free in ncurses/base/wresize.c
+ + add try/catch block to c++/cursesmain.cc
+
20070331
+ modify Ada95 binding to build with --enable-reentrant by wrapping
global variables (bug: acs_map does not yet work).
#include "internal.h"
#include "cursesapp.h"
-MODULE_ID("$Id: cursesmain.cc,v 1.13 2007/01/27 20:29:27 tom Exp $")
+#if CPP_HAS_TRY_CATCH && HAVE_IOSTREAM
+#include <iostream>
+#else
+#undef CPP_HAS_TRY_CATCH
+#define CPP_HAS_TRY_CATCH 0
+#endif
+
+MODULE_ID("$Id: cursesmain.cc,v 1.14 2007/04/07 17:10:11 tom Exp $")
#if HAVE_LOCALE_H
#include <locale.h>
A->handleArgs(argc,argv);
::endwin();
+#if CPP_HAS_TRY_CATCH
+ try {
+ res = (*A)();
+ ::endwin();
+ }
+ catch(const NCursesException &e) {
+ ::endwin();
+ std::cerr << e.message << std::endl;
+ res = e.errorno;
+ }
+#else
res = (*A)();
::endwin();
+#endif
#if NO_LEAKS
delete A;
_nc_free_and_exit(res);
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#ifndef NCURSES_CURSESP_H_incl
#define NCURSES_CURSESP_H_incl 1
-// $Id: cursesp.h,v 1.26 2005/08/13 18:09:21 tom Exp $
+// $Id: cursesp.h,v 1.27 2007/04/07 17:12:54 tom Exp $
#include <cursesw.h>
return uptr->m_user;
}
- void OnError (int err) const THROWS((NCursesPanelException))
+ void OnError (int err) const THROWS(NCursesPanelException)
{
if (err==ERR)
THROW(new NCursesPanelException (this, err));
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include "internal.h"
-#include <stdio.h>
+#include <etip.h>
+#include <cursesw.h>
-#include "etip.h"
-#include "cursesw.h"
-
-MODULE_ID("$Id: cursespad.cc,v 1.11 2005/07/23 20:51:23 tom Exp $")
+MODULE_ID("$Id: cursespad.cc,v 1.12 2007/04/07 18:43:54 tom Exp $")
NCursesPad::NCursesPad(int nlines, int ncols)
: NCursesWindow(),
#ifndef NCURSES_CURSESW_H_incl
#define NCURSES_CURSESW_H_incl 1
-// $Id: cursesw.h,v 1.43 2007/03/24 18:33:50 tom Exp $
-
-#include <stdarg.h>
-#include <stdio.h>
+// $Id: cursesw.h,v 1.44 2007/04/07 18:42:04 tom Exp $
#include <etip.h>
* Demo code for NCursesMenu and NCursesForm written by
* Juergen Pfeifer
*
- * $Id: demo.cc,v 1.35 2007/01/27 20:28:51 tom Exp $
+ * $Id: demo.cc,v 1.36 2007/04/07 20:24:49 tom Exp $
*/
#include "internal.h"
public:
void run(int sleeptime) {
- NCursesPanel *std = new NCursesPanel();
+ NCursesPanel *mystd = new NCursesPanel();
// Make a few small demo panels
- NCursesPanel *u = new NCursesPanel(8,20,12,4);
- NCursesPanel *v = new NCursesPanel(8,20,10,6);
- NCursesPanel *w = new NCursesPanel(8,20,8,8);
- NCursesPanel *x = new NCursesPanel(8,20,6,10);
- NCursesPanel *y = new NCursesPanel(8,20,4,12);
- NCursesPanel *z = new NCursesPanel(8,30,2,14);
+ NCursesPanel *u = new NCursesPanel(8, 20, 12, 4);
+ NCursesPanel *v = new NCursesPanel(8, 20, 10, 6);
+ NCursesPanel *w = new NCursesPanel(8, 20, 8, 8);
+ NCursesPanel *x = new NCursesPanel(8, 20, 6, 10);
+ NCursesPanel *y = new NCursesPanel(8, 20, 4, 12);
+ NCursesPanel *z = new NCursesPanel(8, 30, 2, 14);
// Draw something on the main screen, so we can see what happens
// when panels get moved or deleted.
- std->box();
- std->move(std->height()/2,1);
- std->hline(std->width()-2);
- std->move(1,std->width()/2);
- std->vline(std->height()-2);
- std->addch(0,std->width()/2,ACS_TTEE);
- std->addch(std->height()-1,std->width()/2,ACS_BTEE);
- std->addch(std->height()/2,0,ACS_LTEE);
- std->addch(std->height()/2,std->width()-1,ACS_RTEE);
- std->addch(std->height()/2,std->width()/2,ACS_PLUS);
+ mystd->box();
+ mystd->move(mystd->height()/2, 1);
+ mystd->hline(mystd->width()-2);
+ mystd->move(1, mystd->width()/2);
+ mystd->vline(mystd->height()-2);
+ mystd->addch(0, mystd->width()/2, ACS_TTEE);
+ mystd->addch(mystd->height()-1, mystd->width()/2, ACS_BTEE);
+ mystd->addch(mystd->height()/2, 0, ACS_LTEE);
+ mystd->addch(mystd->height()/2, mystd->width()-1, ACS_RTEE);
+ mystd->addch(mystd->height()/2, mystd->width()/2, ACS_PLUS);
// Draw frames with titles around panels so that we can see where
// the panels are located.
}
// A refresh to any valid panel updates all panels and refreshes
- // the screen. Using std is just convenient - We know it's always
+ // the screen. Using mystd is just convenient - We know it's always
// valid until the end of the program.
- std->refresh();
+ mystd->refresh();
sleep(sleeptime);
// Show what happens when panels are deleted and moved.
sleep(sleeptime);
delete u;
- std->refresh();
+ mystd->refresh();
sleep(sleeptime);
delete z;
- std->refresh();
+ mystd->refresh();
sleep(sleeptime);
delete v;
- std->refresh();
+ mystd->refresh();
// show how it looks when a panel moves
sleep(sleeptime);
- y->mvwin(5,30);
- std->refresh();
+ y->mvwin(5, 30);
+ mystd->refresh();
sleep(sleeptime);
delete y;
- std->refresh();
+ mystd->refresh();
// show how it looks when you raise a panel
sleep(sleeptime);
w->top();
- std->refresh();
+ mystd->refresh();
sleep(sleeptime);
delete w;
- std->refresh();
+ mystd->refresh();
sleep(sleeptime);
delete x;
- std->clear();
- std->refresh();
+ mystd->clear();
+ mystd->refresh();
// Don't forget to clean up the main screen. Since this is the
// last thing using NCursesWindow, this has the effect of
// shutting down ncurses and restoring the terminal state.
sleep(sleeptime);
- delete std;
+ delete mystd;
}
};
F = new NCursesFormField*[10];
mft = new MyFieldType('X');
- ift = new Integer_Field(0,1,10);
+ ift = new Integer_Field(0, 1, 10);
eft = new Enumeration_Field(weekdays);
- F[0] = new Label("Demo Entry Form",0,16);
- F[1] = new Label("Weekday Enum",2,1);
- F[2] = new Label("Number(1-10)",2,21);
- F[3] = new Label("Only 'X'",2,35);
- F[4] = new Label("Multiline Field (Dynamic and Scrollable)",5,1);
- F[5] = new NCursesFormField(1,18,3,1);
- F[6] = new NCursesFormField(1,12,3,21);
- F[7] = new NCursesFormField(1,12,3,35);
- F[8] = new NCursesFormField(4,46,6,1,2);
+ F[0] = new Label("Demo Entry Form", 0, 16);
+ F[1] = new Label("Weekday Enum", 2, 1);
+ F[2] = new Label("Number(1-10)", 2, 21);
+ F[3] = new Label("Only 'X'", 2, 35);
+ F[4] = new Label("Multiline Field (Dynamic and Scrollable)", 5, 1);
+ F[5] = new NCursesFormField(1, 18, 3, 1);
+ F[6] = new NCursesFormField(1, 12, 3, 21);
+ F[7] = new NCursesFormField(1, 12, 3, 35);
+ F[8] = new NCursesFormField(4, 46, 6, 1, 2);
F[9] = new NCursesFormField();
- InitForm(F,TRUE,TRUE);
+ InitForm(F, TRUE, TRUE);
boldframe();
F[5]->set_fieldtype(*eft);
Soft_Label_Key_Set* S = new Soft_Label_Key_Set;
for(int i=1; i <= S->labels(); i++) {
char buf[8];
- ::sprintf(buf,"Frm%02d",i);
+ ::sprintf(buf, "Frm%02d", i);
(*S)[i] = buf; // Text
(*S)[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification
}
const int PADSIZE = 200;
unsigned gridcount = 0;
- NCursesPanel std;
- NCursesPanel P(std.lines()-2,std.cols()-2,1,1);
- NCursesFramedPad FP(P,PADSIZE,PADSIZE);
+ NCursesPanel mystd;
+ NCursesPanel P(mystd.lines()-2, mystd.cols()-2, 1, 1);
+ NCursesFramedPad FP(P, PADSIZE, PADSIZE);
for (int i=0; i < PADSIZE; i++) {
for (int j=0; j < PADSIZE; j++) {
}
}
- P.label("Pad Demo",NULL);
+ P.label("Pad Demo", NULL);
FP();
P.clear();
return FALSE;
}
bool action() {
- NCursesPanel *std = new NCursesPanel();
+ NCursesPanel *mystd = new NCursesPanel();
- NCursesPanel *w = new NCursesPanel(std->lines() - 2, std->cols() - 2, 1, 1);
+ NCursesPanel *w = new NCursesPanel(mystd->lines() - 2, mystd->cols() - 2, 1, 1);
w->box();
w->refresh();
delete s;
delete w;
- delete std;
+ delete mystd;
::noecho();
return FALSE;
}
I[6] = new QuitItem();
I[7] = new NCursesMenuItem(); // Terminating empty item
- InitMenu(I,TRUE,TRUE);
+ InitMenu(I, TRUE, TRUE);
- P = new NCursesPanel(1,n_items,LINES-1,1);
- boldframe("Demo","Silly");
+ P = new NCursesPanel(1, n_items, LINES-1, 1);
+ boldframe("Demo", "Silly");
P->show();
}
virtual void On_Menu_Init()
{
NCursesWindow W(::stdscr);
- P->move(0,0);
+ P->move(0, 0);
P->clrtoeol();
for(int i=1; i<=count(); i++)
P->addch('0' + i);
virtual void On_Menu_Termination()
{
- P->move(0,0);
+ P->move(0, 0);
P->clrtoeol();
refresh();
}
virtual void On_Item_Init(NCursesMenuItem& item)
{
- P->move(0,item.index());
+ P->move(0, item.index());
P->attron(A_REVERSE);
- P->printw("%1d",1+item.index());
+ P->printw("%1d", 1+item.index());
P->attroff(A_REVERSE);
refresh();
}
virtual void On_Item_Termination(NCursesMenuItem& item)
{
- P->move(0,item.index());
+ P->move(0, item.index());
P->attroff(A_REVERSE);
- P->printw("%1d",1+item.index());
+ P->printw("%1d", 1+item.index());
refresh();
}
};
{
for(int i=1; i <= S.labels(); i++) {
char buf[8];
- ::sprintf(buf,"Key%02d",i);
+ ::sprintf(buf, "Key%02d", i);
S[i] = buf; // Text
S[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification
}
const int len = ::strlen(titleText);
titleWindow->bkgd(screen_titles());
- titleWindow->addstr(0,(titleWindow->cols() - len)/2, titleText);
+ titleWindow->addstr(0, (titleWindow->cols() - len)/2, titleText);
titleWindow->noutrefresh();
}
#!/bin/sh
-# $Id: edit_cfg.sh,v 1.15 2007/01/27 18:51:04 tom Exp $
+# $Id: edit_cfg.sh,v 1.16 2007/04/07 19:08:49 tom Exp $
##############################################################################
# Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. #
# #
HAVE_BUILTIN_H \
HAVE_GPP_BUILTIN_H \
HAVE_GXX_BUILTIN_H \
+ HAVE_IOSTREAM \
HAVE_TYPEINFO \
HAVE_VALUES_H
do
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: etip.h.in,v 1.34 2007/01/27 18:49:00 tom Exp $
+// $Id: etip.h.in,v 1.36 2007/04/07 18:56:32 tom Exp $
#ifndef NCURSES_ETIP_H_incl
#define NCURSES_ETIP_H_incl 1
#define HAVE_GPP_BUILTIN_H 0
#endif
+#ifndef HAVE_IOSTREAM
+#define HAVE_IOSTREAM 0
+#endif
+
#ifndef HAVE_TYPEINFO
#define HAVE_TYPEINFO 0
#endif
};
#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC))
-# include <iostream.h>
+# if HAVE_IOSTREAM
+# include <iostream>
+using std::cerr;
+using std::endl;
+# else
+# include <iostream.h>
+# endif
extern "C" void exit(int);
#endif
inline void THROW(const NCursesException *e) {
#if defined(__GNUG__) && defined(__EXCEPTIONS)
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
- (*lib_error_handler)(e?e->classname():"",e?e->message:"");
+ (*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
#else
- throw *e;
+#define CPP_HAS_TRY_CATCH 1
#endif
#elif defined(__SUNPRO_CC)
# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
#else
- throw *e;
+#define CPP_HAS_TRY_CATCH 1
#endif
#else
if (e)
cerr << e->message << endl;
exit(0);
#endif
-}
-#define THROWS(s)
+#ifndef CPP_HAS_TRY_CATCH
+#define CPP_HAS_TRY_CATCH 0
+#define NCURSES_CPP_TRY /* nothing */
+#define NCURSES_CPP_CATCH(e) if (false)
+#define THROWS(s) /* nothing */
+#elif CPP_HAS_TRY_CATCH
+ throw *e;
+#define NCURSES_CPP_TRY try
+#define NCURSES_CPP_CATCH(e) catch(e)
+#define THROWS(s) throw(s)
+#endif
+}
#endif /* NCURSES_ETIP_H_incl */
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: internal.h,v 1.13 2006/09/30 21:59:57 tom Exp $
+// $Id: internal.h,v 1.14 2007/04/07 18:44:17 tom Exp $
#ifndef NCURSES_CPLUS_INTERNAL_H
#define NCURSES_CPLUS_INTERNAL_H 1
+#include <stdlib.h>
+
#include <ncurses_cfg.h>
#if USE_RCS_IDS
#! /bin/sh
-# From configure.in Revision: 1.410 .
+# From configure.in Revision: 1.412 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by Autoconf 2.52.20061216.
#
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_main_return=return
-for ac_header in typeinfo
+for ac_header in iostream typeinfo
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:13979: checking for $ac_header" >&5
fi
+if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then
+ SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config"
+fi
+
DIRS_TO_MAKE="lib"
for cf_item in $cf_list_models
do
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:15499: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:15503: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:15675: error: ambiguous option: $1
+ { { echo "$as_me:15679: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:15694: error: unrecognized option: $1
+ -*) { { echo "$as_me:15698: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
"include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
- *) { { echo "$as_me:15790: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:15794: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:16167: creating $ac_file" >&5
+ { echo "$as_me:16171: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:16185: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:16189: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:16198: error: cannot find input file: $f" >&5
+ { { echo "$as_me:16202: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
* ) ac_file_in=$ac_file.in ;;
esac
- test x"$ac_file" != x- && { echo "$as_me:16264: creating $ac_file" >&5
+ test x"$ac_file" != x- && { echo "$as_me:16268: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:16275: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:16279: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:16288: error: cannot find input file: $f" >&5
+ { { echo "$as_me:16292: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
- { echo "$as_me:16346: $ac_file is unchanged" >&5
+ { echo "$as_me:16350: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: configure.in,v 1.410 2007/03/24 23:12:57 tom Exp $
+dnl $Id: configure.in,v 1.412 2007/04/07 21:15:23 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.13.20020210)
-AC_REVISION($Revision: 1.410 $)
+AC_REVISION($Revision: 1.412 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
;;
esac
- AC_CHECK_HEADERS(typeinfo)
+ AC_CHECK_HEADERS(iostream typeinfo)
CF_BOOL_DECL
CF_BOOL_SIZE
### with the appropriate compile-rules.
CF_SRC_MODULES($modules_to_build)
+
+if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then
+ SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config"
+fi
+
CF_DIRS_TO_MAKE
AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.587 2007/04/01 00:32:37 tom Exp $
+# $Id: dist.mk,v 1.588 2007/04/07 17:04:04 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 6
-NCURSES_PATCH = 20070331
+NCURSES_PATCH = 20070407
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
-# $Id: ncurses_defs,v 1.32 2007/03/10 15:40:16 tom Exp $
+# $Id: ncurses_defs,v 1.33 2007/04/07 17:07:27 tom Exp $
##############################################################################
# Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. #
# #
HAVE_GPP_BUILTIN_H
HAVE_GXX_BUILTIN_H
HAVE_HAS_KEY
+HAVE_IOSTREAM
HAVE_ISASCII
HAVE_ISSETUGID
HAVE_LANGINFO_CODESET
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_getyx.3x,v 1.14 2007/03/17 20:22:45 tom Exp $
+.\" $Id: curs_getyx.3x,v 1.15 2007/04/07 23:21:34 tom Exp $
.TH curs_getyx 3X ""
.SH NAME
\fBgetyx\fR,
\fBgetpary\fR
for compatibility with older versions of curses.
.SH SEE ALSO
-\fBcurses\fR(3X)
+\fBcurses\fR(3X),
+\fBcurs_legacy\fR(3X)
.\"#
.\"# The following sets edit modes for GNU EMACS
.\"# Local Variables:
--- /dev/null
+.\"***************************************************************************
+.\" Copyright (c) 2007 Free Software Foundation, Inc. *
+.\" *
+.\" Permission is hereby granted, free of charge, to any person obtaining a *
+.\" copy of this software and associated documentation files (the *
+.\" "Software"), to deal in the Software without restriction, including *
+.\" without limitation the rights to use, copy, modify, merge, publish, *
+.\" distribute, distribute with modifications, sublicense, and/or sell *
+.\" copies of the Software, and to permit persons to whom the Software is *
+.\" furnished to do so, subject to the following conditions: *
+.\" *
+.\" The above copyright notice and this permission notice shall be included *
+.\" in all copies or substantial portions of the Software. *
+.\" *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+.\" *
+.\" Except as contained in this notice, the name(s) of the above copyright *
+.\" holders shall not be used in advertising or otherwise to promote the *
+.\" sale, use or other dealings in this Software without prior written *
+.\" authorization. *
+.\"***************************************************************************
+.\"
+.\" $Id: curs_legacy.3x,v 1.1 2007/04/07 23:54:29 tom Exp $
+.TH curs_legacy 3X ""
+.SH NAME
+\fBgetbegx\fR,
+\fBgetbegy\fR,
+\fBgetcurx\fR,
+\fBgetcury\fR,
+\fBgetmaxx\fR,
+\fBgetmaxy\fR,
+\fBgetparx\fR,
+\fBgetpary\fR - get \fBcurses\fR cursor and window coordinates
+.SH SYNOPSIS
+\fB#include <curses.h>\fR
+.sp
+\fBint getbegx(WINDOW *win);\fR
+.br
+\fBint getbegy(WINDOW *win);\fR
+.br
+\fBint getcurx(WINDOW *win);\fR
+.br
+\fBint getcury(WINDOW *win);\fR
+.br
+\fBint getmaxx(WINDOW *win);\fR
+.br
+\fBint getmaxy(WINDOW *win);\fR
+.br
+\fBint getparx(WINDOW *win);\fR
+.br
+\fBint getpary(WINDOW *win);\fR
+.br
+.SH DESCRIPTION
+The \fBgetbegy\fR and \fBgetbegx\fR functions return the same
+data as \fBgetbegyx\fR.
+.PP
+The \fBgetcury\fR and \fBgetcurx\fR functions return the same
+data as \fBgetyx\fR.
+.PP
+The \fBgetmaxy\fR and \fBgetmaxx\fR functions return the same
+data as \fBgetmaxyx\fR.
+.PP
+The \fBgetpary\fR and \fBgetparx\fR functions return the same
+data as \fBgetparyx\fR.
+.SH RETURN VALUE
+These functions return an integer,
+or ERR if the window parameter is null.
+.SH NOTES
+All of these interfaces are provided as macros and functions.
+The macros are suppressed (and only the functions provided)
+when \fBNCURSES_OPAQUE\fR is defined.
+The standard forms such as \fBgetyx\fP must be implemented as macros,
+and (in this implementation) are defined in terms of the functions
+described here,
+to avoid reliance on internal details of the WINDOW structure.
+.SH PORTABILITY
+These functions were supported on Version 7, BSD or System V implementations.
+.SH SEE ALSO
+\fBcurses\fR(3X),
+\fBcurs_getyx\fR(3X),
+\fBcurs_opaque\fR(3X)
+.\"#
+.\"# The following sets edit modes for GNU EMACS
+.\"# Local Variables:
+.\"# mode:nroff
+.\"# fill-column:79
+.\"# End:
--- /dev/null
+.\"***************************************************************************
+.\" Copyright (c) 2007 Free Software Foundation, Inc. *
+.\" *
+.\" Permission is hereby granted, free of charge, to any person obtaining a *
+.\" copy of this software and associated documentation files (the *
+.\" "Software"), to deal in the Software without restriction, including *
+.\" without limitation the rights to use, copy, modify, merge, publish, *
+.\" distribute, distribute with modifications, sublicense, and/or sell *
+.\" copies of the Software, and to permit persons to whom the Software is *
+.\" furnished to do so, subject to the following conditions: *
+.\" *
+.\" The above copyright notice and this permission notice shall be included *
+.\" in all copies or substantial portions of the Software. *
+.\" *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+.\" *
+.\" Except as contained in this notice, the name(s) of the above copyright *
+.\" holders shall not be used in advertising or otherwise to promote the *
+.\" sale, use or other dealings in this Software without prior written *
+.\" authorization. *
+.\"***************************************************************************
+.\"
+.\" $Id: curs_opaque.3x,v 1.1 2007/04/07 23:19:40 tom Exp $
+.TH curs_opaque 3X ""
+.na
+.hy 0
+.SH NAME
+\fBis_cleared\fR,
+\fBis_idlok\fR,
+\fBis_idcok\fR,
+\fBis_immedok\fR,
+\fBis_keypad\fR,
+\fBis_leaveok\fR,
+\fBis_nodelay\fR,
+\fBis_timeout\fR,
+\fBis_scrollok\fR,
+\fBis_syncok\fR - \fBcurses\fR output options
+.ad
+.hy
+.SH SYNOPSIS
+\fB#include <curses.h>\fR
+.sp
+\fBbool is_cleared (WINDOW *win);\fR
+.br
+\fBbool is_idcok (WINDOW *win);\fR
+.br
+\fBbool is_idlok (WINDOW *win);\fR
+.br
+\fBbool is_immedok (WINDOW *win);\fR
+.br
+\fBbool is_keypad (WINDOW *win);\fR
+.br
+\fBbool is_leaveok (WINDOW *win);\fR
+.br
+\fBbool is_nodelay (WINDOW *win);\fR
+.br
+\fBbool is_notimeout (WINDOW *win);\fR
+.br
+\fBbool is_scrollok (WINDOW *win);\fR
+.br
+\fBbool is_syncok (WINDOW *win);\fR
+.br
+.SH DESCRIPTION
+This implementation provides functions which return properties
+set in the WINDOW structure, allowing it to be ``opaque'' if
+the symbol \fBNCURSES_OPAQUE\fR is defined:
+.TP 5
+\fBis_cleared\fR
+returns the value set in \fBclearok\fR
+.TP 5
+\fBis_idcok\fR
+returns the value set in \fBidcok\fR
+.TP 5
+\fBis_idlok\fR
+returns the value set in \fBidlok\fR
+.TP 5
+\fBis_immedok\fR
+returns the value set in \fBimmedok\fR
+.TP 5
+\fBis_keypad\fR
+returns the value set in \fBkeypad\fR
+.TP 5
+\fBis_leaveok\fR
+returns the value set in \fBleaveok\fR
+.TP 5
+\fBis_nodelay\fR
+returns the value set in \fBnodelay\fR
+.TP 5
+\fBis_notimeout\fR
+returns the value set in \fBnotimeout\fR
+.TP 5
+\fBis_scrollok\fR
+returns the value set in \fBscrollok\fR
+.TP 5
+\fBis_syncok\fR
+returns the value set in \fBsyncok\fR
+.RE
+.SH RETURN VALUE
+These functions all return TRUE or FALSE.
+.SH NOTES
+Both a macro and a function are provided for each name.
+.SH PORTABILITY
+These routines are specific to ncurses.
+They were not supported on Version 7, BSD or System V implementations.
+It is recommended that any code depending on ncurses extensions
+be conditioned using NCURSES_VERSION.
+.SH SEE ALSO
+\fBcurses\fR(3X),
+\fBcurs_inopts\fR(3X),
+\fBcurs_outopts\fR(3X),
+\fBcurs_window\fR(3X)
+.\"#
+.\"# The following sets edit modes for GNU EMACS
+.\"# Local Variables:
+.\"# mode:nroff
+.\"# fill-column:79
+.\"# End:
##############################################################################
-# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: man_db.renames,v 0.38 2006/12/24 16:07:46 tom Exp $
+# $Id: man_db.renames,v 0.39 2007/04/07 23:06:31 tom Exp $
# Manual-page renamings for the man_db program
#
# Files:
curs_instr.3x instr.3ncurses
curs_inwstr.3x inwstr.3ncurses
curs_kernel.3x kernel.3ncurses
+curs_legacy.3x legacy.3ncurses
curs_mouse.3x mouse.3ncurses
curs_move.3x move.3ncurses
+curs_opaque.3x opaque.3ncurses
curs_outopts.3x outopts.3ncurses
curs_overlay.3x overlay.3ncurses
curs_pad.3x pad.3ncurses
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: ncurses.3x,v 1.84 2007/03/17 20:30:11 tom Exp $
+.\" $Id: ncurses.3x,v 1.86 2007/04/07 23:08:08 tom Exp $
.hy 0
.TH ncurses 3X ""
.ds n 5
get_wch/\fBcurs_get_wch\fR(3X)
get_wstr/\fBcurs_get_wstr\fR(3X)
getattrs/\fBcurs_attr\fR(3X)
-getbegx/\fBcurs_getyx\fR(3X)
-getbegy/\fBcurs_getyx\fR(3X)
+getbegx/\fBcurs_legacy\fR(3X)*
+getbegy/\fBcurs_legacy\fR(3X)*
getbegyx/\fBcurs_getyx\fR(3X)
getbkgd/\fBcurs_bkgd\fR(3X)
getbkgrnd/\fBcurs_bkgrnd\fR(3X)
getcchar/\fBcurs_getcchar\fR(3X)
getch/\fBcurs_getch\fR(3X)
-getcurx/\fBcurs_getyx\fR(3X)
-getcury/\fBcurs_getyx\fR(3X)
-getmaxx/\fBcurs_getyx\fR(3X)
-getmaxy/\fBcurs_getyx\fR(3X)
+getcurx/\fBcurs_legacy\fR(3X)*
+getcury/\fBcurs_legacy\fR(3X)*
+getmaxx/\fBcurs_legacy\fR(3X)*
+getmaxy/\fBcurs_legacy\fR(3X)*
getmaxyx/\fBcurs_getyx\fR(3X)
getmouse/\fBcurs_mouse\fR(3X)*
getn_wstr/\fBcurs_get_wstr\fR(3X)
getnstr/\fBcurs_getstr\fR(3X)
-getparx/\fBcurs_getyx\fR(3X)
-getpary/\fBcurs_getyx\fR(3X)
+getparx/\fBcurs_legacy\fR(3X)*
+getpary/\fBcurs_legacy\fR(3X)*
getparyx/\fBcurs_getyx\fR(3X)
getstr/\fBcurs_getstr\fR(3X)
getsyx/\fBcurs_kernel\fR(3X)
instr/\fBcurs_instr\fR(3X)
intrflush/\fBcurs_inopts\fR(3X)
inwstr/\fBcurs_inwstr\fR(3X)
+is_cleared/\fBcurs_opaque\fR(3X)*
+is_idcok/\fBcurs_opaque\fR(3X)*
+is_idlok/\fBcurs_opaque\fR(3X)*
+is_immedok/\fBcurs_opaque\fR(3X)*
+is_keypad/\fBcurs_opaque\fR(3X)*
+is_leaveok/\fBcurs_opaque\fR(3X)*
is_linetouched/\fBcurs_touch\fR(3X)
+is_nodelay/\fBcurs_opaque\fR(3X)*
+is_notimeout/\fBcurs_opaque\fR(3X)*
+is_scrollok/\fBcurs_opaque\fR(3X)*
+is_syncok/\fBcurs_opaque\fR(3X)*
+is_term_resized/\fBresizeterm\fR(3X)*
is_wintouched/\fBcurs_touch\fR(3X)
isendwin/\fBcurs_initscr\fR(3X)
key_defined/\fBkey_defined\fR(3X)*
nocbreak/\fBcurs_inopts\fR(3X)
nodelay/\fBcurs_inopts\fR(3X)
noecho/\fBcurs_inopts\fR(3X)
+nofilter/\fBcurs_util\fR(3X)*
nonl/\fBcurs_outopts\fR(3X)
noqiflush/\fBcurs_inopts\fR(3X)
noraw/\fBcurs_inopts\fR(3X)
use_default_colors/\fBdefault_colors\fR(3X)*
use_env/\fBcurs_util\fR(3X)
use_extended_names/\fBcurs_extend\fR(3X)*
+use_legacy_coding/\fBlegacy_coding\fR(3X)*
vid_attr/\fBcurs_terminfo\fR(3X)
vid_puts/\fBcurs_terminfo\fR(3X)
vidattr/\fBcurs_terminfo\fR(3X)
the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR
sections of the library man pages.
.PP
+This implementation also contains several extensions:
+.RS 5
+.PP
The routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4. See
the \fBcurs_getch\fR(3X) manual page for details.
.PP
-The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4. See
-the \fBcurs_slk\fR(3X) manual page for details.
+The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4.
+See the \fBcurs_slk\fR(3X) manual page for details.
.PP
The routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,
\fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are not
-part of XPG4, nor are they present in SVr4. See the \fBcurs_mouse\fR(3X)
-manual page for details.
+part of XPG4, nor are they present in SVr4.
+See the \fBcurs_mouse\fR(3X) manual page for details.
.PP
-The routine \fBmcprint\fR was not present in any previous curses
-implementation. See the \fBcurs_print\fR(3X) manual page for details.
+The routine \fBmcprint\fR was not present in any previous curses implementation.
+See the \fBcurs_print\fR(3X) manual page for details.
.PP
-The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4. See
-the \fBwresize\fR(3X) manual page for details.
+The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4.
+See the \fBwresize\fR(3X) manual page for details.
+.PP
+The WINDOW structure's internal details can be hidden from application
+programs.
+See \fBcurs_opaque\fR(3X) for the discussion of \fBis_scrollok\fR, etc.
+.RE
.PP
In historic curses versions, delays embedded in the capabilities \fBcr\fR,
\fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delay
/****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_addstr.c,v 1.46 2006/05/27 19:22:19 tom Exp $")
+MODULE_ID("$Id: lib_addstr.c,v 1.47 2007/04/07 17:13:21 tom Exp $")
NCURSES_EXPORT(int)
waddnstr(WINDOW *win, const char *astr, int n)
NCURSES_EXPORT(int)
waddchnstr(WINDOW *win, const chtype *astr, int n)
{
- NCURSES_SIZE_T y = win->_cury;
- NCURSES_SIZE_T x = win->_curx;
+ NCURSES_SIZE_T y, x;
int code = OK;
int i;
struct ldat *line;
if (!win)
returnCode(ERR);
+ y = win->_cury;
+ x = win->_curx;
if (n < 0) {
const chtype *str;
n = 0;
#include <term.h>
#include <tic.h>
-MODULE_ID("$Id: lib_color.c,v 1.84 2007/03/10 19:20:15 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.85 2007/04/07 17:07:28 tom Exp $")
/*
* These should be screen structure members. They need to be globals for
#define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
+#define MAX_PALETTE 8
+
#define OkColorHi(n) (((n) < COLORS) && ((n) < max_colors))
+#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE)
/*
* Given a RGB range of 0..1000, we'll normally set the individual values
tp = (hue_lightness_saturation) ? hls_palette : cga_palette;
for (n = 0; n < COLORS; n++) {
- if (n < 8) {
+ if (InPalette(n)) {
SP->_color_table[n] = tp[n];
} else {
- SP->_color_table[n] = tp[n % 8];
+ SP->_color_table[n] = tp[n % MAX_PALETTE];
if (hue_lightness_saturation) {
SP->_color_table[n].green = 100;
} else {
if (GET_SCREEN_PAIR(SP) == pair)
SET_SCREEN_PAIR(SP, (chtype) (~0)); /* force attribute update */
- if (initialize_pair) {
+ if (initialize_pair && InPalette(f) && InPalette(b)) {
const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette;
TR(TRACE_ATTRS,
/****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_overlay.c,v 1.22 2006/10/14 20:43:31 tom Exp $")
+MODULE_ID("$Id: lib_overlay.c,v 1.23 2007/04/07 17:13:52 tom Exp $")
static int
overlap(const WINDOW *const s, WINDOW *const d, int const flag)
{
int sx, sy, dx, dy;
bool touched;
- attr_t bk = AttrOf(dst->_nc_bkgd);
- attr_t mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0);
+ attr_t bk;
+ attr_t mask;
T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"),
src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over));
if (!src || !dst)
returnCode(ERR);
+ bk = AttrOf(dst->_nc_bkgd);
+ mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0);
+
/* make sure rectangle exists in source */
if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) ||
(smincol + dmaxcol - dmincol) > (src->_maxx + 1)) {
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: tries.c,v 1.23 2006/12/30 16:26:54 tom Exp $")
+MODULE_ID("$Id: tries.c,v 1.24 2007/04/07 17:14:27 tom Exp $")
/*
* Expand a keycode into the string that it corresponds to, returning null if
}
}
if (result != 0) {
- if ((result[len] = ptr->ch) == 0)
+ if (ptr != 0 && (result[len] = ptr->ch) == 0)
*((unsigned char *) (result + len)) = 128;
#ifdef TRACE
if (len == 0 && _nc_tracing != 0)
/****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: wresize.c,v 1.24 2006/10/14 20:43:31 tom Exp $")
+MODULE_ID("$Id: wresize.c,v 1.25 2007/04/07 17:13:42 tom Exp $")
static int
cleanup_lines(struct ldat *data, int length)
{
while (--length >= 0)
- free(data->text);
+ free(data[length].text);
free(data);
return ERR;
}
/****************************************************************************
- * Copyright (c) 2005 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$Id: trim_sgr0.c,v 1.7 2006/12/02 19:37:57 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $")
#undef CUR
#define CUR tp->
if (!rewrite_sgr(on, enter_alt_charset_mode)
|| !rewrite_sgr(off, exit_alt_charset_mode)
|| !rewrite_sgr(end, exit_alt_charset_mode)) {
- FreeIfNeeded(on);
FreeIfNeeded(off);
- FreeIfNeeded(end);
} else if (similar_sgr(off, end)
&& !similar_sgr(off, on)) {
TR(TRACE_DATABASE, ("adjusting sgr(9:off) : %s", _nc_visbuf(off)));
*/
free(off);
}
- free(end);
- free(on);
+ FreeIfNeeded(end);
+ FreeIfNeeded(on);
} else {
/*
* Possibly some applications are confused if sgr0 contains rmacs,
#include <tic.h>
#include <ctype.h>
-MODULE_ID("$Id: visbuf.c,v 1.22 2007/03/11 00:03:11 tom Exp $")
+MODULE_ID("$Id: visbuf.c,v 1.23 2007/04/07 19:25:28 tom Exp $")
+#ifdef TRACE
static const char d_quote[] = {D_QUOTE, 0};
static const char l_brace[] = {L_BRACE, 0};
static const char r_brace[] = {R_BRACE, 0};
+#endif
static char *
_nc_vischar(char *tp, unsigned c)
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.79 2006/09/30 20:18:15 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.80 2007/04/07 17:13:36 tom Exp $")
#define INDENT 8
#define DISCARD(string) string = ABSENT_STRING
}
break;
+#define is_termcap(type) (idx < (int) sizeof(type##_from_termcap) && \
+ type##_from_termcap[idx])
+
case V_BSD: /* BSD */
switch (type) {
case BOOLEAN:
- return bool_from_termcap[idx];
+ return is_termcap(bool);
case NUMBER:
- return num_from_termcap[idx];
+ return is_termcap(num);
case STRING:
- return str_from_termcap[idx];
+ return is_termcap(str);
}
break;
}
* Much more work should be done on this to support dumping termcaps.
*/
if (tversion == V_HPUX) {
- if (memory_lock) {
+ if (VALID_STRING(memory_lock)) {
(void) sprintf(buffer, "meml=%s", memory_lock);
WRAP_CONCAT;
}
- if (memory_unlock) {
+ if (VALID_STRING(memory_unlock)) {
(void) sprintf(buffer, "memu=%s", memory_unlock);
WRAP_CONCAT;
}
#include <dump_entry.h>
-MODULE_ID("$Id: infocmp.c,v 1.87 2007/02/03 19:10:27 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.88 2007/04/07 17:07:30 tom Exp $")
#define L_CURL "{"
#define R_CURL "}"
}
*tp++ = '"';
*tp = '\0';
- size += (strlen(term->Strings[n]) + 1);
(void) printf("static char %-20s[] = %s;\n",
string_variable(ExtStrname(term, n, strnames)), buf);
}
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <dump_entry.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.131 2006/12/02 22:13:17 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.132 2007/04/07 17:14:27 tom Exp $")
const char *_nc_progname = "tic";
return fp;
}
+#if NO_LEAKS
+static void
+free_namelist(char **src)
+{
+ if (src != 0) {
+ int n;
+ for (n = 0; src[n] != 0; ++n)
+ free(src[n]);
+ free(src);
+ }
+}
+#endif
+
/* Parse the "-e" option-value into a list of names */
-static const char **
+static char **
make_namelist(char *src)
{
- const char **dst = 0;
+ char **dst = 0;
char *s, *base;
unsigned pass, n, nn;
if ((s = stripped(buffer)) != 0) {
if (dst != 0)
dst[nn] = s;
+ else
+ free(s);
nn++;
}
}
if (pass == 1) {
- dst = typeCalloc(const char *, nn + 1);
+ dst = typeCalloc(char *, nn + 1);
rewind(fp);
}
}
break;
}
if (pass == 1)
- dst = typeCalloc(const char *, nn + 1);
+ dst = typeCalloc(char *, nn + 1);
}
}
- if (showsummary) {
+ if (showsummary && (dst != 0)) {
fprintf(log_fp, "Entries that will be compiled:\n");
for (n = 0; dst[n] != 0; n++)
fprintf(log_fp, "%u:%s\n", n + 1, dst[n]);
}
static bool
-matches(const char **needle, const char *haystack)
+matches(char **needle, const char *haystack)
/* does entry in needle list match |-separated field in haystack? */
{
bool code = FALSE;
bool limited = TRUE;
char *tversion = (char *) NULL;
const char *source_file = "terminfo";
- const char **namelst = 0;
+ char **namelst = 0;
char *outdir = (char *) NULL;
bool check_only = FALSE;
bool suppress_untranslatable = FALSE;
else
fprintf(log_fp, "No entries written\n");
}
+#if NO_LEAKS
+ free_namelist(namelst);
+#endif
cleanup();
ExitProgram(EXIT_SUCCESS);
}
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* v2.0 featuring strict ANSI/POSIX conformance, November 1993.
* v2.1 with ncurses mouse support, September 1995
*
- * $Id: bs.c,v 1.44 2006/05/20 15:38:52 tom Exp $
+ * $Id: bs.c,v 1.45 2007/04/07 17:13:11 tom Exp $
*/
#include <test.priv.h>
do {
c = getch();
} while
- (!strchr("hjklrR", c) || c == FF);
+ (!(strchr("hjklrR", c) || c == FF));
if (c == FF) {
(void) clearok(stdscr, TRUE);
/*
* Author: Thomas E. Dickey
*
- * $Id: cardfile.c,v 1.29 2007/03/10 19:16:45 tom Exp $
+ * $Id: cardfile.c,v 1.30 2007/04/07 17:07:34 tom Exp $
*
* File format: text beginning in column 1 is a title; other text is content.
*/
if ((offset = strlen(card->content)) != 0) {
total += 1 + offset;
card->content = (char *) realloc(card->content, total + 1);
- strcpy(card->content + offset++, " ");
+ if (card->content)
+ strcpy(card->content + offset++, " ");
} else {
if (card->content != 0)
free(card->content);
card->content = (char *) malloc(total + 1);
}
- strcpy(card->content + offset, content);
+ if (card->content)
+ strcpy(card->content + offset, content);
}
}
/****************************************************************************
- * Copyright (c) 2002-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_defkey.c,v 1.16 2006/04/01 19:08:03 tom Exp $
+ * $Id: demo_defkey.c,v 1.17 2007/04/07 17:13:03 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2002/11/23
code_name);
}
log_last_line(win);
+
if (vis_string != 0) {
free(vis_string);
vis_string = 0;
}
- if (vis_string != 0)
- free(vis_string);
vis_string = visible(new_string);
if ((rc = key_defined(new_string)) > 0) {
wprintw(win, "%s was bound to %s\n", vis_string, keyname(rc));