/***********************************************************************

                      CSDB Library, Free Evaluation Version 2.0.5 
                                       Release: January 22th 1997 

       Extension on an array.

                                           Copyright(c) 1994-1997 
                                                          ComBits 
                                                  The Netherlands 
***********************************************************************/

#ifndef __CSTABA_H
#define __CSTABA_H

#include "cstable.h"
#include "csarray.h"


#ifdef __BORLANDC__
#pragma warn -sig
#endif

#ifdef _CP_002
#pragma warning(disable : 4051 4135 4018)
#endif



class TABLEa: public TABLE, public ARRAY
{
  public:

      void name(csCHAR *s);
      void zap(void)        { ARRAY::zap(); TABLE::zap(); }
      void size(size_t nr)  { ARRAY::size(MAX(nr,256U));   }
      void open(void)       { TABLE::open(); }
      void close(void)      { TABLE::close(); }
      void insert(long key,void *d)
          { if(key<=nr_lin) { ARRAY::insert(key,d); }
            else            { TABLE::insert(key,d); } }
      void insert(long key,void *d,void ** &add)
          { if(key<=nr_lin) { ARRAY::insert(key,d,add); }
            else            { TABLE::insert(key,d,add); } }
      void insert(long key,long d)
          { if(key<=nr_lin) { ARRAY::insert(key,d); }
            else            { TABLE::insert(key,d); } }
      void insert(long key,long d,long * &add)
          { if(key<=nr_lin) { ARRAY::insert(key,d,add); }
            else            { TABLE::insert(key,d,add); } }
      void delet(long key)
          { if(key>nr_lin) TABLE::delet(key);
            else           ARRAY::delet(key); }
      int search(long key,void * &d)
          { if(key<=nr_lin) { ARRAY::search(key,d); return TRUE; }
            else            { return TABLE::search(key,d); } }
      int search(long key,void * &d,void ** &add)
          { if(key<=nr_lin) { ARRAY::search(key,d,add); return TRUE; }
            else            { return TABLE::search(key,d,add); } }
      int search(long key,long &d)
          { if(key<=nr_lin) { ARRAY::search(key,d);  return TRUE; }
            else            { return TABLE::search(key,d); } }
      int search(long key,long &d,long * &add)
          { if(key<=nr_lin) { ARRAY::search(key,d,add); return TRUE; }
            else            { return TABLE::search(key,d,add); } }
      void empty(void)      { ARRAY::empty(); TABLE::empty(); }
      long export(FILE *fp,long nr);
      long import(FILE *fp,long number);
      int  report(csCHAR *name,int sub=10);
      void report(FILE *fipo,int sub=10);


};


#ifdef __BORLANDC__
#pragma warn .sig
#endif


#ifdef _MSC_VER
#pragma warning(default : 4051 4135)
#endif


#endif
