summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2017-04-13 12:55:29 +0000
committerkrasimir <krasimir@chalmers.se>2017-04-13 12:55:29 +0000
commitdf6c2f3f17c9ab410721f7974cfed347657b633e (patch)
tree54c3a6fdfeeba706123574908dc30deb9b96cf2d /src/runtime
parent2551ab740b57053e8594443b03bf7b6d446ce6cf (diff)
add gu_string_buf_data and gu_string_buf_length in libgu
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/c/gu/string.c14
-rw-r--r--src/runtime/c/gu/string.h6
2 files changed, 20 insertions, 0 deletions
diff --git a/src/runtime/c/gu/string.c b/src/runtime/c/gu/string.c
index 3e754a72c..386eb7a6f 100644
--- a/src/runtime/c/gu/string.c
+++ b/src/runtime/c/gu/string.c
@@ -82,6 +82,20 @@ gu_string_buf_freeze(GuStringBuf* sb, GuPool* pool)
return p;
}
+char*
+gu_string_buf_data(GuStringBuf* sb)
+{
+ gu_out_flush(sb->out, NULL);
+ return gu_buf_data(sb->buf);
+}
+
+size_t
+gu_string_buf_length(GuStringBuf* sb)
+{
+ gu_out_flush(sb->out, NULL);
+ return gu_buf_length(sb->buf);
+}
+
void
gu_string_buf_flush(GuStringBuf* sb)
{
diff --git a/src/runtime/c/gu/string.h b/src/runtime/c/gu/string.h
index 17b932397..d52c9dddb 100644
--- a/src/runtime/c/gu/string.h
+++ b/src/runtime/c/gu/string.h
@@ -33,6 +33,12 @@ gu_string_buf_out(GuStringBuf* sb);
GuString
gu_string_buf_freeze(GuStringBuf* sb, GuPool* pool);
+char*
+gu_string_buf_data(GuStringBuf* sb);
+
+size_t
+gu_string_buf_length(GuStringBuf* sb);
+
void
gu_string_buf_flush(GuStringBuf* sb);