# HG changeset patch # User jwe # Date 848531436 0 # Node ID 65e2cd433c7f3b10a6aacbcd7cfacab12a1f172c # Parent c5fdf05ee5da054e37bf69b92c7802a798e43f3b [project @ 1996-11-20 23:08:48 by jwe] diff --git a/libcruft/ChangeLog b/libcruft/ChangeLog --- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,15 @@ +Wed Nov 20 01:00:43 1996 John W. Eaton + + * misc/Makefile.in (install): Also install lo-error.h. + + * Makefile.in (MISC_OBJ): Add misc/f77-fcn.o. + + * misc/lo-error.h: New file, moved here from liboctave. + * misc/lo-error.c: Rename from lo-error.cc. Make this a C-file + instead of C++. + + * Version 1.93. + Tue Nov 19 23:04:24 1996 John W. Eaton * misc/Makefile.in: Add variables for installing things. diff --git a/libcruft/Makefile.in b/libcruft/Makefile.in --- a/libcruft/Makefile.in +++ b/libcruft/Makefile.in @@ -43,7 +43,8 @@ # XXX FIXME XXX -- this should build the shared library directly from # a normal archive file (created from PIC code, though). -MISC_OBJ := misc/machar.o misc/dostop.o misc/f77-extern.o misc/lo-error.o +MISC_OBJ := misc/machar.o misc/dostop.o misc/f77-extern.o \ + misc/f77-fcn.o misc/lo-error.o CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) diff --git a/libcruft/misc/Makefile.in b/libcruft/misc/Makefile.in --- a/libcruft/misc/Makefile.in +++ b/libcruft/misc/Makefile.in @@ -13,7 +13,7 @@ VPATH = @srcdir@ SPECIAL := machar.c d1mach-tst.for dostop.c f77-extern.cc \ - f77-fcn.c f77-fcn.h lo-error.cc + f77-fcn.c f77-fcn.h lo-error.c lo-error.h SPECIAL_DEPEND := d1mach.o machar.o dostop.o f77-extern.o \ f77-fcn.o lo-error.o @@ -41,6 +41,7 @@ install:: $(top_srcdir)/mkinstalldirs $(octincludedir) $(INSTALL_DATA) $(srcdir)/f77-fcn.h $(octincludedir)/f77-fcn.h + $(INSTALL_DATA) $(srcdir)/lo-error.h $(octincludedir)/lo-error.h uninstall:: rm -f $(octincludedir)/f77-fcn.h diff --git a/libcruft/misc/lo-error.c b/libcruft/misc/lo-error.c new file mode 100644 --- /dev/null +++ b/libcruft/misc/lo-error.c @@ -0,0 +1,75 @@ +/* + +Copyright (C) 1996 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "lo-error.h" + +// Having this file in this directory is a kluge to avoid unresolved +// symbol errors when creating shared versions of libcruft. + +// Pointer to the current error handling function. +liboctave_error_handler current_liboctave_error_handler = liboctave_fatal; + +static void +verror (const char *name, const char *fmt, va_list args) +{ + if (name) + fprintf (stderr, "%s: ", name); + + vfprintf (stderr, fmt, args); + fprintf (stderr, "\n"); + fflush (stderr); +} + +void +set_liboctave_error_handler (liboctave_error_handler f) +{ + if (f) + current_liboctave_error_handler = f; + else + current_liboctave_error_handler = liboctave_fatal; +} + +void +liboctave_fatal (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + verror ("fatal", fmt, args); + va_end (args); + + exit (1); +} + +/* +;;; Local Variables: *** +;;; mode: C *** +;;; page-delimiter: "^/\\*" *** +;;; End: *** +*/ diff --git a/libcruft/misc/lo-error.cc b/libcruft/misc/lo-error.cc deleted file mode 100644 --- a/libcruft/misc/lo-error.cc +++ /dev/null @@ -1,76 +0,0 @@ -//lo-error.cc -*- C++ -*- -/* - -Copyright (C) 1996 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "lo-error.h" - -// Having this file in this directory is a kluge to avoid unresolved -// symbol errors when creating shared versions of libcruft. - -// Pointer to the current error handling function. -liboctave_error_handler current_liboctave_error_handler = liboctave_fatal; - -static void -verror (const char *name, const char *fmt, va_list args) -{ - if (name) - fprintf (stderr, "%s: ", name); - - vfprintf (stderr, fmt, args); - fprintf (stderr, "\n"); - fflush (stderr); -} - -void -set_liboctave_error_handler (liboctave_error_handler f) -{ - if (f) - current_liboctave_error_handler = f; - else - current_liboctave_error_handler = liboctave_fatal; -} - -void -liboctave_fatal (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - verror ("fatal", fmt, args); - va_end (args); - - exit (1); -} - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; page-delimiter: "^/\\*" *** -;;; End: *** -*/ diff --git a/libcruft/misc/lo-error.h b/libcruft/misc/lo-error.h new file mode 100644 --- /dev/null +++ b/libcruft/misc/lo-error.h @@ -0,0 +1,50 @@ +/* + +Copyright (C) 1996 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#if !defined (octave_liboctave_error_h) +#define octave_liboctave_error_h 1 + +#ifdef __cplusplus +extern "C" { +#endif + +extern void liboctave_fatal (const char *fmt, ...) GCC_ATTR_NORETURN; + +typedef void (*liboctave_error_handler) (const char *, ...); + +/* Would be nice to make this private, but we want to share it among + all the liboctave classes. */ +extern liboctave_error_handler current_liboctave_error_handler; + +extern void set_liboctave_error_handler (liboctave_error_handler f); + +#ifdef __cplusplus +} +#endif + +#endif + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +Wed Nov 20 01:00:40 1996 John W. Eaton + + * Makefile.in (INCLUDES): Delete lo-error.h. + * lo-error.h: Delete (moved to libcruft/misc). + + * Version 1.93. + Tue Nov 19 23:07:45 1996 John W. Eaton * oct-glob.cc (glob_match::match): Don't expect our flag values to diff --git a/liboctave/Makefile.in b/liboctave/Makefile.in --- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -38,7 +38,7 @@ LinConst.h LP.h LPsolve.h LSODE.h NLConst.h NLEqn.h NLFunc.h \ NLP.h NPSOL.h ODE.h ODEFunc.h Objective.h QP.h QPSOL.h Quad.h \ Range.h base-de.h base-min.h byte-swap.h cmd-hist.h data-conv.h \ - dir-ops.h file-ops.h getopt.h idx-vector.h lo-error.h \ + dir-ops.h file-ops.h getopt.h idx-vector.h \ lo-ieee.h lo-mappers.h lo-utils.h mach-info.h oct-alloc.h \ oct-cmplx.h oct-glob.h oct-math.h oct-term.h pathsearch.h \ prog-args.h statdefs.h str-vec.h sun-utils.h sysdir.h \ diff --git a/liboctave/lo-error.h b/liboctave/lo-error.h deleted file mode 100644 --- a/liboctave/lo-error.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - -Copyright (C) 1996 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -#if !defined (octave_liboctave_error_h) -#define octave_liboctave_error_h 1 - -/* Tell g++ that fatal doesn't return */ - -#if defined (__GNUG__) -typedef void v_fcn_cpc_x (const char *, ...); -volatile v_fcn_cpc_x fatal; -#endif - -extern void liboctave_fatal (const char *fmt, ...); - -typedef void (*liboctave_error_handler) (const char *, ...); - -/* Would be nice to make this private, but we want to share it among - all the liboctave classes. */ -extern liboctave_error_handler current_liboctave_error_handler; - -extern void set_liboctave_error_handler (liboctave_error_handler f); - -#endif - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/