From af4760fff0e1a15c616aaadcec04dbd38d8ab2a6 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 3 Aug 2005 16:00:01 +0000 Subject: [PATCH] *** empty log message *** --- ase/stx/symbol.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/ase/stx/symbol.c b/ase/stx/symbol.c index 5d112d1b..6121eab7 100644 --- a/ase/stx/symbol.c +++ b/ase/stx/symbol.c @@ -1,5 +1,5 @@ /* - * $Id: symbol.c,v 1.18 2005-07-19 15:52:19 bacon Exp $ + * $Id: symbol.c,v 1.19 2005-08-03 16:00:01 bacon Exp $ */ #include @@ -82,3 +82,29 @@ void xp_stx_traverse_symbol_table ( } } } + +xp_word_t xp_stx_new_symbolx ( + xp_stx_t* stx, const xp_char_t* name, xp_word_t len) +{ + xp_word_t capa, hash, index; + + capa = stx->symtab.capacity; + size = stx->symtab.size; + + if (capa <= size + 1) { + __grow_symtab (stx); + } + + hash = xp_stx_strxhash(name,len); + index = hash % stx->symtab.capacity; + + while (1) { + symbol = stx->symtab.datum[index]; + if (symbol != stx->nil) break; + + if (xp_strxncmp(name, len, + XP_STX_DATA(stx,symbol), XP_STX_SIZE(stx,symbol)) == 0) break; + + index = index % stx->symtabl.capacity + 1; + } +}