diff --git a/ase/stx/bootstrp.c b/ase/stx/bootstrp.c index 6f822833..a7133f3e 100644 --- a/ase/stx/bootstrp.c +++ b/ase/stx/bootstrp.c @@ -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 @@ -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); diff --git a/ase/stx/bootstrp.h b/ase/stx/bootstrp.h index b6c72527..72bc7f11 100644 --- a/ase/stx/bootstrp.h +++ b/ase/stx/bootstrp.h @@ -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); diff --git a/ase/stx/extra.h b/ase/stx/extra.h deleted file mode 100644 index ebc16c96..00000000 --- a/ase/stx/extra.h +++ /dev/null @@ -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 - -#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 diff --git a/ase/stx/hash.c b/ase/stx/hash.c index e24e3bb7..7f9848fe 100644 --- a/ase/stx/hash.c +++ b/ase/stx/hash.c @@ -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 @@ -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; } diff --git a/ase/stx/misc.c b/ase/stx/misc.c index 8c0252ab..93b556bb 100644 --- a/ase/stx/misc.c +++ b/ase/stx/misc.c @@ -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_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; diff --git a/ase/stx/misc.h b/ase/stx/misc.h index 8318eda3..d70a2fc0 100644 --- a/ase/stx/misc.h +++ b/ase/stx/misc.h @@ -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 #include #include + #include #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); diff --git a/ase/stx/object.c b/ase/stx/object.c index 08170820..ae2c1bc5 100644 --- a/ase/stx/object.c +++ b/ase/stx/object.c @@ -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 @@ -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); diff --git a/ase/stx/stx.h b/ase/stx/stx.h index 518060e5..80c077cd 100644 --- a/ase/stx/stx.h +++ b/ase/stx/stx.h @@ -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 diff --git a/ase/stx/symbol.c b/ase/stx/symbol.c index 44623329..27000c85 100644 --- a/ase/stx/symbol.c +++ b/ase/stx/symbol.c @@ -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 @@ -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;