/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 | 8.87M | { |
32 | 8.87M | pdf_num *num = (pdf_num *)obj; |
33 | | |
34 | 8.87M | switch (pdfi_type_of(num)) { |
35 | 4.14M | case PDF_INT: |
36 | 4.14M | *d = (double)num->value.i; |
37 | 4.14M | break; |
38 | 4.71M | case PDF_REAL: |
39 | 4.71M | *d = num->value.d; |
40 | 4.71M | break; |
41 | 14.5k | default: |
42 | 14.5k | return_error(gs_error_typecheck); |
43 | 8.87M | } |
44 | | |
45 | 8.86M | return 0; |
46 | 8.87M | } zpdfops.c:pdfi_obj_to_real Line | Count | Source | 31 | 17.6k | { | 32 | 17.6k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 17.6k | switch (pdfi_type_of(num)) { | 35 | 0 | case PDF_INT: | 36 | 0 | *d = (double)num->value.i; | 37 | 0 | break; | 38 | 17.6k | case PDF_REAL: | 39 | 17.6k | *d = num->value.d; | 40 | 17.6k | break; | 41 | 0 | default: | 42 | 0 | return_error(gs_error_typecheck); | 43 | 17.6k | } | 44 | | | 45 | 17.6k | return 0; | 46 | 17.6k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_real pdf_dict.c:pdfi_obj_to_real Line | Count | Source | 31 | 135k | { | 32 | 135k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 135k | switch (pdfi_type_of(num)) { | 35 | 112k | case PDF_INT: | 36 | 112k | *d = (double)num->value.i; | 37 | 112k | break; | 38 | 23.3k | case PDF_REAL: | 39 | 23.3k | *d = num->value.d; | 40 | 23.3k | break; | 41 | 5 | default: | 42 | 5 | return_error(gs_error_typecheck); | 43 | 135k | } | 44 | | | 45 | 135k | return 0; | 46 | 135k | } |
pdf_array.c:pdfi_obj_to_real Line | Count | Source | 31 | 1.29M | { | 32 | 1.29M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 1.29M | switch (pdfi_type_of(num)) { | 35 | 1.03M | case PDF_INT: | 36 | 1.03M | *d = (double)num->value.i; | 37 | 1.03M | break; | 38 | 254k | case PDF_REAL: | 39 | 254k | *d = num->value.d; | 40 | 254k | break; | 41 | 63 | default: | 42 | 63 | return_error(gs_error_typecheck); | 43 | 1.29M | } | 44 | | | 45 | 1.29M | return 0; | 46 | 1.29M | } |
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 | 6.31M | { | 32 | 6.31M | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 6.31M | switch (pdfi_type_of(num)) { | 35 | 2.29M | case PDF_INT: | 36 | 2.29M | *d = (double)num->value.i; | 37 | 2.29M | break; | 38 | 4.00M | case PDF_REAL: | 39 | 4.00M | *d = num->value.d; | 40 | 4.00M | break; | 41 | 14.4k | default: | 42 | 14.4k | return_error(gs_error_typecheck); | 43 | 6.31M | } | 44 | | | 45 | 6.29M | return 0; | 46 | 6.31M | } |
Unexecuted instantiation: pdf_image.c:pdfi_obj_to_real pdf_page.c:pdfi_obj_to_real Line | Count | Source | 31 | 37.5k | { | 32 | 37.5k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 37.5k | switch (pdfi_type_of(num)) { | 35 | 19.9k | case PDF_INT: | 36 | 19.9k | *d = (double)num->value.i; | 37 | 19.9k | break; | 38 | 17.6k | case PDF_REAL: | 39 | 17.6k | *d = num->value.d; | 40 | 17.6k | break; | 41 | 11 | default: | 42 | 11 | return_error(gs_error_typecheck); | 43 | 37.5k | } | 44 | | | 45 | 37.5k | return 0; | 46 | 37.5k | } |
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 | 120k | { | 32 | 120k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 120k | switch (pdfi_type_of(num)) { | 35 | 71.0k | case PDF_INT: | 36 | 71.0k | *d = (double)num->value.i; | 37 | 71.0k | break; | 38 | 49.1k | case PDF_REAL: | 39 | 49.1k | *d = num->value.d; | 40 | 49.1k | break; | 41 | 40 | default: | 42 | 40 | return_error(gs_error_typecheck); | 43 | 120k | } | 44 | | | 45 | 120k | return 0; | 46 | 120k | } |
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 | 959k | { | 32 | 959k | pdf_num *num = (pdf_num *)obj; | 33 | | | 34 | 959k | switch (pdfi_type_of(num)) { | 35 | 614k | case PDF_INT: | 36 | 614k | *d = (double)num->value.i; | 37 | 614k | break; | 38 | 345k | case PDF_REAL: | 39 | 345k | *d = num->value.d; | 40 | 345k | break; | 41 | 7 | default: | 42 | 7 | return_error(gs_error_typecheck); | 43 | 959k | } | 44 | | | 45 | 959k | return 0; | 46 | 959k | } |
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 | 859k | { |
51 | 859k | pdf_num *num = (pdf_num *)obj; |
52 | | |
53 | 859k | switch (pdfi_type_of(num)) { |
54 | 359k | case PDF_INT: |
55 | 359k | *f = (float)num->value.i; |
56 | 359k | break; |
57 | 499k | case PDF_REAL: |
58 | 499k | *f = (float)num->value.d; |
59 | 499k | break; |
60 | 899 | default: |
61 | 899 | return_error(gs_error_typecheck); |
62 | 859k | } |
63 | | |
64 | 858k | return 0; |
65 | 859k | } 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 | 50.8k | { | 51 | 50.8k | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 50.8k | switch (pdfi_type_of(num)) { | 54 | 15.5k | case PDF_INT: | 55 | 15.5k | *f = (float)num->value.i; | 56 | 15.5k | break; | 57 | 34.6k | case PDF_REAL: | 58 | 34.6k | *f = (float)num->value.d; | 59 | 34.6k | break; | 60 | 638 | default: | 61 | 638 | return_error(gs_error_typecheck); | 62 | 50.8k | } | 63 | | | 64 | 50.1k | return 0; | 65 | 50.8k | } |
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 | 809k | { | 51 | 809k | pdf_num *num = (pdf_num *)obj; | 52 | | | 53 | 809k | switch (pdfi_type_of(num)) { | 54 | 344k | case PDF_INT: | 55 | 344k | *f = (float)num->value.i; | 56 | 344k | break; | 57 | 464k | case PDF_REAL: | 58 | 464k | *f = (float)num->value.d; | 59 | 464k | break; | 60 | 261 | default: | 61 | 261 | return_error(gs_error_typecheck); | 62 | 809k | } | 63 | | | 64 | 808k | return 0; | 65 | 809k | } |
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 | 471k | { |
70 | 471k | pdf_num *num = (pdf_num *)obj; |
71 | 471k | int64_t tmp; |
72 | | |
73 | 471k | switch (pdfi_type_of(num)) { |
74 | 468k | case PDF_INT: |
75 | 468k | *i = num->value.i; |
76 | 468k | break; |
77 | 1.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 | 1.59k | tmp = (int64_t)num->value.d; |
84 | 1.59k | if ((double)tmp != num->value.d) { |
85 | 826 | return_error(gs_error_typecheck); |
86 | 826 | } |
87 | 766 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); |
88 | 766 | *i = tmp; |
89 | 766 | break; |
90 | 1.41k | default: |
91 | 1.41k | return_error(gs_error_typecheck); |
92 | 471k | } |
93 | | |
94 | 468k | return 0; |
95 | 471k | } zpdfops.c:pdfi_obj_to_int Line | Count | Source | 69 | 30.3k | { | 70 | 30.3k | pdf_num *num = (pdf_num *)obj; | 71 | 30.3k | int64_t tmp; | 72 | | | 73 | 30.3k | switch (pdfi_type_of(num)) { | 74 | 30.3k | case PDF_INT: | 75 | 30.3k | *i = num->value.i; | 76 | 30.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 | 0 | default: | 91 | 0 | return_error(gs_error_typecheck); | 92 | 30.3k | } | 93 | | | 94 | 30.3k | return 0; | 95 | 30.3k | } |
Unexecuted instantiation: ghostpdf.c:pdfi_obj_to_int pdf_dict.c:pdfi_obj_to_int Line | Count | Source | 69 | 232k | { | 70 | 232k | pdf_num *num = (pdf_num *)obj; | 71 | 232k | int64_t tmp; | 72 | | | 73 | 232k | switch (pdfi_type_of(num)) { | 74 | 232k | case PDF_INT: | 75 | 232k | *i = num->value.i; | 76 | 232k | break; | 77 | 290 | 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 | 290 | tmp = (int64_t)num->value.d; | 84 | 290 | if ((double)tmp != num->value.d) { | 85 | 0 | return_error(gs_error_typecheck); | 86 | 0 | } | 87 | 290 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 290 | *i = tmp; | 89 | 290 | break; | 90 | 30 | default: | 91 | 30 | return_error(gs_error_typecheck); | 92 | 232k | } | 93 | | | 94 | 232k | return 0; | 95 | 232k | } |
pdf_array.c:pdfi_obj_to_int Line | Count | Source | 69 | 6.03k | { | 70 | 6.03k | pdf_num *num = (pdf_num *)obj; | 71 | 6.03k | int64_t tmp; | 72 | | | 73 | 6.03k | switch (pdfi_type_of(num)) { | 74 | 6.03k | case PDF_INT: | 75 | 6.03k | *i = num->value.i; | 76 | 6.03k | 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 | 5 | default: | 91 | 5 | return_error(gs_error_typecheck); | 92 | 6.03k | } | 93 | | | 94 | 6.03k | return 0; | 95 | 6.03k | } |
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 | 202k | { | 70 | 202k | pdf_num *num = (pdf_num *)obj; | 71 | 202k | int64_t tmp; | 72 | | | 73 | 202k | switch (pdfi_type_of(num)) { | 74 | 199k | case PDF_INT: | 75 | 199k | *i = num->value.i; | 76 | 199k | break; | 77 | 1.30k | 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 | 1.30k | tmp = (int64_t)num->value.d; | 84 | 1.30k | if ((double)tmp != num->value.d) { | 85 | 826 | return_error(gs_error_typecheck); | 86 | 826 | } | 87 | 476 | pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL); | 88 | 476 | *i = tmp; | 89 | 476 | break; | 90 | 1.38k | default: | 91 | 1.38k | return_error(gs_error_typecheck); | 92 | 202k | } | 93 | | | 94 | 199k | return 0; | 95 | 202k | } |
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 | 2.81k | { |
101 | 2.81k | pdf_buffer *b = (pdf_buffer *)o; |
102 | 2.81k | if (pdfi_type_of(b) != PDF_BUFFER) { |
103 | 0 | return_error(gs_error_typecheck); |
104 | 0 | } |
105 | | |
106 | 2.81k | if (b->data) { |
107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); |
108 | 0 | } |
109 | 2.81k | b->data = data; |
110 | 2.81k | b->length = length; |
111 | 2.81k | return 0; |
112 | 2.81k | } 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 | 2 | { | 101 | 2 | pdf_buffer *b = (pdf_buffer *)o; | 102 | 2 | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 2 | if (b->data) { | 107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 2 | b->data = data; | 110 | 2 | b->length = length; | 111 | 2 | return 0; | 112 | 2 | } |
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 | 1.36k | { | 101 | 1.36k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 1.36k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 1.36k | if (b->data) { | 107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 1.36k | b->data = data; | 110 | 1.36k | b->length = length; | 111 | 1.36k | return 0; | 112 | 1.36k | } |
pdf_font11.c:pdfi_buffer_set_data Line | Count | Source | 100 | 1.45k | { | 101 | 1.45k | pdf_buffer *b = (pdf_buffer *)o; | 102 | 1.45k | if (pdfi_type_of(b) != PDF_BUFFER) { | 103 | 0 | return_error(gs_error_typecheck); | 104 | 0 | } | 105 | | | 106 | 1.45k | if (b->data) { | 107 | 0 | gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)"); | 108 | 0 | } | 109 | 1.45k | b->data = data; | 110 | 1.45k | b->length = length; | 111 | 1.45k | return 0; | 112 | 1.45k | } |
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 |