Added sdscatsds() to sds.c/h

This commit is contained in:
antirez 2011-11-21 15:34:00 +01:00
parent 7e14a20801
commit 08a879af6e
2 changed files with 5 additions and 0 deletions

View File

@ -196,6 +196,10 @@ sds sdscat(sds s, char *t) {
return sdscatlen(s, t, strlen(t));
}
sds sdscatsds(sds s, sds t) {
return sdscatlen(s, t, sdslen(t));
}
sds sdscpylen(sds s, char *t, size_t len) {
struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));
size_t totlen = sh->free+sh->len;

View File

@ -62,6 +62,7 @@ size_t sdsavail(sds s);
sds sdsgrowzero(sds s, size_t len);
sds sdscatlen(sds s, void *t, size_t len);
sds sdscat(sds s, char *t);
sds sdscatsds(sds s, sds t);
sds sdscpylen(sds s, char *t, size_t len);
sds sdscpy(sds s, char *t);