diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-03-12 11:19:09 -0500 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-03-22 12:07:26 +0100 |
commit | cfb66cd25bbf31857b471735e5ff0f7c2aea4d3c (patch) | |
tree | 8d8d06c9e2c880611a3c8cc025d8c35fe38d59ba /platform/java | |
parent | 3832d0c7ab87aa1f2b3a3dbebe43a37e4055d121 (diff) | |
download | mupdf-cfb66cd25bbf31857b471735e5ff0f7c2aea4d3c.tar.xz |
Rename fz_putc/puts/printf to fz_write_*.
Rename fz_write to fz_write_data.
Rename fz_write_buffer_* and fz_buffer_printf to fz_append_*.
Be consistent in naming:
fz_write_* calls write to fz_output.
fz_append_* calls append to fz_buffer.
Update documentation.
Diffstat (limited to 'platform/java')
-rw-r--r-- | platform/java/mupdf_native.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 4b6ca33a..311560fd 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -4864,22 +4864,22 @@ FUN(Page_textAsHtml)(JNIEnv *env, jobject self) buf = fz_new_buffer(ctx, 256); out = fz_new_output_with_buffer(ctx, buf); - fz_printf(ctx, out, "<html>\n"); - fz_printf(ctx, out, "<style>\n"); - fz_printf(ctx, out, "body{margin:0;}\n"); - fz_printf(ctx, out, "div.page{background-color:white;}\n"); - fz_printf(ctx, out, "div.block{margin:0pt;padding:0pt;}\n"); - fz_printf(ctx, out, "div.metaline{display:table;width:100%%}\n"); - fz_printf(ctx, out, "div.line{display:table-row;}\n"); - fz_printf(ctx, out, "div.cell{display:table-cell;padding-left:0.25em;padding-right:0.25em}\n"); - //fz_printf(ctx, out, "p{margin:0;padding:0;}\n"); - fz_printf(ctx, out, "</style>\n"); - fz_printf(ctx, out, "<body style=\"margin:0\"><div style=\"padding:10px\" id=\"content\">"); + fz_write_printf(ctx, out, "<html>\n"); + fz_write_printf(ctx, out, "<style>\n"); + fz_write_printf(ctx, out, "body{margin:0;}\n"); + fz_write_printf(ctx, out, "div.page{background-color:white;}\n"); + fz_write_printf(ctx, out, "div.block{margin:0pt;padding:0pt;}\n"); + fz_write_printf(ctx, out, "div.metaline{display:table;width:100%%}\n"); + fz_write_printf(ctx, out, "div.line{display:table-row;}\n"); + fz_write_printf(ctx, out, "div.cell{display:table-cell;padding-left:0.25em;padding-right:0.25em}\n"); + //fz_write_printf(ctx, out, "p{margin:0;padding:0;}\n"); + fz_write_printf(ctx, out, "</style>\n"); + fz_write_printf(ctx, out, "<body style=\"margin:0\"><div style=\"padding:10px\" id=\"content\">"); fz_print_stext_page_html(ctx, out, text); - fz_printf(ctx, out, "</div></body>\n"); - fz_printf(ctx, out, "<style>\n"); + fz_write_printf(ctx, out, "</div></body>\n"); + fz_write_printf(ctx, out, "<style>\n"); fz_print_stext_sheet(ctx, out, sheet); - fz_printf(ctx, out, "</style>\n</html>\n"); + fz_write_printf(ctx, out, "</style>\n</html>\n"); } fz_always(ctx) { @@ -5244,7 +5244,7 @@ FUN(Buffer_writeByte)(JNIEnv *env, jobject self, jbyte b) if (!ctx || !buf) return; fz_try(ctx) - fz_write_buffer_byte(ctx, buf, b); + fz_append_byte(ctx, buf, b); fz_catch(ctx) jni_rethrow(env, ctx); } @@ -5265,7 +5265,7 @@ FUN(Buffer_writeBytes)(JNIEnv *env, jobject self, jobject jbs) if (!bs) { jni_throw_io(env, "cannot get bytes to write"); return; } fz_try(ctx) - fz_write_buffer(ctx, buf, bs, len); + fz_append_data(ctx, buf, bs, len); fz_always(ctx) (*env)->ReleaseByteArrayElements(env, jbs, bs, JNI_ABORT); fz_catch(ctx) @@ -5306,7 +5306,7 @@ FUN(Buffer_writeBytesFrom)(JNIEnv *env, jobject self, jobject jbs, jint joff, ji if (!bs) { jni_throw_io(env, "cannot get bytes to write"); return; } fz_try(ctx) - fz_write_buffer(ctx, buf, &bs[off], len); + fz_append_data(ctx, buf, &bs[off], len); fz_always(ctx) (*env)->ReleaseByteArrayElements(env, jbs, bs, JNI_ABORT); fz_catch(ctx) @@ -5358,8 +5358,8 @@ FUN(Buffer_writeLine)(JNIEnv *env, jobject self, jstring jline) fz_try(ctx) { - fz_write_buffer(ctx, buf, line, strlen(line)); - fz_write_buffer_byte(ctx, buf, '\n'); + fz_append_string(ctx, buf, line); + fz_append_byte(ctx, buf, '\n'); } fz_always(ctx) (*env)->ReleaseStringUTFChars(env, jline, line); @@ -5395,8 +5395,8 @@ FUN(Buffer_writeLines)(JNIEnv *env, jobject self, jobject jlines) fz_try(ctx) { - fz_write_buffer(ctx, buf, line, strlen(line)); - fz_write_buffer_byte(ctx, buf, '\n'); + fz_append_string(ctx, buf, line); + fz_append_byte(ctx, buf, '\n'); } fz_always(ctx) (*env)->ReleaseStringUTFChars(env, jline, line); |