Example #1
0
void node_delete(NODE* node)
{
	if (!node)
		return;

	symbol_delete(node->symbol);

	if (node->left)
		node_delete(node->left);

	if (node->right)
		node_delete(node->right);

	free(node);
}
void
symtable_close()
{
	if (symtable != NULL) {
		DBT	 key;
		DBT	 data;

		while (symtable->seq(symtable, &key, &data, R_FIRST) == 0) {
			symbol_t *stored_ptr;

			memcpy(&stored_ptr, data.data, sizeof(stored_ptr));
			symbol_delete(stored_ptr);
		}
		symtable->close(symtable);
	}
}
Example #3
0
void
reference_delete(Reference *p_reference) {
   symbol_delete(p_reference->p_symbol);
   free(p_reference);
}