Debian Codegraph @

src/main/escp2-resolutions.c

raw symbols SCIP
1 /*
2 *
3 * Print plug-in EPSON ESC/P2 driver for the GIMP.
4 *
5 * Copyright 1997-2000 Michael Sweet ([email protected]) and
6 * Robert Krawitz ([email protected])
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:411:9`!
23 #include <config.h>cxx . . $ `<file>/config.h`/
24 #endif
25 #include <gutenprint/gutenprint.h>cxx . . $ `<file>/include/gutenprint/gutenprint.h`/
26 #include "gutenprint-internal.h"cxx . . $ `<file>/src/main/gutenprint-internal.h`/
27 #include <gutenprint/gutenprint-intl-internal.h>cxx . . $ `<file>/include/gutenprint/gutenprint-intl-internal.h`/
28 #include "print-escp2.h"cxx . . $ `<file>/src/main/print-escp2.h`/
29
30
31 static printer_weave_list_tcxx . . $ printer_weave_list_t# *
32 stpi_escp2_load_printer_weaves_from_xmlcxx . . $ stpi_escp2_load_printer_weaves_from_xml(e3ba91ae96b15ecc).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *node)
33 {
34 printer_weave_list_tcxx . . $ printer_weave_list_t# *xpw = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(sizeof(printer_weave_list_tcxx . . $ printer_weave_list_t#));
35 int count = 0;
36 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *child = node->childcxx . . $ stp_mxml_node_s#child.;
37 while (child)
38 {
39 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
40 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "weave"))
41 count++;
42 child = child->nextcxx . . $ stp_mxml_node_s#next.;
43 }
44 if (stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(node, "name"))
45 xpw->namecxx . . $ $anonymous_type_2c59c6ae4581c18b_8#name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(node, "name"));
46 xpw->n_printer_weavescxx . . $ $anonymous_type_2c59c6ae4581c18b_8#n_printer_weaves. = count;
47 xpw->printer_weavescxx . . $ $anonymous_type_2c59c6ae4581c18b_8#printer_weaves. = stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(printer_weave_tcxx . . $ printer_weave_t#) * count);
48 child = node->childcxx . . $ stp_mxml_node_s#child.;
49 count = 0;
50 while (child)
51 {
52 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
53 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "weave"))
54 {
55 const char *wname = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "name");
56 const char *wtext = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "text");
57 const char *cmd = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "command");
58 if (wname)
59 xpw->printer_weavescxx . . $ $anonymous_type_2c59c6ae4581c18b_8#printer_weaves.[count].namecxx . . $ $anonymous_type_2c59c6ae4581c18b_7#name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(wname);
60 if (wtext)
61 xpw->printer_weavescxx . . $ $anonymous_type_2c59c6ae4581c18b_8#printer_weaves.[count].textcxx . . $ $anonymous_type_2c59c6ae4581c18b_7#text. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(wtext);
62 if (cmd)
63 xpw->printer_weavescxx . . $ $anonymous_type_2c59c6ae4581c18b_8#printer_weaves.[count].commandcxx . . $ $anonymous_type_2c59c6ae4581c18b_7#command. = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(cmd);
64 count++;
65 }
66 child = child->nextcxx . . $ stp_mxml_node_s#next.;
67 }
68 return xpw;
69 }
70
71 int
72 stpi_escp2_load_printer_weavescxx . . $ stpi_escp2_load_printer_weaves(b1e629819c29df09).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *name)
73 {
74 static const char *weave_cache = "escp2PrinterWeaves";
75 stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *printdef = stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(v);
76 printer_weave_list_tcxx . . $ printer_weave_list_t# *pw =
77 (printer_weave_list_tcxx . . $ printer_weave_list_t# *) stp_refcache_find_itemcxx . . $ stp_refcache_find_item(12e6862c879384a7).(weave_cache, name);
78 if(! pw)
79 {
80 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *node =
81 stp_xml_parse_file_from_path_uncached_safecxx . . $ stp_xml_parse_file_from_path_uncached_safe(5a8029715312b5a0).(name, "escp2PrinterWeaves", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
82 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v,
83 ">>>Loading printer weave data from %s (%p)...", name, (void *) node);
84 stp_xml_initcxx . . $ stp_xml_init(49f6e7a06ebc5aa8).();
85 pw = stpi_escp2_load_printer_weaves_from_xmlcxx . . $ stpi_escp2_load_printer_weaves_from_xml(e3ba91ae96b15ecc).(node);
86 stp_xml_exitcxx . . $ stp_xml_exit(49f6e7a06ebc5aa8).();
87 stp_refcache_add_itemcxx . . $ stp_refcache_add_item(285a709643be31b2).(weave_cache, name, pw);
88 stp_xml_free_parsed_filecxx . . $ stp_xml_free_parsed_file(6927777f14b5e2a1).(node);
89 }
90 printdef->printer_weavescxx . . $ escp2_printer#printer_weaves. = pw;
91 return 1;
92 }
93
94 static resolution_list_tcxx . . $ resolution_list_t# *
95 stpi_escp2_load_resolutions_from_xmlcxx . . $ stpi_escp2_load_resolutions_from_xml(5ea1fa0fb81d6bb2).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *node)
96 {
97 resolution_list_tcxx . . $ resolution_list_t# *xrs = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(sizeof(resolution_list_tcxx . . $ resolution_list_t#));
98 int count = 0;
99 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *child = node->childcxx . . $ stp_mxml_node_s#child.;
100 while (child)
101 {
102 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
103 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "resolution"))
104 {
105 count++;
106 }
107 child = child->nextcxx . . $ stp_mxml_node_s#next.;
108 }
109 if (stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(node, "name"))
110 xrs->namecxx . . $ $anonymous_type_2c59c6ae4581c18b_4#name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(node, "name"));
111 xrs->n_resolutionscxx . . $ $anonymous_type_2c59c6ae4581c18b_4#n_resolutions. = count;
112 xrs->resolutionscxx . . $ $anonymous_type_2c59c6ae4581c18b_4#resolutions. = stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(res_tcxx . . $ res_t#) * count);
113 child = node->childcxx . . $ stp_mxml_node_s#child.;
114 count = 0;
115 while (child)
116 {
117 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
118 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "resolution"))
119 {
120 res_tcxx . . $ res_t# *res = &(xrs->resolutionscxx . . $ $anonymous_type_2c59c6ae4581c18b_4#resolutions.[count]);
121 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *cchild = child->childcxx . . $ stp_mxml_node_s#child.;
122 const char *wname = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "name");
123 const char *wtext = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "text");
124 res->vcxx . . $ $anonymous_type_2c59c6ae4581c18b_3#v. = stp_vars_createcxx . . $ stp_vars_create(ca9164ca858eeb6f).();
125 res->vertical_passescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#vertical_passes. = 1;
126 if (wname)
127 res->namecxx . . $ $anonymous_type_2c59c6ae4581c18b_3#name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(wname);
128 if (wtext)
129 res->textcxx . . $ $anonymous_type_2c59c6ae4581c18b_3#text. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(wtext);
130 stp_vars_fill_from_xmltree_refcxx . . $ stp_vars_fill_from_xmltree_ref(3a5b38a25339ac9d).(cchild, node, res->vcxx . . $ $anonymous_type_2c59c6ae4581c18b_3#v.);
131 while (cchild)
132 {
133 if (cchild->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT.)
134 {
135 const char *elt = cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name.;
136 if (cchild->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
137 (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(elt, "physicalResolution") ||
138 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(elt, "printedResolution")))
139 {
140 long data[2] = { 0, 0 };
141 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *ccchild = cchild->childcxx . . $ stp_mxml_node_s#child.;
142 data[0] = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(ccchild->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
143 ccchild = ccchild->nextcxx . . $ stp_mxml_node_s#next.;
144 data[1] = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(ccchild->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
145 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(elt, "physicalResolution"))
146 {
147 res->hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#hres. = data[0];
148 res->vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#vres. = data[1];
149 }
150 else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(elt, "printedResolution"))
151 {
152 res->printed_hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#printed_hres. = data[0];
153 res->printed_vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#printed_vres. = data[1];
154 }
155 }
156 else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(elt, "verticalPasses") &&
157 cchild->childcxx . . $ stp_mxml_node_s#child. &&
158 cchild->childcxx . . $ stp_mxml_node_s#child.->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_TEXTcxx . . $ STP_MXML_TEXT.)
159 res->vertical_passescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#vertical_passes. = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(cchild->childcxx . . $ stp_mxml_node_s#child.->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
160 else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(elt, "printerWeave") &&
161 stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(cchild, "command"))
162 res->commandcxx . . $ $anonymous_type_2c59c6ae4581c18b_3#command. = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(cchild, "command"));
163 }
164 cchild = cchild->nextcxx . . $ stp_mxml_node_s#next.;
165 }
166 if (!res->printed_hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#printed_hres.)
167 res->printed_hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#printed_hres. = res->hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#hres.;
168 if (!res->printed_vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#printed_vres.)
169 res->printed_vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#printed_vres. = res->vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_3#vres.;
170 count++;
171 }
172 child = child->nextcxx . . $ stp_mxml_node_s#next.;
173 }
174 return xrs;
175 }
176
177 int
178 stpi_escp2_load_resolutionscxx . . $ stpi_escp2_load_resolutions(5eab70e4dd30e869).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *name,
179 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *node)
180 {
181 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v,
182 ">>>Loading resolutions from %s (%p)...", name, (void *) node);
183 static const char *res_cache = "escp2Resolutions";
184 stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *printdef = stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(v);
185 resolution_list_tcxx . . $ resolution_list_t# *pr =
186 (resolution_list_tcxx . . $ resolution_list_t# *) stp_refcache_find_itemcxx . . $ stp_refcache_find_item(12e6862c879384a7).(res_cache, name);
187 int found = 0;
188 if (pr)
189 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v, "cached!");
190 if(! pr)
191 {
192 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *parent = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
193 if (! node)
194 {
195 parent = stp_xml_parse_file_from_path_uncached_safecxx . . $ stp_xml_parse_file_from_path_uncached_safe(5a8029715312b5a0).(name, "escp2Resolutions", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
196 node = parent->childcxx . . $ stp_mxml_node_s#child.;
197 }
198 while (node)
199 {
200 if (node->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
201 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(node->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "resolutions"))
202 {
203 stp_xml_initcxx . . $ stp_xml_init(49f6e7a06ebc5aa8).();
204 pr = stpi_escp2_load_resolutions_from_xmlcxx . . $ stpi_escp2_load_resolutions_from_xml(5ea1fa0fb81d6bb2).(node);
205 stp_refcache_add_itemcxx . . $ stp_refcache_add_item(285a709643be31b2).(res_cache, name, pr);
206 stp_xml_exitcxx . . $ stp_xml_exit(49f6e7a06ebc5aa8).();
207 found = 1;
208 break;
209 }
210 node = node->nextcxx . . $ stp_mxml_node_s#next.;
211 }
212 stp_xml_free_parsed_filecxx . . $ stp_xml_free_parsed_file(6927777f14b5e2a1).(parent);
213 }
214 printdef->resolutionscxx . . $ escp2_printer#resolutions. = pr;
215 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v, "(%p) done!", (void *) pr);
216 return found;
217 }
218
219 static quality_list_tcxx . . $ quality_list_t# *
220 stpi_escp2_load_quality_presets_from_xmlcxx . . $ stpi_escp2_load_quality_presets_from_xml(90ada9a75317e8ea).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *node)
221 {
222 quality_list_tcxx . . $ quality_list_t# *qpw = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(sizeof(quality_list_tcxx . . $ quality_list_t#));
223 int count = 0;
224 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *child = node->childcxx . . $ stp_mxml_node_s#child.;
225 while (child)
226 {
227 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
228 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "quality"))
229 count++;
230 child = child->nextcxx . . $ stp_mxml_node_s#next.;
231 }
232 if (stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(node, "name"))
233 qpw->namecxx . . $ $anonymous_type_2c59c6ae4581c18b_6#name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(node, "name"));
234 qpw->n_qualscxx . . $ $anonymous_type_2c59c6ae4581c18b_6#n_quals. = count;
235 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities. = stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(quality_tcxx . . $ quality_t#) * count);
236 child = node->childcxx . . $ stp_mxml_node_s#child.;
237 count = 0;
238 while (child)
239 {
240 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
241 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(child->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "quality"))
242 {
243 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *cchild = child->childcxx . . $ stp_mxml_node_s#child.;
244 const char *wname = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "name");
245 const char *wtext = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(child, "text");
246 if (wname)
247 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].namecxx . . $ $anonymous_type_2c59c6ae4581c18b_5#name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(wname);
248 if (wtext)
249 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].textcxx . . $ $anonymous_type_2c59c6ae4581c18b_5#text. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(wtext);
250 while (cchild)
251 {
252 if (cchild->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT. &&
253 (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "minimumResolution") ||
254 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "maximumResolution") ||
255 !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "desiredResolution")))
256 {
257 long data[2] = { 0, 0 };
258 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *ccchild = cchild->childcxx . . $ stp_mxml_node_s#child.;
259 data[0] = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(ccchild->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
260 ccchild = ccchild->nextcxx . . $ stp_mxml_node_s#next.;
261 data[1] = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(ccchild->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
262 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "minimumResolution"))
263 {
264 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].min_hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_5#min_hres. = data[0];
265 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].min_vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_5#min_vres. = data[1];
266 }
267 else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "maximumResolution"))
268 {
269 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].max_hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_5#max_hres. = data[0];
270 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].max_vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_5#max_vres. = data[1];
271 }
272 else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(cchild->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name., "desiredResolution"))
273 {
274 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].desired_hrescxx . . $ $anonymous_type_2c59c6ae4581c18b_5#desired_hres. = data[0];
275 qpw->qualitiescxx . . $ $anonymous_type_2c59c6ae4581c18b_6#qualities.[count].desired_vrescxx . . $ $anonymous_type_2c59c6ae4581c18b_5#desired_vres. = data[1];
276 }
277 }
278 cchild = cchild->nextcxx . . $ stp_mxml_node_s#next.;
279 }
280 count++;
281 }
282 child = child->nextcxx . . $ stp_mxml_node_s#next.;
283 }
284 return qpw;
285 }
286
287 int
288 stpi_escp2_load_quality_presetscxx . . $ stpi_escp2_load_quality_presets(b1e629819c29df09).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *name)
289 {
290 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v,
291 ">>>Loading quality presets from %s...", name);
292 static const char *quality_cache = "escp2QualityPresets";
293 stpi_escp2_printer_tcxx . . $ stpi_escp2_printer_t# *printdef = stpi_escp2_get_printercxx . . $ stpi_escp2_get_printer(d94ed1084d556691).(v);
294 quality_list_tcxx . . $ quality_list_t# *qpw =
295 (quality_list_tcxx . . $ quality_list_t# *) stp_refcache_find_itemcxx . . $ stp_refcache_find_item(12e6862c879384a7).(quality_cache, name);
296 if (qpw)
297 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v, "cached!");
298 if(! qpw)
299 {
300 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *node =
301 stp_xml_parse_file_from_path_uncached_safecxx . . $ stp_xml_parse_file_from_path_uncached_safe(5a8029715312b5a0).(name, "escp2QualityPresets", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
302 stp_xml_initcxx . . $ stp_xml_init(49f6e7a06ebc5aa8).();
303 qpw = stpi_escp2_load_quality_presets_from_xmlcxx . . $ stpi_escp2_load_quality_presets_from_xml(90ada9a75317e8ea).(node);
304 stp_refcache_add_itemcxx . . $ stp_refcache_add_item(285a709643be31b2).(quality_cache, name, qpw);
305 stp_xml_free_parsed_filecxx . . $ stp_xml_free_parsed_file(6927777f14b5e2a1).(node);
306 stp_xml_exitcxx . . $ stp_xml_exit(49f6e7a06ebc5aa8).();
307 }
308 printdef->quality_listcxx . . $ escp2_printer#quality_list. = qpw;
309 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_ESCP2_XMLcxx . . $ `include/gutenprint/util.h:191:9`!, v, "(%p) done!", (void *) qpw);
310 return 1;
311 }