2009-05-04 02:46:13 -04:00
|
|
|
namespace factor
|
|
|
|
{
|
|
|
|
|
2009-05-04 05:50:24 -04:00
|
|
|
inline static cell string_capacity(string *str)
|
2009-05-02 05:04:19 -04:00
|
|
|
{
|
2009-05-02 21:47:29 -04:00
|
|
|
return untag_fixnum(str->length);
|
2009-05-02 05:04:19 -04:00
|
|
|
}
|
|
|
|
|
2009-05-04 05:50:24 -04:00
|
|
|
inline static cell string_size(cell size)
|
2009-05-02 05:04:19 -04:00
|
|
|
{
|
2009-05-04 05:50:24 -04:00
|
|
|
return sizeof(string) + size;
|
2009-05-02 05:04:19 -04:00
|
|
|
}
|
|
|
|
|
2009-05-04 05:50:24 -04:00
|
|
|
string* allot_string_internal(cell capacity);
|
|
|
|
string* allot_string(cell capacity, cell fill);
|
2009-05-04 02:00:30 -04:00
|
|
|
PRIMITIVE(string);
|
2009-05-04 05:50:24 -04:00
|
|
|
string *reallot_string(string *string, cell capacity);
|
2009-05-04 02:00:30 -04:00
|
|
|
PRIMITIVE(resize_string);
|
2009-05-02 05:04:19 -04:00
|
|
|
|
|
|
|
/* String getters and setters */
|
2009-05-04 05:50:24 -04:00
|
|
|
cell string_nth(string* string, cell index);
|
|
|
|
void set_string_nth(string* string, cell index, cell value);
|
2009-05-02 05:04:19 -04:00
|
|
|
|
2009-05-04 02:00:30 -04:00
|
|
|
PRIMITIVE(string_nth);
|
|
|
|
PRIMITIVE(set_string_nth_slow);
|
|
|
|
PRIMITIVE(set_string_nth_fast);
|
2009-05-04 02:46:13 -04:00
|
|
|
|
|
|
|
}
|