summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/mutool/run.html2
-rw-r--r--source/tools/murun.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/mutool/run.html b/docs/mutool/run.html
index 23286f07..c9ab103e 100644
--- a/docs/mutool/run.html
+++ b/docs/mutool/run.html
@@ -109,6 +109,8 @@ only store bytes.
<dd>Append arguments to the end of the buffer, separated by spaces, ending with a newline.
<dt>Buffer#write(...)
<dd>Append arguments to the end of the buffer, separated by spaces.
+<dt>Buffer#writeBuffer(data)
+<dd>Append the contents of the 'data' buffer to the end of the buffer.
<dt>Buffer#save(fileName)
<dd>Write the contents of the buffer to a file.
</dl>
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 0adb8bc0..b8a7d991 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -1497,6 +1497,17 @@ static void ffi_Buffer_writeLine(js_State *J)
rethrow(J);
}
+static void ffi_Buffer_writeBuffer(js_State *J)
+{
+ fz_context *ctx = js_getcontext(J);
+ fz_buffer *buf = js_touserdata(J, 0, "fz_buffer");
+ fz_buffer *cat = js_touserdata(J, 1, "fz_buffer");
+ fz_try(ctx)
+ fz_append_buffer(ctx, buf, cat);
+ fz_catch(ctx)
+ rethrow(J);
+}
+
static void ffi_Buffer_save(js_State *J)
{
fz_context *ctx = js_getcontext(J);
@@ -3054,6 +3065,7 @@ int murun_main(int argc, char **argv)
jsB_propfun(J, "Buffer.writeByte", ffi_Buffer_writeByte, 1);
jsB_propfun(J, "Buffer.writeRune", ffi_Buffer_writeRune, 1);
jsB_propfun(J, "Buffer.writeLine", ffi_Buffer_writeLine, 1);
+ jsB_propfun(J, "Buffer.writeBuffer", ffi_Buffer_writeBuffer, 1);
jsB_propfun(J, "Buffer.write", ffi_Buffer_write, 1);
jsB_propfun(J, "Buffer.save", ffi_Buffer_save, 1);
}