Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 7434)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 7438)
@@ -15,4 +15,7 @@
 #pragma link C++ class MLogPlugin+;
 #pragma link C++ class MLogHtml+;
+
+// I/O
+#pragma link C++ class MZlib+;
 
 // Basic Network Tools
Index: trunk/MagicSoft/Mars/mbase/MDirIter.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MDirIter.cc	(revision 7434)
+++ trunk/MagicSoft/Mars/mbase/MDirIter.cc	(revision 7438)
@@ -223,5 +223,4 @@
     n.ReplaceAll("+", "\\+");
     n.ReplaceAll("*", "[^\\/:]*");
-    n.ReplaceAll("?", ".");
     n.Append("$");
 
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 7434)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 7438)
@@ -173,5 +173,5 @@
 // which is used for the output (i)
 //
-MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
+MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -183,5 +183,5 @@
 // ofstream as the default output device
 //
-MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
+MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -193,5 +193,5 @@
 // TGTextView as the default output device
 //
-MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
+MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
 {
     Init();
@@ -204,5 +204,5 @@
 // or not.
 //
-MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
+MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
Index: trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.h	(revision 7434)
+++ trunk/MagicSoft/Mars/mbase/MLog.h	(revision 7438)
@@ -13,5 +13,4 @@
 #include <iostream>  // base classes for MLog
 
-#define bsz    160 // two standard lines
 
 class MArgs;
@@ -54,6 +53,8 @@
     static const char *const kDark;
 
+    static const int fgBufferSize = 160;  // two standard lines
+
     char        fBuffer;      //!
-    char        fBase[bsz+1]; //! Buffer to store the data in
+    char        fBase[fgBufferSize+1]; //! Buffer to store the data in
     char       *fPPtr;        //! Pointer to present position in buffer
     const char *fEPtr;        //! Pointer to end of buffer
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7434)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7438)
@@ -722,6 +722,6 @@
     // set the smallest and biggest size of the Main frame
     // and move it to its appearance position
-    SetWMSizeHints(571, 480, 2048, 1536, 1, 1);
-    MoveResize(rand()%100+571, rand()%100+480, 570, 480);
+    SetWMSizeHints(572, 480, 2048, 1536, 1, 1);
+    MoveResize(rand()%100+572, rand()%100+480, 572, 480);
 
     //
@@ -998,4 +998,5 @@
 
     c.SetFillColor(16/*165*//*17*//*203*/);
+    c.SetFrameBorderMode(0);
     c.SetBorderMode(0);
 
@@ -1589,5 +1590,5 @@
 
     case kSize640:  
-        Resize(571, 480);
+        Resize(572, 480);
         return kTRUE;
     case kSize768:  
Index: trunk/MagicSoft/Mars/mbase/MZlib.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MZlib.cc	(revision 7438)
+++ trunk/MagicSoft/Mars/mbase/MZlib.cc	(revision 7438)
@@ -0,0 +1,159 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 12/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// MZlib
+//
+// This is a C++ wrapper for zlib (taken from root)
+//
+// WARNING: - There might not be support for all features.
+//          - seek calls might be rather slow
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MZlib.h"
+
+ClassImp(MZlib);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Open a file by name. Test if it is open like for an ifstream
+// It doesn't matter whether the file is gzip compressed or not.
+//
+void MZlib::open(const char* name)
+{
+    if (is_open())
+    {
+        clear(rdstate()|ios::badbit);
+        return;
+    }
+
+    fFile = gzopen(name, "rb0");
+    if (fFile == 0)
+    {
+        clear(rdstate()|ios::badbit);
+        return;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Close an open file.
+//
+void MZlib::close()
+{
+    if (!is_open())
+        return;
+
+    sync();
+
+    if (gzclose(fFile) != Z_OK)
+        clear(rdstate()|ios::badbit);
+
+    fFile = 0;
+}
+
+// --------------------------------------------------------------------------
+//
+int MZlib::underflow()
+{
+    if (gptr() && gptr()<egptr())
+        return * reinterpret_cast<unsigned char *>(gptr());
+
+    if (!is_open())
+        return EOF;
+
+    // implementation of inbuf
+    const int putback = gptr()-eback()>4 ? 4 : gptr()-eback();
+
+    memcpy(fBuffer+(4-putback), gptr()-putback, putback);
+
+    const int num = gzread(fFile, fBuffer+4, fgBufferSize-4);
+    if (num <= 0) // ERROR or EOF
+        return EOF;
+
+    // reset buffer pointers
+    setg(fBuffer+(4-putback), fBuffer+4, fBuffer+4+num);
+
+    // return next character
+    return *reinterpret_cast<unsigned char *>(gptr());
+}
+
+// --------------------------------------------------------------------------
+//
+int MZlib::flush_buffer()
+{
+    // Separate the writing of the buffer from overflow() and sync() operation.
+    const int w = pptr() - pbase();
+
+    if (gzwrite(fFile, pbase(), w) != w)
+        return EOF;
+
+    pbump(-w);
+
+    return w;
+}
+
+/*
+int MZlib::overflow( int c)
+{
+    if ( ! ( mode & ios::out) || ! opened)
+        return EOF;
+
+    if (c != EOF)
+    {
+        *pptr() = c;
+        pbump(1);
+
+    }
+    if ( flush_buffer() == EOF)
+        return EOF;
+
+    return c;
+}
+*/
+
+// --------------------------------------------------------------------------
+//
+int MZlib::sync()
+{
+    // Use flush_buffer() instead of overflow(EOF) to
+    // cause proper behavior with std::endl and flush()
+    if (pptr() && pptr()>pbase())
+    {
+        if (flush_buffer() == EOF)
+            return -1;
+    }
+    return 0;
+}
+
+// --------------------------------------------------------------------------
+//
+streambuf::pos_type MZlib::seekoff(streambuf::off_type offset, ios_base::seekdir dir, ios_base::openmode)
+{
+    return gzseek(fFile, offset, dir);
+}
Index: trunk/MagicSoft/Mars/mbase/MZlib.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MZlib.h	(revision 7438)
+++ trunk/MagicSoft/Mars/mbase/MZlib.h	(revision 7438)
@@ -0,0 +1,56 @@
+#ifndef MARS_MZlib
+#define MARS_MZlib
+
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif
+
+#ifdef __CINT__
+typedef void *gzFile;
+#else
+#include <zlib.h>
+#endif
+
+#include <iostream>  // base classes for MLog
+
+class MZlib : public std::streambuf, virtual public std::istream, public TObject
+{
+private:
+    static const int fgBufferSize = 47+256; // size of data buff totals 512 bytes under g++ for igzstream at the end.
+
+    gzFile fFile;                 // file handle for compressed file
+    char   fBuffer[fgBufferSize]; // data buffer
+
+    int flush_buffer();
+    int underflow();
+    int sync();
+
+public:
+    MZlib() : istream(this), fFile(0)
+    {
+        setp(fBuffer,   fBuffer+fgBufferSize-1);
+        setg(fBuffer+4, fBuffer+4, fBuffer+4);
+    }
+    MZlib(const char *name) : istream(this), fFile(0)
+    {
+        setp(fBuffer,   fBuffer+fgBufferSize-1);
+        setg(fBuffer+4, fBuffer+4, fBuffer+4);
+
+        open(name);
+    }
+    ~MZlib() { MZlib::close(); }
+
+    int is_open() { return fFile!=0; }
+
+    void open(const char* name);
+    void close();
+
+    std::streambuf::pos_type seekoff(std::streambuf::off_type, std::ios_base::seekdir,
+                                     std::ios_base::openmode = std::ios_base::in | std::ios_base::out);
+    //std::streambuf::pos_type seekpos(std::streambuf::pos_type,
+    //                                 std::ios_base::openmode = std::ios_base::in | std::ios_base::out);
+
+    ClassDef(MZlib, 0) // A C++ wrapper to istream zlib files
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 7434)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 7438)
@@ -59,5 +59,6 @@
            MClone.cc \
            MContinue.cc \
-           MPrint.cc
+           MPrint.cc \
+           MZlib.cc
 
 ############################################################
