diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-02-01 00:04:33 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-02-09 17:06:38 -0500 |
commit | d64db6bad79e10f92c56e5572d6ae9072d62b3a3 (patch) | |
tree | f1f334c165afecd1907e9c4cf377878ba172c35a /dstring.c | |
parent | 563b5f9d48e54dc2f5d61a23ce2171e005da201a (diff) | |
download | bfs-d64db6bad79e10f92c56e5572d6ae9072d62b3a3.tar.xz |
Add some documentation comments
Diffstat (limited to 'dstring.c')
-rw-r--r-- | dstring.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -27,10 +27,12 @@ struct dstring { char data[]; }; +/** Get the string header from the string data pointer. */ static struct dstring *dstrheader(const char *dstr) { return (struct dstring *)(dstr - offsetof(struct dstring, data)); } +/** Get the correct size for a dstring with the given capacity. */ static size_t dstrsize(size_t capacity) { return sizeof(struct dstring) + capacity + 1; } @@ -81,6 +83,7 @@ int dstresize(char **dstr, size_t length) { return 0; } +/** Common implementation of dstr{cat,ncat,app}. */ static int dstrcat_impl(char **dest, const char *src, size_t srclen) { size_t oldlen = dstrlen(*dest); size_t newlen = oldlen + srclen; |