#include "callback.h"
#include "darray.h"
#include "bool.h"
#include "useful.h"

Darray CB2Objects; 

/*--------------------------------------------------*/
CBObj2 CB2_create(one,two)
VOIDP one;
VOIDP two;
{
  static Bool   CB2Init=Bool_FALSE;
  CBObj2 o;

  if (CB2Init==Bool_FALSE) {
    CB2Objects=Darray_create();
    CB2Init=Bool_TRUE;
  }
  o=(CBObj2)safe_malloc(sizeof(struct CBObj2_str));
  o->one=one;
  o->two=two;
  Darray_addh(CB2Objects,o);
  return(o);
}

/*--------------------------------------------------*/
void CB2_destroy_all()
{
  unsigned i, l;
  l=Darray_len(CB2Objects);
  for (i=0;i<l;i++) 
    safe_free(Darray_get(CB2Objects,i));
  Darray_destroy(CB2Objects);
}
