From 65fa6f2f0045a61896c3875d09519407e559aba7 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 24 Mar 2001 13:12:26 +0000 Subject: [PATCH] fg_traits.hxx -> sg_traits.hxx fg_zlib.hxx -> sg_zlib.hxx --- simgear/Makefile.am | 2 +- simgear/debug/logstream.hxx | 45 +++++++++--- simgear/ephemeris/ephemeris.hxx | 3 + simgear/fg_zlib.h | 87 ---------------------- simgear/math/interpolater.cxx | 2 +- simgear/misc/zfstream.hxx | 2 +- simgear/{fg_traits.hxx => sg_traits.hxx} | 11 ++- simgear/sg_zlib.h | 92 ++++++++++++++++++++++++ 8 files changed, 142 insertions(+), 102 deletions(-) delete mode 100644 simgear/fg_zlib.h rename simgear/{fg_traits.hxx => sg_traits.hxx} (68%) create mode 100644 simgear/sg_zlib.h diff --git a/simgear/Makefile.am b/simgear/Makefile.am index 7d62acec..dc6e96d2 100644 --- a/simgear/Makefile.am +++ b/simgear/Makefile.am @@ -22,7 +22,7 @@ METAR_DIRS = metar EXTRA_DIST = version.h.in include_HEADERS = \ - compiler.h constants.h fg_traits.hxx fg_zlib.h inlines.h version.h + compiler.h constants.h inlines.h sg_traits.hxx sg_zlib.h version.h SUBDIRS = \ bucket \ diff --git a/simgear/debug/logstream.hxx b/simgear/debug/logstream.hxx index c640461a..e2977bf6 100644 --- a/simgear/debug/logstream.hxx +++ b/simgear/debug/logstream.hxx @@ -42,7 +42,7 @@ # include #else # include -# include +# include #endif #include @@ -92,13 +92,24 @@ public: /** Is logging enabled? */ bool enabled() { return logging_enabled; } - /** Set the logging level of subsequent messages. */ + /** + * Set the logging level of subsequent messages. + * @param c debug class + * @param p priority + */ void set_log_state( sgDebugClass c, sgDebugPriority p ); - /** Set the global logging level. */ + /** + * Set the global logging level. + * @param c debug class + * @param p priority + */ static void set_log_level( sgDebugClass c, sgDebugPriority p ); - /** Set the stream buffer */ + /** + * Set the stream buffer + * @param sb stream buffer + */ void set_sb( streambuf* sb ); protected: @@ -181,19 +192,32 @@ struct logstream_base class logstream : private logstream_base, public ostream { public: - /** The default is to send messages to cerr. */ + /** + * The default is to send messages to cerr. + * @param out output stream + */ logstream( ostream& out ) // : logstream_base(out.rdbuf()), : logstream_base(), ostream(&lbuf) { lbuf.set_sb(out.rdbuf());} - /** Set the output stream */ + /** + * Set the output stream + * @param out output stream + */ void set_output( ostream& out ) { lbuf.set_sb( out.rdbuf() ); } - /** Set the global log class and priority level. */ + /** + * Set the global log class and priority level. + * @param c debug class + * @param p priority + */ void setLogLevels( sgDebugClass c, sgDebugPriority p ); - /** Output operator to capture the debug level and priority of a message. */ + /** + * Output operator to capture the debug level and priority of a message. + * @param l log level + */ inline ostream& operator<< ( const loglevel& l ); }; @@ -219,7 +243,10 @@ sglog() /** \def SG_LOG(C,P,M) - * Log a message = M of class = C and priority = P + * Log a message. + * @param C debug class + * @param P priority + * @param M message */ #ifdef FG_NDEBUG # define SG_LOG(C,P,M) diff --git a/simgear/ephemeris/ephemeris.hxx b/simgear/ephemeris/ephemeris.hxx index 6f487c3e..664b5c5f 100644 --- a/simgear/ephemeris/ephemeris.hxx +++ b/simgear/ephemeris/ephemeris.hxx @@ -50,6 +50,9 @@ /** Ephemeris class + * + * Written by Durk Talsma and Curtis Olson + * * * Introduction * diff --git a/simgear/fg_zlib.h b/simgear/fg_zlib.h deleted file mode 100644 index fb4178b4..00000000 --- a/simgear/fg_zlib.h +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************** - * fg_zlib.h -- a zlib wrapper to replace zlib calls with normal uncompressed - * calls for systems that have problems building zlib. - * - * Written by Curtis Olson, started April 1998. - * - * Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * $Id$ - **************************************************************************/ - - -#ifndef _FG_ZLIB_H -#define _FG_ZLIB_H - - -#ifdef HAVE_CONFIG_H -# include -#endif - - -#ifdef AVOID_USING_ZLIB - - #include - - #define fgFile FILE * - - /* fgFile fgopen(char *filename, const char *flags) */ - #define fgopen(P, F) (fopen((P), (F))) - - /* int fgseek(fgFile *file, long offset, int whence) */ - #define fgseek(F, O, W) (fseek((F), (O), (W))) - - /* fgread(fgFile file, void *buf, int size); */ - #define fgread(F, B, S) (fread((B), (S), 1, (F))) - - /* int fggets(fgFile fd, char *buffer, int len) */ - #define fggets(F, B, L) (fgets((B), (L), (F))) - - /* int fgclose(fgFile fd) */ - #define fgclose(F) (fclose((F))) -#else - -#ifdef HAVE_ZLIB - #include -#else - #include -#endif - - #define fgFile gzFile - - /* fgFile fgopen(char *filename, const char *flags) */ - #define fgopen(P, F) (gzopen((P), (F))) - - /* int fgseek(fgFile *file, long offset, int whence) */ - #define fgseek(F, O, W) (gzseek((F), (O), (W))) - - /* fgread(fgFile file, void *buf, int size); */ - #define fgread(F, B, S) (gzread((F), (B), (S))) - - /* int fggets(fgFile fd, char *buffer, int len) */ - #define fggets(F, B, L) (gzgets((F), (B), (L))) - - /* int fgclose(fgFile fd) */ - #define fgclose(F) (gzclose((F))) - -#endif /* #ifdef AVOID_USING_ZLIB #else #endif */ - - -#endif /* _FG_ZLIB_H */ - - diff --git a/simgear/math/interpolater.cxx b/simgear/math/interpolater.cxx index 064443ad..52410453 100644 --- a/simgear/math/interpolater.cxx +++ b/simgear/math/interpolater.cxx @@ -30,7 +30,7 @@ #include STL_STRING -#include +// depricated - #include #include #include diff --git a/simgear/misc/zfstream.hxx b/simgear/misc/zfstream.hxx index 3c2ce34f..ddd63011 100644 --- a/simgear/misc/zfstream.hxx +++ b/simgear/misc/zfstream.hxx @@ -92,7 +92,7 @@ SG_USING_STD(streamoff); # define ios_badbit ios::badbit # define ios_failbit ios::failbit -# include +# include #endif // SG_HAVE_STD_INCLUDES diff --git a/simgear/fg_traits.hxx b/simgear/sg_traits.hxx similarity index 68% rename from simgear/fg_traits.hxx rename to simgear/sg_traits.hxx index ed8c926a..500f739a 100644 --- a/simgear/fg_traits.hxx +++ b/simgear/sg_traits.hxx @@ -1,5 +1,10 @@ -#ifndef _FG_TRAITS_HXX -#define _FG_TRAITS_HXX +/** \file sg_traits.hxx + * Provides a char_traits declaration for systems without it. + * \internal + */ + +#ifndef _SG_TRAITS_HXX +#define _SG_TRAITS_HXX #include @@ -20,4 +25,4 @@ struct char_traits }; #endif // SG_HAVE_TRAITS -#endif // _FG_TRAITS_HXX +#endif // _SG_TRAITS_HXX diff --git a/simgear/sg_zlib.h b/simgear/sg_zlib.h new file mode 100644 index 00000000..c8b41e06 --- /dev/null +++ b/simgear/sg_zlib.h @@ -0,0 +1,92 @@ +/** + * \file sg_zlib.h + * A file IO wrapper system that can select at compile time if the system + * should use zlib calls or normal uncompressed calls for systems that have + * problems building zlib. + * Define AVOID_USING_ZLIB to use standard uncompressed calls. + */ + +/* + * Written by Curtis Olson, started April 1998. + * + * Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * $Id$ + **************************************************************************/ + + +#ifndef _SG_ZLIB_H +#define _SG_ZLIB_H + + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#ifdef AVOID_USING_ZLIB + + #include + + #define sgFile FILE * + + /* sgFile sgopen(char *filename, const char *flags) */ + #define sgopen(P, F) (fopen((P), (F))) + + /* int sgseek(sgFile *file, long offset, int whence) */ + #define sgseek(F, O, W) (fseek((F), (O), (W))) + + /* sgread(sgFile file, void *buf, int size); */ + #define sgread(F, B, S) (fread((B), (S), 1, (F))) + + /* int sggets(sgFile fd, char *buffer, int len) */ + #define sggets(F, B, L) (sgets((B), (L), (F))) + + /* int sgclose(sgFile fd) */ + #define sgclose(F) (fclose((F))) +#else + +#ifdef HAVE_ZLIB + #include +#else + #include +#endif + + #define sgFile gzFile + + /* sgFile sgopen(char *filename, const char *flags) */ + #define sgopen(P, F) (gzopen((P), (F))) + + /* int sgseek(sgFile *file, long offset, int whence) */ + #define sgseek(F, O, W) (gzseek((F), (O), (W))) + + /* sgread(sgFile file, void *buf, int size); */ + #define sgread(F, B, S) (gzread((F), (B), (S))) + + /* int sggets(sgFile fd, char *buffer, int len) */ + #define sggets(F, B, L) (gzgets((F), (B), (L))) + + /* int sgclose(sgFile fd) */ + #define sgclose(F) (gzclose((F))) + +#endif /* #ifdef AVOID_USING_ZLIB #else #endif */ + + +#endif /* _SG_ZLIB_H */ + + -- 2.39.5