aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-10-25 20:03:24 -0400
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-07 13:34:56 -0300
commit50f1c5db258f95f4770537497f7acd1968f3485c (patch)
treea445cfd50e10e062e44b9a9d41473003c99bb6d2
parent4df884a6113c8ce685dddb44628a936188532888 (diff)
downloadrneovim-50f1c5db258f95f4770537497f7acd1968f3485c.tar.gz
rneovim-50f1c5db258f95f4770537497f7acd1968f3485c.tar.bz2
rneovim-50f1c5db258f95f4770537497f7acd1968f3485c.zip
rstream: Expose rstream_read_ptr and _available.
Needed for accessing this information without direct access to the rstream_buffer.
-rw-r--r--src/nvim/os/rstream.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/os/rstream.c b/src/nvim/os/rstream.c
index f16226cdd1..e36a0213c8 100644
--- a/src/nvim/os/rstream.c
+++ b/src/nvim/os/rstream.c
@@ -190,6 +190,18 @@ RStream * rstream_new(rstream_cb cb, RBuffer *buffer, void *data)
return rv;
}
+/// Returns the read pointer used by the rstream.
+char *rstream_read_ptr(RStream *rstream)
+{
+ return rbuffer_read_ptr(rstream->buffer);
+}
+
+/// Returns the number of bytes before the rstream is full.
+size_t rstream_available(RStream *rstream)
+{
+ return rbuffer_available(rstream->buffer);
+}
+
/// Frees all memory allocated for a RStream instance
///
/// @param rstream The `RStream` instance