diff options
author | peter <peter@FreeBSD.org> | 2000-07-03 09:24:12 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-07-03 09:24:12 +0000 |
commit | cc6a5cc05f3c2cde24338d35c9714f1e7ebf032e (patch) | |
tree | 27e79485df3c9195e6fe58960df47f675f41f1e9 /contrib/ncurses/c++ | |
parent | b22d00e9129b5cb2fee8da1592ca70eff2222f7e (diff) | |
download | FreeBSD-src-cc6a5cc05f3c2cde24338d35c9714f1e7ebf032e.zip FreeBSD-src-cc6a5cc05f3c2cde24338d35c9714f1e7ebf032e.tar.gz |
Import the most recent ncurses 5.1 prerelease (20000701).
Mostly this is intended to resolve the trace() badness once and for all.
Obtained from: ftp://dickey.his.com/ncurses/
Diffstat (limited to 'contrib/ncurses/c++')
-rw-r--r-- | contrib/ncurses/c++/Makefile.in | 9 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesapp.cc | 8 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesf.cc | 20 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesf.h | 10 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesm.cc | 6 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesm.h | 14 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesp.cc | 6 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesp.h | 38 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesw.cc | 4 | ||||
-rwxr-xr-x | contrib/ncurses/c++/edit_cfg.sh | 15 |
10 files changed, 85 insertions, 45 deletions
diff --git a/contrib/ncurses/c++/Makefile.in b/contrib/ncurses/c++/Makefile.in index 886678d..e807989 100644 --- a/contrib/ncurses/c++/Makefile.in +++ b/contrib/ncurses/c++/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.51 1999/10/23 20:13:02 tom Exp $ +# $Id: Makefile.in,v 1.52 2000/05/28 01:44:34 tom Exp $ ############################################################################## # Copyright (c) 1998,1999 Free Software Foundation, Inc. # # # @@ -76,7 +76,7 @@ ABI_VERSION = @cf_cv_abi_version@ LINK = @LINK_PROGS@ $(CXX) @CXXLDFLAGS@ -LIBROOT = ncurses++ +LIBROOT = ncurses++@LIB_SUFFIX@ LIBNAME = @LIB_PREFIX@$(LIBROOT).a LDFLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) \ @@ -94,7 +94,10 @@ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) AUTO_SRC = \ etip.h -all: $(AUTO_SRC) ../lib/$(LIBNAME) demo$x +all \ +libs :: $(AUTO_SRC) ../lib/$(LIBNAME) + +all :: demo$x sources : $(AUTO_SRC) diff --git a/contrib/ncurses/c++/cursesapp.cc b/contrib/ncurses/c++/cursesapp.cc index ae88b44..eaaadc7 100644 --- a/contrib/ncurses/c++/cursesapp.cc +++ b/contrib/ncurses/c++/cursesapp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 * @@ -34,7 +34,7 @@ #include "cursesapp.h" #include "internal.h" -MODULE_ID("$Id: cursesapp.cc,v 1.4 1999/05/16 17:31:11 juergen Exp $") +MODULE_ID("$Id: cursesapp.cc,v 1.6 1999/10/30 23:59:37 tom Exp $") void NCursesApplication::init(bool bColors) { @@ -85,7 +85,7 @@ int NCursesApplication::rinit(NCursesWindow& w) { void NCursesApplication::push(Soft_Label_Key_Set& S) { SLK_Link* L = new SLK_Link; - assert(L); + assert(L != 0); L->prev = slk_stack; L->SLKs = &S; slk_stack = L; @@ -121,7 +121,7 @@ int NCursesApplication::operator()(void) { Soft_Label_Key_Set::Label_Layout fmt = useSLKs(); if (fmt!=Soft_Label_Key_Set::None) { S = new Soft_Label_Key_Set(fmt); - assert(S); + assert(S != 0); init_labels(*S); } diff --git a/contrib/ncurses/c++/cursesf.cc b/contrib/ncurses/c++/cursesf.cc index 12b9cd4..a993322 100644 --- a/contrib/ncurses/c++/cursesf.cc +++ b/contrib/ncurses/c++/cursesf.cc @@ -35,7 +35,7 @@ #include "cursesapp.h" #include "internal.h" -MODULE_ID("$Id: cursesf.cc,v 1.9 1999/05/16 17:29:36 juergen Exp $") +MODULE_ID("$Id: cursesf.cc,v 1.10 1999/10/30 23:49:28 tom Exp $") NCursesFormField::~NCursesFormField () { if (field) @@ -49,7 +49,7 @@ FIELD** NCursesForm::mapFields(NCursesFormField* nfields[]) { int fieldCount = 0,lcv; - assert(nfields); + assert(nfields != 0); for (lcv=0; nfields[lcv]->field; ++lcv) ++fieldCount; @@ -350,18 +350,18 @@ NCursesForm::virtualize(int c) { // bool UserDefinedFieldType::fcheck(FIELD *f, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->field_check(*F); } bool UserDefinedFieldType::ccheck(int c, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->char_check(c); } @@ -379,19 +379,19 @@ FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = bool UserDefinedFieldType_With_Choice::next_choice(FIELD *f, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType_With_Choice* udf = (UserDefinedFieldType_With_Choice*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->next(*F); } bool UserDefinedFieldType_With_Choice::prev_choice(FIELD *f, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType_With_Choice* udf = (UserDefinedFieldType_With_Choice*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->previous(*F); } diff --git a/contrib/ncurses/c++/cursesf.h b/contrib/ncurses/c++/cursesf.h index 1119f5c..89f0cbe 100644 --- a/contrib/ncurses/c++/cursesf.h +++ b/contrib/ncurses/c++/cursesf.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 * @@ -31,7 +31,7 @@ * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $Id: cursesf.h,v 1.10 1999/05/16 17:31:42 juergen Exp $ +// $Id: cursesf.h,v 1.11 1999/10/30 23:59:37 tom Exp $ #ifndef _CURSESF_H #define _CURSESF_H @@ -310,7 +310,7 @@ private: // Get the backward pointer to the C++ object from a FORM static inline NCursesForm* getHook(const FORM *f) { UserHook* hook = (UserHook*)::form_userptr(f); - assert(hook && hook->m_owner==f); + assert(hook != 0 && hook->m_owner==f); return (NCursesForm*)(hook->m_back); } @@ -329,13 +329,13 @@ protected: // internal routines inline void set_user(void *user) { UserHook* uptr = (UserHook*)::form_userptr (form); - assert (uptr && uptr->m_back==this && uptr->m_owner==form); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); uptr->m_user = user; } inline void *get_user() { UserHook* uptr = (UserHook*)::form_userptr (form); - assert (uptr && uptr->m_back==this && uptr->m_owner==form); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); return uptr->m_user; } diff --git a/contrib/ncurses/c++/cursesm.cc b/contrib/ncurses/c++/cursesm.cc index 599b5f1..3b4dbd5 100644 --- a/contrib/ncurses/c++/cursesm.cc +++ b/contrib/ncurses/c++/cursesm.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 * @@ -35,7 +35,7 @@ #include "cursesapp.h" #include "internal.h" -MODULE_ID("$Id: cursesm.cc,v 1.11 1999/07/31 09:45:23 juergen Exp $") +MODULE_ID("$Id: cursesm.cc,v 1.12 1999/10/30 23:59:37 tom Exp $") NCursesMenuItem::~NCursesMenuItem() { if (item) @@ -304,7 +304,7 @@ NCursesMenu::operator()(void) { if (drvCmnd == CMD_ACTION) { if (options() & O_ONEVALUE) { NCursesMenuItem* itm = current_item(); - assert(itm); + assert(itm != 0); if (itm->options() & O_SELECTABLE) { b_action = itm->action(); diff --git a/contrib/ncurses/c++/cursesm.h b/contrib/ncurses/c++/cursesm.h index 5037ae2..26e0b4c 100644 --- a/contrib/ncurses/c++/cursesm.h +++ b/contrib/ncurses/c++/cursesm.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 * @@ -31,7 +31,7 @@ * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $Id: cursesm.h,v 1.12 1999/05/16 17:30:27 juergen Exp $ +// $Id: cursesm.h,v 1.13 1999/10/30 23:59:37 tom Exp $ #ifndef _CURSESM_H #define _CURSESM_H @@ -137,10 +137,10 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&); // function pointer for items. class NCursesMenuCallbackItem : public NCursesMenuItem { private: - const ITEMCALLBACK* p_fct; + ITEMCALLBACK* p_fct; public: - NCursesMenuCallbackItem(const ITEMCALLBACK* fct = NULL, + NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, const char* p_name = NULL, const char* p_descript = NULL ) : NCursesMenuItem (p_name, p_descript), @@ -179,7 +179,7 @@ private: // Get the backward pointer to the C++ object from a MENU static inline NCursesMenu* getHook(const MENU *m) { UserHook* hook = (UserHook*)::menu_userptr(m); - assert(hook && hook->m_owner==m); + assert(hook != 0 && hook->m_owner==m); return (NCursesMenu*)(hook->m_back); } @@ -198,13 +198,13 @@ protected: // internal routines inline void set_user(void *user) { UserHook* uptr = (UserHook*)::menu_userptr (menu); - assert (uptr && uptr->m_back==this && uptr->m_owner==menu); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); uptr->m_user = user; } inline void *get_user() { UserHook* uptr = (UserHook*)::menu_userptr (menu); - assert (uptr && uptr->m_back==this && uptr->m_owner==menu); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); return uptr->m_user; } diff --git a/contrib/ncurses/c++/cursesp.cc b/contrib/ncurses/c++/cursesp.cc index e0c17ae..3bcf3d2 100644 --- a/contrib/ncurses/c++/cursesp.cc +++ b/contrib/ncurses/c++/cursesp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 * @@ -34,7 +34,7 @@ #include "cursesp.h" #include "internal.h" -MODULE_ID("$Id: cursesp.cc,v 1.14 1999/05/16 17:30:51 juergen Exp $") +MODULE_ID("$Id: cursesp.cc,v 1.15 1999/10/30 23:59:37 tom Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -52,7 +52,7 @@ void NCursesPanel::init() { NCursesPanel::~NCursesPanel() { UserHook* hook = (UserHook*)::panel_userptr(p); - assert(hook && hook->m_back==this && hook->m_owner==p); + assert(hook != 0 && hook->m_back==this && hook->m_owner==p); delete hook; ::del_panel(p); ::update_panels(); diff --git a/contrib/ncurses/c++/cursesp.h b/contrib/ncurses/c++/cursesp.h index 51cb4cd..6293dd1 100644 --- a/contrib/ncurses/c++/cursesp.h +++ b/contrib/ncurses/c++/cursesp.h @@ -1,8 +1,40 @@ // * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999 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: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * + ****************************************************************************/ + #ifndef _CURSESP_H #define _CURSESP_H -// $Id: cursesp.h,v 1.11 1999/07/31 09:46:05 juergen Exp $ +// $Id: cursesp.h,v 1.12 1999/10/31 00:00:02 tom Exp $ #include <cursesw.h> @@ -29,14 +61,14 @@ private: protected: void set_user(void *user) { UserHook* uptr = (UserHook*)::panel_userptr (p); - assert (uptr && uptr->m_back==this && uptr->m_owner==p); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); uptr->m_user = user; } // Set the user pointer of the panel. void *get_user() { UserHook* uptr = (UserHook*)::panel_userptr (p); - assert (uptr && uptr->m_back==this && uptr->m_owner==p); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); return uptr->m_user; } diff --git a/contrib/ncurses/c++/cursesw.cc b/contrib/ncurses/c++/cursesw.cc index 4072c3c..baae046 100644 --- a/contrib/ncurses/c++/cursesw.cc +++ b/contrib/ncurses/c++/cursesw.cc @@ -25,7 +25,7 @@ #include "cursesw.h" #include "internal.h" -MODULE_ID("$Id: cursesw.cc,v 1.15 1999/09/11 23:26:29 tom Exp $") +MODULE_ID("$Id: cursesw.cc,v 1.16 1999/11/13 23:42:17 tom Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -424,9 +424,11 @@ NCursesWindow::setcolor(short pair) return OK; } +#ifdef HAVE_HAS_KEY extern "C" int _nc_has_mouse(void); bool NCursesWindow::has_mouse() const { return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse()) ? TRUE : FALSE); } +#endif diff --git a/contrib/ncurses/c++/edit_cfg.sh b/contrib/ncurses/c++/edit_cfg.sh index e108074..efea833 100755 --- a/contrib/ncurses/c++/edit_cfg.sh +++ b/contrib/ncurses/c++/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.7 1999/09/12 02:00:14 tom Exp $ +# $Id: edit_cfg.sh,v 1.8 2000/07/01 16:07:37 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -36,6 +36,7 @@ # $1 = ncurses_cfg.h # $2 = etip.h # +echo "substituting autoconf'd values from $1 into $2" for name in \ CPP_HAS_PARAM_INIT \ ETIP_NEEDS_MATH_EXCEPTION \ @@ -49,16 +50,18 @@ do mv $2 $2.bak if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) then - sed -e 's/define '$name'.*$/ define '$name' 1/' $2.bak >$2 + value=1 + sed -e 's/define '$name'.*$/define '$name' 1/' $2.bak >$2 else - sed -e 's/define '$name'.*$/ define '$name' 0/' $2.bak >$2 + value=0 + sed -e 's/define '$name'.*$/define '$name' 0/' $2.bak >$2 fi if (cmp -s $2 $2.bak) then - echo '** same: '$name + echo '... '$name $value mv $2.bak $2 else - echo '** edit: '$name + echo '... '$name $value rm -f $2.bak fi done |