#ifndef _RString_Header
#define _RString_Header

typedef struct rstring {
	char *data;
	int length;
	int bytes;
} RString;

RString *rstring_new(int bfsz);
RString *rstring_new2(int bfsz);
void rstring_free(RString **s);

int rstring_set(RString *s, char *format, ...);
int rstring_printf(RString *s, char *format, ...);

int rstring_copy(RString *s, char *bf);
int rstring_ncpy(RString *s, char *bf, int n);

int rstring_cat(RString *s, char *bf);
int rstring_ncat(RString *s, char *bf, int n);

int rstring_to_char(RString *s, char *bf, int bfsz);

void rstring_consume(RString *s, int n);

#endif
