Index: tol/btol/bdb/filehandle.cpp
===================================================================
--- tol/btol/bdb/filehandle.cpp	(revision d794d035c509d34bf2e9a2fa43de33978fecf441)
+++ tol/btol/bdb/filehandle.cpp	(revision b67be8d0ab9be6e652f31771294c86ccdbeb979a)
@@ -25,4 +25,5 @@
 
 
+#include <tol/tol_filehandle.h>
 #include <tol/tol_bout.h>
 #include <tol/tol_btxtgra.h>
@@ -39,23 +40,10 @@
 BTraceInit("file.cpp");
 
-/////////////////////////////////////////////////////////////////////////////
-struct BFileDesc
-/////////////////////////////////////////////////////////////////////////////
-{
-  FILE* file_;
-  BText path_;
-  BFileDesc(FILE* file, BText path)
-  : file_(file),
-    path_(path)
-  { }
-};
-
-BFileDesc noFileDesc_(NULL,"");
-
-typedef hash_map_by_int <BFileDesc*>::dense_ BFileHashByHandle;
-
-
-/////////////////////////////////////////////////////////////////////////////
-static BFileHashByHandle& FileHandle()
+
+BFileDesc BFileDesc::noFileDesc_(NULL,"");
+
+
+/////////////////////////////////////////////////////////////////////////////
+BFileDesc::BFileHashByHandle& BFileDesc::FileHandle()
 /////////////////////////////////////////////////////////////////////////////
 {
@@ -73,6 +61,6 @@
 
 /////////////////////////////////////////////////////////////////////////////
-static FILE* CheckFileHandle(int handle, bool verbose, const BText& msg, 
-                             BFileHashByHandle::const_iterator& found)
+ FILE* BFileDesc::CheckFileHandle(int handle, bool verbose, const BText& msg, 
+                                  BFileHashByHandle::const_iterator& found)
 /////////////////////////////////////////////////////////////////////////////
 {
@@ -96,5 +84,5 @@
 
 /////////////////////////////////////////////////////////////////////////////
-static FILE* CheckFileHandle(int handle, bool verbose, const BText& msg)
+FILE* BFileDesc::CheckFileHandle(int handle, bool verbose, const BText& msg)
 /////////////////////////////////////////////////////////////////////////////
 {
@@ -104,5 +92,5 @@
 
 /////////////////////////////////////////////////////////////////////////////
-void SysChkErrNo(bool clean, bool verbose, const BText& msg)
+void BFileDesc::SysChkErrNo(bool clean, bool verbose, const BText& msg)
 /////////////////////////////////////////////////////////////////////////////
 {
@@ -145,5 +133,5 @@
   if(Arg(2)) { verbose = int(Real(Arg(2)))!=0; }
   contens_ = errno;
-  SysChkErrNo(clean, verbose, "");
+  BFileDesc::SysChkErrNo(clean, verbose, "");
 }
 
@@ -215,9 +203,9 @@
   {
     handle = fileno(file);
-    FileHandle()[handle] = new BFileDesc(file, path);
+    BFileDesc::FileHandle()[handle] = new BFileDesc(file, path);
   }
   else
   {
-    SysChkErrNo(clean, verbose, 
+    BFileDesc::SysChkErrNo(clean, verbose, 
       I2("Fail in ","Fallo en ")+
       "FOpen(\""+path+"\",\""+access+"\")");
@@ -245,5 +233,5 @@
   contens_ = "";
    
-  FILE* file = CheckFileHandle(handle,true,
+  FILE* file = BFileDesc::CheckFileHandle(handle,true,
                                I2("Fail in ","Fallo en ")+"FGetText");
   if(file)
@@ -266,5 +254,5 @@
   BText& txt    = Text(Arg(2));
   contens_ = EOF;
-  FILE* file = CheckFileHandle(handle,true,
+  FILE* file = BFileDesc::CheckFileHandle(handle,true,
                                I2("Fail in ","Fallo en ")+"FPutText");
   if(file)
@@ -288,5 +276,5 @@
   int handle  = (int)Real(Arg(1));
   contens_ = EOF;
-  FILE* file = CheckFileHandle(handle, true,
+  FILE* file = BFileDesc::CheckFileHandle(handle, true,
                                I2("Fail in ","Fallo en ")+"FEof");
   if(file)
@@ -320,5 +308,5 @@
   else
   {
-    FILE* file = CheckFileHandle(handle, true,
+    FILE* file = BFileDesc::CheckFileHandle(handle, true,
                                  I2("Fail in ","Fallo en ")+"FFlush");
     if(file)
@@ -350,7 +338,7 @@
   if(Arg(3)) { verbose = int(Real(Arg(3)))!=0; }
   contens_ = EOF;
-  BFileHashByHandle::const_iterator found;
+  BFileDesc::BFileHashByHandle::const_iterator found;
   BText failMsg = I2("Fail in ","Fallo en ")+"FClose";
-  FILE* file = CheckFileHandle(handle, true, failMsg, found);
+  FILE* file = BFileDesc::CheckFileHandle(handle, true, failMsg, found);
   if(file)
   {
@@ -359,9 +347,9 @@
     if(!fc)
     {
-      FileHandle().erase(found->first);
+      BFileDesc::FileHandle().erase(found->first);
     }
     else
     {
-      SysChkErrNo(clean, verbose, failMsg);
+      BFileDesc::SysChkErrNo(clean, verbose, failMsg);
     }
   }
Index: tol/btol/bdb/tol_filehandle.h
===================================================================
--- tol/btol/bdb/tol_filehandle.h	(revision b67be8d0ab9be6e652f31771294c86ccdbeb979a)
+++ tol/btol/bdb/tol_filehandle.h	(revision b67be8d0ab9be6e652f31771294c86ccdbeb979a)
@@ -0,0 +1,55 @@
+/* tol_filehandle.h:  Input-Output built-in TOL functions.
+            GNU/TOL Language.
+
+   Copyright (C) 2003 - Bayes Decision, SL (Spain [EU])
+
+   This program 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.
+
+   This program 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 this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+   USA.
+ */
+
+#if defined(_MSC_VER)
+#include <win_tolinc.h>
+#endif
+
+
+#include <tol/tol_btext.h>
+#include <tol/tol_hash_map.h>
+
+/////////////////////////////////////////////////////////////////////////////
+class BFileDesc
+/////////////////////////////////////////////////////////////////////////////
+{
+public:
+  typedef hash_map_by_int <BFileDesc*>::dense_ BFileHashByHandle;
+  static BFileDesc noFileDesc_;
+
+  FILE* file_;
+  BText path_;
+  BFileDesc(FILE* file, BText path)
+  : file_(file),
+    path_(path)
+  { }
+
+  static BFileHashByHandle& FileHandle();
+  static FILE* CheckFileHandle(int handle, bool verbose, const BText& msg, 
+                             BFileHashByHandle::const_iterator& found);
+
+  static FILE* CheckFileHandle(int handle, bool verbose, const BText& msg);
+  static void SysChkErrNo(bool clean, bool verbose, const BText& msg);
+
+};
+
+
+
