*** empty log message ***

This commit is contained in:
hyung-hwan 2005-05-08 15:54:44 +00:00
parent ca6170b0a8
commit 15d81e593f
3 changed files with 65 additions and 3 deletions

46
ase/stx/hash.c Normal file
View File

@ -0,0 +1,46 @@
/*
* $Id: hash.c,v 1.1 2005-05-08 15:54:44 bacon Exp $
*/
#include <xp/stx/hash.h>
int xp_stx_new_link (
xp_stx_t* stx, xp_stx_word_t key, xp_stx_word_t value)
{
xp_stx_word_t x;
x = xp_stx_alloc_object (3);
XP_STX_CLASS(stx,x) = hash_lookup(stx, XP_STX_TEXT("Link"));
XP_STX_AT(stx,x,0) = key;
XP_STX_AT(stx,x,1) = value;
/* XP_STX_AT(stx,x,2) = stx->nil; */
return x;
}
void xp_stx_hash_insert (
xp_stx_t* stx, xp_stx_word_t key, xp_stx_word_t value)
{
xp_stx_word_t table;
table = XP_STX_AT(stx,stx->globals,0);
hash = __hash(key);
link = XP_STX_AT(stx,table,hash);
for (;;) {
if (XP_STX_AT(stx,link,0) == key) {
XP_STX_AT(stx,link,1) = value;
break;
}
next = XP_STX_AT(stx,link,2);
if (next == stx->nil) {
new = xp_stx_new_link (stx, key, value);
XP_STX_AT(stx,link,2) = new;
break;
}
link = next;
}
}

16
ase/stx/hash.h Normal file
View File

@ -0,0 +1,16 @@
/*
* $Id: hash.h,v 1.1 2005-05-08 15:54:44 bacon Exp $
*/
#ifndef _XP_STX_HASH_H_
#define _XP_STX_HASH_H_
#ifdef __cplusplus
extern "C"
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -6,7 +6,7 @@ VpeMain
WRect
1500
440
7680
3770
9200
2
MProject
@ -30,7 +30,7 @@ VComponent
WRect
0
0
5700
3260
4280
0
0
@ -39,5 +39,5 @@ WFileName
7
stx.tgt
0
3
4
7