Index: trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.cc	(revision 1209)
+++ trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.cc	(revision 1209)
@@ -0,0 +1,154 @@
+#include "pexceptions.h"
+#include "fitsbntbllineRW.h"
+#include "utils.h"
+///////////////////////////////////////////////////////////
+//    
+//    
+///////////////////////////////////////////////////////////
+
+
+#define LONNOM 31 
+
+
+FITS_BntblLineReader::FITS_BntblLineReader()
+{
+  InitNull();
+}
+
+FITS_BntblLineReader::FITS_BntblLineReader(char inputfile[],int hdunum)
+{
+  InitNull();
+  inFits_  = new FitsInFile (inputfile);
+  inFits_->ReadFInit(hdunum);
+
+  //  if (!fn->IsFitsTable())
+  if (!inFits_->IsFitsTable())
+    {
+      throw PException("FITS_BntblLineReader: the fits file seems not to be a bintable nor ASCII table");
+    }
+
+  //
+  int nbcols, nbentries;
+  //  nbcols = fn->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, inFits_->NentriesFromFits(k) );
+
+  //
+  // pour mettre les colonnes dans l'ordre double, float, int, char :
+  // tableau de correspondance 
+  // DfitsCol(j)= numero dans le fichier fits de la  jeme variable double du 
+  // xntuple;
+  // FfitsCol(j)= numero dans le fichier fits de la  jeme variable float du 
+  // xntuple;
+  // etc.
+  vector<int> DfitsCol;
+  vector<int> FfitsCol;
+  vector<int> IfitsCol;
+  vector<int> SfitsCol;
+  for (k=0; k<nbcols;k++)
+    {
+      //      char ss= fn->ColTypeFromFits(k);
+      char ss= inFits_->ColTypeFromFits(k);
+      if (ss == 'D') DfitsCol.push_back(k);
+      else if (ss == 'E') FfitsCol.push_back(k);
+      else if (ss == 'I') IfitsCol.push_back(k);
+      else if (ss == 'S') SfitsCol.push_back(k);
+      else {
+	cout << " FITS_XNTuple: colonne fits " << k << " type= " << ss << endl;
+	throw  IOExc("type de champ inconnu");
+      }
+    }
+  vector<string> ColN(nbcols);
+  int compt=0;
+  for (k=0; k<DfitsCol.size(); k++)
+    {
+      ColN[compt++] = inFits_->ColNameFromFits(DfitsCol[k]);
+    }
+  for (k=0; k<FfitsCol.size(); k++)
+    {
+      ColN[compt++] =  inFits_->ColNameFromFits(FfitsCol[k]);
+    }
+  for (k=0; k<IfitsCol.size(); k++)
+    {
+      ColN[compt++] =  inFits_->ColNameFromFits(IfitsCol[k]);
+    }
+  for (k=0; k<SfitsCol.size(); k++)
+    {
+      ColN[compt++] = inFits_->ColNameFromFits(SfitsCol[k]);
+    }
+
+  ligne_.setFormat(DfitsCol.size(), FfitsCol.size(), IfitsCol.size(), SfitsCol.size(), ColN);
+}
+
+
+FITS_BntblLineReader::~FITS_BntblLineReader()
+{
+  if (inFits_ != NULL) delete inFits_;
+}
+
+BnTblLine& FITS_BntblLineReader::ReadNextLine()
+{
+  inFits_->GetBinTabLine(nextLineToBeRead_++, ligne_);
+  return ligne_;
+}
+
+
+
+FITS_BntblLineWriter::FITS_BntblLineWriter()
+{
+  InitNull();
+}
+
+FITS_BntblLineWriter::FITS_BntblLineWriter(char inputfile[],int dc, int fc,int ic, int cc, vector<string> names,  WriteMode wrm)
+{
+  int k;
+  int nbcols = dc+fc+ic+cc;
+  if (nbcols !=  names.size())
+    {
+      cout << " WARNING: BnTblLineWriter:: length of vector of column names not equal to total number of columns" << endl;
+    }
+  InitNull();
+  outFits_  = new FitsOutFile (inputfile, wrm);
+  string types;
+  vector<int> StringSizes(cc);
+  for (k=0; k<dc;k++)
+    {
+      types+='D';
+    }
+  for (k=0; k<fc;k++)
+    {
+      types+='E';
+    }
+  for (k=0; k<ic;k++)
+    {
+      types+='I';
+    }
+  for (k=0; k<cc;k++)
+    {
+      types+='A';
+      StringSizes[k] = names[dc+fc+ic+k].length();
+    }            
+  DVList dvl;
+  string extname("Lines_on_Binary_tbl"); 
+  outFits_->makeHeaderBntblOnFits(types, names, 1, nbcols, dvl, extname,StringSizes); 
+    ligne_.setFormat(dc, fc, ic, cc, names);
+
+}
+
+FITS_BntblLineWriter::~FITS_BntblLineWriter()
+{
+  if (outFits_ != NULL)  delete outFits_;
+}
+
+void FITS_BntblLineWriter::WriteNextLine( BnTblLine& WorkLine)
+{
+  if (! ligne_.sameFormat(WorkLine) )
+    {
+    	      throw PException("  FITS_BntblLineWriter:: line to be written does not match the header");
+    }
+  outFits_->PutBinTabLine(nextLineToBeWritten_++, WorkLine);
+
+}
Index: trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.h	(revision 1209)
+++ trunk/SophyaExt/FitsIOServer/fitsbntbllineRW.h	(revision 1209)
@@ -0,0 +1,91 @@
+// Guy Le Meur 06/2000
+
+
+#ifndef FITSBntblLineRW_SEEN
+#define FITSBntblLineRW_SEEN
+#include "fitsfile.h"
+//#include "xntuple.h"
+
+namespace SOPHYA {
+///////////////////////////////////////////////////////////
+//   Lecture ligne par ligne d'une BINTABLE sur fichier FITS 
+//   
+///////////////////////////////////////////////////////////
+
+class  FITS_BntblLineReader : public FitsIOHandler  
+{
+
+public:
+FITS_BntblLineReader();
+FITS_BntblLineReader(char inputfile[],int hdunum=2);
+~FITS_BntblLineReader();
+
+BnTblLine& ReadNextLine();
+ inline  BnTblLine& GetBnTblLine()  {return ligne_;}
+ inline long GetNextLineIndex() const {return nextLineToBeRead_;}
+ inline  void SetStartingLineIndex(long n)  { nextLineToBeRead_ = n;}
+
+ inline int status() const {return inFits_->statusF();};
+ inline string GetStatus(int status) const {return inFits_->GetErrStatus(status);}; 
+
+
+
+protected:
+
+  // implementation de  FitsIOHandler
+  virtual void  ReadFromFits(FitsInFile& is) {};
+virtual void    WriteToFits(FitsOutFile& os) {};
+
+ private :
+
+inline void InitNull()
+   {
+     inFits_ = NULL;
+     nextLineToBeRead_= 0;
+   }
+  // attributs de classe
+
+ FitsInFile* inFits_;
+  long nextLineToBeRead_;
+  BnTblLine ligne_;
+};
+
+
+//////////////////////////////////////////////////////////////////
+
+
+class  FITS_BntblLineWriter : public FitsIOHandler  
+{
+
+public:
+FITS_BntblLineWriter();
+ FITS_BntblLineWriter(char inputfile[],int dc, int fc, int ic, int cc, vector<string> names,  WriteMode wrm = clear);
+~FITS_BntblLineWriter();
+ void WriteNextLine( BnTblLine& WorkLine);
+
+ private :
+
+inline void InitNull()
+   {
+     outFits_ = NULL;
+     nextLineToBeWritten_= 0;
+   }
+
+protected:
+
+  // implementation de  FitsIOHandler
+  virtual void  ReadFromFits(FitsInFile& is) {};
+virtual void    WriteToFits(FitsOutFile& os) {};
+
+
+  // attributs de classe
+
+ FitsOutFile* outFits_;
+  long nextLineToBeWritten_;
+  BnTblLine ligne_;
+};
+
+
+} // Fin du namespace
+
+#endif
Index: trunk/SophyaExt/FitsIOServer/fitsfile.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 1208)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 1209)
@@ -80,5 +80,5 @@
 }
 
-string FitsFile::getErrStatus(int status) 
+string FitsFile::GetErrStatus(int status) 
 {
   char text[31];
@@ -131,14 +131,14 @@
 }
 
-void FitsInFile::getBlockType(char flnm[], int hdunum, string& typeOfExtension, int& naxis, vector<int>& naxisn, string& dataType, DVList& dvl )
+void FitsInFile::GetBlockType(char flnm[], int hdunum, string& typeOfExtension, int& naxis, vector<int>& naxisn, string& dataType, DVList& dvl )
 {
   int status = 0;
   fitsfile* fileptr; 
   fits_open_file(&fileptr,flnm,READONLY,&status);
-  if( status ) printerror( status, "getBlockType: erreur ouverture fichier" );
+  if( status ) printerror( status, "GetBlockType: erreur ouverture fichier" );
   // move to the specified HDU number
   int hdutype = 0;
   fits_movabs_hdu(fileptr,hdunum,&hdutype,&status);
-  if( status ) printerror( status,"getBlockType: erreur movabs");
+  if( status ) printerror( status,"GetBlockType: erreur movabs");
   if(hdutype == IMAGE_HDU) 
     {
@@ -154,5 +154,5 @@
 	    {
 	      cout << " bitpix= " << bitpix << endl;
-	      throw PException(" FitsFile::getBlockType : unsupprted FITS data type");
+	      throw PException(" FitsFile::GetBlockType : unsupprted FITS data type");
 	    }
       
@@ -186,5 +186,5 @@
 		    {
 		      cout << " types[0]= " << types[0] << endl;
-		      throw PException(" FitsFile::getBlockType : unsupprted FITS data type");
+		      throw PException(" FitsFile::GetBlockType : unsupprted FITS data type");
 	    }
 	  }
@@ -193,5 +193,5 @@
       {
 	cout << " hdutype= " << hdutype << endl;
-	throw IOExc("FitsFile::getBlockType: this HDU type is unknown");
+	throw IOExc("FitsFile::GetBlockType: this HDU type is unknown");
       }
   
@@ -968,23 +968,23 @@
 
 }
-void FitsOutFile::putImageToFits(int nbData, double* map) const
+void FitsOutFile::PutImageToFits(int nbData, double* map) const
 {
   int status = 0;
   long npix= nbData;
   fits_write_img(fptr_,TDOUBLE,1,npix,map,&status); 
-  if( status ) printerror( status, "erreur ecriture putImageToFits" );
+  if( status ) printerror( status, "erreur ecriture PutImageToFits" );
   //  writeSignatureOnFits();
 }
 
-void FitsOutFile::putImageToFits(int nbData, float* map) const
+void FitsOutFile::PutImageToFits(int nbData, float* map) const
 {
   int status = 0;
   long npix= nbData;
   fits_write_img(fptr_,TFLOAT,1,npix, map,&status); 
-  if( status ) printerror( status, "erreur ecriture putImageToFits" );
+  if( status ) printerror( status, "erreur ecriture PutImageToFits" );
   //  writeSignatureOnFits();
 
 }
-void FitsOutFile::putImageToFits( int nbData, int* map) const
+void FitsOutFile::PutImageToFits( int nbData, int* map) const
 {
   int status = 0;
@@ -992,5 +992,5 @@
   long npix= nbData;
   fits_write_img(fptr_,TINT,1,npix,map,&status); 
-  if( status ) printerror( status, "erreur ecriture putImageToFits" );
+  if( status ) printerror( status, "erreur ecriture PutImageToFits" );
   //  writeSignatureOnFits();
 }
@@ -1000,6 +1000,9 @@
 void FitsOutFile::makeHeaderBntblOnFits( string fieldType, vector<string> Noms, int nentries, int tfields, DVList &dvl, string extname, vector<int> taille_des_chaines) 
 { 
+  int k;
   int status = 0;
   long nrows;
+  // verifications de coherence
+
   if (fieldType.length() != tfields)
     {
@@ -1007,4 +1010,21 @@
       throw ParmError("FitsFile:: fields and types don't match");
 
+    }
+  if (tfields >  Noms.size())
+    {
+      cout << " WARNING: FitsOutFile::makeHeaderBntblOnFits, length of vector of column names not equal to total number of columns" << endl;
+      for (k=0; k<(tfields-Noms.size()); k++) Noms.push_back( string(" "));
+    }
+  
+  // nombre de variables "chaines de caracteres"
+  int nbString = 0;
+  for (k=0; k<tfields;k++) if (fieldType[k] == 'A') nbString++;
+  // coherence de la longueur du vecteur des tailles 
+  if (nbString >  taille_des_chaines.size())
+    {
+      cout << " WARNING: FitsOutFile::makeHeaderBntblOnFits, length of vector of string lengths  not equal to total number of columns" << endl;
+      int strSz=0;
+      for (k=0; k<taille_des_chaines.size(); k++) if ( taille_des_chaines[k] > strSz) strSz = taille_des_chaines[k];
+      for (k=0; k<(nbString-taille_des_chaines.size()); k++) taille_des_chaines.push_back(strSz);
     }
   char ** ttype= new char*[tfields];
@@ -1012,5 +1032,4 @@
   char largeur[FLEN_VALUE];
   int noColString=0;
-  int k;
   for (k=0; k<tfields;k++)
     {
@@ -1073,15 +1092,15 @@
 }
 
-void FitsOutFile::putColToFits(int nocol, int nentries, double* donnees) const
+void FitsOutFile::PutColToFits(int nocol, int nentries, double* donnees) const
 {
   int status = 0;
   int hdutype;
   fits_movabs_hdu(fptr_,hdunum_,&hdutype,&status);
-  if( status ) printerror(status,"putColToFits: le movabs a foire");
+  if( status ) printerror(status,"PutColToFits: le movabs a foire");
   fits_get_hdu_type(fptr_, &hdutype, &status);
     if(hdutype != ASCII_TBL && hdutype != BINARY_TBL)
         {
             cout << " hdunum= " << hdunum_ << " hdutype= " << hdutype << endl;
-     throw IOExc("FitsFile::putColToFits, this HDU is not an ASCII table nor a binary table");
+     throw IOExc("FitsFile::PutColToFits, this HDU is not an ASCII table nor a binary table");
           }
   int code; 
@@ -1090,24 +1109,24 @@
   if( code != TDOUBLE)
     {
-      cout << " WARNING : types don't match (putColToFits) : on fits file= " << code << " to be written= DOUBLE " << endl;
+      cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " to be written= DOUBLE " << endl;
     } 
   fits_write_col(fptr_,TDOUBLE,nocol+1,1,1,nentries, donnees ,&status);
   if( status )  printerror( status,"erreur ecriture du fichier fits" );
 }
-void FitsOutFile::putColToFits(int nocol, int nentries, float* donnees) const
+void FitsOutFile::PutColToFits(int nocol, int nentries, float* donnees) const
 {
   int status = 0;
   int hdutype;
   fits_movabs_hdu(fptr_,hdunum_,&hdutype,&status);
-  if( status ) printerror(status,"putColToFits: le movabs a foire");
+  if( status ) printerror(status,"PutColToFits: le movabs a foire");
   fits_get_hdu_type(fptr_, &hdutype, &status);
   if(hdutype != ASCII_TBL && hdutype != BINARY_TBL)
     {
       cout << " hdunum= " << hdunum_ << " hdutype= " << hdutype << endl;
-      throw IOExc("FitsFile::putColToFits, this HDU is not an ASCII table nor a binary table");
+      throw IOExc("FitsFile::PutColToFits, this HDU is not an ASCII table nor a binary table");
     }
   if(hdutype == ASCII_TBL && nocol>0)
     {
-      throw IOExc("FitsFile::putColToFits, this HDU is an ASCII table, nocol>0  forbidden");
+      throw IOExc("FitsFile::PutColToFits, this HDU is an ASCII table, nocol>0  forbidden");
     }
   int code; 
@@ -1116,24 +1135,24 @@
   if( code != TFLOAT)
     {
-      cout << " WARNING : types don't match (putColToFits) : on fits file= " << code << " (FITS code), to be written= FLOAT " << endl;
+      cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " (FITS code), to be written= FLOAT " << endl;
     } 
   fits_write_col(fptr_,TFLOAT,nocol+1,1,1,nentries, donnees ,&status);
   if( status )  printerror( status,"erreur ecriture du fichier fits" );
 }
-void FitsOutFile::putColToFits(int nocol, int nentries, int* donnees) const
+void FitsOutFile::PutColToFits(int nocol, int nentries, int* donnees) const
 {
   int status = 0;
   int hdutype;
   fits_movabs_hdu(fptr_,hdunum_,&hdutype,&status);
-  if( status ) printerror(status,"putColToFits: le movabs a foire");
+  if( status ) printerror(status,"PutColToFits: le movabs a foire");
   fits_get_hdu_type(fptr_, &hdutype, &status);
   if(hdutype != ASCII_TBL && hdutype != BINARY_TBL)
     {
       cout << " hdunum= " << hdunum_ << " hdutype= " << hdutype << endl;
-      throw IOExc("FitsFile::putColToFits, this HDU is not an ASCII table nor a binary table");
+      throw IOExc("FitsFile::PutColToFits, this HDU is not an ASCII table nor a binary table");
     }
   if(hdutype == ASCII_TBL && nocol>0)
     {
-      throw IOExc("FitsFile::putColToFits, this HDU is an ASCII table, nocol>0  forbidden");
+      throw IOExc("FitsFile::PutColToFits, this HDU is an ASCII table, nocol>0  forbidden");
     }
   int code; 
@@ -1142,24 +1161,24 @@
   if( code != TLONG &&  code != TINT &&  code != TSHORT ) 
     {
-      cout << " WARNING : types don't match (putColToFits) : on fits file= " << code << " (FITS code), to be written= INT " << endl;
+      cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " (FITS code), to be written= INT " << endl;
     } 
   fits_write_col(fptr_,TINT,nocol+1,1,1,nentries, donnees ,&status);
   if( status )  printerror( status," ecriture du fichier fits" );
 }
-void FitsOutFile::putColToFits(int nocol, int nentries, char** donnees) const
+void FitsOutFile::PutColToFits(int nocol, int nentries, char** donnees) const
 {
   int status = 0;
   int hdutype;
   fits_movabs_hdu(fptr_,hdunum_,&hdutype,&status);
-  if( status ) printerror(status,"putColToFits: le movabs a foire");
+  if( status ) printerror(status,"PutColToFits: le movabs a foire");
   fits_get_hdu_type(fptr_, &hdutype, &status);
   if(hdutype != ASCII_TBL && hdutype != BINARY_TBL)
     {
       cout << " hdunum= " << hdunum_ << " hdutype= " << hdutype << endl;
-      throw IOExc("FitsFile::putColToFits, this HDU is not an ASCII table nor a binary table");
+      throw IOExc("FitsFile::PutColToFits, this HDU is not an ASCII table nor a binary table");
     }
   if(hdutype == ASCII_TBL && nocol>0)
     {
-      throw IOExc("FitsFile::putColToFits, this HDU is an ASCII table, nocol>0  forbidden");
+      throw IOExc("FitsFile::PutColToFits, this HDU is an ASCII table, nocol>0  forbidden");
     }
   int code; 
@@ -1168,5 +1187,5 @@
   if( code != TSTRING)
     {
-      cout << " WARNING : types don't match (putColToFits) : on fits file= " << code << " (FITS code), to be written= char** " << endl;
+      cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " (FITS code), to be written= char** " << endl;
     } 
   fits_write_col(fptr_,TSTRING,nocol+1,1,1,nentries, donnees ,&status);
@@ -1174,48 +1193,35 @@
 }
 
-void FitsOutFile::putBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char ** cdata) const
-{
+void FitsOutFile::PutBinTabLine(long NoLine,  BnTblLine& ligne) const
+{
+  // on ne fait pas de verification de type, ni de dimension ici, pour 
+  // des raisons de performances
+  int k;
   int status= 0;
   int    anull;
-  int dcount = 0.;
-  int fcount = 0.;
-  int icount = 0;
-  int ccount =0;
-  int ncol;
+  int ncol=0;
   long nels=1;
-  int nbcols;
-  fits_get_num_cols(fptr_, &nbcols,&status);
-  for (ncol=0; ncol<nbcols; ncol++)
-    {
-      int code; 
-      long repeat, width;
-      fits_get_coltype(fptr_, ncol+1, &code, &repeat,&width, &status);
-      switch (code)
-	{ 
-	case TDOUBLE :
-	  fits_write_col(fptr_,TDOUBLE,ncol+1,NoLine+1,1,1, &ddata[dcount++] ,&status);
-	    break;
-	case TFLOAT :
-	  fits_write_col(fptr_,TFLOAT,ncol+1,NoLine+1,1,1, &fdata[fcount++] ,&status);
-	  break;
-	case TINT :
-	  fits_write_col(fptr_,TINT,ncol+1,NoLine+1,1,1, &idata[icount++] ,&status);
-	  break;
-	case TLONG :
-	  fits_write_col(fptr_,TINT,ncol+1,NoLine+1,1,1, &idata[icount++] ,&status);
-	  break;
-	case TSHORT :
-	  fits_write_col(fptr_,TINT,ncol+1,NoLine+1,1,1, &idata[icount++] ,&status);
-	  break;
-	case TSTRING :
-	  fits_write_col(fptr_,TSTRING,ncol+1,NoLine+1,1,1, &cdata[ccount++] ,&status);
-	  break;
-	}
-      if (status)
-	{
-	  cout << " WARNING : unknown type (putBinTabLine) : on fits file= " << code << " (FITS code) " << endl;
-	  status = 0;
-	  break;
-	}
+  //  int nbcols;
+  //  fits_get_num_cols(fptr_, &nbcols,&status);
+  for (k=0; k<ligne.ddata_.size(); k++, ncol++)
+    {
+      fits_write_col(fptr_,TDOUBLE,ncol+1,NoLine+1,1,1, &ligne.ddata_[k] ,&status);
+      if( status ) printerror( status, "PutBinTabLine : erreur ecriture double"  );
+    }
+  for (k=0; k<ligne.fdata_.size(); k++, ncol++)
+    {
+      fits_write_col(fptr_,TFLOAT,ncol+1,NoLine+1,1,1, &ligne.fdata_[k] ,&status);
+      if( status ) printerror( status, "PutBinTabLine : erreur ecriture float"  );
+    }
+  for (k=0; k<ligne.idata_.size(); k++, ncol++)
+    {
+      fits_write_col(fptr_,TINT,ncol+1,NoLine+1,1,1, &ligne.idata_[k] ,&status);
+      if( status ) printerror( status, "PutBinTabLine : erreur ecriture entier"  );
+    }
+  
+  for (k=0; k<ligne.cdata_.size(); k++, ncol++)
+    {
+      fits_write_col(fptr_,TSTRING,ncol+1,NoLine+1,1,1, strdup(ligne.cdata_[k].c_str()) ,&status);
+      if( status ) printerror( status, "PutBinTabLine : erreur ecriture caracteres"  );
     }
 }
Index: trunk/SophyaExt/FitsIOServer/fitsfile.h
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 1208)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.h	(revision 1209)
@@ -18,6 +18,12 @@
    {
     int nbcols = dc + fc + ic + cc;
+    int maxName = names.size();
+    if (nbcols != maxName)
+      {
+	cout << " WARNING: BnTblLine:: length of vector of column names not equal to total number of columns" << endl;
+	maxName = nbcols < maxName ? nbcols : maxName;
+      }
     ColName_ = vector<string>(nbcols);
-     for (int k=0; k < nbcols; k++) ColName_ = names;
+     for (int k=0; k < maxName; k++) ColName_[k] = names[k];
     if (dc >0) ddata_ = vector<double>(dc);
     if (fc >0) fdata_ = vector<float>(fc);
@@ -25,11 +31,17 @@
     if (cc >0) cdata_ = vector<string>(fc);
    }
-   void Print()
+
+bool sameFormat(const BnTblLine& btl) const
+   {
+     if (btl.ddata_.size() == ddata_.size() && btl.fdata_.size() == fdata_.size() && btl.idata_.size() == idata_.size() && btl.cdata_.size() == cdata_.size()) return true;
+     else return false;
+   }
+
+void Print()
    {
      int k;
-     int compt = 0;
      cout << " ********* ligne ************* " << endl;
      cout << " *** noms de variables  " << endl;
-     for (k=0; k < compt + ColName_.size(); k++) cout << ColName_[k] << " ";
+     for (k=0; k < ColName_.size(); k++) cout << ColName_[k] << " ";
      cout << endl;
      cout << " *** variables doubles  " << endl;
@@ -162,5 +174,5 @@
   virtual ~FitsFile();
 
-  static string getErrStatus(int status);
+  static string GetErrStatus(int status);
 
 
@@ -210,5 +222,5 @@
 
   static int NbBlocks(char flnm[]);
-  static void getBlockType(char flnm[], int hdunum, string& typeOfExtension, int& naxis, vector<int>& naxisn, string& dataType, DVList& dvl  );
+  static void GetBlockType(char flnm[], int hdunum, string& typeOfExtension, int& naxis, vector<int>& naxisn, string& dataType, DVList& dvl  );
 
 
@@ -298,15 +310,15 @@
 
   /*!
-get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
+Get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
   */
   void GetBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char
 ** cdata) ;
   /*!
-get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
+Get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
   */
   void GetBinTabLine(long NoLine, BnTblLine& ligne) ;
 
   /*!
-get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
+Get the NoLine-th 'line'  from the current BINTABLE extension on FITS file,
   */
   void GetBinTabLine(int NoLine, float* fdata) ;
@@ -438,11 +450,11 @@
 
    */
-  void putImageToFits( int nbData, double* map) const;
+  void PutImageToFits( int nbData, double* map) const;
 
   /*! same as previous method with float data */
-  void putImageToFits(int nbData, float* map ) const;
+  void PutImageToFits(int nbData, float* map ) const;
 
   /*! same as previous method with int data */
-  void putImageToFits(int nbData, int* map) const;
+  void PutImageToFits(int nbData, int* map) const;
 
 
@@ -470,16 +482,16 @@
 
    */
-  void putColToFits(int nocol, int nentries, double* donnees) const;
+  void PutColToFits(int nocol, int nentries, double* donnees) const;
 
   /*! same as previous method with float data */
-  void putColToFits(int nocol, int nentries, float* donnees) const;
+  void PutColToFits(int nocol, int nentries, float* donnees) const;
 
   /*! same as previous method with int data */
-  void putColToFits(int nocol, int nentries, int* donnees) const;
+  void PutColToFits(int nocol, int nentries, int* donnees) const;
 
   /*! same as previous method with char* data */
-  void putColToFits(int nocol, int nentries, char** donnees) const;
-
-  void putBinTabLine(int NoLine, double* ddata, float* fdata, int* idata, char ** cdata) const;
+  void PutColToFits(int nocol, int nentries, char** donnees) const;
+
+  void PutBinTabLine(long NoLine,  BnTblLine& ligne) const;
 
 
@@ -489,5 +501,5 @@
 
 
-/* put keywords from a DVList into the primary header of the fits-file */
+/* Put keywords from a DVList into the primary header of the fits-file */
 void  DVListIntoPrimaryHeader(DVList& dvl) const;
 
