summaryrefslogtreecommitdiff
path: root/deps/lua/src/strbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/lua/src/strbuf.h')
-rw-r--r--deps/lua/src/strbuf.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/deps/lua/src/strbuf.h b/deps/lua/src/strbuf.h
index f856543ad..d861108c1 100644
--- a/deps/lua/src/strbuf.h
+++ b/deps/lua/src/strbuf.h
@@ -1,6 +1,6 @@
/* strbuf - String buffer routines
*
- * Copyright (c) 2010-2011 Mark Pulford <mark@kyne.com.au>
+ * Copyright (c) 2010-2012 Mark Pulford <mark@kyne.com.au>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -62,7 +62,9 @@ extern void strbuf_resize(strbuf_t *s, int len);
static int strbuf_empty_length(strbuf_t *s);
static int strbuf_length(strbuf_t *s);
static char *strbuf_string(strbuf_t *s, int *len);
-static void strbuf_ensure_empty_length(strbuf_t *s, int len);
+static void strbuf_ensure_empty_length(strbuf_t *s, int len);
+static char *strbuf_empty_ptr(strbuf_t *s);
+static void strbuf_extend_length(strbuf_t *s, int len);
/* Update */
extern void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...);
@@ -96,6 +98,16 @@ static inline void strbuf_ensure_empty_length(strbuf_t *s, int len)
strbuf_resize(s, s->length + len);
}
+static inline char *strbuf_empty_ptr(strbuf_t *s)
+{
+ return s->buf + s->length;
+}
+
+static inline void strbuf_extend_length(strbuf_t *s, int len)
+{
+ s->length += len;
+}
+
static inline int strbuf_length(strbuf_t *s)
{
return s->length;