2009-05-04 02:00:30 -04:00
|
|
|
inline static CELL string_capacity(F_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 02:00:30 -04:00
|
|
|
inline static CELL string_size(CELL size)
|
2009-05-02 05:04:19 -04:00
|
|
|
{
|
|
|
|
return sizeof(F_STRING) + size;
|
|
|
|
}
|
|
|
|
|
|
|
|
F_STRING* allot_string_internal(CELL capacity);
|
|
|
|
F_STRING* allot_string(CELL capacity, CELL fill);
|
2009-05-04 02:00:30 -04:00
|
|
|
PRIMITIVE(string);
|
2009-05-02 05:04:19 -04:00
|
|
|
F_STRING *reallot_string(F_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 */
|
|
|
|
CELL string_nth(F_STRING* string, CELL index);
|
|
|
|
void set_string_nth(F_STRING* string, CELL index, CELL value);
|
|
|
|
|
2009-05-04 02:00:30 -04:00
|
|
|
PRIMITIVE(string_nth);
|
|
|
|
PRIMITIVE(set_string_nth_slow);
|
|
|
|
PRIMITIVE(set_string_nth_fast);
|