summaryrefslogtreecommitdiffstats
path: root/docs/reference.rst
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-08-24 20:51:29 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-08-24 20:51:29 +0300
commitea57f74741b5b5ab3ab4a3e81d8b61811417b4c6 (patch)
treea0438951f0e43d6033e31414c72719dabab32345 /docs/reference.rst
parent9383f305dc42eeca8b043c5c6dff3fe2e3e8f4f2 (diff)
Document pb_close_string_substream.
Diffstat (limited to 'docs/reference.rst')
-rw-r--r--docs/reference.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/reference.rst b/docs/reference.rst
index 7dd08edd..3a6e11a4 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -428,4 +428,16 @@ Decode the length for a field with wire type *PB_WT_STRING* and create a substre
:substream: New substream that has limited length. Filled in by the function.
:returns: True on success, false if reading the length fails.
-This function uses `pb_decode_varint`_ to read an integer from the stream. This is interpreted as a number of bytes, and the substream is set up so that its `bytes_left` is initially the same as the length. The substream has a wrapper callback that in turn reads from the parent stream.
+This function uses `pb_decode_varint`_ to read an integer from the stream. This is interpreted as a number of bytes, and the substream is set up so that its `bytes_left` is initially the same as the length, and its callback function and state the same as the parent stream.
+
+pb_close_string_substream
+------------------------
+Close the substream created with `pb_make_string_substream`_. ::
+
+ void pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream);
+
+:stream: Original input stream to read the length and data from.
+:substream: Substream to close
+
+This function copies back the state from the substream to the parent stream.
+It must be called after done with the substream.