/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 | 266M | { |
32 | 266M | pdf_num *num = (pdf_num *)obj; |
33 | | |
34 | 266M | switch (pdfi_type_of(num)) { |
35 | 92.2M | case PDF_INT: |
36 | 92.2M | *d = (double)num->value.i; |
37 | 92.2M | break; |
38 | 174M | case PDF_REAL: |
39 | 174M | *d = num->value.d; |
40 | 174M | break; |
41 | 378k | default: |
42 | 378k | return_error(gs_error_typecheck); |
43 | 266M | } |
44 | | |
45 | 266M | return 0; |
46 | 266M | } zpdfops.c:pdfi_obj_to_real Line | Count | Source | 31 | 378k | { | 32 | 378k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 378k | switch (pdfi_type_of(num)) { | 35 | 0 | case PDF_INT: | 36 | 0 | *d = (double)num->value.i; | 37 | 0 | break; | 38 | 378k | case PDF_REAL: | 39 | 378k | *d = num->value.d; | 40 | 378k | break; | 41 | 0 | default: | 42 | 0 | return_error(gs_error_typecheck); | 43 | 378k | } | 44 | | | 45 | 378k | return 0; | 46 | 378k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_real pdf_dict.c:pdfi_obj_to_real Line | Count | Source | 31 | 3.18M | { | 32 | 3.18M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 3.18M | switch (pdfi_type_of(num)) { | 35 | 2.55M | case PDF_INT: | 36 | 2.55M | *d = (double)num->value.i; | 37 | 2.55M | break; | 38 | 636k | case PDF_REAL: | 39 | 636k | *d = num->value.d; | 40 | 636k | break; | 41 | 107 | default: | 42 | 107 | return_error(gs_error_typecheck); | 43 | 3.18M | } | 44 | | | 45 | 3.18M | return 0; | 46 | 3.18M | } |
pdf_array.c:pdfi_obj_to_real Line | Count | Source | 31 | 30.4M | { | 32 | 30.4M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 30.4M | switch (pdfi_type_of(num)) { | 35 | 24.4M | case PDF_INT: | 36 | 24.4M | *d = (double)num->value.i; | 37 | 24.4M | break; | 38 | 5.99M | case PDF_REAL: | 39 | 5.99M | *d = num->value.d; | 40 | 5.99M | break; | 41 | 1.54k | default: | 42 | 1.54k | return_error(gs_error_typecheck); | 43 | 30.4M | } | 44 | | | 45 | 30.4M | return 0; | 46 | 30.4M | } |
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 | 208M | { | 32 | 208M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 208M | switch (pdfi_type_of(num)) { | 35 | 49.0M | case PDF_INT: | 36 | 49.0M | *d = (double)num->value.i; | 37 | 49.0M | break; | 38 | 159M | case PDF_REAL: | 39 | 159M | *d = num->value.d; | 40 | 159M | break; | 41 | 372k | default: | 42 | 372k | return_error(gs_error_typecheck); | 43 | 208M | } | 44 | | | 45 | 208M | return 0; | 46 | 208M | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_real pdf_page.c:pdfi_obj_to_real Line | Count | Source | 31 | 893k | { | 32 | 893k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 893k | switch (pdfi_type_of(num)) { | 35 | 519k | case PDF_INT: | 36 | 519k | *d = (double)num->value.i; | 37 | 519k | break; | 38 | 374k | case PDF_REAL: | 39 | 374k | *d = num->value.d; | 40 | 374k | break; | 41 | 269 | default: | 42 | 269 | return_error(gs_error_typecheck); | 43 | 893k | } | 44 | | | 45 | 893k | return 0; | 46 | 893k | } |
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 | 2.52M | { | 32 | 2.52M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 2.52M | switch (pdfi_type_of(num)) { | 35 | 1.47M | case PDF_INT: | 36 | 1.47M | *d = (double)num->value.i; | 37 | 1.47M | break; | 38 | 1.04M | case PDF_REAL: | 39 | 1.04M | *d = num->value.d; | 40 | 1.04M | break; | 41 | 3.92k | default: | 42 | 3.92k | return_error(gs_error_typecheck); | 43 | 2.52M | } | 44 | | | 45 | 2.52M | return 0; | 46 | 2.52M | } |
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 | 20.5M | { | 32 | 20.5M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 20.5M | switch (pdfi_type_of(num)) { | 35 | 14.1M | case PDF_INT: | 36 | 14.1M | *d = (double)num->value.i; | 37 | 14.1M | break; | 38 | 6.35M | case PDF_REAL: | 39 | 6.35M | *d = num->value.d; | 40 | 6.35M | break; | 41 | 159 | default: | 42 | 159 | return_error(gs_error_typecheck); | 43 | 20.5M | } | 44 | | | 45 | 20.5M | return 0; | 46 | 20.5M | } |
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 | 18.0M | { |
51 | 18.0M | pdf_num *num = (pdf_num *)obj; |
52 | | |
53 | 18.0M | switch (pdfi_type_of(num)) { |
54 | 8.34M | case PDF_INT: |
55 | 8.34M | *f = (float)num->value.i; |
56 | 8.34M | break; |
57 | 9.69M | case PDF_REAL: |
58 | 9.69M | *f = (float)num->value.d; |
59 | 9.69M | break; |
60 | 21.7k | default: |
61 | 21.7k | return_error(gs_error_typecheck); |
62 | 18.0M | } |
63 | | |
64 | 18.0M | return 0; |
65 | 18.0M | } 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 | 1.16M | { | 51 | 1.16M | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 1.16M | switch (pdfi_type_of(num)) { | 54 | 433k | case PDF_INT: | 55 | 433k | *f = (float)num->value.i; | 56 | 433k | break; | 57 | 717k | case PDF_REAL: | 58 | 717k | *f = (float)num->value.d; | 59 | 717k | break; | 60 | 13.7k | default: | 61 | 13.7k | return_error(gs_error_typecheck); | 62 | 1.16M | } | 63 | | | 64 | 1.15M | return 0; | 65 | 1.16M | } |
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 | 16.8M | { | 51 | 16.8M | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 16.8M | switch (pdfi_type_of(num)) { | 54 | 7.90M | case PDF_INT: | 55 | 7.90M | *f = (float)num->value.i; | 56 | 7.90M | break; | 57 | 8.98M | case PDF_REAL: | 58 | 8.98M | *f = (float)num->value.d; | 59 | 8.98M | break; | 60 | 8.00k | default: | 61 | 8.00k | return_error(gs_error_typecheck); | 62 | 16.8M | } | 63 | | | 64 | 16.8M | return 0; | 65 | 16.8M | } |
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 | 13.4M | { |
70 | 13.4M | pdf_num *num = (pdf_num *)obj; |
71 | 13.4M | int64_t tmp; |
72 | | |
73 | 13.4M | switch (pdfi_type_of(num)) { |
74 | 13.3M | case PDF_INT: |
75 | 13.3M | *i = num->value.i; |
76 | 13.3M | break; |
77 | 38.3k | 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 | 38.3k | tmp = (int64_t)num->value.d; |
84 | 38.3k | if ((double)tmp != num->value.d) { |
85 | 22.8k | return_error(gs_error_typecheck); |
86 | 22.8k | } |
87 | 15.5k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); |
88 | 15.5k | *i = tmp; |
89 | 15.5k | break; |
90 | 30.3k | default: |
91 | 30.3k | return_error(gs_error_typecheck); |
92 | 13.4M | } |
93 | | |
94 | 13.3M | return 0; |
95 | 13.4M | } zpdfops.c:pdfi_obj_to_int Line | Count | Source | 69 | 728k | { | 70 | 728k | pdf_num *num = (pdf_num *)obj; | 71 | 728k | int64_t tmp; | 72 | | | 73 | 728k | switch (pdfi_type_of(num)) { | 74 | 728k | case PDF_INT: | 75 | 728k | *i = num->value.i; | 76 | 728k | 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 | 728k | } | 93 | | | 94 | 728k | return 0; | 95 | 728k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_int pdf_dict.c:pdfi_obj_to_int Line | Count | Source | 69 | 8.77M | { | 70 | 8.77M | pdf_num *num = (pdf_num *)obj; | 71 | 8.77M | int64_t tmp; | 72 | | | 73 | 8.77M | switch (pdfi_type_of(num)) { | 74 | 8.77M | case PDF_INT: | 75 | 8.77M | *i = num->value.i; | 76 | 8.77M | break; | 77 | 2.59k | 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.59k | tmp = (int64_t)num->value.d; | 84 | 2.59k | if ((double)tmp != num->value.d) { | 85 | 23 | return_error(gs_error_typecheck); | 86 | 23 | } | 87 | 2.57k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 2.57k | *i = tmp; | 89 | 2.57k | break; | 90 | 1.01k | default: | 91 | 1.01k | return_error(gs_error_typecheck); | 92 | 8.77M | } | 93 | | | 94 | 8.77M | return 0; | 95 | 8.77M | } |
pdf_array.c:pdfi_obj_to_int Line | Count | Source | 69 | 96.1k | { | 70 | 96.1k | pdf_num *num = (pdf_num *)obj; | 71 | 96.1k | int64_t tmp; | 72 | | | 73 | 96.1k | switch (pdfi_type_of(num)) { | 74 | 96.0k | case PDF_INT: | 75 | 96.0k | *i = num->value.i; | 76 | 96.0k | 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 | 92 | default: | 91 | 92 | return_error(gs_error_typecheck); | 92 | 96.1k | } | 93 | | | 94 | 96.0k | return 0; | 95 | 96.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 | 69 | 3.82M | { | 70 | 3.82M | pdf_num *num = (pdf_num *)obj; | 71 | 3.82M | int64_t tmp; | 72 | | | 73 | 3.82M | switch (pdfi_type_of(num)) { | 74 | 3.75M | case PDF_INT: | 75 | 3.75M | *i = num->value.i; | 76 | 3.75M | break; | 77 | 35.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 | 35.7k | tmp = (int64_t)num->value.d; | 84 | 35.7k | if ((double)tmp != num->value.d) { | 85 | 22.8k | return_error(gs_error_typecheck); | 86 | 22.8k | } | 87 | 12.9k | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 12.9k | *i = tmp; | 89 | 12.9k | break; | 90 | 29.2k | default: | 91 | 29.2k | return_error(gs_error_typecheck); | 92 | 3.82M | } | 93 | | | 94 | 3.77M | return 0; | 95 | 3.82M | } |
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 | 57.2k | { |
101 | 57.2k | pdf_buffer *b = (pdf_buffer *)o; |
102 | 57.2k | if (pdfi_type_of(b) != PDF_BUFFER) { |
103 | 0 | return_error(gs_error_typecheck); |
104 | 0 | } |
105 | | |
106 | 57.2k | if (b->data) { |
107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); |
108 | 0 | } |
109 | 57.2k | b->data = data; |
110 | 57.2k | b->length = length; |
111 | 57.2k | return 0; |
112 | 57.2k | } 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 | 23 | { | 101 | 23 | pdf_buffer *b = (pdf_buffer *)o; | 102 | 23 | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 23 | if (b->data) { | 107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 23 | b->data = data; | 110 | 23 | b->length = length; | 111 | 23 | return 0; | 112 | 23 | } |
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 | 34.6k | { | 101 | 34.6k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 34.6k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 34.6k | if (b->data) { | 107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 34.6k | b->data = data; | 110 | 34.6k | b->length = length; | 111 | 34.6k | return 0; | 112 | 34.6k | } |
pdf_font11.c:pdfi_buffer_set_data Line | Count | Source | 100 | 22.5k | { | 101 | 22.5k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 22.5k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 22.5k | if (b->data) { | 107 | | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 22.5k | b->data = data; | 110 | 22.5k | b->length = length; | 111 | 22.5k | return 0; | 112 | 22.5k | } |
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 |