Commit 08a879af authored by antirez's avatar antirez
Browse files

Added sdscatsds() to sds.c/h

parent 7e14a208
...@@ -196,6 +196,10 @@ sds sdscat(sds s, char *t) { ...@@ -196,6 +196,10 @@ sds sdscat(sds s, char *t) {
return sdscatlen(s, t, strlen(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) { sds sdscpylen(sds s, char *t, size_t len) {
struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr))); struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));
size_t totlen = sh->free+sh->len; size_t totlen = sh->free+sh->len;
......
...@@ -62,6 +62,7 @@ size_t sdsavail(sds s); ...@@ -62,6 +62,7 @@ size_t sdsavail(sds s);
sds sdsgrowzero(sds s, size_t len); sds sdsgrowzero(sds s, size_t len);
sds sdscatlen(sds s, void *t, size_t len); sds sdscatlen(sds s, void *t, size_t len);
sds sdscat(sds s, char *t); sds sdscat(sds s, char *t);
sds sdscatsds(sds s, sds t);
sds sdscpylen(sds s, char *t, size_t len); sds sdscpylen(sds s, char *t, size_t len);
sds sdscpy(sds s, char *t); sds sdscpy(sds s, char *t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment