diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:41:13 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-17 23:41:13 +0100 |
commit | d89b7953c0c3409d8debd3b98430a4d2f5f83fed (patch) | |
tree | e31bcf49e6cb6e2d9fe75eb8aeb5bd479e159443 /src | |
parent | bce31907c030849f85c7777a53052fef31f80515 (diff) | |
download | sds-d89b7953c0c3409d8debd3b98430a4d2f5f83fed.tar.xz |
sds.h: Add inline function for getting the sdshdr
Diffstat (limited to 'src')
-rw-r--r-- | src/sds.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |