*** empty log message ***

This commit is contained in:
hyung-hwan 2005-06-08 16:14:52 +00:00
parent 8a69307e57
commit 29877d7513
9 changed files with 18 additions and 82 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: bootstrp.c,v 1.11 2005-06-08 16:00:51 bacon Exp $
* $Id: bootstrp.c,v 1.12 2005-06-08 16:11:18 bacon Exp $
*/
#include <xp/stx/bootstrp.h>
@ -511,7 +511,7 @@ static xp_word_t __count_subclasses (const xp_char_t* str)
for (p = class_info; p->name != XP_NULL; p++) {
if (p->superclass == XP_NULL) continue;
if (xp_stx_strcmp (str, p->superclass) == 0) n++;
if (xp_strcmp (str, p->superclass) == 0) n++;
}
return n;
@ -525,7 +525,7 @@ static void __set_subclasses (
for (p = class_info; p->name != XP_NULL; p++) {
if (p->superclass == XP_NULL) continue;
if (xp_stx_strcmp (str, p->superclass) != 0) continue;
if (xp_strcmp (str, p->superclass) != 0) continue;
class = xp_stx_lookup_class (stx, p->name);
xp_assert (class != stx->nil);
array[n++] = class;
@ -540,7 +540,7 @@ static void __set_metaclass_subclasses (
for (p = class_info; p->name != XP_NULL; p++) {
if (p->superclass == XP_NULL) continue;
if (xp_stx_strcmp (str, p->superclass) != 0) continue;
if (xp_strcmp (str, p->superclass) != 0) continue;
class = xp_stx_lookup_class (stx, p->name);
xp_assert (class != stx->nil);
array[n++] = XP_STX_CLASS(stx,class);

View File

@ -1,5 +1,5 @@
/*
* $Id: bootstrp.h,v 1.3 2005-06-08 16:00:51 bacon Exp $
* $Id: bootstrp.h,v 1.4 2005-06-08 16:14:52 bacon Exp $
*/
#ifndef _XP_STX_BOOTSTRP_H_
@ -11,7 +11,6 @@
extern "C" {
#endif
xp_word_t xp_stx_new_array (xp_stx_t* stx, xp_word_t size);
int xp_stx_bootstrap (xp_stx_t* stx);

View File

@ -1,28 +0,0 @@
/*
* $Id: extra.h,v 1.2 2005-06-08 16:00:51 bacon Exp $
*/
#ifndef _XP_STX_EXTRA_H_
#define _XP_STX_EXTRA_H_
#include <xp/stx/stx.h>
#ifdef __cplusplus
extern "C" {
#endif
xp_word_t xp_stx_strlen (const xp_char_t* str)
int xp_stx_strcmp (
const xp_char_t* s1, const xp_char_t* s2);
int xp_stx_strxcmp (
const xp_char_t* s1, xp_word_t len, const xp_char_t* s2);
xp_word_t xp_stx_strhash (const xp_char_t* str);
xp_word_t xp_stx_strxhash (const xp_char_t* str, xp_word_t len);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: hash.c,v 1.19 2005-06-08 16:00:51 bacon Exp $
* $Id: hash.c,v 1.20 2005-06-08 16:11:18 bacon Exp $
*/
#include <xp/stx/hash.h>
@ -71,7 +71,7 @@ xp_word_t xp_stx_hash_lookup_symbol (
obj = (xp_stx_pairlink_t*)XP_STX_WORD_OBJECT(stx,link);
tmp = XP_CHAR_OBJECT(stx,obj->key);
if (tmp->header.class == stx->class_symbol &&
xp_stx_strcmp (tmp->data, name) == 0) return link;
xp_strcmp (tmp->data, name) == 0) return link;
link = obj->link;
}

View File

@ -1,36 +1,9 @@
/*
* $Id: misc.c,v 1.3 2005-06-08 16:00:51 bacon Exp $
* $Id: misc.c,v 1.4 2005-06-08 16:11:18 bacon Exp $
*/
#include <xp/stx/misc.h>
xp_word_t xp_stx_strlen (const xp_char_t* str)
{
const xp_char_t* p = str;
while (*p != XP_CHAR('\0')) p++;
return p - str;
}
int xp_stx_strcmp (const xp_char_t* s1, const xp_char_t* s2)
{
while (*s1 == *s2 && *s2 != XP_CHAR('\0')) s1++, s2++;
if (*s1 > *s2) return 1;
else if (*s1 < *s2) return -1;
return 0;
}
int xp_stx_strxcmp (
const xp_char_t* s1, xp_word_t len, const xp_char_t* s2)
{
const xp_char_t* end = s1 + len;
while (s1 < end && *s2 != XP_CHAR('\0') && *s1 == *s2) {
s1++; s2++;
}
if (s1 == end && *s2 == XP_CHAR('\0')) return 0;
if (*s1 == *s2) return (s1 < end)? 1: -1;
return (*s1 > *s2)? 1: -1;
}
xp_word_t xp_stx_strhash (const xp_char_t* str)
{
xp_word_t h = 0;

View File

@ -1,5 +1,5 @@
/*
* $Id: misc.h,v 1.6 2005-06-08 16:05:41 bacon Exp $
* $Id: misc.h,v 1.7 2005-06-08 16:11:18 bacon Exp $
*/
#ifndef _XP_STX_MISC_H_
@ -31,19 +31,13 @@
#include <xp/bas/assert.h>
#include <xp/bas/stdarg.h>
#include <xp/bas/ctype.h>
#include <xp/bas/string.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
xp_word_t xp_stx_strlen (const xp_char_t* str);
int xp_stx_strcmp (
const xp_char_t* s1, const xp_char_t* s2);
int xp_stx_strxcmp (
const xp_char_t* s1, xp_word_t len, const xp_char_t* s2);
xp_word_t xp_stx_strhash (const xp_char_t* str);
xp_word_t xp_stx_strxhash (const xp_char_t* str, xp_word_t len);

View File

@ -1,5 +1,5 @@
/*
* $Id: object.c,v 1.24 2005-06-08 16:00:51 bacon Exp $
* $Id: object.c,v 1.25 2005-06-08 16:11:18 bacon Exp $
*/
#include <xp/stx/object.h>
@ -64,7 +64,7 @@ xp_word_t xp_stx_alloc_byte_object (xp_stx_t* stx, xp_word_t n)
xp_word_t xp_stx_alloc_char_object (
xp_stx_t* stx, const xp_char_t* str)
{
return xp_stx_alloc_char_objectx (stx, str, xp_stx_strlen(str));
return xp_stx_alloc_char_objectx (stx, str, xp_strlen(str));
}
xp_word_t xp_stx_alloc_char_objectx (
@ -103,7 +103,7 @@ xp_word_t xp_stx_allocn_char_object (xp_stx_t* stx, ...)
xp_va_start (ap, stx);
while ((p = xp_va_arg(ap, const xp_char_t*)) != XP_NULL) {
n += xp_stx_strlen(p);
n += xp_strlen(p);
}
xp_va_end (ap);

View File

@ -1,5 +1,5 @@
/*
* $Id: stx.h,v 1.26 2005-06-08 16:00:51 bacon Exp $
* $Id: stx.h,v 1.27 2005-06-08 16:14:52 bacon Exp $
*/
#ifndef _XP_STX_STX_H_
@ -117,8 +117,6 @@ extern "C" {
xp_stx_t* xp_stx_open (xp_stx_t* stx, xp_word_t capacity);
void xp_stx_close (xp_stx_t* stx);
int xp_stx_bootstrap (xp_stx_t* stx);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: symbol.c,v 1.9 2005-06-08 16:00:51 bacon Exp $
* $Id: symbol.c,v 1.10 2005-06-08 16:11:18 bacon Exp $
*/
#include <xp/stx/symbol.h>
@ -36,7 +36,7 @@ xp_word_t xp_stx_new_symbol (xp_stx_t* stx, const xp_char_t* name)
x = XP_STX_WORDAT(stx,link,XP_STX_SYMLINK_SYMBOL);
xp_assert (XP_STX_CLASS(stx,x) == stx->class_symbol);
if (xp_stx_strxcmp (
if (xp_strxcmp (
&XP_STX_CHARAT(stx,x,0),
XP_STX_SIZE(stx,x), name) == 0) return x;
@ -75,7 +75,7 @@ xp_word_t xp_stx_new_symbolx (
x = XP_STX_WORDAT(stx,link,XP_STX_SYMLINK_SYMBOL);
xp_assert (XP_STX_CLASS(stx,x) == stx->class_symbol);
if (xp_stx_strxcmp (
if (xp_strxcmp (
&XP_STX_CHARAT(stx,x,0),
XP_STX_SIZE(stx,x), name) == 0) return x;
@ -115,7 +115,7 @@ xp_word_t xp_stx_new_symbol_pp (
x = XP_STX_WORDAT(stx,link,XP_STX_SYMLINK_SYMBOL);
xp_assert (XP_STX_CLASS(stx,x) == stx->class_symbol);
if (xp_stx_strxcmp (
if (xp_strxcmp (
&XP_STX_CHARAT(stx,x,0),
XP_STX_SIZE(stx,x), name) == 0) return x;