summaryrefslogtreecommitdiff
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-03 13:51:55 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-03-04 11:24:58 -0500
commit41d8555f72e3bc60cf93af2a1a4786b452fd2736 (patch)
tree832c10fa71173264e87b891832362d273da91647 /libavformat/avio.h
parentfd085bc08203979c6d0e8a6ab031c7e19b57f7a1 (diff)
avio: add avio_get_str()
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index cc46ad79e5..fd4839c789 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -526,6 +526,20 @@ unsigned int avio_rl32(AVIOContext *s);
uint64_t avio_rl64(AVIOContext *s);
/**
+ * Read a string from pb into buf. The reading will terminate when either
+ * a NULL character was encountered, maxlen bytes have been read, or nothing
+ * more can be read from pb. The result is guaranteed to be NULL-terminated, it
+ * will be truncated if buf is too small.
+ * Note that the string is not interpreted or validated in any way, it
+ * might get truncated in the middle of a sequence for multi-byte encodings.
+ *
+ * @return number of bytes read (is always <= maxlen).
+ * If reading ends on EOF or error, the return value will be one more than
+ * bytes actually read.
+ */
+int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+/**
* Read a UTF-16 string from pb and convert it to UTF-8.
* The reading will terminate when either a null or invalid character was
* encountered or maxlen bytes have been read.