symClose basic EMF

Synopsis

Closes and frees a symbol table

Prototype

void symClose(sym_fd_t sd, void (*cleanup)(sym_t *symp)); 

Parameters

sd Table handle
cleanup Function pointer that performs any table specific cleanup

Description

This module implements a highly efficient generic symbol table with update and access routines. Symbols are simple character strings and the values they take can be flexible types as defined by value_t. This module allows multiple symbol tables to be created.

Frees all symbols in the hash table, then the hash table itself.

Return Value

No return value

Example

sym_fd_t id;

symClose(id, websFreeVar);

/*********************************************
/*
 *  Callback from symClose. Free the variable.
 */

static void websFreeVar(sym_t* sp)
{
    valueFree(&sp->content);
}

See Also

symDelete, symEnter, symFirst, symLookup, symNext, symOpen