Add generic function to grow an sds value

Move logic concerned with setting a bit in an sds to the SETBIT command
instead of keeping it in sds.c. The function to grow an sds can and will
be reused for a command to set a range within a string value.
This commit is contained in:
Pieter Noordhuis
2010-12-10 11:58:14 +01:00
parent 076f88d657
commit eae33c1c81
4 changed files with 42 additions and 39 deletions

View File

@ -49,11 +49,11 @@ size_t sdslen(const sds s);
sds sdsdup(const sds s);
void sdsfree(sds s);
size_t sdsavail(sds s);
sds sdsgrowsafe(sds s, size_t len);
sds sdscatlen(sds s, void *t, size_t len);
sds sdscat(sds s, char *t);
sds sdscpylen(sds s, char *t, size_t len);
sds sdscpy(sds s, char *t);
sds sdssetbit(sds s, size_t bit, int on);
sds sdscatvprintf(sds s, const char *fmt, va_list ap);
#ifdef __GNUC__