/src/ghostpdl/pdf/pdf_obj.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Copyright (C) 2020-2022 Artifex Software, Inc. |
2 | | All Rights Reserved. |
3 | | |
4 | | This software is provided AS-IS with no warranty, either express or |
5 | | implied. |
6 | | |
7 | | This software is distributed under license and may not be copied, |
8 | | modified or distributed except as expressly authorized under the terms |
9 | | of the license contained in the file LICENSE in this distribution. |
10 | | |
11 | | Refer to licensing information at http://www.artifex.com or contact |
12 | | Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, |
13 | | CA 94945, U.S.A., +1(415)492-9861, for further information. |
14 | | */ |
15 | | |
16 | | #ifndef PDF_OBJECTS |
17 | | #define PDF_OBJECTS |
18 | | |
19 | | int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pdf_obj **obj); |
20 | | void pdfi_free_object(pdf_obj *o); |
21 | | int pdfi_obj_to_string(pdf_context *ctx, pdf_obj *obj, byte **data, int *len); |
22 | | int pdfi_obj_dict_to_stream(pdf_context *ctx, pdf_dict *dict, pdf_stream **stream, bool do_convert); |
23 | | int pdfi_obj_charstr_to_string(pdf_context *ctx, const char *charstr, pdf_string **string); |
24 | | int pdfi_obj_charstr_to_name(pdf_context *ctx, const char *charstr, pdf_name **name); |
25 | | int pdfi_obj_get_label(pdf_context *ctx, pdf_obj *obj, char **label); |
26 | | int pdfi_num_alloc(pdf_context *ctx, double d, pdf_num **num); |
27 | | |
28 | | static inline int |
29 | | pdfi_obj_to_real(pdf_context *ctx, pdf_obj *obj, double *d) |
30 | 119M | { |
31 | 119M | pdf_num *num = (pdf_num *)obj; |
32 | | |
33 | 119M | switch (pdfi_type_of(num)) { |
34 | 20.9M | case PDF_INT: |
35 | 20.9M | *d = (double)num->value.i; |
36 | 20.9M | break; |
37 | 98.7M | case PDF_REAL: |
38 | 98.7M | *d = num->value.d; |
39 | 98.7M | break; |
40 | 94.0k | default: |
41 | 94.0k | return_error(gs_error_typecheck); |
42 | 119M | } |
43 | | |
44 | 119M | return 0; |
45 | 119M | } zpdfops.c:pdfi_obj_to_real Line | Count | Source | 30 | 102k | { | 31 | 102k | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 102k | switch (pdfi_type_of(num)) { | 34 | 0 | case PDF_INT: | 35 | 0 | *d = (double)num->value.i; | 36 | 0 | break; | 37 | 102k | case PDF_REAL: | 38 | 102k | *d = num->value.d; | 39 | 102k | break; | 40 | 0 | default: | 41 | 0 | return_error(gs_error_typecheck); | 42 | 102k | } | 43 | | | 44 | 102k | return 0; | 45 | 102k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_real pdf_dict.c:pdfi_obj_to_real Line | Count | Source | 30 | 639k | { | 31 | 639k | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 639k | switch (pdfi_type_of(num)) { | 34 | 518k | case PDF_INT: | 35 | 518k | *d = (double)num->value.i; | 36 | 518k | break; | 37 | 120k | case PDF_REAL: | 38 | 120k | *d = num->value.d; | 39 | 120k | break; | 40 | 23 | default: | 41 | 23 | return_error(gs_error_typecheck); | 42 | 639k | } | 43 | | | 44 | 639k | return 0; | 45 | 639k | } |
pdf_array.c:pdfi_obj_to_real Line | Count | Source | 30 | 9.08M | { | 31 | 9.08M | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 9.08M | switch (pdfi_type_of(num)) { | 34 | 7.67M | case PDF_INT: | 35 | 7.67M | *d = (double)num->value.i; | 36 | 7.67M | break; | 37 | 1.41M | case PDF_REAL: | 38 | 1.41M | *d = num->value.d; | 39 | 1.41M | break; | 40 | 153 | default: | 41 | 153 | return_error(gs_error_typecheck); | 42 | 9.08M | } | 43 | | | 44 | 9.08M | return 0; | 45 | 9.08M | } |
Unexecuted instantiation: pdf_xref.c:pdfi_obj_to_real Unexecuted instantiation: pdf_int.c:pdfi_obj_to_real Unexecuted instantiation: pdf_file.c:pdfi_obj_to_real Unexecuted instantiation: pdf_path.c:pdfi_obj_to_real Unexecuted instantiation: pdf_colour.c:pdfi_obj_to_real Unexecuted instantiation: pdf_pattern.c:pdfi_obj_to_real Unexecuted instantiation: pdf_gstate.c:pdfi_obj_to_real pdf_stack.c:pdfi_obj_to_real Line | Count | Source | 30 | 104M | { | 31 | 104M | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 104M | switch (pdfi_type_of(num)) { | 34 | 9.55M | case PDF_INT: | 35 | 9.55M | *d = (double)num->value.i; | 36 | 9.55M | break; | 37 | 94.5M | case PDF_REAL: | 38 | 94.5M | *d = num->value.d; | 39 | 94.5M | break; | 40 | 92.1k | default: | 41 | 92.1k | return_error(gs_error_typecheck); | 42 | 104M | } | 43 | | | 44 | 104M | return 0; | 45 | 104M | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_real pdf_page.c:pdfi_obj_to_real Line | Count | Source | 30 | 312k | { | 31 | 312k | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 312k | switch (pdfi_type_of(num)) { | 34 | 209k | case PDF_INT: | 35 | 209k | *d = (double)num->value.i; | 36 | 209k | break; | 37 | 102k | case PDF_REAL: | 38 | 102k | *d = num->value.d; | 39 | 102k | break; | 40 | 56 | default: | 41 | 56 | return_error(gs_error_typecheck); | 42 | 312k | } | 43 | | | 44 | 312k | return 0; | 45 | 312k | } |
Unexecuted instantiation: pdf_annot.c:pdfi_obj_to_real Unexecuted instantiation: pdf_mark.c:pdfi_obj_to_real pdf_font.c:pdfi_obj_to_real Line | Count | Source | 30 | 493k | { | 31 | 493k | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 493k | switch (pdfi_type_of(num)) { | 34 | 312k | case PDF_INT: | 35 | 312k | *d = (double)num->value.i; | 36 | 312k | break; | 37 | 180k | case PDF_REAL: | 38 | 180k | *d = num->value.d; | 39 | 180k | break; | 40 | 1.11k | default: | 41 | 1.11k | return_error(gs_error_typecheck); | 42 | 493k | } | 43 | | | 44 | 492k | return 0; | 45 | 493k | } |
Unexecuted instantiation: pdf_font0.c:pdfi_obj_to_real Unexecuted instantiation: pdf_font1.c:pdfi_obj_to_real Unexecuted instantiation: pdf_font1C.c:pdfi_obj_to_real Unexecuted instantiation: pdf_fontps.c:pdfi_obj_to_real Unexecuted instantiation: pdf_font3.c:pdfi_obj_to_real Unexecuted instantiation: pdf_fontTT.c:pdfi_obj_to_real Unexecuted instantiation: pdf_font11.c:pdfi_obj_to_real Unexecuted instantiation: pdf_cmap.c:pdfi_obj_to_real Unexecuted instantiation: pdf_fmap.c:pdfi_obj_to_real pdf_text.c:pdfi_obj_to_real Line | Count | Source | 30 | 5.02M | { | 31 | 5.02M | pdf_num *num = (pdf_num *)obj; | 32 | | | 33 | 5.02M | switch (pdfi_type_of(num)) { | 34 | 2.73M | case PDF_INT: | 35 | 2.73M | *d = (double)num->value.i; | 36 | 2.73M | break; | 37 | 2.29M | case PDF_REAL: | 38 | 2.29M | *d = num->value.d; | 39 | 2.29M | break; | 40 | 526 | default: | 41 | 526 | return_error(gs_error_typecheck); | 42 | 5.02M | } | 43 | | | 44 | 5.02M | return 0; | 45 | 5.02M | } |
Unexecuted instantiation: pdf_shading.c:pdfi_obj_to_real Unexecuted instantiation: pdf_func.c:pdfi_obj_to_real Unexecuted instantiation: pdf_trans.c:pdfi_obj_to_real Unexecuted instantiation: pdf_device.c:pdfi_obj_to_real Unexecuted instantiation: pdf_misc.c:pdfi_obj_to_real Unexecuted instantiation: pdf_optcontent.c:pdfi_obj_to_real Unexecuted instantiation: pdf_check.c:pdfi_obj_to_real Unexecuted instantiation: pdf_sec.c:pdfi_obj_to_real Unexecuted instantiation: pdf_utf8.c:pdfi_obj_to_real Unexecuted instantiation: pdf_deref.c:pdfi_obj_to_real Unexecuted instantiation: pdf_repair.c:pdfi_obj_to_real Unexecuted instantiation: pdf_obj.c:pdfi_obj_to_real Unexecuted instantiation: pdf_doc.c:pdfi_obj_to_real Unexecuted instantiation: pdf_fapi.c:pdfi_obj_to_real |
46 | | |
47 | | static inline int |
48 | | pdfi_obj_to_float(pdf_context *ctx, pdf_obj *obj, float *f) |
49 | 4.34M | { |
50 | 4.34M | pdf_num *num = (pdf_num *)obj; |
51 | | |
52 | 4.34M | switch (pdfi_type_of(num)) { |
53 | 2.34M | case PDF_INT: |
54 | 2.34M | *f = (float)num->value.i; |
55 | 2.34M | break; |
56 | 1.98M | case PDF_REAL: |
57 | 1.98M | *f = (float)num->value.d; |
58 | 1.98M | break; |
59 | 6.72k | default: |
60 | 6.72k | return_error(gs_error_typecheck); |
61 | 4.34M | } |
62 | | |
63 | 4.33M | return 0; |
64 | 4.34M | } Unexecuted instantiation: zpdfops.c:pdfi_obj_to_float Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_float Unexecuted instantiation: pdf_dict.c:pdfi_obj_to_float Unexecuted instantiation: pdf_array.c:pdfi_obj_to_float Unexecuted instantiation: pdf_xref.c:pdfi_obj_to_float Unexecuted instantiation: pdf_int.c:pdfi_obj_to_float Unexecuted instantiation: pdf_file.c:pdfi_obj_to_float Unexecuted instantiation: pdf_path.c:pdfi_obj_to_float pdf_colour.c:pdfi_obj_to_float Line | Count | Source | 49 | 359k | { | 50 | 359k | pdf_num *num = (pdf_num *)obj; | 51 | | | 52 | 359k | switch (pdfi_type_of(num)) { | 53 | 150k | case PDF_INT: | 54 | 150k | *f = (float)num->value.i; | 55 | 150k | break; | 56 | 206k | case PDF_REAL: | 57 | 206k | *f = (float)num->value.d; | 58 | 206k | break; | 59 | 2.93k | default: | 60 | 2.93k | return_error(gs_error_typecheck); | 61 | 359k | } | 62 | | | 63 | 356k | return 0; | 64 | 359k | } |
Unexecuted instantiation: pdf_pattern.c:pdfi_obj_to_float Unexecuted instantiation: pdf_gstate.c:pdfi_obj_to_float pdf_stack.c:pdfi_obj_to_float Line | Count | Source | 49 | 3.98M | { | 50 | 3.98M | pdf_num *num = (pdf_num *)obj; | 51 | | | 52 | 3.98M | switch (pdfi_type_of(num)) { | 53 | 2.19M | case PDF_INT: | 54 | 2.19M | *f = (float)num->value.i; | 55 | 2.19M | break; | 56 | 1.78M | case PDF_REAL: | 57 | 1.78M | *f = (float)num->value.d; | 58 | 1.78M | break; | 59 | 3.78k | default: | 60 | 3.78k | return_error(gs_error_typecheck); | 61 | 3.98M | } | 62 | | | 63 | 3.97M | return 0; | 64 | 3.98M | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_float Unexecuted instantiation: pdf_page.c:pdfi_obj_to_float Unexecuted instantiation: pdf_annot.c:pdfi_obj_to_float Unexecuted instantiation: pdf_mark.c:pdfi_obj_to_float Unexecuted instantiation: pdf_font.c:pdfi_obj_to_float Unexecuted instantiation: pdf_font0.c:pdfi_obj_to_float Unexecuted instantiation: pdf_font1.c:pdfi_obj_to_float Unexecuted instantiation: pdf_font1C.c:pdfi_obj_to_float Unexecuted instantiation: pdf_fontps.c:pdfi_obj_to_float Unexecuted instantiation: pdf_font3.c:pdfi_obj_to_float Unexecuted instantiation: pdf_fontTT.c:pdfi_obj_to_float Unexecuted instantiation: pdf_font11.c:pdfi_obj_to_float Unexecuted instantiation: pdf_cmap.c:pdfi_obj_to_float Unexecuted instantiation: pdf_fmap.c:pdfi_obj_to_float Unexecuted instantiation: pdf_text.c:pdfi_obj_to_float Unexecuted instantiation: pdf_shading.c:pdfi_obj_to_float Unexecuted instantiation: pdf_func.c:pdfi_obj_to_float Unexecuted instantiation: pdf_trans.c:pdfi_obj_to_float Unexecuted instantiation: pdf_device.c:pdfi_obj_to_float Unexecuted instantiation: pdf_misc.c:pdfi_obj_to_float Unexecuted instantiation: pdf_optcontent.c:pdfi_obj_to_float Unexecuted instantiation: pdf_check.c:pdfi_obj_to_float Unexecuted instantiation: pdf_sec.c:pdfi_obj_to_float Unexecuted instantiation: pdf_utf8.c:pdfi_obj_to_float Unexecuted instantiation: pdf_deref.c:pdfi_obj_to_float Unexecuted instantiation: pdf_repair.c:pdfi_obj_to_float Unexecuted instantiation: pdf_obj.c:pdfi_obj_to_float Unexecuted instantiation: pdf_doc.c:pdfi_obj_to_float Unexecuted instantiation: pdf_fapi.c:pdfi_obj_to_float |
65 | | |
66 | | static inline int |
67 | | pdfi_obj_to_int(pdf_context *ctx, pdf_obj *obj, int64_t *i) |
68 | 5.60M | { |
69 | 5.60M | pdf_num *num = (pdf_num *)obj; |
70 | 5.60M | int64_t tmp; |
71 | | |
72 | 5.60M | switch (pdfi_type_of(num)) { |
73 | 5.60M | case PDF_INT: |
74 | 5.60M | *i = num->value.i; |
75 | 5.60M | break; |
76 | 3.86k | case PDF_REAL: |
77 | | /* We shouldn't be given a real here. We will grudgingly accept |
78 | | * (with a warning) an int given as a real, but will error out |
79 | | * otherwise. If we find a case where we need to accept reals |
80 | | * as ints, we'll do a new version of this function called something |
81 | | * like pdfi_obj_real_as_int what will just cast it down. */ |
82 | 3.86k | tmp = (int64_t)num->value.d; |
83 | 3.86k | if ((double)tmp != num->value.d) { |
84 | 2.34k | return_error(gs_error_typecheck); |
85 | 2.34k | } |
86 | 1.52k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); |
87 | 1.52k | *i = tmp; |
88 | 1.52k | break; |
89 | 4.29k | default: |
90 | 4.29k | return_error(gs_error_typecheck); |
91 | 5.60M | } |
92 | | |
93 | 5.60M | return 0; |
94 | 5.60M | } zpdfops.c:pdfi_obj_to_int Line | Count | Source | 68 | 277k | { | 69 | 277k | pdf_num *num = (pdf_num *)obj; | 70 | 277k | int64_t tmp; | 71 | | | 72 | 277k | switch (pdfi_type_of(num)) { | 73 | 277k | case PDF_INT: | 74 | 277k | *i = num->value.i; | 75 | 277k | break; | 76 | 0 | case PDF_REAL: | 77 | | /* We shouldn't be given a real here. We will grudgingly accept | 78 | | * (with a warning) an int given as a real, but will error out | 79 | | * otherwise. If we find a case where we need to accept reals | 80 | | * as ints, we'll do a new version of this function called something | 81 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 82 | 0 | tmp = (int64_t)num->value.d; | 83 | 0 | if ((double)tmp != num->value.d) { | 84 | 0 | return_error(gs_error_typecheck); | 85 | 0 | } | 86 | 0 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 87 | 0 | *i = tmp; | 88 | 0 | break; | 89 | 0 | default: | 90 | 0 | return_error(gs_error_typecheck); | 91 | 277k | } | 92 | | | 93 | 277k | return 0; | 94 | 277k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_int pdf_dict.c:pdfi_obj_to_int Line | Count | Source | 68 | 4.75M | { | 69 | 4.75M | pdf_num *num = (pdf_num *)obj; | 70 | 4.75M | int64_t tmp; | 71 | | | 72 | 4.75M | switch (pdfi_type_of(num)) { | 73 | 4.75M | case PDF_INT: | 74 | 4.75M | *i = num->value.i; | 75 | 4.75M | break; | 76 | 388 | case PDF_REAL: | 77 | | /* We shouldn't be given a real here. We will grudgingly accept | 78 | | * (with a warning) an int given as a real, but will error out | 79 | | * otherwise. If we find a case where we need to accept reals | 80 | | * as ints, we'll do a new version of this function called something | 81 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 82 | 388 | tmp = (int64_t)num->value.d; | 83 | 388 | if ((double)tmp != num->value.d) { | 84 | 2 | return_error(gs_error_typecheck); | 85 | 2 | } | 86 | 386 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 87 | 386 | *i = tmp; | 88 | 386 | break; | 89 | 180 | default: | 90 | 180 | return_error(gs_error_typecheck); | 91 | 4.75M | } | 92 | | | 93 | 4.75M | return 0; | 94 | 4.75M | } |
pdf_array.c:pdfi_obj_to_int Line | Count | Source | 68 | 33.1k | { | 69 | 33.1k | pdf_num *num = (pdf_num *)obj; | 70 | 33.1k | int64_t tmp; | 71 | | | 72 | 33.1k | switch (pdfi_type_of(num)) { | 73 | 33.0k | case PDF_INT: | 74 | 33.0k | *i = num->value.i; | 75 | 33.0k | break; | 76 | 0 | case PDF_REAL: | 77 | | /* We shouldn't be given a real here. We will grudgingly accept | 78 | | * (with a warning) an int given as a real, but will error out | 79 | | * otherwise. If we find a case where we need to accept reals | 80 | | * as ints, we'll do a new version of this function called something | 81 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 82 | 0 | tmp = (int64_t)num->value.d; | 83 | 0 | if ((double)tmp != num->value.d) { | 84 | 0 | return_error(gs_error_typecheck); | 85 | 0 | } | 86 | 0 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 87 | 0 | *i = tmp; | 88 | 0 | break; | 89 | 37 | default: | 90 | 37 | return_error(gs_error_typecheck); | 91 | 33.1k | } | 92 | | | 93 | 33.0k | return 0; | 94 | 33.1k | } |
Unexecuted instantiation: pdf_xref.c:pdfi_obj_to_int Unexecuted instantiation: pdf_int.c:pdfi_obj_to_int Unexecuted instantiation: pdf_file.c:pdfi_obj_to_int Unexecuted instantiation: pdf_path.c:pdfi_obj_to_int Unexecuted instantiation: pdf_colour.c:pdfi_obj_to_int Unexecuted instantiation: pdf_pattern.c:pdfi_obj_to_int Unexecuted instantiation: pdf_gstate.c:pdfi_obj_to_int pdf_stack.c:pdfi_obj_to_int Line | Count | Source | 68 | 540k | { | 69 | 540k | pdf_num *num = (pdf_num *)obj; | 70 | 540k | int64_t tmp; | 71 | | | 72 | 540k | switch (pdfi_type_of(num)) { | 73 | 532k | case PDF_INT: | 74 | 532k | *i = num->value.i; | 75 | 532k | break; | 76 | 3.47k | case PDF_REAL: | 77 | | /* We shouldn't be given a real here. We will grudgingly accept | 78 | | * (with a warning) an int given as a real, but will error out | 79 | | * otherwise. If we find a case where we need to accept reals | 80 | | * as ints, we'll do a new version of this function called something | 81 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 82 | 3.47k | tmp = (int64_t)num->value.d; | 83 | 3.47k | if ((double)tmp != num->value.d) { | 84 | 2.33k | return_error(gs_error_typecheck); | 85 | 2.33k | } | 86 | 1.13k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 87 | 1.13k | *i = tmp; | 88 | 1.13k | break; | 89 | 4.07k | default: | 90 | 4.07k | return_error(gs_error_typecheck); | 91 | 540k | } | 92 | | | 93 | 533k | return 0; | 94 | 540k | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_int Unexecuted instantiation: pdf_page.c:pdfi_obj_to_int Unexecuted instantiation: pdf_annot.c:pdfi_obj_to_int Unexecuted instantiation: pdf_mark.c:pdfi_obj_to_int Unexecuted instantiation: pdf_font.c:pdfi_obj_to_int Unexecuted instantiation: pdf_font0.c:pdfi_obj_to_int Unexecuted instantiation: pdf_font1.c:pdfi_obj_to_int Unexecuted instantiation: pdf_font1C.c:pdfi_obj_to_int Unexecuted instantiation: pdf_fontps.c:pdfi_obj_to_int Unexecuted instantiation: pdf_font3.c:pdfi_obj_to_int Unexecuted instantiation: pdf_fontTT.c:pdfi_obj_to_int Unexecuted instantiation: pdf_font11.c:pdfi_obj_to_int Unexecuted instantiation: pdf_cmap.c:pdfi_obj_to_int Unexecuted instantiation: pdf_fmap.c:pdfi_obj_to_int Unexecuted instantiation: pdf_text.c:pdfi_obj_to_int Unexecuted instantiation: pdf_shading.c:pdfi_obj_to_int Unexecuted instantiation: pdf_func.c:pdfi_obj_to_int Unexecuted instantiation: pdf_trans.c:pdfi_obj_to_int Unexecuted instantiation: pdf_device.c:pdfi_obj_to_int Unexecuted instantiation: pdf_misc.c:pdfi_obj_to_int Unexecuted instantiation: pdf_optcontent.c:pdfi_obj_to_int Unexecuted instantiation: pdf_check.c:pdfi_obj_to_int Unexecuted instantiation: pdf_sec.c:pdfi_obj_to_int Unexecuted instantiation: pdf_utf8.c:pdfi_obj_to_int Unexecuted instantiation: pdf_deref.c:pdfi_obj_to_int Unexecuted instantiation: pdf_repair.c:pdfi_obj_to_int Unexecuted instantiation: pdf_obj.c:pdfi_obj_to_int Unexecuted instantiation: pdf_doc.c:pdfi_obj_to_int Unexecuted instantiation: pdf_fapi.c:pdfi_obj_to_int |
95 | | |
96 | | /* NOTE: the buffer object takes ownership of "data" */ |
97 | | static inline int |
98 | | pdfi_buffer_set_data(pdf_obj *o, byte *data, int32_t length) |
99 | 20.8k | { |
100 | 20.8k | pdf_buffer *b = (pdf_buffer *)o; |
101 | 20.8k | if (pdfi_type_of(b) != PDF_BUFFER) { |
102 | 0 | return_error(gs_error_typecheck); |
103 | 0 | } |
104 | | |
105 | 20.8k | if (b->data) { |
106 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); |
107 | 0 | } |
108 | 20.8k | b->data = data; |
109 | 20.8k | b->length = length; |
110 | 20.8k | return 0; |
111 | 20.8k | } Unexecuted instantiation: zpdfops.c:pdfi_buffer_set_data Unexecuted instantiation: ghostpdf.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_dict.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_array.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_xref.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_int.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_file.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_path.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_colour.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_pattern.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_gstate.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_stack.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_image.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_page.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_annot.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_mark.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_font.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_font0.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_font1.c:pdfi_buffer_set_data pdf_font1C.c:pdfi_buffer_set_data Line | Count | Source | 99 | 5 | { | 100 | 5 | pdf_buffer *b = (pdf_buffer *)o; | 101 | 5 | if (pdfi_type_of(b) != PDF_BUFFER) { | 102 | 0 | return_error(gs_error_typecheck); | 103 | 0 | } | 104 | | | 105 | 5 | if (b->data) { | 106 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 107 | 0 | } | 108 | 5 | b->data = data; | 109 | 5 | b->length = length; | 110 | 5 | return 0; | 111 | 5 | } |
Unexecuted instantiation: pdf_fontps.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_font3.c:pdfi_buffer_set_data pdf_fontTT.c:pdfi_buffer_set_data Line | Count | Source | 99 | 16.8k | { | 100 | 16.8k | pdf_buffer *b = (pdf_buffer *)o; | 101 | 16.8k | if (pdfi_type_of(b) != PDF_BUFFER) { | 102 | 0 | return_error(gs_error_typecheck); | 103 | 0 | } | 104 | | | 105 | 16.8k | if (b->data) { | 106 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 107 | 0 | } | 108 | 16.8k | b->data = data; | 109 | 16.8k | b->length = length; | 110 | 16.8k | return 0; | 111 | 16.8k | } |
pdf_font11.c:pdfi_buffer_set_data Line | Count | Source | 99 | 3.94k | { | 100 | 3.94k | pdf_buffer *b = (pdf_buffer *)o; | 101 | 3.94k | if (pdfi_type_of(b) != PDF_BUFFER) { | 102 | 0 | return_error(gs_error_typecheck); | 103 | 0 | } | 104 | | | 105 | 3.94k | if (b->data) { | 106 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 107 | 0 | } | 108 | 3.94k | b->data = data; | 109 | 3.94k | b->length = length; | 110 | 3.94k | return 0; | 111 | 3.94k | } |
Unexecuted instantiation: pdf_cmap.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_fmap.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_text.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_shading.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_func.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_trans.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_device.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_misc.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_optcontent.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_check.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_sec.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_utf8.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_deref.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_repair.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_obj.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_doc.c:pdfi_buffer_set_data Unexecuted instantiation: pdf_fapi.c:pdfi_buffer_set_data |
112 | | |
113 | | |
114 | | #endif |