factor/native/sbuf.h

26 lines
446 B
C
Raw Normal View History

2004-07-16 02:26:21 -04:00
typedef struct {
/* always tag_header(SBUF_TYPE) */
CELL header;
2005-05-05 22:30:58 -04:00
/* tagged */
2004-07-16 02:26:21 -04:00
CELL top;
/* tagged */
CELL string;
} F_SBUF;
2004-07-16 02:26:21 -04:00
2005-05-05 22:30:58 -04:00
INLINE CELL sbuf_capacity(F_SBUF* sbuf)
{
return untag_fixnum_fast(sbuf->top);
}
INLINE F_SBUF* untag_sbuf(CELL tagged)
2004-07-16 02:26:21 -04:00
{
type_check(SBUF_TYPE,tagged);
return (F_SBUF*)UNTAG(tagged);
2004-07-16 02:26:21 -04:00
}
F_SBUF* sbuf(F_FIXNUM capacity);
2004-07-16 02:26:21 -04:00
void primitive_sbuf(void);
void fixup_sbuf(F_SBUF* sbuf);
void collect_sbuf(F_SBUF* sbuf);