| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
Filename: sflsymb.h
Package: Standard Function Library (SFL)
Written: 1993/12/27 iMatix SFL project team sfl@imatix.com
Revised: 1999/08/07
Copyright: Copyright (c) 1996-2000 iMatix Corporation
Symbol lookup is by name. Symbols contain a string value and a pointer to an caller-defined memory block. The symbol-table functions let you create and manage symbol tables. The functions are designed to be as general as possible (to support a wide variety of applications), but at the same time fast. The symbol table data structure is based on a combined linked list & hash table representation. The file sflsymb.h contains definitions for the various structures and external functions used in the sflsymb.c. Both the linked-list and hash-table representations have a guaranteed order. In the linked-list, new symbols are pushed on to the head of the list. In the hash table each bucket just contains a pointer to a linked-list of symbols. When a new symbol is created, it is pushed onto the front of this list. The reason that both data structures are used is to make the algorithm faster. Each representation has its stengths and weaknesses. For instance, if you wanted to lookup a symbol table entry for a given name using the hash table you could find it immediately, whereas with the linked- list, you would need to traverse most of the table to find the symbol. Some of these functions are called through macros that add the filename and line number of the call, for tracing. Do NOT call these functions directly.
sflsymb.h defines these symbols, possibly conditionally:
Symbol: | Defined as: |
---|---|
SFLSYMB_INCLUDED | TRUE |
SYM_HASH_SIZE | 256 /* Assumed by sym_hash () */ |
descr2symb(d) | (various) |
strt2symb(s) | (various) |
sym_assume_symbol(t,n,v) | (various) |
sym_create_symbol(t,n,v) | (various) |
sym_create_table() | (various) |
symb2descr(t) | (various) |
symb2strt(t) | (various) |
Type name: | Defined as: |
---|---|
symfunc | Bool (*) (SYMBOL *, ...) |
symsort | int (*) (const void *symb1, const void *symb2) |
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |