Index: trunk/SophyaExt/FitsIOServer/fitsbntbllinereader.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsbntbllinereader.cc	(revision 1048)
+++ trunk/SophyaExt/FitsIOServer/fitsbntbllinereader.cc	(revision 1136)
@@ -20,9 +20,10 @@
 
   //  FitsFile* fn=ReadFInit(inputfile,hdunum);
-  ReadFInit(inputfile,hdunum);
-
+  //  ReadFInit(inputfile,hdunum);
+  inFits_  = new FitsInFile (inputfile);
+  inFits_->ReadFInit(hdunum);
 
   //  if (!fn->IsFitsTable())
-  if (!IsFitsTable())
+  if (!inFits_->IsFitsTable())
     {
       throw PException("FITS_BntblLineReader: the fits file seems not to be a bintable nor ASCII table");
@@ -32,9 +33,9 @@
   int nbcols, nbentries;
   //  nbcols = fn->NbColsFromFits();
-  nbcols = NbColsFromFits();
+  nbcols = inFits_->NbColsFromFits();
   nbentries = 0;
   int k;
   //  for (k=0; k<nbcols; k++) nbentries=max( nbentries, fn->NentriesFromFits(k) );
-  for (k=0; k<nbcols; k++) nbentries=max( nbentries, NentriesFromFits(k) );
+  for (k=0; k<nbcols; k++) nbentries=max( nbentries, inFits_->NentriesFromFits(k) );
 
   //
@@ -53,5 +54,5 @@
     {
       //      char ss= fn->ColTypeFromFits(k);
-      char ss= ColTypeFromFits(k);
+      char ss= inFits_->ColTypeFromFits(k);
       if (ss == 'D') DfitsCol.push_back(k);
       else if (ss == 'E') FfitsCol.push_back(k);
@@ -69,5 +70,5 @@
       ColName_[compt] = new char[LONNOM+1]; 
       //      strncpy(ColName_[compt], fn->ColNameFromFits(DfitsCol[k]).c_str(), LONNOM);
-      strncpy(ColName_[compt], ColNameFromFits(DfitsCol[k]).c_str(), LONNOM);
+      strncpy(ColName_[compt], inFits_->ColNameFromFits(DfitsCol[k]).c_str(), LONNOM);
       ColName_[compt++][ LONNOM] =  '\0';
     }
@@ -76,5 +77,5 @@
       ColName_[compt] = new char[LONNOM+1]; 
       //      strncpy(ColName_[compt], fn->ColNameFromFits(FfitsCol[k]).c_str(), LONNOM);
-      strncpy(ColName_[compt], ColNameFromFits(FfitsCol[k]).c_str(), LONNOM);
+      strncpy(ColName_[compt], inFits_->ColNameFromFits(FfitsCol[k]).c_str(), LONNOM);
       ColName_[compt++][ LONNOM] =  '\0';
     }
@@ -83,5 +84,5 @@
       ColName_[compt] = new char[LONNOM+1]; 
       //      strncpy(ColName_[compt], fn->ColNameFromFits(IfitsCol[k]).c_str(), LONNOM);
-      strncpy(ColName_[compt], ColNameFromFits(IfitsCol[k]).c_str(), LONNOM);
+      strncpy(ColName_[compt], inFits_->ColNameFromFits(IfitsCol[k]).c_str(), LONNOM);
       ColName_[compt++][ LONNOM] =  '\0';
     }
@@ -90,5 +91,5 @@
       ColName_[compt] = new char[LONNOM+1]; 
       //      strncpy(ColName_[compt], fn->ColNameFromFits(SfitsCol[k]).c_str(), LONNOM);
-      strncpy(ColName_[compt], ColNameFromFits(SfitsCol[k]).c_str(), LONNOM);
+      strncpy(ColName_[compt], inFits_->ColNameFromFits(SfitsCol[k]).c_str(), LONNOM);
       ColName_[compt++][LONNOM] =  '\0';
     }
@@ -115,5 +116,5 @@
       taille_des_chaines_ = 0;
       //      for (k=0; k< ccount_; k++)  taille_des_chaines_ = max( taille_des_chaines_, fn->ColStringLengthFromFits(SfitsCol[k]) );
-      for (k=0; k< ccount_; k++)  taille_des_chaines_ = max( taille_des_chaines_, ColStringLengthFromFits(SfitsCol[k]) );
+      for (k=0; k< ccount_; k++)  taille_des_chaines_ = max( taille_des_chaines_, inFits_->ColStringLengthFromFits(SfitsCol[k]) );
       for (k=0; k<ccount_; k++) cdata_[k]=new char[taille_des_chaines_+1];
     }
@@ -123,4 +124,5 @@
 FITS_BntblLineReader::~FITS_BntblLineReader()
 {
+  if (inFits_ != NULL) delete inFits_;
   if (ddata_ != NULL) delete [] ddata_;
   if (fdata_ != NULL) delete [] fdata_;
@@ -147,5 +149,5 @@
 XNTuple FITS_BntblLineReader::ReadNextLine()
 {
-  GetBinTabLine(nextLineToBeRead_++, ddata_, fdata_, idata_, cdata_ );
+  inFits_->GetBinTabLine(nextLineToBeRead_++, ddata_, fdata_, idata_, cdata_ );
   XNTuple xnt(dcount_, fcount_, icount_,ccount_, ColName_); 
   xnt.Fill(ddata_, fdata_, idata_, cdata_);    
@@ -153,9 +155,9 @@
 }
 
-void  FITS_BntblLineReader::ReadFromFits()
+void  FITS_BntblLineReader::ReadFromFits(FitsInFile&)
 {   
 }
 
-void FITS_BntblLineReader::WriteToFits()
+void FITS_BntblLineReader::WriteToFits(FitsOutFile&)
 {
 }
