/src/ghostpdl/pdf/pdf_obj.h
Line | Count | Source |
1 | | /* Copyright (C) 2020-2024 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., 39 Mesa Street, Suite 108A, San Francisco, |
13 | | CA 94129, USA, 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_get_stream_dict(pdf_context *ctx, pdf_stream *stream, pdf_dict **dict); |
24 | | int pdfi_obj_charstr_to_string(pdf_context *ctx, const char *charstr, pdf_string **string); |
25 | | int pdfi_obj_charstr_to_name(pdf_context *ctx, const char *charstr, pdf_name **name); |
26 | | int pdfi_obj_get_label(pdf_context *ctx, pdf_obj *obj, char **label); |
27 | | int pdfi_num_alloc(pdf_context *ctx, double d, pdf_num **num); |
28 | | |
29 | | static inline int |
30 | | pdfi_obj_to_real(pdf_context *ctx, pdf_obj *obj, double *d) |
31 | 147M | { |
32 | 147M | pdf_num *num = (pdf_num *)obj; |
33 | | |
34 | 147M | switch (pdfi_type_of(num)) { |
35 | 43.7M | case PDF_INT: |
36 | 43.7M | *d = (double)num->value.i; |
37 | 43.7M | break; |
38 | 103M | case PDF_REAL: |
39 | 103M | *d = num->value.d; |
40 | 103M | break; |
41 | 228k | default: |
42 | 228k | return_error(gs_error_typecheck); |
43 | 147M | } |
44 | | |
45 | 147M | return 0; |
46 | 147M | } zpdfops.c:pdfi_obj_to_real Line | Count | Source | 31 | 238k | { | 32 | 238k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 238k | switch (pdfi_type_of(num)) { | 35 | 0 | case PDF_INT: | 36 | 0 | *d = (double)num->value.i; | 37 | 0 | break; | 38 | 238k | case PDF_REAL: | 39 | 238k | *d = num->value.d; | 40 | 238k | break; | 41 | 0 | default: | 42 | 0 | return_error(gs_error_typecheck); | 43 | 238k | } | 44 | | | 45 | 238k | return 0; | 46 | 238k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_real pdf_dict.c:pdfi_obj_to_real Line | Count | Source | 31 | 1.56M | { | 32 | 1.56M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 1.56M | switch (pdfi_type_of(num)) { | 35 | 1.36M | case PDF_INT: | 36 | 1.36M | *d = (double)num->value.i; | 37 | 1.36M | break; | 38 | 202k | case PDF_REAL: | 39 | 202k | *d = num->value.d; | 40 | 202k | break; | 41 | 77 | default: | 42 | 77 | return_error(gs_error_typecheck); | 43 | 1.56M | } | 44 | | | 45 | 1.56M | return 0; | 46 | 1.56M | } |
pdf_array.c:pdfi_obj_to_real Line | Count | Source | 31 | 14.0M | { | 32 | 14.0M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 14.0M | switch (pdfi_type_of(num)) { | 35 | 11.8M | case PDF_INT: | 36 | 11.8M | *d = (double)num->value.i; | 37 | 11.8M | break; | 38 | 2.19M | case PDF_REAL: | 39 | 2.19M | *d = num->value.d; | 40 | 2.19M | break; | 41 | 836 | default: | 42 | 836 | return_error(gs_error_typecheck); | 43 | 14.0M | } | 44 | | | 45 | 14.0M | return 0; | 46 | 14.0M | } |
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 | 31 | 119M | { | 32 | 119M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 119M | switch (pdfi_type_of(num)) { | 35 | 23.4M | case PDF_INT: | 36 | 23.4M | *d = (double)num->value.i; | 37 | 23.4M | break; | 38 | 96.0M | case PDF_REAL: | 39 | 96.0M | *d = num->value.d; | 40 | 96.0M | break; | 41 | 224k | default: | 42 | 224k | return_error(gs_error_typecheck); | 43 | 119M | } | 44 | | | 45 | 119M | return 0; | 46 | 119M | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_real pdf_page.c:pdfi_obj_to_real Line | Count | Source | 31 | 590k | { | 32 | 590k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 590k | switch (pdfi_type_of(num)) { | 35 | 353k | case PDF_INT: | 36 | 353k | *d = (double)num->value.i; | 37 | 353k | break; | 38 | 236k | case PDF_REAL: | 39 | 236k | *d = num->value.d; | 40 | 236k | break; | 41 | 183 | default: | 42 | 183 | return_error(gs_error_typecheck); | 43 | 590k | } | 44 | | | 45 | 590k | return 0; | 46 | 590k | } |
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 | 31 | 1.14M | { | 32 | 1.14M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 1.14M | switch (pdfi_type_of(num)) { | 35 | 671k | case PDF_INT: | 36 | 671k | *d = (double)num->value.i; | 37 | 671k | break; | 38 | 469k | case PDF_REAL: | 39 | 469k | *d = num->value.d; | 40 | 469k | break; | 41 | 2.63k | default: | 42 | 2.63k | return_error(gs_error_typecheck); | 43 | 1.14M | } | 44 | | | 45 | 1.14M | return 0; | 46 | 1.14M | } |
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 | 31 | 10.1M | { | 32 | 10.1M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 10.1M | switch (pdfi_type_of(num)) { | 35 | 6.09M | case PDF_INT: | 36 | 6.09M | *d = (double)num->value.i; | 37 | 6.09M | break; | 38 | 4.04M | case PDF_REAL: | 39 | 4.04M | *d = num->value.d; | 40 | 4.04M | break; | 41 | 90 | default: | 42 | 90 | return_error(gs_error_typecheck); | 43 | 10.1M | } | 44 | | | 45 | 10.1M | return 0; | 46 | 10.1M | } |
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 |
47 | | |
48 | | static inline int |
49 | | pdfi_obj_to_float(pdf_context *ctx, pdf_obj *obj, float *f) |
50 | 9.21M | { |
51 | 9.21M | pdf_num *num = (pdf_num *)obj; |
52 | | |
53 | 9.21M | switch (pdfi_type_of(num)) { |
54 | 3.84M | case PDF_INT: |
55 | 3.84M | *f = (float)num->value.i; |
56 | 3.84M | break; |
57 | 5.36M | case PDF_REAL: |
58 | 5.36M | *f = (float)num->value.d; |
59 | 5.36M | break; |
60 | 15.8k | default: |
61 | 15.8k | return_error(gs_error_typecheck); |
62 | 9.21M | } |
63 | | |
64 | 9.20M | return 0; |
65 | 9.21M | } 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 | 50 | 528k | { | 51 | 528k | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 528k | switch (pdfi_type_of(num)) { | 54 | 221k | case PDF_INT: | 55 | 221k | *f = (float)num->value.i; | 56 | 221k | break; | 57 | 297k | case PDF_REAL: | 58 | 297k | *f = (float)num->value.d; | 59 | 297k | break; | 60 | 9.96k | default: | 61 | 9.96k | return_error(gs_error_typecheck); | 62 | 528k | } | 63 | | | 64 | 518k | return 0; | 65 | 528k | } |
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 | 50 | 8.68M | { | 51 | 8.68M | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 8.68M | switch (pdfi_type_of(num)) { | 54 | 3.61M | case PDF_INT: | 55 | 3.61M | *f = (float)num->value.i; | 56 | 3.61M | break; | 57 | 5.06M | case PDF_REAL: | 58 | 5.06M | *f = (float)num->value.d; | 59 | 5.06M | break; | 60 | 5.89k | default: | 61 | 5.89k | return_error(gs_error_typecheck); | 62 | 8.68M | } | 63 | | | 64 | 8.68M | return 0; | 65 | 8.68M | } |
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 |
66 | | |
67 | | static inline int |
68 | | pdfi_obj_to_int(pdf_context *ctx, pdf_obj *obj, int64_t *i) |
69 | 7.60M | { |
70 | 7.60M | pdf_num *num = (pdf_num *)obj; |
71 | 7.60M | int64_t tmp; |
72 | | |
73 | 7.60M | switch (pdfi_type_of(num)) { |
74 | 7.57M | case PDF_INT: |
75 | 7.57M | *i = num->value.i; |
76 | 7.57M | break; |
77 | 22.8k | case PDF_REAL: |
78 | | /* We shouldn't be given a real here. We will grudgingly accept |
79 | | * (with a warning) an int given as a real, but will error out |
80 | | * otherwise. If we find a case where we need to accept reals |
81 | | * as ints, we'll do a new version of this function called something |
82 | | * like pdfi_obj_real_as_int what will just cast it down. */ |
83 | 22.8k | tmp = (int64_t)num->value.d; |
84 | 22.8k | if ((double)tmp != num->value.d) { |
85 | 13.1k | return_error(gs_error_typecheck); |
86 | 13.1k | } |
87 | 9.70k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); |
88 | 9.70k | *i = tmp; |
89 | 9.70k | break; |
90 | 14.2k | default: |
91 | 14.2k | return_error(gs_error_typecheck); |
92 | 7.60M | } |
93 | | |
94 | 7.58M | return 0; |
95 | 7.60M | } zpdfops.c:pdfi_obj_to_int Line | Count | Source | 69 | 497k | { | 70 | 497k | pdf_num *num = (pdf_num *)obj; | 71 | 497k | int64_t tmp; | 72 | | | 73 | 497k | switch (pdfi_type_of(num)) { | 74 | 497k | case PDF_INT: | 75 | 497k | *i = num->value.i; | 76 | 497k | break; | 77 | 0 | case PDF_REAL: | 78 | | /* We shouldn't be given a real here. We will grudgingly accept | 79 | | * (with a warning) an int given as a real, but will error out | 80 | | * otherwise. If we find a case where we need to accept reals | 81 | | * as ints, we'll do a new version of this function called something | 82 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 83 | 0 | tmp = (int64_t)num->value.d; | 84 | 0 | if ((double)tmp != num->value.d) { | 85 | 0 | return_error(gs_error_typecheck); | 86 | 0 | } | 87 | 0 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 0 | *i = tmp; | 89 | 0 | break; | 90 | 0 | default: | 91 | 0 | return_error(gs_error_typecheck); | 92 | 497k | } | 93 | | | 94 | 497k | return 0; | 95 | 497k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_int pdf_dict.c:pdfi_obj_to_int Line | Count | Source | 69 | 5.07M | { | 70 | 5.07M | pdf_num *num = (pdf_num *)obj; | 71 | 5.07M | int64_t tmp; | 72 | | | 73 | 5.07M | switch (pdfi_type_of(num)) { | 74 | 5.07M | case PDF_INT: | 75 | 5.07M | *i = num->value.i; | 76 | 5.07M | break; | 77 | 2.09k | case PDF_REAL: | 78 | | /* We shouldn't be given a real here. We will grudgingly accept | 79 | | * (with a warning) an int given as a real, but will error out | 80 | | * otherwise. If we find a case where we need to accept reals | 81 | | * as ints, we'll do a new version of this function called something | 82 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 83 | 2.09k | tmp = (int64_t)num->value.d; | 84 | 2.09k | if ((double)tmp != num->value.d) { | 85 | 10 | return_error(gs_error_typecheck); | 86 | 10 | } | 87 | 2.08k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 2.08k | *i = tmp; | 89 | 2.08k | break; | 90 | 598 | default: | 91 | 598 | return_error(gs_error_typecheck); | 92 | 5.07M | } | 93 | | | 94 | 5.07M | return 0; | 95 | 5.07M | } |
pdf_array.c:pdfi_obj_to_int Line | Count | Source | 69 | 64.3k | { | 70 | 64.3k | pdf_num *num = (pdf_num *)obj; | 71 | 64.3k | int64_t tmp; | 72 | | | 73 | 64.3k | switch (pdfi_type_of(num)) { | 74 | 64.3k | case PDF_INT: | 75 | 64.3k | *i = num->value.i; | 76 | 64.3k | break; | 77 | 0 | case PDF_REAL: | 78 | | /* We shouldn't be given a real here. We will grudgingly accept | 79 | | * (with a warning) an int given as a real, but will error out | 80 | | * otherwise. If we find a case where we need to accept reals | 81 | | * as ints, we'll do a new version of this function called something | 82 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 83 | 0 | tmp = (int64_t)num->value.d; | 84 | 0 | if ((double)tmp != num->value.d) { | 85 | 0 | return_error(gs_error_typecheck); | 86 | 0 | } | 87 | 0 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 0 | *i = tmp; | 89 | 0 | break; | 90 | 64 | default: | 91 | 64 | return_error(gs_error_typecheck); | 92 | 64.3k | } | 93 | | | 94 | 64.3k | return 0; | 95 | 64.3k | } |
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 | 69 | 1.96M | { | 70 | 1.96M | pdf_num *num = (pdf_num *)obj; | 71 | 1.96M | int64_t tmp; | 72 | | | 73 | 1.96M | switch (pdfi_type_of(num)) { | 74 | 1.93M | case PDF_INT: | 75 | 1.93M | *i = num->value.i; | 76 | 1.93M | break; | 77 | 20.7k | case PDF_REAL: | 78 | | /* We shouldn't be given a real here. We will grudgingly accept | 79 | | * (with a warning) an int given as a real, but will error out | 80 | | * otherwise. If we find a case where we need to accept reals | 81 | | * as ints, we'll do a new version of this function called something | 82 | | * like pdfi_obj_real_as_int what will just cast it down. */ | 83 | 20.7k | tmp = (int64_t)num->value.d; | 84 | 20.7k | if ((double)tmp != num->value.d) { | 85 | 13.1k | return_error(gs_error_typecheck); | 86 | 13.1k | } | 87 | 7.61k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 7.61k | *i = tmp; | 89 | 7.61k | break; | 90 | 13.5k | default: | 91 | 13.5k | return_error(gs_error_typecheck); | 92 | 1.96M | } | 93 | | | 94 | 1.94M | return 0; | 95 | 1.96M | } |
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 |
96 | | |
97 | | /* NOTE: the buffer object takes ownership of "data" */ |
98 | | static inline int |
99 | | pdfi_buffer_set_data(pdf_obj *o, byte *data, int32_t length) |
100 | 35.6k | { |
101 | 35.6k | pdf_buffer *b = (pdf_buffer *)o; |
102 | 35.6k | if (pdfi_type_of(b) != PDF_BUFFER) { |
103 | 0 | return_error(gs_error_typecheck); |
104 | 0 | } |
105 | | |
106 | 35.6k | if (b->data) { |
107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); |
108 | 0 | } |
109 | 35.6k | b->data = data; |
110 | 35.6k | b->length = length; |
111 | 35.6k | return 0; |
112 | 35.6k | } 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 | 100 | 17 | { | 101 | 17 | pdf_buffer *b = (pdf_buffer *)o; | 102 | 17 | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 17 | if (b->data) { | 107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 17 | b->data = data; | 110 | 17 | b->length = length; | 111 | 17 | return 0; | 112 | 17 | } |
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 | 100 | 21.2k | { | 101 | 21.2k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 21.2k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 21.2k | if (b->data) { | 107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 21.2k | b->data = data; | 110 | 21.2k | b->length = length; | 111 | 21.2k | return 0; | 112 | 21.2k | } |
pdf_font11.c:pdfi_buffer_set_data Line | Count | Source | 100 | 14.3k | { | 101 | 14.3k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 14.3k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 14.3k | if (b->data) { | 107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 14.3k | b->data = data; | 110 | 14.3k | b->length = length; | 111 | 14.3k | return 0; | 112 | 14.3k | } |
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 |
113 | | |
114 | | |
115 | | #endif |