diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-08-14 19:37:59 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-08-17 12:36:19 +0100 |
commit | dda017988150901dccd6b9dcb2823d7d8522433b (patch) | |
tree | f6ee6d696c5170ccc686abb77fe0939263b6053e /include/mupdf/fitz/stream.h | |
parent | 88003e46fa0db666d4cbccdfa81857ca7853e55f (diff) | |
download | mupdf-dda017988150901dccd6b9dcb2823d7d8522433b.tar.xz |
Add fz_read_string function to read a null terminated string
Use that within gproof. The existing use of fz_read_line was broken
and was resulting in bad values for separations.
Diffstat (limited to 'include/mupdf/fitz/stream.h')
-rw-r--r-- | include/mupdf/fitz/stream.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mupdf/fitz/stream.h b/include/mupdf/fitz/stream.h index 896b5846..53d5a256 100644 --- a/include/mupdf/fitz/stream.h +++ b/include/mupdf/fitz/stream.h @@ -173,6 +173,16 @@ int16_t fz_read_int16_le(fz_context *ctx, fz_stream *stm); int32_t fz_read_int32_le(fz_context *ctx, fz_stream *stm); int64_t fz_read_int64_le(fz_context *ctx, fz_stream *stm); +/* + fz_read_string: Read a null terminated string from the stream into + the a buffer of a given length. The buffer will be null terminated. + Throws on failure (including the failure to fit the entire string + including the terminator into the buffer). +*/ +void fz_read_string(fz_context *ctx, fz_stream *stm, char *buffer, int len); + + + enum { FZ_STREAM_META_PROGRESSIVE = 1, |