| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

sym_delete_table

#include "sflsymb.h"
void
sym_delete_table (
    SYMTAB *table)                      /*  Symbol table to delete           */

Synopsis

Deletes the given symbol table. First frees any memory space used by the table and attached symbols, including the user data block if that is not null. If the table argument is NULL, does nothing.

Source Code - (sflsymb.c)

{
    SYMBOL
        *symbol,                        /*  Pointer to symbol                */
        *next = NULL;                   /*    and to next symbol in list     */

    if (!table)
        return;                         /*  Do nothing if argument is null   */

    for (symbol = table-> symbols; symbol; symbol = next)
      {
        next = symbol-> next;           /*  Keep track of next in list       */
        mem_free (symbol-> value);      /*  Free value if used               */
        mem_free (symbol);              /*  Finally free symbol and name     */
      }
    mem_free (table);                   /*  Now free the table               */
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation