Add sdsnative()

Use the existing memory space for an SDS to convert it to a regular
character buffer so we don't need to allocate duplicate space just
to extract a usable buffer for native operations.
This commit is contained in:
Matt Stancliff
2014-12-10 15:40:34 -05:00
parent c6bf20c2a7
commit e1619772db
2 changed files with 12 additions and 0 deletions

View File

@ -60,6 +60,7 @@ sds sdsempty(void);
size_t sdslen(const sds s);
sds sdsdup(const sds s);
void sdsfree(sds s);
char *sdsnative(sds s);
size_t sdsavail(const sds s);
sds sdsgrowzero(sds s, size_t len);
sds sdscatlen(sds s, const void *t, size_t len);