| iMatix home page | << | < | > | >> |
![]() Version 1.91 |
#include "sflsymb.h" SYMBOL * sym_assume_symbol ( SYMTAB *table, /* Symbol table to search */ const char *name, /* Name of symbol to find/create */ const char *value) /* Value of symbol to create */
Searches for a symbol, by name, in the specified symbol table. If the symbol does not exist, creates the symbol as specified. Returns a SYMBOL pointer to the existing or new symbol, or NULL if a new symbol could not be created. The lookup and creation follow the same rules as sym lookup symbol() and sym create symbol(). The symbol's value is set to the supplied value in all cases.
{ SYMBOL *symbol; /* Allocated or found symbol */ ASSERT (table); symbol = sym lookup symbol (table, name); if (symbol) { /* Update the symbol value, if it has changed */ if (symbol-> value && strneq (symbol-> value, value)) sym set value (symbol, value); } else symbol = sym create symbol (table, name, value); return (symbol); }
| << | < | > | >> |
![]() |