/src/ghostpdl/pdf/pdf_dict.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Copyright (C) 2018-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 | | /* dictionary handling for the PDF interpreter */ |
17 | | |
18 | | #ifndef PDF_DICTIONARY_FUNCTIONS |
19 | | #define PDF_DICTIONARY_FUNCTIONS |
20 | | |
21 | 111k | static inline uint64_t pdfi_dict_entries(pdf_dict *d) { return d->entries; } zpdfops.c:pdfi_dict_entries Line | Count | Source | 21 | 7.81k | static inline uint64_t pdfi_dict_entries(pdf_dict *d) { return d->entries; } |
Unexecuted instantiation: ghostpdf.c:pdfi_dict_entries Unexecuted instantiation: pdf_dict.c:pdfi_dict_entries Unexecuted instantiation: pdf_xref.c:pdfi_dict_entries Unexecuted instantiation: pdf_int.c:pdfi_dict_entries Unexecuted instantiation: pdf_file.c:pdfi_dict_entries pdf_colour.c:pdfi_dict_entries Line | Count | Source | 21 | 1.17k | static inline uint64_t pdfi_dict_entries(pdf_dict *d) { return d->entries; } |
Unexecuted instantiation: pdf_pattern.c:pdfi_dict_entries Unexecuted instantiation: pdf_gstate.c:pdfi_dict_entries Unexecuted instantiation: pdf_image.c:pdfi_dict_entries Unexecuted instantiation: pdf_page.c:pdfi_dict_entries Unexecuted instantiation: pdf_annot.c:pdfi_dict_entries Unexecuted instantiation: pdf_mark.c:pdfi_dict_entries Unexecuted instantiation: pdf_font.c:pdfi_dict_entries Unexecuted instantiation: pdf_font0.c:pdfi_dict_entries Unexecuted instantiation: pdf_font1.c:pdfi_dict_entries Unexecuted instantiation: pdf_font1C.c:pdfi_dict_entries Unexecuted instantiation: pdf_fontps.c:pdfi_dict_entries Unexecuted instantiation: pdf_font3.c:pdfi_dict_entries Unexecuted instantiation: pdf_fontTT.c:pdfi_dict_entries Unexecuted instantiation: pdf_font11.c:pdfi_dict_entries Unexecuted instantiation: pdf_cmap.c:pdfi_dict_entries Unexecuted instantiation: pdf_fmap.c:pdfi_dict_entries Unexecuted instantiation: pdf_shading.c:pdfi_dict_entries Unexecuted instantiation: pdf_func.c:pdfi_dict_entries Unexecuted instantiation: pdf_trans.c:pdfi_dict_entries Unexecuted instantiation: pdf_optcontent.c:pdfi_dict_entries pdf_check.c:pdfi_dict_entries Line | Count | Source | 21 | 102k | static inline uint64_t pdfi_dict_entries(pdf_dict *d) { return d->entries; } |
Unexecuted instantiation: pdf_sec.c:pdfi_dict_entries Unexecuted instantiation: pdf_deref.c:pdfi_dict_entries Unexecuted instantiation: pdf_repair.c:pdfi_dict_entries Unexecuted instantiation: pdf_obj.c:pdfi_dict_entries Unexecuted instantiation: pdf_doc.c:pdfi_dict_entries Unexecuted instantiation: pdf_fapi.c:pdfi_dict_entries |
22 | | |
23 | | int pdfi_dict_get_common(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o, bool cache); |
24 | | static inline int pdfi_dict_get(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o) |
25 | 2.81M | { |
26 | 2.81M | return pdfi_dict_get_common(ctx, d, Key, o, true); |
27 | 2.81M | } Unexecuted instantiation: zpdfops.c:pdfi_dict_get Line | Count | Source | 25 | 2.99k | { | 26 | 2.99k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 2.99k | } |
Line | Count | Source | 25 | 2.54M | { | 26 | 2.54M | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 2.54M | } |
Unexecuted instantiation: pdf_xref.c:pdfi_dict_get Unexecuted instantiation: pdf_int.c:pdfi_dict_get Line | Count | Source | 25 | 716 | { | 26 | 716 | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 716 | } |
pdf_colour.c:pdfi_dict_get Line | Count | Source | 25 | 1.17k | { | 26 | 1.17k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 1.17k | } |
Unexecuted instantiation: pdf_pattern.c:pdfi_dict_get pdf_gstate.c:pdfi_dict_get Line | Count | Source | 25 | 20.7k | { | 26 | 20.7k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 20.7k | } |
pdf_image.c:pdfi_dict_get Line | Count | Source | 25 | 114k | { | 26 | 114k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 114k | } |
Line | Count | Source | 25 | 18.3k | { | 26 | 18.3k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 18.3k | } |
Unexecuted instantiation: pdf_annot.c:pdfi_dict_get Unexecuted instantiation: pdf_mark.c:pdfi_dict_get Line | Count | Source | 25 | 12.3k | { | 26 | 12.3k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 12.3k | } |
pdf_font0.c:pdfi_dict_get Line | Count | Source | 25 | 13.0k | { | 26 | 13.0k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 13.0k | } |
pdf_font1.c:pdfi_dict_get Line | Count | Source | 25 | 56.2k | { | 26 | 56.2k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 56.2k | } |
pdf_font1C.c:pdfi_dict_get Line | Count | Source | 25 | 786 | { | 26 | 786 | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 786 | } |
Unexecuted instantiation: pdf_fontps.c:pdfi_dict_get pdf_font3.c:pdfi_dict_get Line | Count | Source | 25 | 1.04k | { | 26 | 1.04k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 1.04k | } |
pdf_fontTT.c:pdfi_dict_get Line | Count | Source | 25 | 3.58k | { | 26 | 3.58k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 3.58k | } |
pdf_font11.c:pdfi_dict_get Line | Count | Source | 25 | 211 | { | 26 | 211 | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 211 | } |
Unexecuted instantiation: pdf_cmap.c:pdfi_dict_get Line | Count | Source | 25 | 1.67k | { | 26 | 1.67k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 1.67k | } |
pdf_shading.c:pdfi_dict_get Line | Count | Source | 25 | 11.4k | { | 26 | 11.4k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 11.4k | } |
Unexecuted instantiation: pdf_func.c:pdfi_dict_get pdf_trans.c:pdfi_dict_get Line | Count | Source | 25 | 1.19k | { | 26 | 1.19k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 1.19k | } |
Unexecuted instantiation: pdf_optcontent.c:pdfi_dict_get Unexecuted instantiation: pdf_check.c:pdfi_dict_get Line | Count | Source | 25 | 94 | { | 26 | 94 | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 94 | } |
Unexecuted instantiation: pdf_deref.c:pdfi_dict_get Unexecuted instantiation: pdf_repair.c:pdfi_dict_get Unexecuted instantiation: pdf_obj.c:pdfi_dict_get Line | Count | Source | 25 | 10.7k | { | 26 | 10.7k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 10.7k | } |
Line | Count | Source | 25 | 5.31k | { | 26 | 5.31k | return pdfi_dict_get_common(ctx, d, Key, o, true); | 27 | 5.31k | } |
|
28 | | |
29 | | static inline int pdfi_dict_get_nocache(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o) |
30 | 0 | { |
31 | 0 | return pdfi_dict_get_common(ctx, d, Key, o, false); |
32 | 0 | } Unexecuted instantiation: zpdfops.c:pdfi_dict_get_nocache Unexecuted instantiation: ghostpdf.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_dict.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_xref.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_int.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_file.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_colour.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_pattern.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_gstate.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_image.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_page.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_annot.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_mark.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_font.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_font0.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_font1.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_font1C.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_fontps.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_font3.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_fontTT.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_font11.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_cmap.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_fmap.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_shading.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_func.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_trans.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_optcontent.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_check.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_sec.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_deref.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_repair.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_obj.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_doc.c:pdfi_dict_get_nocache Unexecuted instantiation: pdf_fapi.c:pdfi_dict_get_nocache |
33 | | |
34 | | |
35 | | void pdfi_free_dict(pdf_obj *o); |
36 | | int pdfi_dict_delete_pair(pdf_context *ctx, pdf_dict *d, pdf_name *n); |
37 | | int pdfi_dict_delete(pdf_context *ctx, pdf_dict *d, const char *str); |
38 | | int pdfi_dict_alloc(pdf_context *ctx, uint64_t size, pdf_dict **d); |
39 | | int pdfi_dict_from_stack(pdf_context *ctx, uint32_t indirect_num, uint32_t indirect_gen, bool convert_string_keys); |
40 | | int pdfi_dict_known(pdf_context *ctx, pdf_dict *d, const char *Key, bool *known); |
41 | | int pdfi_dict_known_by_key(pdf_context *ctx, pdf_dict *d, pdf_name *Key, bool *known); |
42 | | int pdfi_dict_knownget(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o); |
43 | | int pdfi_dict_knownget_type(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_type type, pdf_obj **o); |
44 | | int pdfi_dict_knownget_type_no_store_R(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_type type, pdf_obj **o); |
45 | | int pdfi_dict_knownget_number(pdf_context *ctx, pdf_dict *d, const char *Key, double *f); |
46 | | int pdfi_dict_knownget_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool *b); |
47 | | int pdfi_merge_dicts(pdf_context *ctx, pdf_dict *target, pdf_dict *source); |
48 | | int pdfi_dict_put_obj(pdf_context *ctx, pdf_dict *d, pdf_obj *Key, pdf_obj *value, bool replace); |
49 | | int pdfi_dict_put_unchecked(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value); |
50 | | int pdfi_dict_put(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value); |
51 | | int pdfi_dict_put_int(pdf_context *ctx, pdf_dict *d, const char *Key, int64_t value); |
52 | | int pdfi_dict_put_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool value); |
53 | | int pdfi_dict_put_name(pdf_context *ctx, pdf_dict *d, const char *Key, const char *name); |
54 | | int pdfi_dict_get2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, pdf_obj **o); |
55 | | int pdfi_dict_get_no_deref(pdf_context *ctx, pdf_dict *d, const pdf_name *Key, pdf_obj **o); |
56 | | int pdfi_dict_get_by_key(pdf_context *ctx, pdf_dict *d, const pdf_name *Key, pdf_obj **o); |
57 | | int pdfi_dict_get_no_store_R_key(pdf_context *ctx, pdf_dict *d, const pdf_name *Key, pdf_obj **o); |
58 | | int pdfi_dict_get_no_store_R(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o); |
59 | | int pdfi_dict_get_type2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, pdf_obj_type type, pdf_obj **o); |
60 | | int pdfi_dict_get_type(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_type t, pdf_obj **o); |
61 | | int pdfi_dict_get_type_no_store_R(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_type type, pdf_obj **o); |
62 | | int pdfi_dict_get_ref(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_indirect_ref **o); |
63 | | int pdfi_dict_get_int2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, int64_t *i); |
64 | | int pdfi_dict_get_int(pdf_context *ctx, pdf_dict *d, const char *Key, int64_t *i); |
65 | | int pdfi_dict_get_int_def(pdf_context *ctx, pdf_dict *d, const char *Key, int64_t *i, int64_t def_val); |
66 | | int pdfi_dict_get_bool2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, bool *val); |
67 | | int pdfi_dict_get_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool *val); |
68 | | int pdfi_dict_get_number(pdf_context *ctx, pdf_dict *d, const char *Key, double *f); |
69 | | int pdfi_dict_get_number2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, double *f); |
70 | | int fill_domain_from_dict(pdf_context *ctx, float *parray, int size, pdf_dict *dict); |
71 | | int fill_float_array_from_dict(pdf_context *ctx, float *parray, int size, pdf_dict *dict, const char *Key); |
72 | | int fill_bool_array_from_dict(pdf_context *ctx, bool *parray, int size, pdf_dict *dict, const char *Key); |
73 | | int fill_matrix_from_dict(pdf_context *ctx, float *parray, pdf_dict *dict); |
74 | | int pdfi_make_float_array_from_dict(pdf_context *ctx, float **parray, pdf_dict *dict, const char *Key); |
75 | | int pdfi_make_int_array_from_dict(pdf_context *ctx, int **parray, pdf_dict *dict, const char *Key); |
76 | | int pdfi_dict_copy(pdf_context *ctx, pdf_dict *target, pdf_dict *source); |
77 | | int pdfi_dict_next(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, pdf_obj **Value, uint64_t *index); |
78 | | int pdfi_dict_first(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, pdf_obj **Value, uint64_t *index); |
79 | | int pdfi_dict_key_next(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, uint64_t *index); |
80 | | int pdfi_dict_key_first(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, uint64_t *index); |
81 | | |
82 | | int pdfi_dict_from_obj(pdf_context *ctx, pdf_obj *obj, pdf_dict **dict); |
83 | | int64_t pdfi_stream_length(pdf_context *ctx, pdf_stream *stream); |
84 | | gs_offset_t pdfi_stream_offset(pdf_context *ctx, pdf_stream *stream); |
85 | | pdf_stream *pdfi_stream_parent(pdf_context *ctx, pdf_stream *stream); |
86 | | void pdfi_set_stream_parent(pdf_context *ctx, pdf_stream *stream, pdf_stream *parent); |
87 | | void pdfi_clear_stream_parent(pdf_context *ctx, pdf_stream *stream); |
88 | | #endif |