symEnter basic EMF

Synopsis

Adds a lookup-value pair to a symbol table.

Prototype

 #include "uemf.h"

 sym_t *symEnter(sym_fd_t sd, char_t* name, value_t v, 
      int args);

Parameters

sdHandle to the table created from a previous call to symOpen.
nameThe string lookup key for future calls to symLookup.
vThe value to be stored in the symbol table.
argsArgs.

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.

Enters a new or existing symbol into the table. If the symbol is already there, it updates the value and the previous value is freed by valueFree . Always succeeds if enough memory is available.

Return Value

Returns a pointer to a sym_t structure that contains the new entry.

Example

sym_fd_t id;
sym_t* sp;

id = symOpen(64);
...

symEnter(id, "lookup", valueString("value"), 0);
...

sp = symLookup(id, "lookup");

Stability Classification

Evolving.

See Also

symClose, symDelete, symFirst, symLookup, symNext, symOpen