Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-05-10 17:02:01 +0400
committerMark Pulford <mark@kyne.com.au>2011-05-10 17:02:01 +0400
commit126470cc7b6c2314c02805e4d00afe04b6b00312 (patch)
tree9dd59bcc02307403410ef405b0f02bf39bd57560 /strbuf.h
parentc877da6c1f84b19cd2e7e8154b4a0d0e355745a0 (diff)
Add runtime option for persistent encode buffer
Diffstat (limited to 'strbuf.h')
-rw-r--r--strbuf.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/strbuf.h b/strbuf.h
index 7829c63..28512f2 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -78,6 +78,11 @@ static inline void strbuf_reset(strbuf_t *s)
s->length = 0;
}
+static inline int strbuf_allocated(strbuf_t *s)
+{
+ return s->buf != NULL;
+}
+
/* Return bytes remaining in the string buffer
* Ensure there is space for a NULL terminator. */
static inline int strbuf_empty_length(strbuf_t *s)