/src/ghostpdl/pdf/pdf_obj.h
Line | Count | Source (jump to first uncovered line) |
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 | 165M | { |
32 | 165M | pdf_num *num = (pdf_num *)obj; |
33 | | |
34 | 165M | switch (pdfi_type_of(num)) { |
35 | 62.3M | case PDF_INT: |
36 | 62.3M | *d = (double)num->value.i; |
37 | 62.3M | break; |
38 | 102M | case PDF_REAL: |
39 | 102M | *d = num->value.d; |
40 | 102M | break; |
41 | 244k | default: |
42 | 244k | return_error(gs_error_typecheck); |
43 | 165M | } |
44 | | |
45 | 165M | return 0; |
46 | 165M | } zpdfops.c:pdfi_obj_to_real Line | Count | Source | 31 | 285k | { | 32 | 285k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 285k | switch (pdfi_type_of(num)) { | 35 | 0 | case PDF_INT: | 36 | 0 | *d = (double)num->value.i; | 37 | 0 | break; | 38 | 285k | case PDF_REAL: | 39 | 285k | *d = num->value.d; | 40 | 285k | break; | 41 | 0 | default: | 42 | 0 | return_error(gs_error_typecheck); | 43 | 285k | } | 44 | | | 45 | 285k | return 0; | 46 | 285k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_real pdf_dict.c:pdfi_obj_to_real Line | Count | Source | 31 | 2.19M | { | 32 | 2.19M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 2.19M | switch (pdfi_type_of(num)) { | 35 | 1.75M | case PDF_INT: | 36 | 1.75M | *d = (double)num->value.i; | 37 | 1.75M | break; | 38 | 436k | case PDF_REAL: | 39 | 436k | *d = num->value.d; | 40 | 436k | break; | 41 | 103 | default: | 42 | 103 | return_error(gs_error_typecheck); | 43 | 2.19M | } | 44 | | | 45 | 2.19M | return 0; | 46 | 2.19M | } |
pdf_array.c:pdfi_obj_to_real Line | Count | Source | 31 | 19.7M | { | 32 | 19.7M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 19.7M | switch (pdfi_type_of(num)) { | 35 | 15.5M | case PDF_INT: | 36 | 15.5M | *d = (double)num->value.i; | 37 | 15.5M | break; | 38 | 4.26M | case PDF_REAL: | 39 | 4.26M | *d = num->value.d; | 40 | 4.26M | break; | 41 | 1.01k | default: | 42 | 1.01k | return_error(gs_error_typecheck); | 43 | 19.7M | } | 44 | | | 45 | 19.7M | return 0; | 46 | 19.7M | } |
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 | 125M | { | 32 | 125M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 125M | switch (pdfi_type_of(num)) { | 35 | 33.4M | case PDF_INT: | 36 | 33.4M | *d = (double)num->value.i; | 37 | 33.4M | break; | 38 | 91.7M | case PDF_REAL: | 39 | 91.7M | *d = num->value.d; | 40 | 91.7M | break; | 41 | 240k | default: | 42 | 240k | return_error(gs_error_typecheck); | 43 | 125M | } | 44 | | | 45 | 125M | return 0; | 46 | 125M | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_real pdf_page.c:pdfi_obj_to_real Line | Count | Source | 31 | 662k | { | 32 | 662k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 662k | switch (pdfi_type_of(num)) { | 35 | 379k | case PDF_INT: | 36 | 379k | *d = (double)num->value.i; | 37 | 379k | break; | 38 | 283k | case PDF_REAL: | 39 | 283k | *d = num->value.d; | 40 | 283k | break; | 41 | 210 | default: | 42 | 210 | return_error(gs_error_typecheck); | 43 | 662k | } | 44 | | | 45 | 662k | return 0; | 46 | 662k | } |
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.98M | { | 32 | 1.98M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 1.98M | switch (pdfi_type_of(num)) { | 35 | 1.18M | case PDF_INT: | 36 | 1.18M | *d = (double)num->value.i; | 37 | 1.18M | break; | 38 | 798k | case PDF_REAL: | 39 | 798k | *d = num->value.d; | 40 | 798k | break; | 41 | 2.76k | default: | 42 | 2.76k | return_error(gs_error_typecheck); | 43 | 1.98M | } | 44 | | | 45 | 1.98M | return 0; | 46 | 1.98M | } |
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 | 14.8M | { | 32 | 14.8M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 14.8M | switch (pdfi_type_of(num)) { | 35 | 9.98M | case PDF_INT: | 36 | 9.98M | *d = (double)num->value.i; | 37 | 9.98M | break; | 38 | 4.85M | case PDF_REAL: | 39 | 4.85M | *d = num->value.d; | 40 | 4.85M | break; | 41 | 145 | default: | 42 | 145 | return_error(gs_error_typecheck); | 43 | 14.8M | } | 44 | | | 45 | 14.8M | return 0; | 46 | 14.8M | } |
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 | 14.1M | { |
51 | 14.1M | pdf_num *num = (pdf_num *)obj; |
52 | | |
53 | 14.1M | switch (pdfi_type_of(num)) { |
54 | 6.39M | case PDF_INT: |
55 | 6.39M | *f = (float)num->value.i; |
56 | 6.39M | break; |
57 | 7.75M | case PDF_REAL: |
58 | 7.75M | *f = (float)num->value.d; |
59 | 7.75M | break; |
60 | 19.2k | default: |
61 | 19.2k | return_error(gs_error_typecheck); |
62 | 14.1M | } |
63 | | |
64 | 14.1M | return 0; |
65 | 14.1M | } 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 | 924k | { | 51 | 924k | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 924k | switch (pdfi_type_of(num)) { | 54 | 343k | case PDF_INT: | 55 | 343k | *f = (float)num->value.i; | 56 | 343k | break; | 57 | 569k | case PDF_REAL: | 58 | 569k | *f = (float)num->value.d; | 59 | 569k | break; | 60 | 11.8k | default: | 61 | 11.8k | return_error(gs_error_typecheck); | 62 | 924k | } | 63 | | | 64 | 912k | return 0; | 65 | 924k | } |
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 | 13.2M | { | 51 | 13.2M | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 13.2M | switch (pdfi_type_of(num)) { | 54 | 6.04M | case PDF_INT: | 55 | 6.04M | *f = (float)num->value.i; | 56 | 6.04M | break; | 57 | 7.18M | case PDF_REAL: | 58 | 7.18M | *f = (float)num->value.d; | 59 | 7.18M | break; | 60 | 7.43k | default: | 61 | 7.43k | return_error(gs_error_typecheck); | 62 | 13.2M | } | 63 | | | 64 | 13.2M | return 0; | 65 | 13.2M | } |
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 | 9.10M | { |
70 | 9.10M | pdf_num *num = (pdf_num *)obj; |
71 | 9.10M | int64_t tmp; |
72 | | |
73 | 9.10M | switch (pdfi_type_of(num)) { |
74 | 9.05M | case PDF_INT: |
75 | 9.05M | *i = num->value.i; |
76 | 9.05M | break; |
77 | 25.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 | 25.8k | tmp = (int64_t)num->value.d; |
84 | 25.8k | if ((double)tmp != num->value.d) { |
85 | 15.2k | return_error(gs_error_typecheck); |
86 | 15.2k | } |
87 | 10.5k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); |
88 | 10.5k | *i = tmp; |
89 | 10.5k | break; |
90 | 22.0k | default: |
91 | 22.0k | return_error(gs_error_typecheck); |
92 | 9.10M | } |
93 | | |
94 | 9.06M | return 0; |
95 | 9.10M | } zpdfops.c:pdfi_obj_to_int Line | Count | Source | 69 | 534k | { | 70 | 534k | pdf_num *num = (pdf_num *)obj; | 71 | 534k | int64_t tmp; | 72 | | | 73 | 534k | switch (pdfi_type_of(num)) { | 74 | 534k | case PDF_INT: | 75 | 534k | *i = num->value.i; | 76 | 534k | 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 | 534k | } | 93 | | | 94 | 534k | return 0; | 95 | 534k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_int pdf_dict.c:pdfi_obj_to_int Line | Count | Source | 69 | 5.59M | { | 70 | 5.59M | pdf_num *num = (pdf_num *)obj; | 71 | 5.59M | int64_t tmp; | 72 | | | 73 | 5.59M | switch (pdfi_type_of(num)) { | 74 | 5.59M | case PDF_INT: | 75 | 5.59M | *i = num->value.i; | 76 | 5.59M | break; | 77 | 2.24k | 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.24k | tmp = (int64_t)num->value.d; | 84 | 2.24k | if ((double)tmp != num->value.d) { | 85 | 9 | return_error(gs_error_typecheck); | 86 | 9 | } | 87 | 2.24k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 2.24k | *i = tmp; | 89 | 2.24k | break; | 90 | 727 | default: | 91 | 727 | return_error(gs_error_typecheck); | 92 | 5.59M | } | 93 | | | 94 | 5.59M | return 0; | 95 | 5.59M | } |
pdf_array.c:pdfi_obj_to_int Line | Count | Source | 69 | 77.0k | { | 70 | 77.0k | pdf_num *num = (pdf_num *)obj; | 71 | 77.0k | int64_t tmp; | 72 | | | 73 | 77.0k | switch (pdfi_type_of(num)) { | 74 | 76.9k | case PDF_INT: | 75 | 76.9k | *i = num->value.i; | 76 | 76.9k | 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 | 70 | default: | 91 | 70 | return_error(gs_error_typecheck); | 92 | 77.0k | } | 93 | | | 94 | 76.9k | return 0; | 95 | 77.0k | } |
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 | 2.90M | { | 70 | 2.90M | pdf_num *num = (pdf_num *)obj; | 71 | 2.90M | int64_t tmp; | 72 | | | 73 | 2.90M | switch (pdfi_type_of(num)) { | 74 | 2.85M | case PDF_INT: | 75 | 2.85M | *i = num->value.i; | 76 | 2.85M | break; | 77 | 23.5k | 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 | 23.5k | tmp = (int64_t)num->value.d; | 84 | 23.5k | if ((double)tmp != num->value.d) { | 85 | 15.2k | return_error(gs_error_typecheck); | 86 | 15.2k | } | 87 | 8.27k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 8.27k | *i = tmp; | 89 | 8.27k | break; | 90 | 21.2k | default: | 91 | 21.2k | return_error(gs_error_typecheck); | 92 | 2.90M | } | 93 | | | 94 | 2.86M | return 0; | 95 | 2.90M | } |
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 | 40.9k | { |
101 | 40.9k | pdf_buffer *b = (pdf_buffer *)o; |
102 | 40.9k | if (pdfi_type_of(b) != PDF_BUFFER) { |
103 | 0 | return_error(gs_error_typecheck); |
104 | 0 | } |
105 | | |
106 | 40.9k | if (b->data) { |
107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); |
108 | 0 | } |
109 | 40.9k | b->data = data; |
110 | 40.9k | b->length = length; |
111 | 40.9k | return 0; |
112 | 40.9k | } 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 | 0 | 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 | 22.8k | { | 101 | 22.8k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 22.8k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 22.8k | if (b->data) { | 107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 22.8k | b->data = data; | 110 | 22.8k | b->length = length; | 111 | 22.8k | return 0; | 112 | 22.8k | } |
pdf_font11.c:pdfi_buffer_set_data Line | Count | Source | 100 | 18.0k | { | 101 | 18.0k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 18.0k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 18.0k | if (b->data) { | 107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 18.0k | b->data = data; | 110 | 18.0k | b->length = length; | 111 | 18.0k | return 0; | 112 | 18.0k | } |
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 |