Listing 8 Deleting and Testing Elements

/*<<<<<<<<<< Delete an entry from the AA <<<<<<<<<<*/
void aa_delete(aa,key)
AA * aa;      /* input -- AA definition */
void * key;   /* input -- key to delete, with data */
{
   int index=hashindex(aa,key);
   if (VALID_KEY(aa->keys[index])) {
       free ((void *)aa->keys[index]);
       aa->keys[index]=(void *)DELETED_KEY;
       free ((void *)aa->data[index]);
       aa->data[index]=NULL;
       aa->current_elements--;
   }
}

/*>>>>>> Return TRUE if key defined in the AA <<<<<<<*/
BOOLEAN aa_defined(aa,key)
AA * aa;        /* input -- pointer to AA definition */
void * key;     /* input -- key to check if defined */
{
   return(VALID_KEY(aa->keys[hashindex(aa,key)]));
}
/* End of File */