diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-09-13 00:40:03 +0100 |
---|---|---|
committer | Robin Watts <robin@peeves.(none)> | 2012-09-18 05:28:21 -0700 |
commit | 6777c88fab2afc3e6558fda1dfb51110088ede61 (patch) | |
tree | ab0ee337b8e03be4a595703c7177e76ac206e037 /xps | |
parent | 1fa1eca3be2955e1ed1f8433c18d06417ea85f4c (diff) | |
download | ghostpdl-6777c88fab2afc3e6558fda1dfb51110088ede61.tar.gz |
Introduce GS_THREADSAFE define and modify printing calls.
Lots of debugging/error information is printed using eprintf and
dlprintf etc. These functions do not take a gs_memory_t * and are
not safe for use within code that runs under multiple instances
created by gsapi.
Introduce new versions (dmprintf, dmlprintf etc) that DO take a
gs_memory_ *, and move as much of ghostscript/ghostpdl's usage
over to these as possible. I have not touched the contrib directory,
and some locations in the code do not easily have a gs_memory_t
to hand, so I have left them be.
If the GS_THREADSAFE define is made during building, then the
functions that don't take an explicit memory handle are #defined
away to nothing.
If the GS_THREADSAFE define is made, we disable the gsapi check that
checks for a single init.
Diffstat (limited to 'xps')
-rw-r--r-- | xps/ghostxps.h | 2 | ||||
-rw-r--r-- | xps/xpsanalyze.c | 26 | ||||
-rw-r--r-- | xps/xpscff.c | 6 | ||||
-rw-r--r-- | xps/xpsdoc.c | 10 | ||||
-rw-r--r-- | xps/xpsglyphs.c | 30 | ||||
-rw-r--r-- | xps/xpsgradient.c | 2 | ||||
-rw-r--r-- | xps/xpsimage.c | 2 | ||||
-rw-r--r-- | xps/xpspage.c | 2 | ||||
-rw-r--r-- | xps/xpspath.c | 28 | ||||
-rw-r--r-- | xps/xpsresource.c | 12 | ||||
-rw-r--r-- | xps/xpstop.c | 4 | ||||
-rw-r--r-- | xps/xpsttf.c | 4 | ||||
-rw-r--r-- | xps/xpsxml.c | 2 | ||||
-rw-r--r-- | xps/xpszip.c | 20 |
14 files changed, 75 insertions, 75 deletions
diff --git a/xps/ghostxps.h b/xps/ghostxps.h index bd1cfa5f8..37b2bbf90 100644 --- a/xps/ghostxps.h +++ b/xps/ghostxps.h @@ -309,7 +309,7 @@ int xps_parse_resource_dictionary(xps_context_t *ctx, xps_resource_t **dictp, ch void xps_free_resource_dictionary(xps_context_t *ctx, xps_resource_t *dict); void xps_resolve_resource_reference(xps_context_t *ctx, xps_resource_t *dict, char **attp, xps_item_t **tagp, char **urip); -void xps_debug_resource_dictionary(xps_resource_t *dict); +void xps_debug_resource_dictionary(xps_context_t *ctx, xps_resource_t *dict); /* * Fixed page/graphics parsing. diff --git a/xps/xpsanalyze.c b/xps/xpsanalyze.c index 5903b47d1..8a85f59b5 100644 --- a/xps/xpsanalyze.c +++ b/xps/xpsanalyze.c @@ -24,7 +24,7 @@ static int xps_remote_resource_dictionary_has_transparency(xps_context_t *ctx, char *base_uri, char *source_att) { - //dputs("page has transparency: uses a remote resource; not parsed; being conservative\n"); + //dmputs(ctx->memory, "page has transparency: uses a remote resource; not parsed; being conservative\n"); return 1; } @@ -64,7 +64,7 @@ xps_gradient_stops_have_transparency(xps_context_t *ctx, char *base_uri, xps_ite xps_parse_color(ctx, base_uri, color_att, &colorspace, samples); if (samples[0] < 1.0) { - //dputs("page has transparency: GradientStop has alpha\n"); + //dmputs(ctx->memory, "page has transparency: GradientStop has alpha\n"); return 1; } } @@ -85,7 +85,7 @@ xps_gradient_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item { if (atof(opacity_att) < 1.0) { - //dputs("page has transparency: GradientBrush Opacity\n"); + //dmputs(ctx->memory, "page has transparency: GradientBrush Opacity\n"); return 1; } } @@ -125,7 +125,7 @@ xps_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root) float opacity = atof(opacity_att); if (opacity < 1.0 && opacity != 0.0) { - //dputs("page has transparency: SolidColorBrush Opacity\n"); + //dmputs(ctx->memory, "page has transparency: SolidColorBrush Opacity\n"); return 1; } } @@ -136,7 +136,7 @@ xps_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root) xps_parse_color(ctx, base_uri, color_att, &colorspace, samples); if (samples[0] < 1.0 && samples[0] != 0.0) { - //dputs("page has transparency: SolidColorBrush Color has alpha\n"); + //dmputs(ctx->memory, "page has transparency: SolidColorBrush Color has alpha\n"); return 1; } } @@ -149,7 +149,7 @@ xps_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root) { if (atof(opacity_att) < 1.0) { - //dputs("page has transparency: VisualBrush Opacity\n"); + //dmputs(ctx->memory, "page has transparency: VisualBrush Opacity\n"); return 1; } } @@ -194,7 +194,7 @@ xps_path_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root) { if (!strcmp(xps_tag(node), "Path.OpacityMask")) { - //dputs("page has transparency: Path.OpacityMask\n"); + //dmputs(ctx->memory, "page has transparency: Path.OpacityMask\n"); return 1; } @@ -223,7 +223,7 @@ xps_glyphs_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root { if (!strcmp(xps_tag(node), "Glyphs.OpacityMask")) { - //dputs("page has transparency: Glyphs.OpacityMask\n"); + //dmputs(ctx->memory, "page has transparency: Glyphs.OpacityMask\n"); return 1; } @@ -252,7 +252,7 @@ xps_canvas_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root if (!strcmp(xps_tag(node), "Canvas.OpacityMask")) { - //dputs("page has transparency: Canvas.OpacityMask\n"); + //dmputs(ctx->memory, "page has transparency: Canvas.OpacityMask\n"); return 1; } @@ -279,7 +279,7 @@ xps_element_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *nod xps_parse_color(ctx, base_uri, stroke_att, &colorspace, samples); if (samples[0] < 1.0 && samples[0] != 0.0) { - //dprintf1("page has transparency: Stroke alpha=%g\n", samples[0]); + //dmprintf1(ctx->memory, "page has transparency: Stroke alpha=%g\n", samples[0]); return 1; } } @@ -290,7 +290,7 @@ xps_element_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *nod xps_parse_color(ctx, base_uri, fill_att, &colorspace, samples); if (samples[0] < 1.0 && samples[0] != 0.0) { - //dprintf1("page has transparency: Fill alpha=%g\n", samples[0]); + //dmprintf1(ctx->memory, "page has transparency: Fill alpha=%g\n", samples[0]); return 1; } } @@ -301,14 +301,14 @@ xps_element_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *nod float opacity = atof(opacity_att); if (opacity < 1.0 && opacity != 0.0) { - //dprintf1("page has transparency: Opacity=%g\n", atof(opacity_att)); + //dmprintf1(ctx->memory, "page has transparency: Opacity=%g\n", atof(opacity_att)); return 1; } } if (xps_att(node, "OpacityMask")) { - //dputs("page has transparency: OpacityMask\n"); + //dmputs(ctx->memory, "page has transparency: OpacityMask\n"); return 1; } diff --git a/xps/xpscff.c b/xps/xpscff.c index 18342f4bc..b6ca4d537 100644 --- a/xps/xpscff.c +++ b/xps/xpscff.c @@ -607,7 +607,7 @@ xps_post_callback_decode_glyph(gs_font *p42, gs_glyph glyph, int ch) static int xps_post_callback_glyph_name(gs_font *pf, gs_glyph glyph, gs_const_string *pstr) { - dprintf1("asking for CFF glyph name %lu\n", (ulong)glyph); + dmprintf1(pf->memory, "asking for CFF glyph name %lu\n", (ulong)glyph); return -1; } @@ -615,7 +615,7 @@ static int xps_post_callback_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, int members, gs_glyph_info_t *info) { - dprintf1("asking for CFF glyph info %lu\n", (ulong)glyph); + dmprintf1(font->memory, "asking for CFF glyph info %lu\n", (ulong)glyph); return -1; } @@ -623,7 +623,7 @@ static int xps_post_callback_glyph_outline(gs_font *font, int wmode, gs_glyph glyph, const gs_matrix *pmat, gx_path *ppath, double sbw[4]) { - dprintf1("asking for CFF glyph outline %lu\n", (ulong)glyph); + dmprintf1(font->memory, "asking for CFF glyph outline %lu\n", (ulong)glyph); return -1; } diff --git a/xps/xpsdoc.c b/xps/xpsdoc.c index 85a56acd2..c4724ec71 100644 --- a/xps/xpsdoc.c +++ b/xps/xpsdoc.c @@ -53,17 +53,17 @@ xps_debug_fixdocseq(xps_context_t *ctx) xps_page_t *page = ctx->first_page; if (ctx->start_part) - dprintf1("start part %s\n", ctx->start_part); + dmprintf1(ctx->memory, "start part %s\n", ctx->start_part); while (fixdoc) { - dprintf1("fixdoc %s\n", fixdoc->name); + dmprintf1(ctx->memory, "fixdoc %s\n", fixdoc->name); fixdoc = fixdoc->next; } while (page) { - dprintf3("page %s w=%d h=%d\n", page->name, page->width, page->height); + dmprintf3(ctx->memory, "page %s w=%d h=%d\n", page->name, page->width, page->height); page = page->next; } } @@ -78,7 +78,7 @@ xps_add_fixed_document(xps_context_t *ctx, char *name) if (!strcmp(fixdoc->name, name)) return; - if_debug1('|', "doc: adding fixdoc %s\n", name); + if_debug1m('|', ctx->memory, "doc: adding fixdoc %s\n", name); fixdoc = xps_alloc(ctx, sizeof(xps_document_t)); fixdoc->name = xps_strdup(ctx, name); @@ -121,7 +121,7 @@ xps_add_fixed_page(xps_context_t *ctx, char *name, int width, int height) if (!strcmp(page->name, name)) return; - if_debug1('|', "doc: adding page %s\n", name); + if_debug1m('|', ctx->memory, "doc: adding page %s\n", name); page = xps_alloc(ctx, sizeof(xps_page_t)); page->name = xps_strdup(ctx, name); diff --git a/xps/xpsglyphs.c b/xps/xpsglyphs.c index d44eccca9..8847e3ee2 100644 --- a/xps/xpsglyphs.c +++ b/xps/xpsglyphs.c @@ -51,27 +51,27 @@ xps_debug_path(xps_context_t *ctx) switch (seg->type) { case s_start: - dprintf2("%g %g moveto\n", - fixed2float(seg->pt.x) * 0.001, - fixed2float(seg->pt.y) * 0.001); + dmprintf2(ctx->memory, "%g %g moveto\n", + fixed2float(seg->pt.x) * 0.001, + fixed2float(seg->pt.y) * 0.001); break; case s_line: - dprintf2("%g %g lineto\n", - fixed2float(seg->pt.x) * 0.001, - fixed2float(seg->pt.y) * 0.001); + dmprintf2(ctx->memory, "%g %g lineto\n", + fixed2float(seg->pt.x) * 0.001, + fixed2float(seg->pt.y) * 0.001); break; case s_line_close: - dputs("closepath\n"); + dmputs(ctx->memory, "closepath\n"); break; case s_curve: cseg = (curve_segment*)seg; - dprintf6("%g %g %g %g %g %g curveto\n", - fixed2float(cseg->p1.x) * 0.001, - fixed2float(cseg->p1.y) * 0.001, - fixed2float(cseg->p2.x) * 0.001, - fixed2float(cseg->p2.y) * 0.001, - fixed2float(seg->pt.x) * 0.001, - fixed2float(seg->pt.y) * 0.001); + dmprintf6(ctx->memory, "%g %g %g %g %g %g curveto\n", + fixed2float(cseg->p1.x) * 0.001, + fixed2float(cseg->p1.y) * 0.001, + fixed2float(cseg->p2.x) * 0.001, + fixed2float(cseg->p2.y) * 0.001, + fixed2float(seg->pt.x) * 0.001, + fixed2float(seg->pt.y) * 0.001); break; } seg = seg->next; @@ -168,7 +168,7 @@ xps_flush_text_buffer(xps_context_t *ctx, xps_font_t *font, int code; int i; - // dprintf1("flushing text buffer (%d glyphs)\n", buf->count); + // dmprintf1(ctx->memory, "flushing text buffer (%d glyphs)\n", buf->count); gs_moveto(ctx->pgs, x, y); diff --git a/xps/xpsgradient.c b/xps/xpsgradient.c index 4515b5677..efafd6795 100644 --- a/xps/xpsgradient.c +++ b/xps/xpsgradient.c @@ -693,7 +693,7 @@ xps_draw_radial_gradient(xps_context_t *ctx, xps_item_t *root, int spread, gs_fu /* Draw current circle */ if (!point_inside_circle(x0, y0, x1, y1, r1)) - dputs("xps: we should reverse gradient here too\n"); + dmputs(ctx->memory, "xps: we should reverse gradient here too\n"); if (spread == SPREAD_REFLECT && (i & 1)) code = xps_draw_one_radial_gradient(ctx, func, 0, x1, y1, r1, x0, y0, r0); diff --git a/xps/xpsimage.c b/xps/xpsimage.c index 6f0a05c86..39731b093 100644 --- a/xps/xpsimage.c +++ b/xps/xpsimage.c @@ -199,7 +199,7 @@ xps_decode_image(xps_context_t *ctx, xps_part_t *part, xps_image_t *image) if (image->hasalpha) { if (image->bits < 8) - dprintf1("cannot isolate alpha channel in %d bpc images\n", image->bits); + dmprintf1(ctx->memory, "cannot isolate alpha channel in %d bpc images\n", image->bits); if (image->bits == 8) xps_isolate_alpha_channel_8(ctx, image); if (image->bits == 16) diff --git a/xps/xpspage.c b/xps/xpspage.c index 84945a727..bfd1d7393 100644 --- a/xps/xpspage.c +++ b/xps/xpspage.c @@ -123,7 +123,7 @@ xps_parse_fixed_page(xps_context_t *ctx, xps_part_t *part) char *s; int code; - if_debug1('|', "doc: parsing page %s\n", part->name); + if_debug1m('|', ctx->memory, "doc: parsing page %s\n", part->name); xps_strlcpy(base_uri, part->name, sizeof base_uri); s = strrchr(base_uri, '/'); diff --git a/xps/xpspath.c b/xps/xpspath.c index 9383b208d..260bc163c 100644 --- a/xps/xpspath.c +++ b/xps/xpspath.c @@ -263,7 +263,7 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) args = xps_alloc(ctx, sizeof(char*) * (strlen(geom) + 1)); pargs = args; - //dprintf1("new path (%.70s)\n", geom); + //dmprintf1(ctx->memory, "new path (%.70s)\n", geom); gs_newpath(ctx->pgs); while (*s) @@ -321,47 +321,47 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) case 'M': gs_moveto(ctx->pgs, atof(args[i]), atof(args[i+1])); - //dprintf2("moveto %g %g\n", atof(args[i]), atof(args[i+1])); + //dmprintf2(ctx->memory, "moveto %g %g\n", atof(args[i]), atof(args[i+1])); i += 2; break; case 'm': gs_rmoveto(ctx->pgs, atof(args[i]), atof(args[i+1])); - //dprintf2("rmoveto %g %g\n", atof(args[i]), atof(args[i+1])); + //dmprintf2(ctx->memory, "rmoveto %g %g\n", atof(args[i]), atof(args[i+1])); i += 2; break; case 'L': gs_lineto(ctx->pgs, atof(args[i]), atof(args[i+1])); - //dprintf2("lineto %g %g\n", atof(args[i]), atof(args[i+1])); + //dmprintf2(ctx->memory, "lineto %g %g\n", atof(args[i]), atof(args[i+1])); i += 2; break; case 'l': gs_rlineto(ctx->pgs, atof(args[i]), atof(args[i+1])); - //dprintf2("rlineto %g %g\n", atof(args[i]), atof(args[i+1])); + //dmprintf2(ctx->memory, "rlineto %g %g\n", atof(args[i]), atof(args[i+1])); i += 2; break; case 'H': gs_currentpoint(ctx->pgs, &pt); gs_lineto(ctx->pgs, atof(args[i]), pt.y); - //dprintf1("hlineto %g\n", atof(args[i])); + //dmprintf1(ctx->memory, "hlineto %g\n", atof(args[i])); i += 1; break; case 'h': gs_rlineto(ctx->pgs, atof(args[i]), 0.0); - //dprintf1("rhlineto %g\n", atof(args[i])); + //dmprintf1(ctx->memory, "rhlineto %g\n", atof(args[i])); i += 1; break; case 'V': gs_currentpoint(ctx->pgs, &pt); gs_lineto(ctx->pgs, pt.x, atof(args[i])); - //dprintf1("vlineto %g\n", atof(args[i])); + //dmprintf1(ctx->memory, "vlineto %g\n", atof(args[i])); i += 1; break; case 'v': gs_rlineto(ctx->pgs, 0.0, atof(args[i])); - //dprintf1("rvlineto %g\n", atof(args[i])); + //dmprintf1(ctx->memory, "rvlineto %g\n", atof(args[i])); i += 1; break; @@ -400,7 +400,7 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) y1 = atof(args[i+1]); x2 = atof(args[i+2]); y2 = atof(args[i+3]); - //dprintf2("smooth %g %g\n", smooth_x, smooth_y); + //dmprintf2(ctx->memory, "smooth %g %g\n", smooth_x, smooth_y); gs_curveto(ctx->pgs, pt.x + smooth_x, pt.y + smooth_y, x1, y1, x2, y2); i += 4; reset_smooth = 0; @@ -414,7 +414,7 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) y1 = atof(args[i+1]) + pt.y; x2 = atof(args[i+2]) + pt.x; y2 = atof(args[i+3]) + pt.y; - //dprintf2("smooth %g %g\n", smooth_x, smooth_y); + //dmprintf2(ctx->memory, "smooth %g %g\n", smooth_x, smooth_y); gs_curveto(ctx->pgs, pt.x + smooth_x, pt.y + smooth_y, x1, y1, x2, y2); i += 4; reset_smooth = 0; @@ -428,7 +428,7 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) y1 = atof(args[i+1]); x2 = atof(args[i+2]); y2 = atof(args[i+3]); - //dprintf4("conicto %g %g %g %g\n", x1, y1, x2, y2); + //dmprintf4(ctx->memory, "conicto %g %g %g %g\n", x1, y1, x2, y2); gs_curveto(ctx->pgs, (pt.x + 2 * x1) / 3, (pt.y + 2 * y1) / 3, (x2 + 2 * x1) / 3, (y2 + 2 * y1) / 3, @@ -441,7 +441,7 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) y1 = atof(args[i+1]) + pt.y; x2 = atof(args[i+2]) + pt.x; y2 = atof(args[i+3]) + pt.y; - //dprintf4("conicto %g %g %g %g\n", x1, y1, x2, y2); + //dmprintf4(ctx->memory, "conicto %g %g %g %g\n", x1, y1, x2, y2); gs_curveto(ctx->pgs, (pt.x + 2 * x1) / 3, (pt.y + 2 * y1) / 3, (x2 + 2 * x1) / 3, (y2 + 2 * y1) / 3, @@ -468,7 +468,7 @@ xps_parse_abbreviated_geometry(xps_context_t *ctx, char *geom) case 'Z': case 'z': gs_closepath(ctx->pgs); - //dputs("closepath\n"); + //dmputs(ctx->memory, "closepath\n"); break; default: diff --git a/xps/xpsresource.c b/xps/xpsresource.c index 3ad14fc15..88ac3e6aa 100644 --- a/xps/xpsresource.c +++ b/xps/xpsresource.c @@ -189,18 +189,18 @@ xps_free_resource_dictionary(xps_context_t *ctx, xps_resource_t *dict) } void -xps_debug_resource_dictionary(xps_resource_t *dict) +xps_debug_resource_dictionary(xps_context_t *ctx, xps_resource_t *dict) { while (dict) { if (dict->base_uri) - dprintf1("URI = '%s'\n", dict->base_uri); - dprintf2("KEY = '%s' VAL = %p\n", dict->name, dict->data); + dmprintf1(ctx->memory, "URI = '%s'\n", dict->base_uri); + dmprintf2(ctx->memory, "KEY = '%s' VAL = %p\n", dict->name, dict->data); if (dict->parent) { - dputs("PARENT = {\n"); - xps_debug_resource_dictionary(dict->parent); - dputs("}\n"); + dmputs(ctx->memory, "PARENT = {\n"); + xps_debug_resource_dictionary(ctx, dict->parent); + dmputs(ctx->memory, "}\n"); } dict = dict->next; } diff --git a/xps/xpstop.c b/xps/xpstop.c index 2e8ffa6a7..e6fa382c6 100644 --- a/xps/xpstop.c +++ b/xps/xpstop.c @@ -318,7 +318,7 @@ xps_imp_process(pl_interp_instance_t *pinstance, stream_cursor_read *cursor) gs_catch(gs_error_invalidfileaccess, "cannot open scratch file"); return e_ExitLanguage; } - if_debug1('|', "xps: open scratch file '%s'\n", instance->scratch_name); + if_debug1m('|', ctx->memory, "xps: open scratch file '%s'\n", instance->scratch_name); } avail = cursor->limit - cursor->ptr; @@ -354,7 +354,7 @@ xps_imp_process_eof(pl_interp_instance_t *pinstance) if (instance->scratch_file) { - if_debug0('|', "xps: executing scratch file\n"); + if_debug0m('|', ctx->memory, "xps: executing scratch file\n"); fclose(instance->scratch_file); instance->scratch_file = NULL; code = xps_process_file(ctx, instance->scratch_name); diff --git a/xps/xpsttf.c b/xps/xpsttf.c index ef160be46..b70868e74 100644 --- a/xps/xpsttf.c +++ b/xps/xpsttf.c @@ -202,7 +202,7 @@ xps_true_callback_glyph_name(gs_font *pfont, gs_glyph glyph, gs_const_string *ps /* mac easy */ if ( glyph_name_index < 258 ) { - // dprintf2("glyph name (mac) %d = %s\n", glyph, pl_mac_names[glyph_name_index]); + // dmprintf2(pfont->memory, "glyph name (mac) %d = %s\n", glyph, pl_mac_names[glyph_name_index]); pstr->data = (byte*) pl_mac_names[glyph_name_index]; pstr->size = strlen((char*)pstr->data); return 0; @@ -262,7 +262,7 @@ xps_true_callback_build_char(gs_show_enum *penum, gs_state *pgs, gs_font *pfont, gs_fixed_point saved_adjust; int code; - // dprintf1("build char ttf %d\n", glyph); + // dmprintf1(pfont->memory, "build char ttf %d\n", glyph); code = gs_type42_get_metrics(p42, glyph, sbw); if (code < 0) diff --git a/xps/xpsxml.c b/xps/xpsxml.c index 37d154d60..1d8dc2627 100644 --- a/xps/xpsxml.c +++ b/xps/xpsxml.c @@ -90,7 +90,7 @@ on_open_tag(void *zp, char *ns_name, char **atts) if (!name) { - dprintf1("unknown namespace: %s\n", ns_name); + dmprintf1(ctx->memory, "unknown namespace: %s\n", ns_name); name = ns_name; } diff --git a/xps/xpszip.c b/xps/xpszip.c index 1e91e3504..b67046d92 100644 --- a/xps/xpszip.c +++ b/xps/xpszip.c @@ -98,7 +98,7 @@ xps_read_zip_entry(xps_context_t *ctx, xps_entry_t *ent, unsigned char *outbuf) int namelength, extralength; int code; - if_debug1('|', "zip: inflating entry '%s'\n", ent->name); + if_debug1m('|', ctx->memory, "zip: inflating entry '%s'\n", ent->name); fseek(ctx->file, ent->offset, 0); @@ -233,10 +233,10 @@ xps_read_zip_dir(xps_context_t *ctx, int start_offset) for (i = 0; i < ctx->zip_count; i++) { - if_debug3('|', "zip entry '%s' csize=%d usize=%d\n", - ctx->zip_table[i].name, - ctx->zip_table[i].csize, - ctx->zip_table[i].usize); + if_debug3m('|', ctx->memory, "zip entry '%s' csize=%d usize=%d\n", + ctx->zip_table[i].name, + ctx->zip_table[i].csize, + ctx->zip_table[i].usize); } return gs_okay; @@ -480,7 +480,7 @@ xps_process_file(xps_context_t *ctx, char *filename) xps_part_t *part; int size; - if_debug0('|', "zip: single page mode\n"); + if_debug0m('|', ctx->memory, "zip: single page mode\n"); xps_strlcpy(buf, filename, sizeof buf); while (1) { @@ -490,19 +490,19 @@ xps_process_file(xps_context_t *ctx, char *filename) if (!p) break; xps_strlcpy(p, "/_rels/.rels", buf + sizeof buf - p); - if_debug1('|', "zip: testing if '%s' exists\n", buf); + if_debug1m('|', ctx->memory, "zip: testing if '%s' exists\n", buf); if (isfile(buf)) { *p = 0; ctx->directory = xps_strdup(ctx, buf); - if_debug1('|', "zip: using '%s' as root directory\n", ctx->directory); + if_debug1m('|', ctx->memory, "zip: using '%s' as root directory\n", ctx->directory); break; } *p = 0; } if (!ctx->directory) { - if_debug0('|', "zip: no /_rels/.rels found; assuming absolute paths\n"); + if_debug0m('|', ctx->memory, "zip: no /_rels/.rels found; assuming absolute paths\n"); ctx->directory = xps_strdup(ctx, ""); } @@ -528,7 +528,7 @@ xps_process_file(xps_context_t *ctx, char *filename) p = strstr(buf, "\\_rels\\.rels"); *p = 0; ctx->directory = xps_strdup(ctx, buf); - if_debug1('|', "zip: using '%s' as root directory\n", ctx->directory); + if_debug1m('|', ctx->memory, "zip: using '%s' as root directory\n", ctx->directory); } else { |