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

                      CSDB Library, Free Evaluation Version 2.2.0 
                                           Release: June 9th 1997 

       Extension on an array.

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

#ifndef __CSTABA_H
#define __CSTABA_H

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


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);


};



#include "cscoptof.h"

#endif
