*** empty log message ***
This commit is contained in:
parent
ecfccc31f7
commit
32711250c4
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: object.c,v 1.32 2005-07-05 09:02:13 bacon Exp $
|
||||
* $Id: object.c,v 1.33 2005-07-05 09:52:00 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/stx/object.h>
|
||||
@ -160,6 +160,29 @@ xp_word_t xp_stx_hash_char_object (xp_stx_t* stx, xp_word_t idx)
|
||||
XP_STX_DATA(stx,idx), XP_STX_SIZE(stx,idx));
|
||||
}
|
||||
|
||||
xp_word_t xp_stx_hash_object (xp_stx_t* stx, xp_word_t object)
|
||||
{
|
||||
xp_word_t hv;
|
||||
|
||||
/* TODO: implement this function */
|
||||
|
||||
if (XP_STX_IS_SMALLINT(object)) {
|
||||
hv = 0;
|
||||
}
|
||||
else if (XP_STX_IS_BYTE_OBJECT(stx,object)) {
|
||||
hv = 0;
|
||||
}
|
||||
else if (XP_STX_IS_CHAR_OBJECT(stx,object)) {
|
||||
hv = xp_stx_strxhash (
|
||||
XP_STX_DATA(stx,object), XP_STX_SIZE(stx,object));
|
||||
}
|
||||
else if (XP_STX_IS_WORD_OBJECT(stx,object)) {
|
||||
hv = 0;
|
||||
}
|
||||
|
||||
return hv;
|
||||
}
|
||||
|
||||
xp_word_t xp_stx_instantiate (
|
||||
xp_stx_t* stx, xp_word_t class_index, const void* data,
|
||||
const void* variable_data, xp_word_t variable_nfields)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: object.h,v 1.22 2005-07-05 09:02:13 bacon Exp $
|
||||
* $Id: object.h,v 1.23 2005-07-05 09:52:00 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _XP_STX_OBJECT_H_
|
||||
@ -29,6 +29,7 @@ xp_word_t xp_stx_alloc_char_objectx (
|
||||
xp_word_t xp_stx_allocn_char_object (xp_stx_t* stx, ...);
|
||||
|
||||
xp_word_t xp_stx_hash_char_object (xp_stx_t* stx, xp_word_t idx);
|
||||
xp_word_t xp_stx_hash_object (xp_stx_t* stx, xp_word_t object);
|
||||
|
||||
xp_word_t xp_stx_instantiate (
|
||||
xp_stx_t* stx, xp_word_t class_index, const void* data,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: parser.c,v 1.52 2005-07-05 09:02:13 bacon Exp $
|
||||
* $Id: parser.c,v 1.53 2005-07-05 09:52:00 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/stx/parser.h>
|
||||
@ -7,6 +7,7 @@
|
||||
#include <xp/stx/class.h>
|
||||
#include <xp/stx/method.h>
|
||||
#include <xp/stx/symbol.h>
|
||||
#include <xp/stx/hash.h>
|
||||
#include <xp/stx/misc.h>
|
||||
|
||||
static int __parse_method (
|
||||
@ -326,6 +327,11 @@ static int __finish_method (xp_stx_parser_t* parser)
|
||||
method_obj->temporary_size =
|
||||
XP_STX_TO_SMALLINT(parser->temporary_count);
|
||||
*/
|
||||
|
||||
xp_stx_hash_insert (
|
||||
stx, class_obj->methods,
|
||||
xp_stx_hash_object(stx, selector),
|
||||
selector, method);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stx.h,v 1.32 2005-07-05 09:02:13 bacon Exp $
|
||||
* $Id: stx.h,v 1.33 2005-07-05 09:52:00 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _XP_STX_STX_H_
|
||||
@ -101,11 +101,11 @@ struct xp_stx_t
|
||||
#define XP_STX_BYTE_INDEXED (0x01)
|
||||
#define XP_STX_CHAR_INDEXED (0x02)
|
||||
|
||||
#define XP_STX_IS_WORD_INDEXED(stx,idx) \
|
||||
#define XP_STX_IS_WORD_OBJECT(stx,idx) \
|
||||
(XP_STX_TYPE(stx,idx) == XP_STX_WORD_INDEXED)
|
||||
#define XP_STX_IS_BYTE_INDEXED(stx,idx) \
|
||||
#define XP_STX_IS_BYTE_OBJECT(stx,idx) \
|
||||
(XP_STX_TYPE(stx,idx) == XP_STX_BYTE_INDEXED)
|
||||
#define XP_STX_IS_CHAR_INDEXED(stx,idx) \
|
||||
#define XP_STX_IS_CHAR_OBJECT(stx,idx) \
|
||||
(XP_STX_TYPE(stx,idx) == XP_STX_CHAR_INDEXED)
|
||||
|
||||
#define XP_STX_WORD_OBJECT(stx,idx) \
|
||||
|
Loading…
Reference in New Issue
Block a user