aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/c++
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/c++')
-rw-r--r--contrib/ncurses/c++/Makefile.in50
-rw-r--r--contrib/ncurses/c++/cursesapp.cc6
-rw-r--r--contrib/ncurses/c++/cursesapp.h12
-rw-r--r--contrib/ncurses/c++/cursesf.cc58
-rw-r--r--contrib/ncurses/c++/cursesf.h44
-rw-r--r--contrib/ncurses/c++/cursesm.cc57
-rw-r--r--contrib/ncurses/c++/cursesm.h20
-rw-r--r--contrib/ncurses/c++/cursesmain.cc6
-rw-r--r--contrib/ncurses/c++/cursesp.cc10
-rw-r--r--contrib/ncurses/c++/cursesp.h12
-rw-r--r--contrib/ncurses/c++/cursespad.cc6
-rw-r--r--contrib/ncurses/c++/cursesw.cc77
-rw-r--r--contrib/ncurses/c++/cursesw.h181
-rw-r--r--contrib/ncurses/c++/cursslk.cc10
-rw-r--r--contrib/ncurses/c++/cursslk.h26
-rw-r--r--contrib/ncurses/c++/demo.cc2
-rwxr-xr-xcontrib/ncurses/c++/edit_cfg.sh9
-rw-r--r--contrib/ncurses/c++/etip.h.in64
-rw-r--r--contrib/ncurses/c++/internal.h12
19 files changed, 367 insertions, 295 deletions
diff --git a/contrib/ncurses/c++/Makefile.in b/contrib/ncurses/c++/Makefile.in
index 78b86db364db..96f338fbb152 100644
--- a/contrib/ncurses/c++/Makefile.in
+++ b/contrib/ncurses/c++/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.53 2000/08/19 19:12:32 tom Exp $
+# $Id: Makefile.in,v 1.58 2001/04/21 21:31:08 tom Exp $
##############################################################################
-# Copyright (c) 1998,1999 Free Software Foundation, Inc. #
+# Copyright (c) 1998,1999,2000,2001 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"), #
@@ -48,6 +48,8 @@ exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
+LIBTOOL = @LIBTOOL@
+
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -56,6 +58,7 @@ AR_OPTS = @AR_OPTS@
RANLIB = @RANLIB@
CXX = @CXX@
+CPP = @CPP@
CXXFLAGS = @CXXFLAGS@
CXXLIBS = @CXXLIBS@
@@ -64,6 +67,7 @@ CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
CCFLAGS = $(CPPFLAGS) $(CXXFLAGS)
+CFLAGS_LIBTOOL = $(CCFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
@@ -71,25 +75,37 @@ CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+NCURSES_MAJOR = @NCURSES_MAJOR@
+NCURSES_MINOR = @NCURSES_MINOR@
REL_VERSION = @cf_cv_rel_version@
ABI_VERSION = @cf_cv_abi_version@
-LINK = @LINK_PROGS@ $(CXX) @CXXLDFLAGS@
+LINK = @LINK_PROGS@ $(LIBTOOL) $(CXX) @CXXLDFLAGS@
+
+LIBROOT = ncurses++
+
+LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la
+LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a
+LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@
-LIBROOT = ncurses++@LIB_SUFFIX@
-LIBNAME = @LIB_PREFIX@$(LIBROOT).a
+LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) -l$(LIBROOT)@LIB_SUFFIX@
-LDFLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) \
- -l$(LIBROOT) \
- @TEST_ARGS@ @LDFLAGS@ \
+LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) ../lib/$(LIBNAME)
+LINK_NORMAL = $(LINK_FLAGS)
+LINK_DEBUG = $(LINK_FLAGS)
+LINK_PROFILE = $(LINK_FLAGS)
+LINK_SHARED = $(LINK_FLAGS)
+
+LDFLAGS = @TEST_ARGS@ @LDFLAGS@ \
@LD_MODEL@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS)
+LDFLAGS_LIBTOOL = $(LDFLAGS)
LDFLAGS_NORMAL = $(LDFLAGS)
LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@
LDFLAGS_PROFILE = $(LDFLAGS) -pg
LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@
-LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
+LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@)
AUTO_SRC = \
etip.h
@@ -114,10 +130,15 @@ LIB_OBJS = \
$(MODEL)/cursesapp.o \
$(MODEL)/cursesmain.o
-../lib/$(LIBNAME) : $(LIB_OBJS)
+../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS)
$(AR) $(AR_OPTS) $@ $?
$(RANLIB) $@
+../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS)
+ cd ../lib && $(LIBTOOL) $(CXX) -o $(LIBNAME) $(LIB_OBJS:.o=.lo) \
+ -rpath $(INSTALL_PREFIX)$(libdir) \
+ -version-info $(NCURSES_MAJOR):$(NCURSES_MINOR)
+
OBJS_DEMO = $(MODEL)/demo.o
$(MODEL)/demo.o : $(srcdir)/demo.cc \
@@ -137,17 +158,18 @@ $(DESTDIR)$(libdir) :
install \
install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir)
- $(INSTALL) ../lib/$(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME)
+ $(LIBTOOL) $(INSTALL) ../lib/$(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME)
uninstall \
uninstall.libs::
- -rm -f $(DESTDIR)$(libdir)/$(LIBNAME)
+ -$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME)
mostlyclean ::
- -rm -f core tags TAGS *~ *.ln *.atac trace
+ -rm -f core tags TAGS *~ *.i *.ii *.ln *.atac trace
clean :: mostlyclean
- -rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(OBJS_DEMO)
+ -$(LIBTOOL) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:.o=.lo) $(OBJS_DEMO)
+ -rm -rf .libs
distclean :: clean
-rm -f Makefile
diff --git a/contrib/ncurses/c++/cursesapp.cc b/contrib/ncurses/c++/cursesapp.cc
index eaaadc7eebdd..46cc271db644 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,1999 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,2001 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,10 +31,10 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-#include "cursesapp.h"
#include "internal.h"
+#include "cursesapp.h"
-MODULE_ID("$Id: cursesapp.cc,v 1.6 1999/10/30 23:59:37 tom Exp $")
+MODULE_ID("$Id: cursesapp.cc,v 1.8 2001/03/24 21:25:36 tom Exp $")
void
NCursesApplication::init(bool bColors) {
diff --git a/contrib/ncurses/c++/cursesapp.h b/contrib/ncurses/c++/cursesapp.h
index f13fd1bdb457..c897a07dc20d 100644
--- a/contrib/ncurses/c++/cursesapp.h
+++ b/contrib/ncurses/c++/cursesapp.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * 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 *
@@ -31,14 +31,14 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-// $Id: cursesapp.h,v 1.5 1999/05/16 17:29:59 juergen Exp $
+// $Id: cursesapp.h,v 1.7 2001/03/24 21:41:18 tom Exp $
-#ifndef _CURSESAPP_H
-#define _CURSESAPP_H
+#ifndef NCURSES_CURSESAPP_H_incl
+#define NCURSES_CURSESAPP_H_incl
#include <cursslk.h>
-class NCursesApplication {
+class NCURSES_IMPEXP NCursesApplication {
public:
typedef struct _slk_link { // This structure is used to maintain
struct _slk_link* prev; // a stack of SLKs
@@ -160,4 +160,4 @@ public:
};
-#endif // _CURSESAPP_H
+#endif // NCURSES_CURSESAPP_H_incl
diff --git a/contrib/ncurses/c++/cursesf.cc b/contrib/ncurses/c++/cursesf.cc
index a3b066cb51ef..35e01ee9ea6c 100644
--- a/contrib/ncurses/c++/cursesf.cc
+++ b/contrib/ncurses/c++/cursesf.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2001 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,12 +31,12 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
+#include "internal.h"
#include "cursesf.h"
#include "cursesapp.h"
-#include "internal.h"
-MODULE_ID("$Id: cursesf.cc,v 1.11 2000/06/09 16:15:40 juergen Exp $")
-
+MODULE_ID("$Id: cursesf.cc,v 1.13 2001/03/24 20:03:51 tom Exp $")
+
NCursesFormField::~NCursesFormField () {
if (field)
OnError(::free_field (field));
@@ -54,16 +54,16 @@ NCursesForm::mapFields(NCursesFormField* nfields[]) {
for (lcv=0; nfields[lcv]->field; ++lcv)
++fieldCount;
-
+
FIELD** fields = new FIELD*[fieldCount + 1];
-
+
for (lcv=0;nfields[lcv]->field;++lcv) {
fields[lcv] = nfields[lcv]->field;
}
fields[lcv] = NULL;
-
+
my_fields = nfields;
-
+
if (form && (old_fields = ::form_fields(form))) {
::set_form_fields(form,(FIELD**)0);
delete[] old_fields;
@@ -104,7 +104,7 @@ NCursesForm::InitForm(NCursesFormField* nfields[],
bool with_frame,
bool autoDelete_Fields) {
int mrows, mcols;
-
+
keypad(TRUE);
meta(TRUE);
@@ -115,24 +115,24 @@ NCursesForm::InitForm(NCursesFormField* nfields[],
form = ::new_form(mapFields(nfields));
if (!form)
OnError (E_SYSTEM_ERROR);
-
+
UserHook* hook = new UserHook;
hook->m_user = NULL;
hook->m_back = this;
hook->m_owner = form;
::set_form_userptr(form,(void*)hook);
-
+
::set_form_init (form, NCursesForm::frm_init);
::set_form_term (form, NCursesForm::frm_term);
::set_field_init (form, NCursesForm::fld_init);
::set_field_term (form, NCursesForm::fld_term);
-
+
scale(mrows, mcols);
::set_form_win(form, w);
-
+
if (with_frame) {
if ((mrows > height()-2) || (mcols > width()-2))
- OnError(E_NO_ROOM);
+ OnError(E_NO_ROOM);
sub = new NCursesWindow(*this,mrows,mcols,1,1,'r');
::set_form_sub(form, sub->w);
b_sub_owner = TRUE;
@@ -161,14 +161,14 @@ NCursesForm::~NCursesForm() {
if (b_autoDelete) {
if (cnt>0) {
for (int i=0; i <= cnt; i++)
- delete my_fields[i];
+ delete my_fields[i];
}
delete[] my_fields;
}
::free_form(form);
// It's essential to do this after free_form()
- delete[] fields;
+ delete[] fields;
}
}
@@ -186,7 +186,7 @@ NCursesForm::setSubWindow(NCursesWindow& nsub) {
/* Internal hook functions. They will route the hook
* calls to virtual methods of the NCursesForm class,
- * so in C++ providing a hook is done simply by
+ * so in C++ providing a hook is done simply by
* implementing a virtual method in a derived class
*/
void
@@ -228,7 +228,7 @@ NCursesForm::On_Field_Termination(NCursesFormField& field) {
}
// call the form driver and do basic error checking.
-int
+int
NCursesForm::driver (int c) {
int res = ::form_driver (form, c);
switch (res) {
@@ -244,15 +244,15 @@ NCursesForm::driver (int c) {
}
void NCursesForm::On_Request_Denied(int c) const {
- beep();
+ ::beep();
}
void NCursesForm::On_Invalid_Field(int c) const {
- beep();
+ ::beep();
}
void NCursesForm::On_Unknown_Command(int c) const {
- beep();
+ ::beep();
}
static const int CMD_QUIT = MAX_COMMAND + 1;
@@ -266,7 +266,7 @@ NCursesForm::operator()(void) {
post();
show();
refresh();
-
+
while (((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) {
switch((err=driver(drvCmnd))) {
case E_REQUEST_DENIED:
@@ -295,7 +295,7 @@ NCursesForm::operator()(void) {
// code c into a form request code.
// The default implementation provides a hopefully straightforward
// mapping for the most common keystrokes and form requests.
-int
+int
NCursesForm::virtualize(int c) {
switch(c) {
@@ -318,7 +318,7 @@ NCursesForm::virtualize(int c) {
case CTRL('F') : return(REQ_NEXT_FIELD); // Forward
case CTRL('B') : return(REQ_PREV_FIELD); // Backward
- case CTRL('L') : return(REQ_LEFT_FIELD); // Left
+ case CTRL('L') : return(REQ_LEFT_FIELD); // Left
case CTRL('R') : return(REQ_RIGHT_FIELD); // Right
case CTRL('U') : return(REQ_UP_FIELD); // Up
case CTRL('D') : return(REQ_DOWN_FIELD); // Down
@@ -341,7 +341,7 @@ NCursesForm::virtualize(int c) {
case CTRL('N') : return(REQ_NEXT_CHOICE);
case CTRL('P') : return(REQ_PREV_CHOICE);
-
+
default:
return(c);
}
@@ -362,7 +362,7 @@ bool UserDefinedFieldType::fcheck(FIELD *f, const void *u) {
bool UserDefinedFieldType::ccheck(int c, const void *u) {
NCursesFormField* F = (NCursesFormField*)u;
assert(F != 0);
- UserDefinedFieldType* udf =
+ UserDefinedFieldType* udf =
(UserDefinedFieldType*)(F->fieldtype());
assert(udf != 0);
return udf->char_check(c);
@@ -383,7 +383,7 @@ 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 != 0);
- UserDefinedFieldType_With_Choice* udf =
+ UserDefinedFieldType_With_Choice* udf =
(UserDefinedFieldType_With_Choice*)(F->fieldtype());
assert(udf != 0);
return udf->next(*F);
@@ -392,7 +392,7 @@ bool UserDefinedFieldType_With_Choice::next_choice(FIELD *f, const void *u) {
bool UserDefinedFieldType_With_Choice::prev_choice(FIELD *f, const void *u) {
NCursesFormField* F = (NCursesFormField*)u;
assert(F != 0);
- UserDefinedFieldType_With_Choice* udf =
+ UserDefinedFieldType_With_Choice* udf =
(UserDefinedFieldType_With_Choice*)(F->fieldtype());
assert(udf != 0);
return udf->previous(*F);
@@ -408,7 +408,7 @@ public:
UserDefinedFieldType::makearg,
NULL,
NULL);
- if (code==E_OK)
+ if (code==E_OK)
code = ::set_fieldtype_arg
(UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice,
UserDefinedFieldType::makearg,
diff --git a/contrib/ncurses/c++/cursesf.h b/contrib/ncurses/c++/cursesf.h
index 40f4146172c3..3dc2e9557c0f 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,1999,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,2000,2001 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,10 +31,10 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-// $Id: cursesf.h,v 1.12 2000/07/15 21:08:25 tom Exp $
+// $Id: cursesf.h,v 1.15 2001/03/24 21:41:23 tom Exp $
-#ifndef _CURSESF_H
-#define _CURSESF_H
+#ifndef NCURSES_CURSESF_H_incl
+#define NCURSES_CURSESF_H_incl 1
#include <cursesp.h>
#include <string.h>
@@ -47,11 +47,11 @@ extern "C" {
// The abstract base class for buitin and user defined Fieldtypes.
// -------------------------------------------------------------------------
//
-class NCursesFormField; // forward declaration
+class NCURSES_IMPEXP NCursesFormField; // forward declaration
// Class to represent builtin field types as well as C++ written new
// fieldtypes (see classes UserDefineFieldType...
-class NCursesFieldType {
+class NCURSES_IMPEXP NCursesFieldType {
friend class NCursesFormField;
protected:
@@ -80,7 +80,7 @@ public:
// The class representing a forms field, wrapping the lowlevel FIELD struct
// -------------------------------------------------------------------------
//
-class NCursesFormField {
+class NCURSES_IMPEXP NCursesFormField {
friend class NCursesForm;
protected:
@@ -288,7 +288,7 @@ public:
// The class representing a form, wrapping the lowlevel FORM struct
// -------------------------------------------------------------------------
//
-class NCursesForm : public NCursesPanel {
+class NCURSES_IMPEXP NCursesForm : public NCursesPanel {
protected:
FORM* form; // the lowlevel structure
@@ -541,7 +541,7 @@ public:
// data belongs to some class T. Use T as template argument
// to create a UserField.
// -------------------------------------------------------------------------
-template<class T> class NCursesUserField : public NCursesFormField
+template<class T> class NCURSES_IMPEXP NCursesUserField : public NCursesFormField
{
public:
NCursesUserField (int rows,
@@ -574,7 +574,7 @@ public:
// The same mechanism is used to attach user data to a form
// -------------------------------------------------------------------------
//
-template<class T> class NCursesUserForm : public NCursesForm
+template<class T> class NCURSES_IMPEXP NCursesUserForm : public NCursesForm
{
protected:
// 'Internal' constructor, builds an object without association to a
@@ -637,7 +637,7 @@ public:
// Builtin Fieldtypes
// -------------------------------------------------------------------------
//
-class Alpha_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType {
private:
int min_field_width;
@@ -652,7 +652,7 @@ public:
}
};
-class Alphanumeric_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType {
private:
int min_field_width;
@@ -667,7 +667,7 @@ public:
}
};
-class Integer_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Integer_Field : public NCursesFieldType {
private:
int precision;
long lower_limit, upper_limit;
@@ -684,7 +684,7 @@ public:
}
};
-class Numeric_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType {
private:
int precision;
double lower_limit, upper_limit;
@@ -701,7 +701,7 @@ public:
}
};
-class Regular_Expression_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType {
private:
char* regex;
@@ -712,8 +712,8 @@ private:
public:
Regular_Expression_Field(const char *expr)
: NCursesFieldType(TYPE_REGEXP) {
- regex = new char[1+::strlen(expr)];
- (strcpy)(regex,expr);
+ regex = new char[1 + ::strlen(expr)];
+ (::strcpy)(regex,expr);
}
~Regular_Expression_Field() {
@@ -721,7 +721,7 @@ public:
}
};
-class Enumeration_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType {
private:
char** list;
int case_sensitive;
@@ -742,7 +742,7 @@ public:
}
};
-class IPV4_Address_Field : public NCursesFieldType {
+class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType {
private:
void set(NCursesFormField& f) {
OnError(::set_field_type(f.get_field(),fieldtype));
@@ -757,7 +757,7 @@ public:
// Abstract base class for User-Defined Fieldtypes
// -------------------------------------------------------------------------
//
-class UserDefinedFieldType : public NCursesFieldType {
+class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType {
friend class UDF_Init; // Internal helper to set up statics
private:
// For all C++ defined fieldtypes we need only one generic lowlevel
@@ -793,7 +793,7 @@ public:
// Abstract base class for User-Defined Fieldtypes with Choice functions
// -------------------------------------------------------------------------
//
-class UserDefinedFieldType_With_Choice : public UserDefinedFieldType {
+class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType {
friend class UDF_Init; // Internal helper to set up statics
private:
// For all C++ defined fieldtypes with choice functions we need only one
@@ -820,5 +820,5 @@ public:
}
};
-#endif // _CURSESF_H
+#endif // NCURSES_CURSESF_H_incl
diff --git a/contrib/ncurses/c++/cursesm.cc b/contrib/ncurses/c++/cursesm.cc
index 3b4dbd58bef1..410cdbc892db 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,1999 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,2001 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,18 +31,18 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
+#include "internal.h"
#include "cursesm.h"
#include "cursesapp.h"
-#include "internal.h"
-MODULE_ID("$Id: cursesm.cc,v 1.12 1999/10/30 23:59:37 tom Exp $")
-
+MODULE_ID("$Id: cursesm.cc,v 1.15 2001/03/24 20:03:56 tom Exp $")
+
NCursesMenuItem::~NCursesMenuItem() {
if (item)
OnError(::free_item(item));
}
-bool
+bool
NCursesMenuItem::action() {
return FALSE;
};
@@ -50,7 +50,7 @@ NCursesMenuItem::action() {
NCursesMenuCallbackItem::~NCursesMenuCallbackItem() {
}
-bool
+bool
NCursesMenuCallbackItem::action() {
if (p_fct)
return p_fct (*this);
@@ -60,7 +60,7 @@ NCursesMenuCallbackItem::action() {
/* Internal hook functions. They will route the hook
* calls to virtual methods of the NCursesMenu class,
- * so in C++ providing a hook is done simply by
+ * so in C++ providing a hook is done simply by
* implementing a virtual method in a derived class
*/
void
@@ -91,21 +91,21 @@ NCursesMenu::itm_term(MENU *m) {
ITEM**
NCursesMenu::mapItems(NCursesMenuItem* nitems[]) {
int itemCount = 0,lcv;
-
+
for (lcv=0; nitems[lcv]->item; ++lcv)
++itemCount;
-
+
ITEM** items = new ITEM*[itemCount + 1];
-
+
for (lcv=0;nitems[lcv]->item;++lcv) {
items[lcv] = nitems[lcv]->item;
}
items[lcv] = NULL;
-
+
my_items = nitems;
-
+
if (menu)
- delete[] ::menu_items(menu);
+ delete[] ::menu_items(menu);
return items;
}
@@ -114,7 +114,7 @@ NCursesMenu::InitMenu(NCursesMenuItem* nitems[],
bool with_frame,
bool autoDelete_Items) {
int mrows, mcols;
-
+
keypad(TRUE);
meta(TRUE);
@@ -125,24 +125,24 @@ NCursesMenu::InitMenu(NCursesMenuItem* nitems[],
menu = ::new_menu(mapItems(nitems));
if (!menu)
OnError (E_SYSTEM_ERROR);
-
+
UserHook* hook = new UserHook;
hook->m_user = NULL;
hook->m_back = this;
hook->m_owner = menu;
::set_menu_userptr(menu,(void*)hook);
-
+
::set_menu_init (menu, NCursesMenu::mnu_init);
::set_menu_term (menu, NCursesMenu::mnu_term);
::set_item_init (menu, NCursesMenu::itm_init);
::set_item_term (menu, NCursesMenu::itm_term);
-
+
scale(mrows, mcols);
::set_menu_win(menu, w);
-
+
if (with_frame) {
if ((mrows > height()-2) || (mcols > width()-2))
- OnError(E_NO_ROOM);
+ OnError(E_NO_ROOM);
sub = new NCursesWindow(*this,mrows,mcols,1,1,'r');
::set_menu_sub(menu, sub->w);
b_sub_owner = TRUE;
@@ -180,14 +180,14 @@ NCursesMenu::~NCursesMenu() {
if (b_autoDelete) {
if (cnt>0) {
for (int i=0; i <= cnt; i++)
- delete my_items[i];
+ delete my_items[i];
}
delete[] my_items;
}
::free_menu(menu);
// It's essential to do this after free_menu()
- delete[] itms;
+ delete[] itms;
}
}
@@ -218,7 +218,7 @@ NCursesMenu::set_pattern (const char *pat) {
}
// call the menu driver and do basic error checking.
-int
+int
NCursesMenu::driver (int c) {
int res = ::menu_driver (menu, c);
switch (res) {
@@ -243,7 +243,7 @@ static const int CMD_ACTION = MAX_COMMAND + 2;
// The default implementation provides a hopefully straightforward
// mapping for the most common keystrokes and menu requests.
// -------------------------------------------------------------------------
-int
+int
NCursesMenu::virtualize(int c) {
switch(c) {
case CTRL('X') : return(CMD_QUIT); // eXit
@@ -290,7 +290,7 @@ NCursesMenu::operator()(void) {
post();
show();
refresh();
-
+
while (!b_action && ((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) {
switch((err=driver(drvCmnd))) {
@@ -363,21 +363,20 @@ NCursesMenu::On_Item_Termination(NCursesMenuItem& item) {
void
NCursesMenu::On_Request_Denied(int c) const {
- beep();
+ ::beep();
}
void
NCursesMenu::On_Not_Selectable(int c) const {
- beep();
+ ::beep();
}
void
NCursesMenu::On_No_Match(int c) const {
- beep();
+ ::beep();
}
void
NCursesMenu::On_Unknown_Command(int c) const {
- beep();
+ ::beep();
}
-
diff --git a/contrib/ncurses/c++/cursesm.h b/contrib/ncurses/c++/cursesm.h
index 26e0b4ce2b02..541ba038795b 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,1999 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,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 *
@@ -31,10 +31,10 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-// $Id: cursesm.h,v 1.13 1999/10/30 23:59:37 tom Exp $
+// $Id: cursesm.h,v 1.15 2001/03/24 21:41:28 tom Exp $
-#ifndef _CURSESM_H
-#define _CURSESM_H
+#ifndef NCURSES_CURSESM_H_incl
+#define NCURSES_CURSESM_H_incl 1
#include <cursesp.h>
@@ -46,7 +46,7 @@ extern "C" {
// This wraps the ITEM type of <menu.h>
// -------------------------------------------------------------------------
//
-class NCursesMenuItem {
+class NCURSES_IMPEXP NCursesMenuItem {
friend class NCursesMenu;
protected:
@@ -135,7 +135,7 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&);
// If you don't like to create a child class for individual items to
// overload action(), you may use this class and provide a callback
// function pointer for items.
-class NCursesMenuCallbackItem : public NCursesMenuItem {
+class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem {
private:
ITEMCALLBACK* p_fct;
@@ -156,7 +156,7 @@ public:
// This wraps the MENU type of <menu.h>
// -------------------------------------------------------------------------
//
-class NCursesMenu : public NCursesPanel {
+class NCURSES_IMPEXP NCursesMenu : public NCursesPanel {
protected:
MENU *menu;
@@ -514,7 +514,7 @@ public:
// to create a UserItem.
// -------------------------------------------------------------------------
//
-template<class T> class NCursesUserItem : public NCursesMenuItem
+template<class T> class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem
{
public:
NCursesUserItem (const char* p_name,
@@ -541,7 +541,7 @@ public:
// The same mechanism is used to attach user data to a menu
// -------------------------------------------------------------------------
//
-template<class T> class NCursesUserMenu : public NCursesMenu
+template<class T> class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu
{
protected:
NCursesUserMenu( int lines,
@@ -589,4 +589,4 @@ public:
}
};
-#endif // _CURSESM_H
+#endif // NCURSES_CURSESM_H_incl
diff --git a/contrib/ncurses/c++/cursesmain.cc b/contrib/ncurses/c++/cursesmain.cc
index 09400b8d690a..03f61bc3da68 100644
--- a/contrib/ncurses/c++/cursesmain.cc
+++ b/contrib/ncurses/c++/cursesmain.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2001 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,10 +31,10 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-#include "cursesapp.h"
#include "internal.h"
+#include "cursesapp.h"
-MODULE_ID("$Id: cursesmain.cc,v 1.5 1999/05/16 17:31:22 juergen Exp $")
+MODULE_ID("$Id: cursesmain.cc,v 1.7 2001/03/24 21:25:47 tom Exp $")
/* This is the default implementation of main() for a NCursesApplication.
* You only have to instantiate a static NCursesApplication object in your
diff --git a/contrib/ncurses/c++/cursesp.cc b/contrib/ncurses/c++/cursesp.cc
index 50095d3d2144..bfd4d9f4dda3 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,1999,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,2000,2001 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,11 +31,11 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1993,1997 *
****************************************************************************/
-#include "cursesp.h"
#include "internal.h"
+#include "cursesp.h"
#include <string.h>
-MODULE_ID("$Id: cursesp.cc,v 1.16 2000/07/15 21:08:13 tom Exp $")
+MODULE_ID("$Id: cursesp.cc,v 1.18 2001/03/24 20:04:04 tom Exp $")
NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0;
@@ -75,7 +75,7 @@ NCursesPanel::redraw() {
int
NCursesPanel::refresh() {
::update_panels();
- return doupdate();
+ return ::doupdate();
}
int
@@ -116,7 +116,7 @@ NCursesPanel::label(const char *tLabel, const char *bLabel) {
void
NCursesPanel::centertext(int row,const char *label) {
if (label) {
- int x = (maxx() - strlen(label)) / 2;
+ int x = (maxx() - ::strlen(label)) / 2;
if (x<0)
x=0;
OnError(addstr(row, x, label, width()));
diff --git a/contrib/ncurses/c++/cursesp.h b/contrib/ncurses/c++/cursesp.h
index 6293dd102e87..b56580a6376f 100644
--- a/contrib/ncurses/c++/cursesp.h
+++ b/contrib/ncurses/c++/cursesp.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998,1999 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,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 *
@@ -31,10 +31,10 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-#ifndef _CURSESP_H
-#define _CURSESP_H
+#ifndef NCURSES_CURSESP_H_incl
+#define NCURSES_CURSESP_H_incl 1
-// $Id: cursesp.h,v 1.12 1999/10/31 00:00:02 tom Exp $
+// $Id: cursesp.h,v 1.14 2001/03/24 21:41:35 tom Exp $
#include <cursesw.h>
@@ -42,7 +42,7 @@ extern "C" {
# include <panel.h>
}
-class NCursesPanel : public NCursesWindow {
+class NCURSES_IMPEXP NCursesPanel : public NCursesWindow {
protected:
PANEL *p;
static NCursesPanel *dummy;
@@ -215,4 +215,4 @@ public:
// Associate the user panel with the user data pointed to by p_UserData.
};
-#endif // _CURSESP_H
+#endif // NCURSES_CURSESP_H_incl
diff --git a/contrib/ncurses/c++/cursespad.cc b/contrib/ncurses/c++/cursespad.cc
index b82d39399b45..64795120ebb7 100644
--- a/contrib/ncurses/c++/cursespad.cc
+++ b/contrib/ncurses/c++/cursespad.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1999 Free Software Foundation, Inc. *
+ * Copyright (c) 1999,2001 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,11 +31,11 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1999 *
****************************************************************************/
+#include "internal.h"
#include "etip.h"
#include "cursesw.h"
-#include "internal.h"
-MODULE_ID("$Id: cursespad.cc,v 1.2 1999/09/11 23:25:54 tom Exp $")
+MODULE_ID("$Id: cursespad.cc,v 1.4 2001/03/24 21:25:57 tom Exp $")
NCursesPad::NCursesPad(int lines, int cols)
: NCursesWindow(),
diff --git a/contrib/ncurses/c++/cursesw.cc b/contrib/ncurses/c++/cursesw.cc
index b61a7056af15..463554b404e6 100644
--- a/contrib/ncurses/c++/cursesw.cc
+++ b/contrib/ncurses/c++/cursesw.cc
@@ -22,10 +22,10 @@
modified by Juergen Pfeifer (juergen.pfeifer@gmx.net)
*/
-#include "cursesw.h"
#include "internal.h"
+#include "cursesw.h"
-MODULE_ID("$Id: cursesw.cc,v 1.17 2000/09/02 18:55:31 tom Exp $")
+MODULE_ID("$Id: cursesw.cc,v 1.21 2001/04/07 22:11:39 tom Exp $")
#define COLORS_NEED_INITIALIZATION -1
#define COLORS_NOT_INITIALIZED 0
@@ -45,43 +45,52 @@ bool NCursesWindow::b_initialized = FALSE;
int
NCursesWindow::scanw(const char* fmt, ...)
{
+ int result = ERR;
#if defined(__GNUG__)
- va_list args;
- va_start(args, fmt);
char buf[BUFSIZ];
- int result = wgetstr(w, buf);
- if (result == OK) {
+
+ if (::wgetnstr(w, buf, sizeof(buf)) != ERR) {
+ va_list args;
+ va_start(args, fmt);
+#if USE_STDIO_VSCAN
+ if (::vscanf(fmt, args) != -1)
+ result = OK;
+#elif USE_STRSTREAM_VSCAN /* pre-gcc 3.0 */
strstreambuf ss(buf, sizeof(buf));
- result = ss.vscan(fmt, (_IO_va_list)args);
+ if (ss.vscan(fmt, (_IO_va_list)args) != -1)
+ result = OK;
+#endif
+ va_end(args);
}
- va_end(args);
- return result;
-#else
- return ERR;
#endif
+ return result;
}
int
NCursesWindow::scanw(int y, int x, const char* fmt, ...)
{
+ int result = ERR;
#if defined(__GNUG__)
- va_list args;
- va_start(args, fmt);
char buf[BUFSIZ];
- int result = wmove(w, y, x);
- if (result == OK) {
- result = wgetstr(w, buf);
- if (result == OK) {
+
+ if (::wmove(w, y, x) != ERR) {
+ if (::wgetnstr(w, buf, sizeof(buf)) != ERR) {
+ va_list args;
+ va_start(args, fmt);
+#if USE_STDIO_VSCAN
+ if (::vscanf(fmt, args) != -1)
+ result = OK;
+#elif USE_STRSTREAM_VSCAN /* pre-gcc 3.0 */
strstreambuf ss(buf, sizeof(buf));
- result = ss.vscan(fmt, (_IO_va_list)args);
+ if (ss.vscan(fmt, (_IO_va_list)args) != -1)
+ result = OK;
+#endif
+ va_end(args);
}
}
- va_end(args);
- return result;
-#else
- return ERR;
#endif
+ return result;
}
@@ -91,7 +100,7 @@ NCursesWindow::printw(const char * fmt, ...)
va_list args;
va_start(args, fmt);
char buf[BUFSIZ];
- vsprintf(buf, fmt, args);
+ ::vsprintf(buf, fmt, args);
va_end(args);
return waddstr(w, buf);
}
@@ -102,10 +111,10 @@ NCursesWindow::printw(int y, int x, const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
- int result = wmove(w, y, x);
+ int result = ::wmove(w, y, x);
if (result == OK) {
char buf[BUFSIZ];
- vsprintf(buf, fmt, args);
+ ::vsprintf(buf, fmt, args);
result = waddstr(w, buf);
}
va_end(args);
@@ -142,8 +151,7 @@ NCursesWindow::initialize() {
}
NCursesWindow::NCursesWindow() {
- if (!b_initialized)
- initialize();
+ initialize();
w = (WINDOW *)0;
init();
@@ -154,8 +162,7 @@ NCursesWindow::NCursesWindow() {
NCursesWindow::NCursesWindow(int lines, int cols, int begin_y, int begin_x)
{
- if (!b_initialized)
- initialize();
+ initialize();
w = ::newwin(lines, cols, begin_y, begin_x);
if (w == 0) {
@@ -170,8 +177,7 @@ NCursesWindow::NCursesWindow(int lines, int cols, int begin_y, int begin_x)
NCursesWindow::NCursesWindow(WINDOW* &window)
{
- if (!b_initialized)
- initialize();
+ initialize();
w = window;
init();
@@ -183,6 +189,7 @@ NCursesWindow::NCursesWindow(WINDOW* &window)
NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c,
int begin_y, int begin_x, char absrel)
{
+ initialize();
if (absrel == 'a') { // absolute origin
begin_y -= win.begy();
begin_x -= win.begx();
@@ -208,6 +215,7 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c,
NCursesWindow::NCursesWindow(NCursesWindow& win,
bool do_box NCURSES_PARAM_INIT(TRUE))
{
+ initialize();
w = :: derwin(win.w,win.height()-2,win.width()-2,1,1);
if (w == 0) {
err_handler("Cannot construct subwindow");
@@ -244,6 +252,7 @@ static RIPOFFINIT* prip = R_INIT;
extern "C" int _nc_ripoffline(int,int (*init)(WINDOW*,int));
NCursesWindow::NCursesWindow(WINDOW *win, int cols) {
+ initialize();
w = win;
assert((w->_maxx+1)==cols);
alloced = FALSE;
@@ -323,7 +332,7 @@ NCursesWindow::~NCursesWindow()
}
if (alloced && w != 0)
- delwin(w);
+ ::delwin(w);
if (alloced) {
--count;
@@ -364,7 +373,7 @@ NCursesWindow::getcolor(int getback) const
short fore, back;
if (colorInitialized==COLORS_ARE_REALLY_THERE) {
- if (pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back))
+ if (::pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back))
err_handler("Can't get color pair");
}
else {
@@ -396,7 +405,7 @@ int
NCursesWindow::setpalette(short fore, short back, short pair)
{
if (colorInitialized==COLORS_ARE_REALLY_THERE)
- return init_pair(pair, fore, back);
+ return ::init_pair(pair, fore, back);
else
return OK;
}
diff --git a/contrib/ncurses/c++/cursesw.h b/contrib/ncurses/c++/cursesw.h
index 8091194cbc5e..dcaadd9b3098 100644
--- a/contrib/ncurses/c++/cursesw.h
+++ b/contrib/ncurses/c++/cursesw.h
@@ -1,19 +1,42 @@
// * This makes emacs happy -*-Mode: C++;-*-
-#ifndef _CURSESW_H
-#define _CURSESW_H
-
-// $Id: cursesw.h,v 1.18 1999/10/23 15:16:53 tom Exp $
+/****************************************************************************
+ * Copyright (c) 1998,1999,2000,2001 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. *
+ ****************************************************************************/
+
+#ifndef NCURSES_CURSESW_H_incl
+#define NCURSES_CURSESW_H_incl 1
+
+// $Id: cursesw.h,v 1.25 2001/04/07 22:44:07 tom Exp $
#include <etip.h>
#include <stdio.h>
#include <stdarg.h>
-#ifdef __MWERKS__
-/* This is a bogus check, stringstream is actually ANSI C++ standard,
- * but old compilers like GCC don't have it, and new compilers like Metrowerks
- * don't have strstream
- */
-#include <sstream>
-#else
+
+#if HAVE_STRSTREAM_H && USE_STRSTREAM_VSCAN
#include <strstream.h>
#endif
@@ -118,7 +141,7 @@ inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); }
#undef clearok
#define clearok UNDEF(clearok)
#else
-extern "C" int clearok(WINDOW*, bool);
+extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool);
#endif
#ifdef clrtobot
@@ -152,7 +175,7 @@ inline int UNDEF(erase)() { return erase(); }
#endif
#ifdef flushok
-inline int UNDEF(flushok)(WINDOW* _win, bool _bf) {
+inline int UNDEF(flushok)(WINDOW* _win, bool _bf) {
return flushok(_win, _bf); }
#undef flushok
#define flushok UNDEF(flushok)
@@ -185,49 +208,49 @@ inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str,n); }
#endif
#ifdef mvwinnstr
-inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) {
+inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) {
return mvwinnstr(win,y,x,_str,n); }
#undef mvwinnstr
#define mvwinnstr UNDEF(mvwinnstr)
#endif
#ifdef mvinnstr
-inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) {
+inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) {
return mvinnstr(y,x,_str,n); }
#undef mvinnstr
#define mvinnstr UNDEF(mvinnstr)
#endif
#ifdef winsstr
-inline int UNDEF(winsstr)(WINDOW *w, const char *_str) {
+inline int UNDEF(winsstr)(WINDOW *w, const char *_str) {
return winsstr(w,_str); }
#undef winsstr
#define winsstr UNDEF(winsstr)
#endif
#ifdef mvwinsstr
-inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) {
+inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) {
return mvwinsstr(w,y,x,_str); }
#undef mvwinsstr
#define mvwinsstr UNDEF(mvwinsstr)
#endif
#ifdef insstr
-inline int UNDEF(insstr)(const char *_str) {
+inline int UNDEF(insstr)(const char *_str) {
return insstr(_str); }
#undef insstr
#define insstr UNDEF(insstr)
#endif
#ifdef mvinsstr
-inline int UNDEF(mvinsstr)(int y, int x,const char *_str) {
+inline int UNDEF(mvinsstr)(int y, int x,const char *_str) {
return mvinsstr(y,x,_str); }
#undef mvinsstr
#define mvinsstr UNDEF(mvinsstr)
#endif
#ifdef insnstr
-inline int UNDEF(insnstr)(const char *_str, int n) {
+inline int UNDEF(insnstr)(const char *_str, int n) {
return insnstr(_str,n); }
#undef insnstr
#define insnstr UNDEF(insnstr)
@@ -254,7 +277,7 @@ inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str,n); }
#endif
#ifdef getyx
-inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) {
+inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) {
getyx(win, y, x); }
#undef getyx
#define getyx UNDEF(getyx)
@@ -301,7 +324,7 @@ inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); }
#undef leaveok
#define leaveok UNDEF(leaveok)
#else
-extern "C" int leaveok(WINDOW* win, bool bf);
+extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf);
#endif
#ifdef move
@@ -340,9 +363,9 @@ inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); }
#define scrollok UNDEF(scrollok)
#else
#if defined(__NCURSES_H)
-extern "C" int scrollok(WINDOW*, bool);
+extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool);
#else
-extern "C" int scrollok(WINDOW*, char);
+extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char);
#endif
#endif
@@ -365,7 +388,7 @@ inline int UNDEF(standout)() { return standout(); }
#endif
#ifdef subpad
-inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x)
+inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x)
{ return derwin(p,l,c,y,x); }
#undef subpad
#define subpad UNDEF(subpad)
@@ -434,7 +457,7 @@ inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); }
#endif
#ifdef chgat
-inline int UNDEF(chgat)(int n,attr_t attr, short color, const void *opts) {
+inline int UNDEF(chgat)(int n,attr_t attr, short color, const void *opts) {
return chgat(n,attr,color,opts); }
#undef chgat
#define chgat UNDEF(chgat)
@@ -442,7 +465,7 @@ inline int UNDEF(chgat)(int n,attr_t attr, short color, const void *opts) {
#ifdef mvchgat
inline int UNDEF(mvchgat)(int y, int x, int n,
- attr_t attr, short color, const void *opts) {
+ attr_t attr, short color, const void *opts) {
return mvchgat(y,x,n,attr,color,opts); }
#undef mvchgat
#define mvchgat UNDEF(mvchgat)
@@ -450,7 +473,7 @@ inline int UNDEF(mvchgat)(int y, int x, int n,
#ifdef mvwchgat
inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n,
- attr_t attr, short color, const void *opts) {
+ attr_t attr, short color, const void *opts) {
return mvwchgat(win,y,x,n,attr,color,opts); }
#undef mvwchgat
#define mvwchgat UNDEF(mvwchgat)
@@ -538,7 +561,7 @@ inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n)
#endif
#ifdef mvwinch
-inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) {
+inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) {
return mvwinch(win, y, x);}
#undef mvwinch
#define mvwinch UNDEF(mvwinch)
@@ -671,18 +694,18 @@ inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); }
*
*/
-class NCursesWindow
+class NCURSES_IMPEXP NCursesWindow
{
friend class NCursesMenu;
friend class NCursesForm;
-
+
private:
static bool b_initialized;
static void initialize();
static int ripoff_init(WINDOW *,int);
- void init();
-
+ void init();
+
short getcolor(int getback) const;
static int setpalette(short fore, short back, short pair);
@@ -700,15 +723,15 @@ protected:
// We rely on the c++ promise that
// all otherwise uninitialized
// static class vars are set to 0
-
+
WINDOW* w; // the curses WINDOW
-
+
bool alloced; // TRUE if we own the WINDOW
-
+
NCursesWindow* par; // parent, if subwindow
NCursesWindow* subwins; // head of subwindows list
NCursesWindow* sib; // next subwindow of parent
-
+
void kill_subwindows(); // disable all subwindows
// Destroy all subwindows.
@@ -718,12 +741,12 @@ protected:
public:
NCursesWindow(WINDOW* &window); // useful only for stdscr
-
+
NCursesWindow(int lines, // number of lines
int cols, // number of columns
int begin_y, // line origin
int begin_x); // col origin
-
+
NCursesWindow(NCursesWindow& par,// parent window
int lines, // number of lines
int cols, // number of columns
@@ -751,9 +774,9 @@ public:
int (*init)(NCursesWindow& win));
// This function is used to generate a window of ripped-of lines.
// If the argument is positive, lines are removed from the top, if it
- // is negative lines are removed from the bottom. This enhances the
- // lowlevel ripoffline() function because it uses the internal
- // implementation that allows to remove more than just a single line.
+ // is negative lines are removed from the bottom. This enhances the
+ // lowlevel ripoffline() function because it uses the internal
+ // implementation that allows to remove more than just a single line.
// This function must be called before any other ncurses function. The
// creation of the window is defered until ncurses gets initialized.
// The initialization function is then called.
@@ -761,13 +784,13 @@ public:
// -------------------------------------------------------------------------
// terminal status
// -------------------------------------------------------------------------
- int lines() const { return LINES; }
+ int lines() const { initialize(); return LINES; }
// Number of lines on terminal, *not* window
- int cols() const { return COLS; }
+ int cols() const { initialize(); return COLS; }
// Number of cols on terminal, *not* window
- int tabsize() const { return TABSIZE; }
+ int tabsize() const { initialize(); return TABSIZE; }
// Size of a tab on terminal, *not* window
static int NumberOfColors();
@@ -775,7 +798,7 @@ public:
int colors() const { return NumberOfColors(); }
// Number of available colors
-
+
// -------------------------------------------------------------------------
// window status
// -------------------------------------------------------------------------
@@ -811,7 +834,7 @@ public:
int setcolor(short pair);
// Set actually used palette entry
-
+
// -------------------------------------------------------------------------
// window positioning
// -------------------------------------------------------------------------
@@ -827,12 +850,12 @@ public:
// Move cursor the this position
void getyx(int& y, int& x) const { ::getyx(w, y, x); }
- // Get current position of the cursor
+ // Get current position of the cursor
- int mvcur(int oldrow, int oldcol, int newrow, int newcol) const {
+ int mvcur(int oldrow, int oldcol, int newrow, int newcol) const {
return ::mvcur(oldrow, oldcol, newrow, newcol); }
// Perform lowlevel cursor motion that takes effect immediately.
-
+
// -------------------------------------------------------------------------
// input
// -------------------------------------------------------------------------
@@ -842,13 +865,13 @@ public:
int getch(int y, int x) { return ::mvwgetch(w,y,x); }
// Move cursor to position and get a keystroke from the window
- int getstr(char* str, int n=-1) {
+ int getstr(char* str, int n=-1) {
return ::wgetnstr(w, str,n); }
// Read a series of characters into str until a newline or carriage return
// is received. Read at most n characters. If n is negative, the limit is
// ignored.
- int getstr(int y, int x, char* str, int n=-1) {
+ int getstr(int y, int x, char* str, int n=-1) {
return ::mvwgetnstr(w,y,x,str,n); }
// Move the cursor to the requested position and then perform the getstr()
// as described above.
@@ -880,12 +903,12 @@ public:
#else
;
#endif
-
+
// -------------------------------------------------------------------------
// output
// -------------------------------------------------------------------------
int addch(const chtype ch) { return ::waddch(w, ch); }
- // Put attributed character to the window.
+ // Put attributed character to the window.
int addch(int y, int x, const chtype ch) {
return ::mvwaddch(w,y,x,ch); }
@@ -895,10 +918,10 @@ public:
int echochar(const chtype ch) { return ::wechochar(w,ch); }
// Put attributed character to the window and refresh it immediately.
- int addstr(const char* str, int n=-1) {
+ int addstr(const char* str, int n=-1) {
return ::waddnstr(w, (char*)str,n); }
// Write the string str to the window, stop writing if the terminating
- // NUL or the limit n is reached. If n is negative, it is ignored.
+ // NUL or the limit n is reached. If n is negative, it is ignored.
int addstr(int y, int x, const char * str, int n=-1) {
return ::mvwaddnstr(w,y,x,(char*)str,n); }
@@ -939,7 +962,7 @@ public:
int insertln() { return ::winsdelln(w,1); }
// Insert an empty line above the current line.
-
+
int insdelln(int n=1) { return ::winsdelln(w,n); }
// If n>0 insert that many lines above the current line. If n<0 delete
// that many lines beginning with the current line.
@@ -949,7 +972,7 @@ public:
// Insert the string into the window before the current cursor position.
// Insert stops at end of string or when the limit n is reached. If n is
// negative, it is ignored.
-
+
int insstr(int y, int x, const char *s, int n=-1) {
return ::mvwinsnstr(w,y,x,s,n); }
// Move the cursor to the requested position and then perform the insstr()
@@ -957,7 +980,7 @@ public:
int attron (chtype at) { return ::wattron (w, at); }
// Switch on the window attributes;
-
+
int attroff(chtype at) { return ::wattroff(w, (int) at); }
// Switch off the window attributes;
@@ -995,7 +1018,7 @@ public:
// -------------------------------------------------------------------------
// borders
// -------------------------------------------------------------------------
- int box(chtype vert=0, chtype hor=0) {
+ int box(chtype vert=0, chtype hor=0) {
return ::wborder(w, vert, vert, hor, hor, 0, 0 ,0, 0); }
// Draw a box around the window with the given vertical and horizontal
// drawing characters. If you specifiy a zero as character, curses will try
@@ -1016,7 +1039,7 @@ public:
// -------------------------------------------------------------------------
int hline(int len, chtype ch=0) { return ::whline(w, ch, len); }
// Draw a horizontal line of len characters with the given character. If
- // you pass zero for the character, curses will try to find a "nice" one.
+ // you pass zero for the character, curses will try to find a "nice" one.
int hline(int y, int x, int len, chtype ch=0) {
return ::mvwhline(w,y,x,ch,len); }
@@ -1029,7 +1052,7 @@ public:
int vline(int y, int x, int len, chtype ch=0) {
return ::mvwvline(w,y,x,ch,len); }
// Move the cursor to the requested position and then draw a vertical line.
-
+
// -------------------------------------------------------------------------
// erasure
// -------------------------------------------------------------------------
@@ -1050,7 +1073,7 @@ public:
// Clear to the end of the line.
int delch() { return ::wdelch(w); }
- // Delete character under the cursor.
+ // Delete character under the cursor.
int delch(int y, int x) { return ::mvwdelch(w,y,x); }
// Move cursor to requested position and delete the character under the
@@ -1090,18 +1113,18 @@ public:
int untouchwin() { return ::wtouchln(w,0,height(),0); }
// Mark the whole window as unmodified.
- int touchln(int s, int cnt, bool changed=TRUE) {
+ int touchln(int s, int cnt, bool changed=TRUE) {
return ::wtouchln(w,s,cnt,(int)(changed?1:0)); }
// Mark cnt lines beginning from line s as changed or unchanged, depending
// on the value of the changed flag.
- bool is_linetouched(int line) const {
+ bool is_linetouched(int line) const {
return (::is_linetouched(w,line) ? TRUE:FALSE); }
- // Return TRUE if line is marked as changed, FALSE otherwise
+ // Return TRUE if line is marked as changed, FALSE otherwise
- bool is_wintouched() const {
+ bool is_wintouched() const {
return (::is_wintouched(w) ? TRUE:FALSE); }
- // Return TRUE if window is marked as changed, FALSE otherwise
+ // Return TRUE if window is marked as changed, FALSE otherwise
int leaveok(bool bf) { return ::leaveok(w, bf); }
// If bf is TRUE, curses will leave the cursor after an update whereever
@@ -1141,7 +1164,7 @@ public:
int meta(bool bf) { return ::meta(w,bf); }
// If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise
- // 7-Bit characters are generated.
+ // 7-Bit characters are generated.
int standout() { return ::wstandout(w); }
// Enable "standout" attributes
@@ -1158,9 +1181,9 @@ public:
// doupdate(). This is redefined in NCursesPanel.
virtual int noutrefresh() { return ::wnoutrefresh(w); }
- // Propagate the changes in this window to the virtual screen. This is
+ // Propagate the changes in this window to the virtual screen. This is
// redefined in NCursesPanel.
-
+
// -------------------------------------------------------------------------
// multiple window control
// -------------------------------------------------------------------------
@@ -1207,7 +1230,7 @@ public:
// -------------------------------------------------------------------------
// We leave this here for compatibility reasons.
// -------------------------------------------------------------------------
-class NCursesColorWindow : public NCursesWindow {
+class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow {
public:
NCursesColorWindow(WINDOW* &window) // useful only for stdscr
: NCursesWindow(window) {
@@ -1228,8 +1251,8 @@ public:
char absrel = 'a') // if `a', by & bx are
: NCursesWindow(par,lines,cols, // absolute screen pos,
begin_y,begin_x, // else if `r', they are
- absrel ) { // relative to par origin
- useColors(); }
+ absrel ) { // relative to par origin
+ useColors(); }
};
// These enum definitions really belong inside the NCursesPad class, but only
@@ -1251,7 +1274,7 @@ public:
// Pad Support. We allow an association of a pad with a "real" window
// through which the pad may be viewed.
// -------------------------------------------------------------------------
-class NCursesPad : public NCursesWindow {
+class NCURSES_IMPEXP NCursesPad : public NCursesWindow {
private:
NCursesWindow* viewWin; // the "viewport" window
NCursesWindow* viewSub; // the "viewport" subwindow
@@ -1301,7 +1324,7 @@ public:
int echochar(const chtype ch) { return ::pechochar(w,ch); }
// Put the attributed character onto the pad and immediately do a
// prefresh().
-
+
int refresh();
// If a viewport is defined the pad is displayed in this window, otherwise
// this is a noop.
@@ -1326,7 +1349,7 @@ public:
return ::pnoutrefresh(w,pminrow,pmincol,
sminrow,smincol,smaxrow,smaxcol);
}
- // Does the same like refresh() but without calling doupdate().
+ // Does the same as refresh() but without calling doupdate().
virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1);
// Add the window "view" as viewing window to the pad.
@@ -1343,7 +1366,7 @@ public:
// A FramedPad is constructed always with a viewport window. This viewport
// will be framed (by a box() command) and the interior of the box is the
// viewport subwindow. On the frame we display scrollbar sliders.
-class NCursesFramedPad : public NCursesPad {
+class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad {
protected:
virtual void OnOperation(int pad_req);
@@ -1372,4 +1395,4 @@ public:
};
-#endif // _CURSESW_H
+#endif // NCURSES_CURSESW_H_incl
diff --git a/contrib/ncurses/c++/cursslk.cc b/contrib/ncurses/c++/cursslk.cc
index 236d3a55b3dd..c0c372b04939 100644
--- a/contrib/ncurses/c++/cursslk.cc
+++ b/contrib/ncurses/c++/cursslk.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000,2001 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,23 +31,23 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
+#include "internal.h"
#include "cursslk.h"
#include "cursesapp.h"
-#include "internal.h"
#include <string.h>
-MODULE_ID("$Id: cursslk.cc,v 1.6 2000/07/15 21:07:50 tom Exp $")
+MODULE_ID("$Id: cursslk.cc,v 1.9 2001/03/24 20:04:15 tom Exp $")
void Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) {
delete[] label;
label = new char[1 + ::strlen(text)];
- (strcpy)(label,text);
+ (::strcpy)(label,text);
}
long Soft_Label_Key_Set::count = 0L;
int Soft_Label_Key_Set::num_labels = 0;
-Soft_Label_Key_Set::Label_Layout
+Soft_Label_Key_Set::Label_Layout
Soft_Label_Key_Set::format = None;
void Soft_Label_Key_Set::init() {
diff --git a/contrib/ncurses/c++/cursslk.h b/contrib/ncurses/c++/cursslk.h
index 1598b0634bab..79fa9936fa94 100644
--- a/contrib/ncurses/c++/cursslk.h
+++ b/contrib/ncurses/c++/cursslk.h
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * 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 *
@@ -31,17 +31,17 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-// $Id: cursslk.h,v 1.5 1999/05/16 17:30:08 juergen Exp $
+// $Id: cursslk.h,v 1.7 2001/03/24 21:41:47 tom Exp $
-#ifndef _CURSSLK_H
-#define _CURSSLK_H
+#ifndef NCURSES_CURSSLK_H_incl
+#define NCURSES_CURSSLK_H_incl
#include <cursesw.h>
-class Soft_Label_Key_Set {
+class NCURSES_IMPEXP Soft_Label_Key_Set {
public:
// This inner class represents the attributes of a Soft Label Key (SLK)
- class Soft_Label_Key {
+ class NCURSES_IMPEXP Soft_Label_Key {
friend class Soft_Label_Key_Set;
public:
typedef enum { Left=0, Center=1, Right=2 } Justification;
@@ -83,10 +83,10 @@ public:
} Label_Layout;
private:
- static long count; // Number of Key Sets
- static Label_Layout format; // Layout of the Key Sets
- static int num_labels; // Number Of Labels in Key Sets
- bool b_attrInit; // Are attributes initialized
+ static long NCURSES_IMPEXP count; // Number of Key Sets
+ static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets
+ static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets
+ bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized
Soft_Label_Key *slk_array; // The array of SLK's
@@ -126,12 +126,12 @@ public:
// This constructor assumes, that you already constructed a Key Set
// with a layout by the constructor above. This layout will be reused.
- Soft_Label_Key_Set();
+ NCURSES_IMPEXP Soft_Label_Key_Set();
virtual ~Soft_Label_Key_Set();
// Get Label# i. Label counting starts with 1!
- Soft_Label_Key& operator[](int i);
+ NCURSES_IMPEXP Soft_Label_Key& operator[](int i);
// Retrieve number of Labels
inline int labels() const { return num_labels; }
@@ -202,4 +202,4 @@ public:
}
};
-#endif // _CURSSLK_H
+#endif // NCURSES_CURSSLK_H_incl
diff --git a/contrib/ncurses/c++/demo.cc b/contrib/ncurses/c++/demo.cc
index 088dc2fbc86d..8db700019b56 100644
--- a/contrib/ncurses/c++/demo.cc
+++ b/contrib/ncurses/c++/demo.cc
@@ -6,7 +6,7 @@
* Demo code for NCursesMenu and NCursesForm written by
* Juergen Pfeifer <juergen.pfeifer@gmx.net>
*
- * $Id: demo.cc,v 1.18 1999/09/11 18:57:54 tom Exp $
+ * $Id: demo.cc,v 1.20 2001/01/28 02:26:27 tom Exp $
*/
#include "cursesapp.h"
diff --git a/contrib/ncurses/c++/edit_cfg.sh b/contrib/ncurses/c++/edit_cfg.sh
index efea83323b11..e2f828a86134 100755
--- a/contrib/ncurses/c++/edit_cfg.sh
+++ b/contrib/ncurses/c++/edit_cfg.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: edit_cfg.sh,v 1.8 2000/07/01 16:07:37 tom Exp $
+# $Id: edit_cfg.sh,v 1.10 2001/04/07 22:45:11 tom Exp $
##############################################################################
# Copyright (c) 1998,2000 Free Software Foundation, Inc. #
# #
@@ -42,10 +42,13 @@ for name in \
ETIP_NEEDS_MATH_EXCEPTION \
ETIP_NEEDS_MATH_H \
HAVE_BUILTIN_H \
- HAVE_GXX_BUILTIN_H \
HAVE_GPP_BUILTIN_H \
+ HAVE_GXX_BUILTIN_H \
+ HAVE_STRSTREAM_H \
HAVE_TYPEINFO \
- HAVE_VALUES_H
+ HAVE_VALUES_H \
+ USE_STDIO_VSCAN \
+ USE_STRSTREAM_VSCAN
do
mv $2 $2.bak
if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null)
diff --git a/contrib/ncurses/c++/etip.h.in b/contrib/ncurses/c++/etip.h.in
index 985cd1eb6a06..d3421d2c5f06 100644
--- a/contrib/ncurses/c++/etip.h.in
+++ b/contrib/ncurses/c++/etip.h.in
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998,1999 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,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 *
@@ -31,10 +31,10 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-// $Id: etip.h.in,v 1.13 1999/09/12 02:01:59 tom Exp $
+// $Id: etip.h.in,v 1.18 2001/04/07 22:45:04 tom Exp $
-#ifndef _ETIP_H
-#define _ETIP_H
+#ifndef NCURSES_ETIP_H_incl
+#define NCURSES_ETIP_H_incl 1
// These are substituted at configure/build time
#ifndef HAVE_BUILTIN_H
@@ -49,6 +49,10 @@
#define HAVE_GPP_BUILTIN_H 0
#endif
+#ifndef HAVE_STRSTREAM_H
+#define HAVE_STRSTREAM_H 0
+#endif
+
#ifndef HAVE_TYPEINFO
#define HAVE_TYPEINFO 0
#endif
@@ -69,6 +73,14 @@
#define CPP_HAS_PARAM_INIT 0
#endif
+#ifndef USE_STDIO_VSCAN
+#define USE_STDIO_VSCAN 0
+#endif
+
+#ifndef USE_STRSTREAM_VSCAN
+#define USE_STRSTREAM_VSCAN 0
+#endif
+
#ifdef __GNUG__
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
# if HAVE_TYPEINFO
@@ -104,6 +116,8 @@
# include <string.h>
#endif
+#include <ncurses_dll.h>
+
extern "C" {
#if HAVE_VALUES_H
# include <values.h>
@@ -122,11 +136,11 @@ extern "C" {
#endif
// Forward Declarations
-class NCursesPanel;
-class NCursesMenu;
-class NCursesForm;
+class NCURSES_IMPEXP NCursesPanel;
+class NCURSES_IMPEXP NCursesMenu;
+class NCURSES_IMPEXP NCursesForm;
-class NCursesException
+class NCURSES_IMPEXP NCursesException
{
public:
const char *message;
@@ -145,30 +159,30 @@ public:
}
};
-class NCursesPanelException : public NCursesException
+class NCURSES_IMPEXP NCursesPanelException : public NCursesException
{
public:
const NCursesPanel* p;
- NCursesPanelException (const char *msg, int err) :
+ NCursesPanelException (const char *msg, int err) :
NCursesException (msg, err),
p ((NCursesPanel*)0)
{};
NCursesPanelException (const NCursesPanel* panel,
const char *msg,
- int err) :
+ int err) :
NCursesException (msg, err),
p (panel)
{};
- NCursesPanelException (int err) :
+ NCursesPanelException (int err) :
NCursesException ("panel library error", err),
p ((NCursesPanel*)0)
{};
NCursesPanelException (const NCursesPanel* panel,
- int err) :
+ int err) :
NCursesException ("panel library error", err),
p (panel)
{};
@@ -179,30 +193,30 @@ public:
};
-class NCursesMenuException : public NCursesException
+class NCURSES_IMPEXP NCursesMenuException : public NCursesException
{
public:
const NCursesMenu* m;
- NCursesMenuException (const char *msg, int err) :
+ NCursesMenuException (const char *msg, int err) :
NCursesException (msg, err),
m ((NCursesMenu *)0)
{};
NCursesMenuException (const NCursesMenu* menu,
const char *msg,
- int err) :
+ int err) :
NCursesException (msg, err),
m (menu)
{};
- NCursesMenuException (int err) :
+ NCursesMenuException (int err) :
NCursesException ("menu library error", err),
m ((NCursesMenu *)0)
{};
NCursesMenuException (const NCursesMenu* menu,
- int err) :
+ int err) :
NCursesException ("menu library error", err),
m (menu)
{};
@@ -213,30 +227,30 @@ public:
};
-class NCursesFormException : public NCursesException
+class NCURSES_IMPEXP NCursesFormException : public NCursesException
{
public:
const NCursesForm* f;
- NCursesFormException (const char *msg, int err) :
+ NCursesFormException (const char *msg, int err) :
NCursesException (msg, err),
f ((NCursesForm*)0)
{};
NCursesFormException (const NCursesForm* form,
const char *msg,
- int err) :
+ int err) :
NCursesException (msg, err),
f (form)
{};
- NCursesFormException (int err) :
+ NCursesFormException (int err) :
NCursesException ("form library error", err),
f ((NCursesForm*)0)
{};
NCursesFormException (const NCursesForm* form,
- int err) :
+ int err) :
NCursesException ("form library error", err),
f (form)
{};
@@ -265,9 +279,9 @@ inline void THROW(const NCursesException *e) {
if (e)
cerr << e->message << endl;
exit(0);
-#endif
+#endif
}
#define THROWS(s)
-#endif // _ETIP_H
+#endif // NCURSES_ETIP_H_incl
diff --git a/contrib/ncurses/c++/internal.h b/contrib/ncurses/c++/internal.h
index 67bc3ff2469e..6009027c929a 100644
--- a/contrib/ncurses/c++/internal.h
+++ b/contrib/ncurses/c++/internal.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000,2001 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,10 +31,12 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
-// $Id: internal.h,v 1.6 2000/09/02 18:22:23 tom Exp $
+// $Id: internal.h,v 1.8 2001/03/24 21:36:17 tom Exp $
-#ifndef _CPLUS_INTERNAL_H
-#define _CPLUS_INTERNAL_H 1
+#ifndef NCURSES_CPLUS_INTERNAL_H
+#define NCURSES_CPLUS_INTERNAL_H 1
+
+#include <ncurses_cfg.h>
#if USE_RCS_IDS
#define MODULE_ID(id) static const char Ident[] = id;
@@ -44,4 +46,4 @@
#define CTRL(x) ((x) & 0x1f)
-#endif
+#endif // NCURSES_CPLUS_INTERNAL_H