summaryrefslogtreecommitdiff
path: root/sds.h
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2016-04-20 15:27:38 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2016-04-20 15:27:38 +0200
commit63e1cf0c635acc438806f7acea949c3fcdf86cae (patch)
treede6e0a1de17f40f7cc7919d45cd892e19e86ea90 /sds.h
parentd76e13b6d5e6fe541afc5f73f0302e2a77bbeaf2 (diff)
feat: Include latests changes from sds upstream
Diffstat (limited to 'sds.h')
-rw-r--r--sds.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/sds.h b/sds.h
index 1aadace..394f8b5 100644
--- a/sds.h
+++ b/sds.h
@@ -1,6 +1,8 @@
-/* SDSLib, A C dynamic strings library
+/* SDSLib 2.0 -- A C dynamic strings library
*
- * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com>
+ * Copyright (c) 2006-2015, Salvatore Sanfilippo <antirez at gmail dot com>
+ * Copyright (c) 2015, Oran Agra
+ * Copyright (c) 2015, Redis Labs, Inc
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -247,12 +249,22 @@ sds sdscatrepr(sds s, const char *p, size_t len);
sds *sdssplitargs(const char *line, int *argc);
sds sdsmapchars(sds s, const char *from, const char *to, size_t setlen);
sds sdsjoin(char **argv, int argc, char *sep);
+sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen);
/* Low level functions exposed to the user API */
sds sdsMakeRoomFor(sds s, size_t addlen);
void sdsIncrLen(sds s, int incr);
sds sdsRemoveFreeSpace(sds s);
size_t sdsAllocSize(sds s);
+void *sdsAllocPtr(sds s);
+
+/* Export the allocator used by SDS to the program using SDS.
+ * Sometimes the program SDS is linked to, may use a different set of
+ * allocators, but may want to allocate or free things that SDS will
+ * respectively free or allocate. */
+void *sds_malloc(size_t size);
+void *sds_realloc(void *ptr, size_t size);
+void sds_free(void *ptr);
#ifdef REDIS_TEST
int sdsTest(int argc, char *argv[]);