symFirst basic EMF

Synopsis

Finds the first value for a given symbol table.

Prototype

 #include "uemf.h"

 sym_t *symFirst(sym_fd_t sd);

Parameters

sdHandle to the table created from a previous call to symOpen.

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.

Return the first symbol in the hashtable if there is one. This call is used as the first step in traversing the table. A call to symFirst should be followed by calls to symNext to get the remaining entries.

Return Value

Returns a pointer to a sym_t structure which contains the value. NULL if not found.

Example

sym_fd_t data;
sym_t* elem;

elem = symFirst(data);

while (elem != NULL) {
    ejSetVar(0, elem->name.value.string, elem->content.value.string);
    elem = symNext(data);
}

Stability Classification

Evolving.

See Also

symClose, symDelete, symEnter, symLookup, symNext, symOpen