aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sds.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sds.h b/src/sds.h
index 9b81489..ac99b80 100644
--- a/src/sds.h
+++ b/src/sds.h
@@ -41,6 +41,10 @@ struct sdshdr {
char buf[];
};
+static inline struct sdshdr * sdsheader(const sds s) {
+ return s - (sizeof (struct sdshdr));
+}
+
static inline size_t sdslen(const sds s) {
struct sdshdr *sh = s - (sizeof (struct sdshdr));
return sh->len;