*** empty log message ***

This commit is contained in:
hyung-hwan 2005-05-19 15:08:04 +00:00
parent fd13891ef3
commit 716fd0f03d
7 changed files with 8 additions and 69 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: hash.c,v 1.12 2005-05-18 04:01:51 bacon Exp $ * $Id: hash.c,v 1.13 2005-05-19 15:04:21 bacon Exp $
*/ */
#include <xp/stx/hash.h> #include <xp/stx/hash.h>
@ -41,32 +41,6 @@ xp_stx_word_t xp_stx_hash_lookup (
return stx->nil; /* not found */ return stx->nil; /* not found */
} }
xp_stx_word_t xp_stx_hash_lookup_symbol (
xp_stx_t* stx, xp_stx_word_t table,
xp_stx_word_t hash, const xp_stx_char_t* key_str)
{
xp_stx_word_t link, key;
xp_assert (XP_STX_TYPE(stx,table) == XP_STX_INDEXED);
hash = hash % XP_STX_SIZE(stx,table);
link = XP_STX_AT(stx,table,hash);
while (link != stx->nil) {
key = XP_STX_AT(stx,link,XP_STX_PAIRLINK_KEY);
if (XP_STX_CLASS(stx,key) == stx->class_symbol &&
xp_stx_strxcmp (
&XP_STX_CHARAT(stx,key,0),
XP_STX_SIZE(stx,key), key_str) == 0) {
return link;
}
link = XP_STX_AT(stx,link,XP_STX_PAIRLINK_LINK);
}
return stx->nil; /* not found */
}
void xp_stx_hash_insert ( void xp_stx_hash_insert (
xp_stx_t* stx, xp_stx_word_t table, xp_stx_t* stx, xp_stx_word_t table,
xp_stx_word_t hash, xp_stx_word_t key, xp_stx_word_t value) xp_stx_word_t hash, xp_stx_word_t key, xp_stx_word_t value)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: hash.h,v 1.6 2005-05-18 04:01:51 bacon Exp $ * $Id: hash.h,v 1.7 2005-05-19 15:04:21 bacon Exp $
*/ */
#ifndef _XP_STX_HASH_H_ #ifndef _XP_STX_HASH_H_
@ -22,9 +22,6 @@ xp_stx_word_t xp_stx_new_plink (
xp_stx_word_t xp_stx_hash_lookup ( xp_stx_word_t xp_stx_hash_lookup (
xp_stx_t* stx, xp_stx_word_t table, xp_stx_t* stx, xp_stx_word_t table,
xp_stx_word_t hash, xp_stx_word_t key); xp_stx_word_t hash, xp_stx_word_t key);
xp_stx_word_t xp_stx_hash_lookup_symbol (
xp_stx_t* stx, xp_stx_word_t table,
xp_stx_word_t hash, const xp_stx_char_t* key_str);
void xp_stx_hash_insert ( void xp_stx_hash_insert (
xp_stx_t* stx, xp_stx_word_t table, xp_stx_t* stx, xp_stx_word_t table,
xp_stx_word_t hash, xp_stx_word_t key, xp_stx_word_t value); xp_stx_word_t hash, xp_stx_word_t key, xp_stx_word_t value);

View File

@ -3,7 +3,7 @@ OBJS = stx.obj memory.obj object.obj symbol.obj hash.obj misc.obj context.obj
OUT = xpstx.lib OUT = xpstx.lib
CC = lcc CC = lcc
CFLAGS = -I../.. CFLAGS = -I../.. -g2
LDFLAGS = LDFLAGS =
LIBS = LIBS =

View File

@ -1,5 +1,5 @@
/* /*
* $Id: memory.c,v 1.8 2005-05-18 16:34:51 bacon Exp $ * $Id: memory.c,v 1.9 2005-05-19 15:04:21 bacon Exp $
*/ */
#include <xp/stx/memory.h> #include <xp/stx/memory.h>
@ -78,7 +78,6 @@ xp_stx_word_t xp_stx_memory_alloc (xp_stx_memory_t* mem, xp_stx_word_t nbytes)
mem->free = (xp_stx_object_t**)*slot; mem->free = (xp_stx_object_t**)*slot;
*slot = object; *slot = object;
xp_printf (XP_TEXT("returning %d\n"), slot - mem->slots);
return (xp_stx_word_t)(slot - mem->slots); return (xp_stx_word_t)(slot - mem->slots);
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: stx.c,v 1.19 2005-05-18 16:34:51 bacon Exp $ * $Id: stx.c,v 1.20 2005-05-19 15:04:21 bacon Exp $
*/ */
#include <xp/stx/stx.h> #include <xp/stx/stx.h>
@ -57,14 +57,11 @@ int xp_stx_bootstrap (xp_stx_t* stx)
xp_stx_word_t class_Object, class_Class; xp_stx_word_t class_Object, class_Class;
xp_stx_word_t tmp; xp_stx_word_t tmp;
xp_printf (XP_TEXT("bootstreap\n"));
__create_bootstrapping_objects (stx); __create_bootstrapping_objects (stx);
xp_printf (XP_TEXT("bootstreap over\n"));
/* more initialization */ /* more initialization */
XP_STX_CLASS(stx,stx->symbol_table) = XP_STX_CLASS(stx,stx->symbol_table) =
xp_stx_new_class (stx, XP_STX_TEXT("SymbolTable")); xp_stx_new_class (stx, XP_STX_TEXT("SymbolTable"));
xp_printf (XP_TEXT("bootstreap 1111\n"));
XP_STX_CLASS(stx,stx->smalltalk) = XP_STX_CLASS(stx,stx->smalltalk) =
xp_stx_new_class (stx, XP_STX_TEXT("SystemDictionary")); xp_stx_new_class (stx, XP_STX_TEXT("SystemDictionary"));
@ -144,7 +141,6 @@ static void __create_bootstrapping_objects (xp_stx_t* stx)
class_PairlinkMeta = /* Pairlink class */ class_PairlinkMeta = /* Pairlink class */
xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE); xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE);
/* (Symlink class) setClass: Metaclass */ /* (Symlink class) setClass: Metaclass */
XP_STX_CLASS(stx,class_SymlinkMeta) = stx->class_metaclass; XP_STX_CLASS(stx,class_SymlinkMeta) = stx->class_metaclass;
/* (Symbol class) setClass: Metaclass */ /* (Symbol class) setClass: Metaclass */
@ -163,33 +159,6 @@ static void __create_bootstrapping_objects (xp_stx_t* stx)
/* Pairlink setClass: (Pairlink class) */ /* Pairlink setClass: (Pairlink class) */
XP_STX_CLASS(stx,stx->class_pairlink) = class_PairlinkMeta; XP_STX_CLASS(stx,stx->class_pairlink) = class_PairlinkMeta;
stx->class_symlink = /* Symlink */
xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE);
stx->class_symbol = /* Symbol */
xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE);
stx->class_metaclass = /* Metaclass */
xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE);
stx->class_pairlink = /* Pairlink */
xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE);
/* (Symlink class) setClass: Metaclass */
XP_STX_CLASS(stx,class_SymlinkMeta) = stx->class_metaclass;
/* (Symbol class) setClass: Metaclass */
XP_STX_CLASS(stx,class_SymbolMeta) = stx->class_metaclass;
/* (Metaclass class) setClass: Metaclass */
XP_STX_CLASS(stx,class_MetaclassMeta) = stx->class_metaclass;
/* (Pairlink class) setClass: Metaclass */
XP_STX_CLASS(stx,class_PairlinkMeta) = stx->class_metaclass;
/* Symlink setClass: (Symlink class) */
XP_STX_CLASS(stx,stx->class_symlink) = class_SymlinkMeta;
/* Symbol setClass: (Symbol class) */
XP_STX_CLASS(stx,stx->class_symbol) = class_SymbolMeta;
/* Metaclass setClass: (Metaclass class) */
XP_STX_CLASS(stx,stx->class_metaclass) = class_MetaclassMeta;
/* Pairlink setClass: (Metaclass class) */
XP_STX_CLASS(stx,stx->class_pairlink) = class_PairlinkMeta;
/* (Symlink class) setSpec: CLASS_SIZE */ /* (Symlink class) setSpec: CLASS_SIZE */
XP_STX_AT(stx,class_SymlinkMeta,XP_STX_CLASS_SPEC) = XP_STX_AT(stx,class_SymlinkMeta,XP_STX_CLASS_SPEC) =
XP_STX_TO_SMALLINT(XP_STX_CLASS_SIZE); XP_STX_TO_SMALLINT(XP_STX_CLASS_SIZE);

View File

@ -3,7 +3,7 @@ OBJS = stx.obj
OUT = stx.exe OUT = stx.exe
CC = lcc CC = lcc
CFLAGS = -I../../.. CFLAGS = -I../../.. -g2
#LDFLAGS = -L../../../xp/bas -L../../../xp/stx #LDFLAGS = -L../../../xp/bas -L../../../xp/stx
#LIBS = -lxpstx -lxpbas #LIBS = -lxpstx -lxpbas
LIBS = ..\..\..\xp\bas\xpbas.lib ..\..\..\xp\stx\xpstx.lib LIBS = ..\..\..\xp\bas\xpbas.lib ..\..\..\xp\stx\xpstx.lib

View File

@ -27,7 +27,7 @@ int xp_main (int argc, xp_char_t* argv[])
xp_stx_word_t i; xp_stx_word_t i;
if (argc != 2) { // TODO: argument processing if (argc != 2) { // TODO: argument processing
xp_printf (XP_TEXT("Usage: %s [-f imageFile] MainClass"), argv[0]); xp_printf (XP_TEXT("Usage: %s [-f imageFile] MainClass\n"), argv[0]);
return -1; return -1;
} }