Debian Codegraph @

src/main/printers.c

raw symbols SCIP
1 /*
2 *
3 * Print plug-in driver utility functions 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 /*
23 * This file must include only standard C header files. The core code must
24 * compile on generic platforms that don't support glib, gimp, gtk, etc.
25 */
26
27 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`!
28 #include <config.h>cxx . . $ `<file>/config.h`/
29 #endif
30 #include <gutenprint/gutenprint.h>cxx . . $ `<file>/include/gutenprint/gutenprint.h`/
31 #include "gutenprint-internal.h"cxx . . $ `<file>/src/main/gutenprint-internal.h`/
32 #include <gutenprint/gutenprint-intl-internal.h>cxx . . $ `<file>/include/gutenprint/gutenprint-intl-internal.h`/
33 #include <stdint.h>
34 #include <math.h>
35 #ifdef HAVE_LIMITS_Hcxx . . $ `../../config.h:94:9`!
36 #include <limits.h>
37 #endif
38 #include <string.h>
39 #include <stdlib.h>
40
41 #define FMINcxx . . $ `src/main/printers.c:41:9`!(a, b) ((a) < (b) ? (a) : (b))
42
43
44 static void stpi_printvars_freefunccxx . . $ stpi_printvars_freefunc(5d22bdacc48458e8).(void *item);
45 static const char* stpi_printvars_namefunccxx . . $ stpi_printvars_namefunc(6271d96ae060557f).(const void *item);
46
47 static stp_list_tcxx . . $ stp_list_t# *printvars_listcxx . . $ printvars_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
48
49 typedef struct stp_printvarscxx . . $ stp_printvars#
50 {
51 const char *namecxx . . $ stp_printvars#name.;
52 stp_vars_tcxx . . $ stp_vars_t# *printvarscxx . . $ stp_printvars#printvars.;
53 } stp_printvars_tcxx . . $ stp_printvars_t#;
54
55 static void stpi_printer_freefunccxx . . $ stpi_printer_freefunc(5d22bdacc48458e8).(void *item);
56 static const char* stpi_printer_namefunccxx . . $ stpi_printer_namefunc(6271d96ae060557f).(const void *item);
57 static const char* stpi_printer_long_namefunccxx . . $ stpi_printer_long_namefunc(6271d96ae060557f).(const void *item);
58
59 /*
60 * IMPORTANT NOTE ABOUT PRINTER LIST IMPLEMENTATION:
61 * For testing purposes, at a minimum, the list of printers must be
62 * returned in deterministic order. The Travis run splits up the list
63 * of printers by means of a rotor (each test job gets every Nth printer),
64 * so a given build must preserve ordering if we want to ensure that
65 * all printers are covered.
66 */
67
68 static stp_list_tcxx . . $ stp_list_t# *printer_listcxx . . $ printer_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
69
70 struct stp_printercxx . . $ stp_printer#
71 {
72 const char *drivercxx . . $ stp_printer#driver.;
73 char *long_namecxx . . $ stp_printer#long_name.; /* Long name for UI */
74 char *familycxx . . $ stp_printer#family.; /* Printer family */
75 char *manufacturercxx . . $ stp_printer#manufacturer.; /* Printer manufacturer */
76 char *device_idcxx . . $ stp_printer#device_id.; /* IEEE 1284 device ID */
77 char *commentcxx . . $ stp_printer#comment.; /* Comment string, if any */
78 int modelcxx . . $ stp_printer#model.; /* Model number */
79 int vars_initializedcxx . . $ stp_printer#vars_initialized.;
80 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncscxx . . $ stp_printer#printfuncs.;
81 stp_vars_tcxx . . $ stp_vars_t# *printvarscxx . . $ stp_printer#printvars.;
82 };
83
84 static void
85 stpi_init_printvars_listcxx . . $ stpi_init_printvars_list(49f6e7a06ebc5aa8).(void)
86 {
87 if (!printvars_listcxx . . $ printvars_list.)
88 {
89 printvars_listcxx . . $ printvars_list. = stp_list_createcxx . . $ stp_list_create(728167c67729d082).();
90 stp_list_set_freefunccxx . . $ stp_list_set_freefunc(309a84c3f950ef37).(printvars_listcxx . . $ printvars_list., stpi_printvars_freefunccxx . . $ stpi_printvars_freefunc(5d22bdacc48458e8).);
91 stp_list_set_namefunccxx . . $ stp_list_set_namefunc(83503c4472347457).(printvars_listcxx . . $ printvars_list., stpi_printvars_namefunccxx . . $ stpi_printvars_namefunc(6271d96ae060557f).);
92 stp_list_set_long_namefunccxx . . $ stp_list_set_long_namefunc(83503c4472347457).(printvars_listcxx . . $ printvars_list., stpi_printvars_namefunccxx . . $ stpi_printvars_namefunc(6271d96ae060557f).);
93 }
94 }
95
96 static int
97 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).(void)
98 {
99 if(printer_listcxx . . $ printer_list.)
100 stp_list_destroycxx . . $ stp_list_destroy(29ae8ff464c7f7e5).(printer_listcxx . . $ printer_list.);
101 printer_listcxx . . $ printer_list. = stp_list_createcxx . . $ stp_list_create(728167c67729d082).();
102 stp_list_set_freefunccxx . . $ stp_list_set_freefunc(309a84c3f950ef37).(printer_listcxx . . $ printer_list., stpi_printer_freefunccxx . . $ stpi_printer_freefunc(5d22bdacc48458e8).);
103 stp_list_set_namefunccxx . . $ stp_list_set_namefunc(83503c4472347457).(printer_listcxx . . $ printer_list., stpi_printer_namefunccxx . . $ stpi_printer_namefunc(6271d96ae060557f).);
104 stp_list_set_long_namefunccxx . . $ stp_list_set_long_namefunc(83503c4472347457).(printer_listcxx . . $ printer_list., stpi_printer_long_namefunccxx . . $ stpi_printer_long_namefunc(6271d96ae060557f).);
105 /* stp_list_set_sortfunc(printer_list, stpi_printer_sortfunc); */
106 return 0;
107 }
108
109 int
110 stp_printer_model_countcxx . . $ stp_printer_model_count(b126dc7c1de90089).(void)
111 {
112 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
113 {
114 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("No printer drivers found: "
115 "are STP_DATA_PATH and STP_MODULE_PATH correct?\n");
116 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
117 }
118 return stp_list_get_lengthcxx . . $ stp_list_get_length(c31cc8fb9e1f67aa).(printer_listcxx . . $ printer_list.);
119 }
120
121 const stp_printer_tcxx . . $ stp_printer_t# *
122 stp_get_printer_by_indexcxx . . $ stp_get_printer_by_index(2036101347f379c).(int idx)
123 {
124 stp_list_item_tcxx . . $ stp_list_item_t# *printer;
125 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
126 {
127 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("No printer drivers found: "
128 "are STP_DATA_PATH and STP_MODULE_PATH correct?\n");
129 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
130 }
131 printer = stp_list_get_item_by_indexcxx . . $ stp_list_get_item_by_index(868af1dce2882582).(printer_listcxx . . $ printer_list., idx);
132 if (printer == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
133 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
134 return (const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer);
135 }
136
137 static void
138 stpi_printer_freefunccxx . . $ stpi_printer_freefunc(5d22bdacc48458e8).(void *item)
139 {
140 stp_printer_tcxx . . $ stp_printer_t# *printer = (stp_printer_tcxx . . $ stp_printer_t# *) item;
141 if (printer->commentcxx . . $ stp_printer#comment.)
142 {
143 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(printer->commentcxx . . $ stp_printer#comment.);
144 printer->commentcxx . . $ stp_printer#comment. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
145 }
146 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(printer->long_namecxx . . $ stp_printer#long_name.);
147 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(printer->familycxx . . $ stp_printer#family.);
148 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(printer);
149 }
150
151 /* ARGSUSED */
152 static void
153 stpi_printvars_freefunccxx . . $ stpi_printvars_freefunc(5d22bdacc48458e8).(void *item)
154 {
155 (void)item;
156 }
157
158 static const char *
159 stpi_printvars_namefunccxx . . $ stpi_printvars_namefunc(6271d96ae060557f).(const void *item)
160 {
161 const stp_printvars_tcxx . . $ stp_printvars_t# *printvars = (const stp_printvars_tcxx . . $ stp_printvars_t# *) item;
162 return printvars->namecxx . . $ stp_printvars#name.;
163 }
164
165 const char *
166 stp_printer_get_drivercxx . . $ stp_printer_get_driver(b5d6ef9de7e317aa).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
167 {
168 return printer->drivercxx . . $ stp_printer#driver.;
169 }
170
171 static const char *
172 stpi_printer_namefunccxx . . $ stpi_printer_namefunc(6271d96ae060557f).(const void *item)
173 {
174 const stp_printer_tcxx . . $ stp_printer_t# *printer = (const stp_printer_tcxx . . $ stp_printer_t# *) item;
175 return printer->drivercxx . . $ stp_printer#driver.;
176 }
177
178 const char *
179 stp_printer_get_long_namecxx . . $ stp_printer_get_long_name(b5d6ef9de7e317aa).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
180 {
181 return printer->long_namecxx . . $ stp_printer#long_name.;
182 }
183
184 static const char *
185 stpi_printer_long_namefunccxx . . $ stpi_printer_long_namefunc(6271d96ae060557f).(const void *item)
186 {
187 const stp_printer_tcxx . . $ stp_printer_t# *printer = (const stp_printer_tcxx . . $ stp_printer_t# *) item;
188 return printer->long_namecxx . . $ stp_printer#long_name.;
189 }
190
191 const char *
192 stp_printer_get_device_idcxx . . $ stp_printer_get_device_id(b5d6ef9de7e317aa).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
193 {
194 return printer->device_idcxx . . $ stp_printer#device_id.;
195 }
196
197 const char *
198 stp_printer_get_familycxx . . $ stp_printer_get_family(b5d6ef9de7e317aa).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
199 {
200 return printer->familycxx . . $ stp_printer#family.;
201 }
202
203 const char *
204 stp_printer_get_manufacturercxx . . $ stp_printer_get_manufacturer(b5d6ef9de7e317aa).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
205 {
206 return printer->manufacturercxx . . $ stp_printer#manufacturer.;
207 }
208
209 const char *
210 stp_printer_get_commentcxx . . $ stp_printer_get_comment(b5d6ef9de7e317aa).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
211 {
212 return printer->commentcxx . . $ stp_printer#comment.;
213 }
214
215 int
216 stp_printer_get_modelcxx . . $ stp_printer_get_model(7a5f2d0743711567).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
217 {
218 return printer->modelcxx . . $ stp_printer#model.;
219 }
220
221 static inline const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *
222 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
223 {
224 return printer->printfuncscxx . . $ stp_printer#printfuncs.;
225 }
226
227
228 const stp_printer_tcxx . . $ stp_printer_t# *
229 stp_get_printer_by_long_namecxx . . $ stp_get_printer_by_long_name(5594043bc706389b).(const char *long_name)
230 {
231 stp_list_item_tcxx . . $ stp_list_item_t# *printer_item;
232 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
233 {
234 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("No printer drivers found: "
235 "are STP_DATA_PATH and STP_MODULE_PATH correct?\n");
236 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
237 }
238 printer_item = stp_list_get_item_by_long_namecxx . . $ stp_list_get_item_by_long_name(27765cfe86595311).(printer_listcxx . . $ printer_list., long_name);
239 if (!printer_item)
240 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
241 return (const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
242 }
243
244 const stp_printer_tcxx . . $ stp_printer_t# *
245 stp_get_printer_by_drivercxx . . $ stp_get_printer_by_driver(5594043bc706389b).(const char *driver)
246 {
247 stp_list_item_tcxx . . $ stp_list_item_t# *printer_item;
248 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
249 {
250 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("No printer drivers found: "
251 "are STP_DATA_PATH and STP_MODULE_PATH correct?\n");
252 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
253 }
254 printer_item = stp_list_get_item_by_namecxx . . $ stp_list_get_item_by_name(27765cfe86595311).(printer_listcxx . . $ printer_list., driver);
255 if (!printer_item)
256 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
257 return (const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
258 }
259
260 const stp_printer_tcxx . . $ stp_printer_t# *
261 stp_get_printer_by_device_idcxx . . $ stp_get_printer_by_device_id(5594043bc706389b).(const char *device_id)
262 {
263 stp_list_item_tcxx . . $ stp_list_item_t# *printer_item;
264 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
265 {
266 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("No printer drivers found: "
267 "are STP_DATA_PATH and STP_MODULE_PATH correct?\n");
268 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
269 }
270 if (! device_id || strcmpcxx . . $ strcmp(5ae29d726ae57f88).(device_id, "") == 0)
271 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
272
273 printer_item = stp_list_get_startcxx . . $ stp_list_get_start(44f6202a74729935).(printer_listcxx . . $ printer_list.);
274 while (printer_item)
275 {
276 if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(((const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item))->device_idcxx . . $ stp_printer#device_id.,
277 device_id) == 0)
278 return ((const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item));
279 printer_item = stp_list_item_nextcxx . . $ stp_list_item_next(83833ec172b48f23).(printer_item);
280 }
281 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
282 }
283
284 int
285 stp_get_printer_index_by_drivercxx . . $ stp_get_printer_index_by_driver(5c4306d8553b3696).(const char *driver)
286 {
287 /* There should be no need to ever know the index! */
288 int idx = 0;
289 for (idx = 0; idx < stp_printer_model_countcxx . . $ stp_printer_model_count(b126dc7c1de90089).(); idx++)
290 {
291 const stp_printer_tcxx . . $ stp_printer_t# *printer = stp_get_printer_by_indexcxx . . $ stp_get_printer_by_index(2036101347f379c).(idx);
292 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(stp_printer_get_drivercxx . . $ stp_printer_get_driver(b5d6ef9de7e317aa).(printer), driver))
293 return idx;
294 }
295 return -1;
296 }
297
298 const stp_printer_tcxx . . $ stp_printer_t# *
299 stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(const stp_vars_tcxx . . $ stp_vars_t# *v)
300 {
301 return stp_get_printer_by_drivercxx . . $ stp_get_printer_by_driver(5594043bc706389b).(stp_get_drivercxx . . $ stp_get_driver(4be828c28602b542).(v));
302 }
303
304 int
305 stp_get_model_idcxx . . $ stp_get_model_id(b1be75487ade2f93).(const stp_vars_tcxx . . $ stp_vars_t# *v)
306 {
307 const stp_printer_tcxx . . $ stp_printer_t# *printer = stp_get_printer_by_drivercxx . . $ stp_get_printer_by_driver(5594043bc706389b).(stp_get_drivercxx . . $ stp_get_driver(4be828c28602b542).(v));
308 return printer->modelcxx . . $ stp_printer#model.;
309 }
310
311 stp_parameter_list_tcxx . . $ stp_parameter_list_t#
312 stp_printer_list_parameterscxx . . $ stp_printer_list_parameters(817585d40f809196).(const stp_vars_tcxx . . $ stp_vars_t# *v)
313 {
314 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
315 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
316 return (printfuncs->list_parameterscxx . . $ $anonymous_type_aea12ced6c6256e6_0#list_parameters.)(v);
317 }
318
319 void
320 stp_printer_describe_parametercxx . . $ stp_printer_describe_parameter(dfd5b9531b51a6d2).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *name,
321 stp_parameter_tcxx . . $ stp_parameter_t# *description)
322 {
323 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
324 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
325 (printfuncs->parameterscxx . . $ $anonymous_type_aea12ced6c6256e6_0#parameters.)(v, name, description);
326 }
327
328 static void
329 set_printer_defaultscxx . . $ set_printer_defaults(9e1f5dddaee1574e).(stp_vars_tcxx . . $ stp_vars_t# *v, int core_only, int soft)
330 {
331 stp_parameter_list_tcxx . . $ stp_parameter_list_t# *params;
332 int count;
333 int i;
334 stp_parameter_tcxx . . $ stp_parameter_t# desc;
335 params = stp_get_parameter_listcxx . . $ stp_get_parameter_list(817585d40f809196).(v);
336 count = stp_parameter_list_countcxx . . $ stp_parameter_list_count(2e8e543e1193434e).(params);
337 for (i = 0; i < count; i++)
338 {
339 const stp_parameter_tcxx . . $ stp_parameter_t# *p = stp_parameter_list_paramcxx . . $ stp_parameter_list_param(f24b23997c12c6a6).(params, i);
340 if (p->is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. &&
341 (!core_only || p->p_classcxx . . $ $anonymous_type_c987533f3b833c82_8#p_class. == STP_PARAMETER_CLASS_COREcxx . . $ STP_PARAMETER_CLASS_CORE.))
342 {
343 stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., &desc);
344 switch (p->p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type.)
345 {
346 case STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST.:
347 if (!soft ||
348 !stp_check_string_parametercxx . . $ stp_check_string_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
349 {
350 stp_set_string_parametercxx . . $ stp_set_string_parameter(7405204ff890c7b8).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str.);
351 stp_set_string_parameter_activecxx . . $ stp_set_string_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
352 }
353 break;
354 case STP_PARAMETER_TYPE_DOUBLEcxx . . $ STP_PARAMETER_TYPE_DOUBLE.:
355 if (!soft ||
356 !stp_check_float_parametercxx . . $ stp_check_float_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
357 {
358 stp_set_float_parametercxx . . $ stp_set_float_parameter(bd523a1c1fbe60d3).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#dbl.);
359 stp_set_float_parameter_activecxx . . $ stp_set_float_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
360 }
361 break;
362 case STP_PARAMETER_TYPE_INTcxx . . $ STP_PARAMETER_TYPE_INT.:
363 if (!soft ||
364 !stp_check_int_parametercxx . . $ stp_check_int_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
365 {
366 stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..integercxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#integer.);
367 stp_set_int_parameter_activecxx . . $ stp_set_int_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
368 }
369 break;
370 case STP_PARAMETER_TYPE_DIMENSIONcxx . . $ STP_PARAMETER_TYPE_DIMENSION.:
371 if (!soft ||
372 !stp_check_dimension_parametercxx . . $ stp_check_dimension_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
373 {
374 stp_set_dimension_parametercxx . . $ stp_set_dimension_parameter(bd523a1c1fbe60d3).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..dimensioncxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#dimension.);
375 stp_set_dimension_parameter_activecxx . . $ stp_set_dimension_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
376 }
377 break;
378 case STP_PARAMETER_TYPE_BOOLEANcxx . . $ STP_PARAMETER_TYPE_BOOLEAN.:
379 if (!soft ||
380 !stp_check_boolean_parametercxx . . $ stp_check_boolean_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
381 {
382 stp_set_boolean_parametercxx . . $ stp_set_boolean_parameter(8ec0183b6ab8ae2d).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..booleancxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#boolean.);
383 stp_set_boolean_parameter_activecxx . . $ stp_set_boolean_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
384 }
385 break;
386 case STP_PARAMETER_TYPE_CURVEcxx . . $ STP_PARAMETER_TYPE_CURVE.:
387 if (!soft ||
388 !stp_check_curve_parametercxx . . $ stp_check_curve_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
389 {
390 stp_set_curve_parametercxx . . $ stp_set_curve_parameter(434798a77903eb98).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..curvecxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#curve.);
391 stp_set_curve_parameter_activecxx . . $ stp_set_curve_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
392 }
393 break;
394 case STP_PARAMETER_TYPE_ARRAYcxx . . $ STP_PARAMETER_TYPE_ARRAY.:
395 if (!soft ||
396 !stp_check_array_parametercxx . . $ stp_check_array_parameter(cff2817d3dcc2695).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.))
397 {
398 stp_set_array_parametercxx . . $ stp_set_array_parameter(1a52bd0fb559d0b7).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..arraycxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#array.);
399 stp_set_array_parameter_activecxx . . $ stp_set_array_parameter_active(9e15dbe4857cde8c).(v, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.);
400 }
401 break;
402 default:
403 break;
404 }
405 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc);
406 }
407 }
408 stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(params);
409 }
410
411 void
412 stp_set_printer_defaultscxx . . $ stp_set_printer_defaults(34fc32b65e92740).(stp_vars_tcxx . . $ stp_vars_t# *v, const stp_printer_tcxx . . $ stp_printer_t# *printer)
413 {
414 stp_set_drivercxx . . $ stp_set_driver(f1526d77388867f8).(v, stp_printer_get_drivercxx . . $ stp_printer_get_driver(b5d6ef9de7e317aa).(printer));
415 set_printer_defaultscxx . . $ set_printer_defaults(9e1f5dddaee1574e).(v, 0, 0);
416 }
417
418 void
419 stp_set_printer_defaults_softcxx . . $ stp_set_printer_defaults_soft(34fc32b65e92740).(stp_vars_tcxx . . $ stp_vars_t# *v, const stp_printer_tcxx . . $ stp_printer_t# *printer)
420 {
421 stp_set_drivercxx . . $ stp_set_driver(f1526d77388867f8).(v, stp_printer_get_drivercxx . . $ stp_printer_get_driver(b5d6ef9de7e317aa).(printer));
422 set_printer_defaultscxx . . $ set_printer_defaults(9e1f5dddaee1574e).(v, 0, 1);
423 }
424
425 void
426 stp_initialize_printer_defaultscxx . . $ stp_initialize_printer_defaults(49f6e7a06ebc5aa8).(void)
427 {
428 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
429 {
430 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
431 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).
432 (STP_DBG_PRINTERScxx . . $ `include/gutenprint/util.h:181:9`!,
433 "stpi_family_register(): initialising printer_list...\n");
434 }
435 }
436
437 const stp_vars_tcxx . . $ stp_vars_t# *
438 stp_printer_get_defaultscxx . . $ stp_printer_get_defaults(961f21647a798a4c).(const stp_printer_tcxx . . $ stp_printer_t# *printer)
439 {
440 if (! printer->vars_initializedcxx . . $ stp_printer#vars_initialized.)
441 {
442 stp_printer_tcxx . . $ stp_printer_t# *nc_printer = (stp_printer_tcxx . . $ stp_printer_t# *) stpi_cast_safecxx . . $ stpi_cast_safe(3343d82129b43479).(printer);
443 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).(STP_DBG_PRINTERScxx . . $ `include/gutenprint/util.h:181:9`!, " ==>init %s\n", printer->drivercxx . . $ stp_printer#driver.);
444 set_printer_defaultscxx . . $ set_printer_defaults(9e1f5dddaee1574e). (nc_printer->printvarscxx . . $ stp_printer#printvars., 1, 0);
445 nc_printer->vars_initializedcxx . . $ stp_printer#vars_initialized. = 1;
446 }
447 return printer->printvarscxx . . $ stp_printer#printvars.;
448 }
449
450 void
451 stp_get_media_sizecxx . . $ stp_get_media_size(2eafa46ec96dc268).(const stp_vars_tcxx . . $ stp_vars_t# *v, stp_dimension_tcxx . . $ stp_dimension_t# *width, stp_dimension_tcxx . . $ stp_dimension_t# *height)
452 {
453 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
454 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
455 (printfuncs->media_sizecxx . . $ $anonymous_type_aea12ced6c6256e6_0#media_size.)(v, width, height);
456 }
457
458 void
459 stp_get_imageable_areacxx . . $ stp_get_imageable_area(25e50967534aa153).(const stp_vars_tcxx . . $ stp_vars_t# *v,
460 stp_dimension_tcxx . . $ stp_dimension_t# *left, stp_dimension_tcxx . . $ stp_dimension_t# *right,
461 stp_dimension_tcxx . . $ stp_dimension_t# *bottom, stp_dimension_tcxx . . $ stp_dimension_t# *top)
462 {
463 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
464 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
465 (printfuncs->imageable_areacxx . . $ $anonymous_type_aea12ced6c6256e6_0#imageable_area.)(v, left, right, bottom, top);
466 }
467
468 void
469 stp_get_maximum_imageable_areacxx . . $ stp_get_maximum_imageable_area(25e50967534aa153).(const stp_vars_tcxx . . $ stp_vars_t# *v,
470 stp_dimension_tcxx . . $ stp_dimension_t# *left, stp_dimension_tcxx . . $ stp_dimension_t# *right,
471 stp_dimension_tcxx . . $ stp_dimension_t# *bottom, stp_dimension_tcxx . . $ stp_dimension_t# *top)
472 {
473 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
474 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
475 (printfuncs->maximum_imageable_areacxx . . $ $anonymous_type_aea12ced6c6256e6_0#maximum_imageable_area.)(v, left, right, bottom, top);
476 }
477
478 void
479 stp_get_size_limitcxx . . $ stp_get_size_limit(25e50967534aa153).(const stp_vars_tcxx . . $ stp_vars_t# *v,
480 stp_dimension_tcxx . . $ stp_dimension_t# *max_width, stp_dimension_tcxx . . $ stp_dimension_t# *max_height,
481 stp_dimension_tcxx . . $ stp_dimension_t# *min_width, stp_dimension_tcxx . . $ stp_dimension_t# *min_height)
482 {
483 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
484 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
485 (printfuncs->limitcxx . . $ $anonymous_type_aea12ced6c6256e6_0#limit.)(v, max_width, max_height, min_width,min_height);
486 }
487
488 void
489 stp_describe_resolutioncxx . . $ stp_describe_resolution(5883f070c6139f40).(const stp_vars_tcxx . . $ stp_vars_t# *v, stp_resolution_tcxx . . $ stp_resolution_t# *x, stp_resolution_tcxx . . $ stp_resolution_t# *y)
490 {
491 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
492 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
493 (printfuncs->describe_resolutioncxx . . $ $anonymous_type_aea12ced6c6256e6_0#describe_resolution.)(v, x, y);
494 }
495
496 const char *
497 stp_describe_outputcxx . . $ stp_describe_output(4be828c28602b542).(const stp_vars_tcxx . . $ stp_vars_t# *v)
498 {
499 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
500 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
501 return (printfuncs->describe_outputcxx . . $ $anonymous_type_aea12ced6c6256e6_0#describe_output.)(v);
502 }
503
504 int
505 stp_verifycxx . . $ stp_verify(60b55b6a36641e80).(stp_vars_tcxx . . $ stp_vars_t# *v)
506 {
507 if (stp_get_verifiedcxx . . $ stp_get_verified(b1be75487ade2f93).(v))
508 return 1;
509 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
510 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
511 stp_vars_tcxx . . $ stp_vars_t# *nv = stp_vars_create_copycxx . . $ stp_vars_create_copy(d6c73ebbfa1de3f9).(v);
512 int status;
513 stp_prune_inactive_optionscxx . . $ stp_prune_inactive_options(1a97b8462f9f913c).(nv);
514 status = (printfuncs->verifycxx . . $ $anonymous_type_aea12ced6c6256e6_0#verify.)(nv);
515 stp_set_verifiedcxx . . $ stp_set_verified(c8b26ae77f1a10bd).(v, stp_get_verifiedcxx . . $ stp_get_verified(b1be75487ade2f93).(nv));
516 stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(nv);
517 return status;
518 }
519
520 int
521 stp_printcxx . . $ stp_print(be5d09c432b01f95).(const stp_vars_tcxx . . $ stp_vars_t# *v, stp_image_tcxx . . $ stp_image_t# *image)
522 {
523 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
524 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
525 return (printfuncs->printcxx . . $ $anonymous_type_aea12ced6c6256e6_0#print.)(v, image);
526 }
527
528 int
529 stp_start_jobcxx . . $ stp_start_job(be5d09c432b01f95).(const stp_vars_tcxx . . $ stp_vars_t# *v, stp_image_tcxx . . $ stp_image_t# *image)
530 {
531 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
532 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
533 if (!stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, "JobMode") ||
534 strcmpcxx . . $ strcmp(5ae29d726ae57f88).(stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, "JobMode"), "Page") == 0)
535 return 1;
536 if (printfuncs->start_jobcxx . . $ $anonymous_type_aea12ced6c6256e6_0#start_job.)
537 return (printfuncs->start_jobcxx . . $ $anonymous_type_aea12ced6c6256e6_0#start_job.)(v, image);
538 else
539 return 1;
540 }
541
542 int
543 stp_end_jobcxx . . $ stp_end_job(be5d09c432b01f95).(const stp_vars_tcxx . . $ stp_vars_t# *v, stp_image_tcxx . . $ stp_image_t# *image)
544 {
545 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
546 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
547 if (!stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, "JobMode") ||
548 strcmpcxx . . $ strcmp(5ae29d726ae57f88).(stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, "JobMode"), "Page") == 0)
549 return 1;
550 if (printfuncs->end_jobcxx . . $ $anonymous_type_aea12ced6c6256e6_0#end_job.)
551 return (printfuncs->end_jobcxx . . $ $anonymous_type_aea12ced6c6256e6_0#end_job.)(v, image);
552 else
553 return 1;
554 }
555
556 stp_string_list_tcxx . . $ stp_string_list_t# *
557 stp_get_external_optionscxx . . $ stp_get_external_options(bdc37f1d9ffbc204).(const stp_vars_tcxx . . $ stp_vars_t# *v)
558 {
559 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
560 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
561 if (printfuncs->get_external_optionscxx . . $ $anonymous_type_aea12ced6c6256e6_0#get_external_options.)
562 return (printfuncs->get_external_optionscxx . . $ $anonymous_type_aea12ced6c6256e6_0#get_external_options.)(v);
563 else
564 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
565 }
566
567 const stp_papersize_tcxx . . $ stp_papersize_t# *
568 stpi_printer_describe_papersizecxx . . $ stpi_printer_describe_papersize(977e5bf217e59ec).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *name)
569 {
570 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs =
571 stpi_get_printfuncscxx . . $ stpi_get_printfuncs(aaa09a966994d6a7).(stp_get_printercxx . . $ stp_get_printer(801c723c907e6477).(v));
572 return (printfuncs->describe_papersizecxx . . $ $anonymous_type_aea12ced6c6256e6_0#describe_papersize.)(v, name);
573 }
574
575 static int
576 verify_string_paramcxx . . $ verify_string_param(47633d676b121790).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *parameter,
577 stp_parameter_tcxx . . $ stp_parameter_t# *desc, int quiet)
578 {
579 stp_parameter_verify_tcxx . . $ stp_parameter_verify_t# answer = PARAMETER_OKcxx . . $ PARAMETER_OK.;
580 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " Verifying string %s\n", parameter);
581 if (desc->is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. ||
582 stp_check_string_parametercxx . . $ stp_check_string_parameter(cff2817d3dcc2695).(v, parameter, STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.))
583 {
584 const char *checkval = stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, parameter);
585 stp_string_list_tcxx . . $ stp_string_list_t# *vptr = desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str.;
586 size_t count = 0;
587 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " value %s\n",
588 checkval ? checkval : "(null)");
589 if (vptr)
590 count = stp_string_list_countcxx . . $ stp_string_list_count(53b7214102d1daf6).(vptr);
591 answer = PARAMETER_BADcxx . . $ PARAMETER_BAD.;
592 if (checkval == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
593 {
594 if (count == 0)
595 answer = PARAMETER_OKcxx . . $ PARAMETER_OK.;
596 else
597 {
598 if (!quiet)
599 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Value must be set for %s\n"), parameter);
600 answer = PARAMETER_BADcxx . . $ PARAMETER_BAD.;
601 }
602 }
603 else if (count > 0)
604 {
605 if (stp_string_list_is_presentcxx . . $ stp_string_list_is_present(bf726c32497cc2b).(vptr, checkval))
606 answer = PARAMETER_OKcxx . . $ PARAMETER_OK.;
607 if (!answer && !quiet)
608 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("`%s' is not a valid %s\n"), checkval, parameter);
609 }
610 else if (strlencxx . . $ strlen(751346f8406fd082).(checkval) == 0)
611 answer = PARAMETER_OKcxx . . $ PARAMETER_OK.;
612 else if (!quiet)
613 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("`%s' is not a valid %s\n"), checkval, parameter);
614 }
615 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(desc);
616 return answer;
617 }
618
619 static int
620 verify_double_paramcxx . . $ verify_double_param(47633d676b121790).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *parameter,
621 stp_parameter_tcxx . . $ stp_parameter_t# *desc, int quiet)
622 {
623 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " Verifying double %s\n", parameter);
624 if (desc->is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. ||
625 stp_check_float_parametercxx . . $ stp_check_float_parameter(cff2817d3dcc2695).(v, parameter, STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.))
626 {
627 double checkval = stp_get_float_parametercxx . . $ stp_get_float_parameter(ac3b1c02c916f219).(v, parameter);
628 if (checkval < desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..lowercxx . . $ $anonymous_type_c987533f3b833c82_5#lower. ||
629 checkval > desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.)
630 {
631 if (!quiet)
632 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("%s must be between %f and %f (is %f)\n"),
633 parameter, desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..lowercxx . . $ $anonymous_type_c987533f3b833c82_5#lower.,
634 desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper., checkval);
635 return PARAMETER_BADcxx . . $ PARAMETER_BAD.;
636 }
637 }
638 return PARAMETER_OKcxx . . $ PARAMETER_OK.;
639 }
640
641 static int
642 verify_int_paramcxx . . $ verify_int_param(47633d676b121790).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *parameter,
643 stp_parameter_tcxx . . $ stp_parameter_t# *desc, int quiet)
644 {
645 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " Verifying int %s\n", parameter);
646 if (desc->is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. ||
647 stp_check_int_parametercxx . . $ stp_check_int_parameter(cff2817d3dcc2695).(v, parameter, STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.))
648 {
649 int checkval = stp_get_int_parametercxx . . $ stp_get_int_parameter(b1e629819c29df09).(v, parameter);
650 if (checkval < desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..integercxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#integer..lowercxx . . $ $anonymous_type_c987533f3b833c82_6#lower. ||
651 checkval > desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..integercxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#integer..uppercxx . . $ $anonymous_type_c987533f3b833c82_6#upper.)
652 {
653 if (!quiet)
654 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("%s must be between %d and %d (is %d)\n"),
655 parameter, desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..integercxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#integer..lowercxx . . $ $anonymous_type_c987533f3b833c82_6#lower.,
656 desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..integercxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#integer..uppercxx . . $ $anonymous_type_c987533f3b833c82_6#upper., checkval);
657 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(desc);
658 return PARAMETER_BADcxx . . $ PARAMETER_BAD.;
659 }
660 }
661 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(desc);
662 return PARAMETER_OKcxx . . $ PARAMETER_OK.;
663 }
664
665 static int
666 verify_dimension_paramcxx . . $ verify_dimension_param(47633d676b121790).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *parameter,
667 stp_parameter_tcxx . . $ stp_parameter_t# *desc, int quiet)
668 {
669 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " Verifying dimension %s\n", parameter);
670 if (desc->is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. ||
671 stp_check_dimension_parametercxx . . $ stp_check_dimension_parameter(cff2817d3dcc2695).(v, parameter, STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.))
672 {
673 stp_dimension_tcxx . . $ stp_dimension_t# checkval = stp_get_dimension_parametercxx . . $ stp_get_dimension_parameter(ac3b1c02c916f219).(v, parameter);
674 if (checkval < desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dimensioncxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dimension..lowercxx . . $ $anonymous_type_c987533f3b833c82_7#lower. ||
675 checkval > desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dimensioncxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dimension..uppercxx . . $ $anonymous_type_c987533f3b833c82_7#upper.)
676 {
677 if (!quiet)
678 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("%s must be between %f and %f (is %f)\n"),
679 parameter, desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dimensioncxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dimension..lowercxx . . $ $anonymous_type_c987533f3b833c82_7#lower.,
680 desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dimensioncxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dimension..uppercxx . . $ $anonymous_type_c987533f3b833c82_7#upper., checkval);
681 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(desc);
682 return PARAMETER_BADcxx . . $ PARAMETER_BAD.;
683 }
684 }
685 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(desc);
686 return PARAMETER_OKcxx . . $ PARAMETER_OK.;
687 }
688
689 static int
690 verify_curve_paramcxx . . $ verify_curve_param(47633d676b121790).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *parameter,
691 stp_parameter_tcxx . . $ stp_parameter_t# *desc, int quiet)
692 {
693 stp_parameter_verify_tcxx . . $ stp_parameter_verify_t# answer = 1;
694 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " Verifying curve %s\n", parameter);
695 if (desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..curvecxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#curve. &&
696 (desc->is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. ||
697 stp_check_curve_parametercxx . . $ stp_check_curve_parameter(cff2817d3dcc2695).(v, parameter, STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.)))
698 {
699 const stp_curve_tcxx . . $ stp_curve_t# *checkval = stp_get_curve_parametercxx . . $ stp_get_curve_parameter(702e9bffd3dd1409).(v, parameter);
700 if (checkval)
701 {
702 double u0, l0;
703 double u1, l1;
704 stp_curve_get_boundscxx . . $ stp_curve_get_bounds(de70be28309e8730).(checkval, &l0, &u0);
705 stp_curve_get_boundscxx . . $ stp_curve_get_bounds(de70be28309e8730).(desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..curvecxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#curve., &l1, &u1);
706 if (u0 > u1 || l0 < l1)
707 {
708 if (!quiet)
709 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("%s bounds must be between %f and %f\n"),
710 parameter, l1, u1);
711 answer = PARAMETER_BADcxx . . $ PARAMETER_BAD.;
712 }
713 if (stp_curve_get_wrapcxx . . $ stp_curve_get_wrap(4b83c4900be391a7).(checkval) !=
714 stp_curve_get_wrapcxx . . $ stp_curve_get_wrap(4b83c4900be391a7).(desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..curvecxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#curve.))
715 {
716 if (!quiet)
717 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("%s wrap mode must be %s\n"),
718 parameter,
719 (stp_curve_get_wrapcxx . . $ stp_curve_get_wrap(4b83c4900be391a7).(desc->boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..curvecxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#curve.) ==
720 STP_CURVE_WRAP_NONEcxx . . $ STP_CURVE_WRAP_NONE.) ?
721 _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("no wrap") : _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("wrap around"));
722 answer = PARAMETER_BADcxx . . $ PARAMETER_BAD.;
723 }
724 }
725 }
726 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(desc);
727 return answer;
728 }
729
730 stp_parameter_verify_tcxx . . $ stp_parameter_verify_t#
731 stp_verify_parametercxx . . $ stp_verify_parameter(7de511013079b54c).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *parameter,
732 int quiet)
733 {
734 stp_parameter_tcxx . . $ stp_parameter_t# desc;
735 quiet = 0;
736 stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(v, parameter, &desc);
737 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, " Verifying %s %d %d\n", parameter,
738 desc.is_activecxx . . $ $anonymous_type_c987533f3b833c82_8#is_active., desc.read_onlycxx . . $ $anonymous_type_c987533f3b833c82_8#read_only.);
739 if (!desc.is_activecxx . . $ $anonymous_type_c987533f3b833c82_8#is_active. || desc.read_onlycxx . . $ $anonymous_type_c987533f3b833c82_8#read_only.)
740 {
741 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc);
742 return PARAMETER_INACTIVEcxx . . $ PARAMETER_INACTIVE.;
743 }
744 switch (desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type.)
745 {
746 case STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST.:
747 return verify_string_paramcxx . . $ verify_string_param(47633d676b121790).(v, parameter, &desc, quiet);
748 case STP_PARAMETER_TYPE_DOUBLEcxx . . $ STP_PARAMETER_TYPE_DOUBLE.:
749 return verify_double_paramcxx . . $ verify_double_param(47633d676b121790).(v, parameter, &desc, quiet);
750 case STP_PARAMETER_TYPE_INTcxx . . $ STP_PARAMETER_TYPE_INT.:
751 return verify_int_paramcxx . . $ verify_int_param(47633d676b121790).(v, parameter, &desc, quiet);
752 case STP_PARAMETER_TYPE_DIMENSIONcxx . . $ STP_PARAMETER_TYPE_DIMENSION.:
753 return verify_dimension_paramcxx . . $ verify_dimension_param(47633d676b121790).(v, parameter, &desc, quiet);
754 case STP_PARAMETER_TYPE_CURVEcxx . . $ STP_PARAMETER_TYPE_CURVE.:
755 return verify_curve_paramcxx . . $ verify_curve_param(47633d676b121790).(v, parameter, &desc, quiet);
756 case STP_PARAMETER_TYPE_RAWcxx . . $ STP_PARAMETER_TYPE_RAW.:
757 case STP_PARAMETER_TYPE_FILEcxx . . $ STP_PARAMETER_TYPE_FILE.:
758 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc);
759 return PARAMETER_OKcxx . . $ PARAMETER_OK.; /* No way to verify this here */
760 case STP_PARAMETER_TYPE_BOOLEANcxx . . $ STP_PARAMETER_TYPE_BOOLEAN.:
761 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc);
762 return PARAMETER_OKcxx . . $ PARAMETER_OK.; /* Booleans always OK */
763 default:
764 if (!quiet)
765 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Unknown type parameter %s (%d)\n"),
766 parameter, desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type.);
767 stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc);
768 return 0;
769 }
770 }
771
772 #define CHECK_INT_RANGEcxx . . $ `src/main/printers.c:772:9`!(v, component, min, max) \
773 do \
774 { \
775 if (stp_get_##component((v)) < (min) || stp_get_##component((v)) > (max)) \
776 { \
777 answer = 0; \
778 stp_eprintf(v, _("%s out of range (value %d, min %d, max %d)\n"), \
779 #component, stp_get_##component(v), min, max); \
780 } \
781 } while (0)
782
783 #define CHECK_INT_RANGE_INTERNALcxx . . $ `src/main/printers.c:783:9`!(v, component, min, max) \
784 do \
785 { \
786 if (stpi_get_##component((v)) < (min) || stpi_get_##component((v)) > (max)) \
787 { \
788 answer = 0; \
789 stp_eprintf(v, _("%s out of range (value %d, min %d, max %d)\n"), \
790 #component, stpi_get_##component(v), min, max); \
791 } \
792 } while (0)
793
794 typedef structcxx . . $ $anonymous_type_391f4a771cad5d9b_0#
795 {
796 char *datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data.;
797 size_t bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes.;
798 } errbuf_tcxx . . $ errbuf_t#;
799
800 static void
801 fill_buffer_writefunccxx . . $ fill_buffer_writefunc(8e4e5e8cac233c6a).(void *priv, const char *buffer, size_t bytes)
802 {
803 errbuf_tcxx . . $ errbuf_t# *errbuf = (errbuf_tcxx . . $ errbuf_t# *) priv;
804 if (errbuf->bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes. == 0)
805 errbuf->datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data. = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(bytes + 1);
806 else
807 errbuf->datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data. = stp_realloccxx . . $ stp_realloc(417ab160f6baadc6).(errbuf->datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data., errbuf->bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes. + bytes + 1);
808 memcpycxx . . $ memcpy(cc817cb175f282d).(errbuf->datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data. + errbuf->bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes., buffer, bytes);
809 errbuf->bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes. += bytes;
810 errbuf->datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data.[errbuf->bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes.] = '\0';
811 }
812
813 int
814 stp_verify_printer_paramscxx . . $ stp_verify_printer_params(60b55b6a36641e80).(stp_vars_tcxx . . $ stp_vars_t# *v)
815 {
816 errbuf_tcxx . . $ errbuf_t# errbuf;
817 stp_outfunc_tcxx . . $ stp_outfunc_t# ofunc = stp_get_errfunccxx . . $ stp_get_errfunc(62d2c926a148e2bf).(v);
818 void *odata = stp_get_errdatacxx . . $ stp_get_errdata(817585d40f809196).(v);
819 stp_parameter_list_tcxx . . $ stp_parameter_list_t# params;
820 int nparams;
821 int i;
822 int answer = 1;
823 stp_dimension_tcxx . . $ stp_dimension_t# left, top, bottom, right;
824 const char *pagesize = stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, "PageSize");
825
826 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, "** Entering stp_verify_printer_params(0x%p)\n",
827 (void *) v);
828
829 stp_set_errfunccxx . . $ stp_set_errfunc(d4e9cdcd927ed799).((stp_vars_tcxx . . $ stp_vars_t# *) v, fill_buffer_writefunccxx . . $ fill_buffer_writefunc(8e4e5e8cac233c6a).);
830 stp_set_errdatacxx . . $ stp_set_errdata(da98ca80e19bc349).((stp_vars_tcxx . . $ stp_vars_t# *) v, &errbuf);
831
832 errbuf.datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
833 errbuf.bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes. = 0;
834
835 if (pagesize && strlencxx . . $ strlen(751346f8406fd082).(pagesize) > 0)
836 {
837 if (stp_verify_parametercxx . . $ stp_verify_parameter(7de511013079b54c).(v, "PageSize", 0) == 0)
838 answer = 0;
839 }
840 else
841 {
842 stp_dimension_tcxx . . $ stp_dimension_t# width, height, min_height, min_width;
843 stp_get_size_limitcxx . . $ stp_get_size_limit(25e50967534aa153).(v, &width, &height, &min_width, &min_height);
844 if (stp_get_page_heightcxx . . $ stp_get_page_height(7f9a8d44e8193bba).(v) <= min_height ||
845 stp_get_page_heightcxx . . $ stp_get_page_height(7f9a8d44e8193bba).(v) > height ||
846 stp_get_page_widthcxx . . $ stp_get_page_width(7f9a8d44e8193bba).(v) <= min_width || stp_get_page_widthcxx . . $ stp_get_page_width(7f9a8d44e8193bba).(v) > width)
847 {
848 answer = 0;
849 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Page size is not valid\n"));
850 }
851 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_PAPERcxx . . $ `include/gutenprint/util.h:180:9`!, v,
852 "page size max %f %f min %f %f actual %f %f\n",
853 width, height, min_width, min_height,
854 stp_get_page_widthcxx . . $ stp_get_page_width(7f9a8d44e8193bba).(v), stp_get_page_heightcxx . . $ stp_get_page_height(7f9a8d44e8193bba).(v));
855 }
856
857 stp_get_imageable_areacxx . . $ stp_get_imageable_area(25e50967534aa153).(v, &left, &right, &bottom, &top);
858
859 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_PAPERcxx . . $ `include/gutenprint/util.h:180:9`!, v,
860 "page left %f top %f right %f bottom %f\n",
861 left, top, right, bottom);
862 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_PAPERcxx . . $ `include/gutenprint/util.h:180:9`!, v,
863 "requested left %f top %f width %f height %f\n",
864 stp_get_leftcxx . . $ stp_get_left(7f9a8d44e8193bba).(v), stp_get_topcxx . . $ stp_get_top(7f9a8d44e8193bba).(v),
865 stp_get_widthcxx . . $ stp_get_width(7f9a8d44e8193bba).(v), stp_get_heightcxx . . $ stp_get_height(7f9a8d44e8193bba).(v));
866
867 stp_dimension_tcxx . . $ stp_dimension_t# epsilon = 1e-6;
868
869 if (stp_get_topcxx . . $ stp_get_top(7f9a8d44e8193bba).(v) + epsilon < top)
870 {
871 answer = 0;
872 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Top margin must not be less than %f\n"), top);
873 }
874
875 if (stp_get_leftcxx . . $ stp_get_left(7f9a8d44e8193bba).(v) + epsilon < left)
876 {
877 answer = 0;
878 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Left margin must not be less than %f\n"), left);
879 }
880
881 if (stp_get_heightcxx . . $ stp_get_height(7f9a8d44e8193bba).(v) <= -epsilon)
882 {
883 answer = 0;
884 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Height must be greater than zero\n"));
885 }
886
887 if (stp_get_widthcxx . . $ stp_get_width(7f9a8d44e8193bba).(v) <= -epsilon)
888 {
889 answer = 0;
890 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Width must be greater than zero\n"));
891 }
892
893 if (stp_get_leftcxx . . $ stp_get_left(7f9a8d44e8193bba).(v) + stp_get_widthcxx . . $ stp_get_width(7f9a8d44e8193bba).(v) > right + epsilon)
894 {
895 answer = 0;
896 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Image is too wide for the page: left margin is %f, width %f, right edge is %f\n"),
897 stp_get_leftcxx . . $ stp_get_left(7f9a8d44e8193bba).(v), stp_get_widthcxx . . $ stp_get_width(7f9a8d44e8193bba).(v), right);
898 }
899
900 if (stp_get_topcxx . . $ stp_get_top(7f9a8d44e8193bba).(v) + stp_get_heightcxx . . $ stp_get_height(7f9a8d44e8193bba).(v) > bottom + epsilon)
901 {
902 answer = 0;
903 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, _cxx . . $ `include/gutenprint/gutenprint-intl-internal.h:58:11`!("Image is too long for the page: top margin is %f, height %f, bottom edge is %f\n"),
904 stp_get_topcxx . . $ stp_get_top(7f9a8d44e8193bba).(v), stp_get_heightcxx . . $ stp_get_height(7f9a8d44e8193bba).(v), bottom);
905 }
906
907 params = stp_get_parameter_listcxx . . $ stp_get_parameter_list(817585d40f809196).(v);
908 nparams = stp_parameter_list_countcxx . . $ stp_parameter_list_count(2e8e543e1193434e).(params);
909 for (i = 0; i < nparams; i++)
910 {
911 const stp_parameter_tcxx . . $ stp_parameter_t# *param = stp_parameter_list_paramcxx . . $ stp_parameter_list_param(f24b23997c12c6a6).(params, i);
912 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, "Checking %s %d %d\n", param->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.,
913 param->is_activecxx . . $ $anonymous_type_c987533f3b833c82_8#is_active., param->verify_this_parametercxx . . $ $anonymous_type_c987533f3b833c82_8#verify_this_parameter.);
914
915 if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(param->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., "PageSize") != 0 &&
916 param->is_activecxx . . $ $anonymous_type_c987533f3b833c82_8#is_active. && param->verify_this_parametercxx . . $ $anonymous_type_c987533f3b833c82_8#verify_this_parameter. &&
917 stp_verify_parametercxx . . $ stp_verify_parameter(7de511013079b54c).(v, param->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., 0) == 0)
918 answer = 0;
919 }
920 stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(params);
921 stp_set_errfunccxx . . $ stp_set_errfunc(d4e9cdcd927ed799).((stp_vars_tcxx . . $ stp_vars_t# *) v, ofunc);
922 stp_set_errdatacxx . . $ stp_set_errdata(da98ca80e19bc349).((stp_vars_tcxx . . $ stp_vars_t# *) v, odata);
923 stp_set_verifiedcxx . . $ stp_set_verified(c8b26ae77f1a10bd).((stp_vars_tcxx . . $ stp_vars_t# *) v, answer);
924 if (errbuf.bytescxx . . $ $anonymous_type_391f4a771cad5d9b_0#bytes. > 0)
925 {
926 stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(v, "%s", errbuf.datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data.);
927 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(errbuf.datacxx . . $ $anonymous_type_391f4a771cad5d9b_0#data.);
928 }
929 stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, v, "** Exiting stp_verify_printer_params(0x%p) => %d\n",
930 (void *) v, answer);
931 return answer;
932 }
933
934 static const stp_vars_tcxx . . $ stp_vars_t# *
935 stp_find_paramscxx . . $ stp_find_params(804f7a8dd81ba9b5).(const char *name, const char *family)
936 {
937 if (printvars_listcxx . . $ printvars_list.)
938 {
939 char *stmp =
940 stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(strlencxx . . $ strlen(751346f8406fd082).(family) + strlencxx . . $ strlen(751346f8406fd082).("::") + strlencxx . . $ strlen(751346f8406fd082).(name) + 1);
941 stp_list_item_tcxx . . $ stp_list_item_t# *item;
942 strcpycxx . . $ strcpy(b7b3a83273496486).(stmp, family);
943 strcatcxx . . $ strcat(b7b3a83273496486).(stmp, "::");
944 strcatcxx . . $ strcat(b7b3a83273496486).(stmp, name);
945 item = stp_list_get_item_by_namecxx . . $ stp_list_get_item_by_name(27765cfe86595311).(printvars_listcxx . . $ printvars_list., stmp);
946 if (item)
947 {
948 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(stmp);
949 return ((const stp_printvars_tcxx . . $ stp_printvars_t# *)
950 stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(item))->printvarscxx . . $ stp_printvars#printvars.;
951 }
952 strcpycxx . . $ strcpy(b7b3a83273496486).(stmp, name);
953 item = stp_list_get_item_by_namecxx . . $ stp_list_get_item_by_name(27765cfe86595311).(printvars_listcxx . . $ printvars_list., stmp);
954 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(stmp);
955 if (item)
956 return ((const stp_printvars_tcxx . . $ stp_printvars_t# *)
957 stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(item))->printvarscxx . . $ stp_printvars#printvars.;
958 }
959 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
960 }
961
962 /* Why couldn't strcmp be a valid comparison function... */
963 static int
964 compare_namescxx . . $ compare_names(9148c8c3ff42c9d8).(const void *n1, const void *n2)
965 {
966 return strcmpcxx . . $ strcmp(5ae29d726ae57f88).((const char *) n1, (const char *) n2);
967 }
968
969 void
970 stpi_find_duplicate_printerscxx . . $ stpi_find_duplicate_printers(49f6e7a06ebc5aa8).(void)
971 {
972 size_t nelts = stp_printer_model_countcxx . . $ stp_printer_model_count(b126dc7c1de90089).();
973 if (nelts == 0)
974 return;
975 const char **str_data = stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(const char *) * nelts);
976 stp_list_item_tcxx . . $ stp_list_item_t# *printer_item = stp_list_get_startcxx . . $ stp_list_get_start(44f6202a74729935).(printer_listcxx . . $ printer_list.);
977 size_t i = 0;
978 int found_dups = 0;
979 const stp_printer_tcxx . . $ stp_printer_t# *printer;
980 while (printer_item)
981 {
982 printer = stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
983 STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(i < nelts, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
984 str_data[i] = printer->drivercxx . . $ stp_printer#driver.;
985 printer_item = stp_list_item_nextcxx . . $ stp_list_item_next(83833ec172b48f23).(printer_item);
986 i++;
987 }
988 qsortcxx . . $ qsort(ebb60b13a65e77d7).(str_data, nelts, sizeof(const char *), compare_namescxx . . $ compare_names(9148c8c3ff42c9d8).);
989 for (i = 0; i < nelts - 1; i++)
990 {
991 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str_data[i], str_data[i+1]))
992 {
993 printer_item =
994 stp_list_get_item_by_namecxx . . $ stp_list_get_item_by_name(27765cfe86595311).(printer_listcxx . . $ printer_list., str_data[i]);
995 printer = stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
996 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("Duplicate printer entry '%s' (%s)\n",
997 printer->drivercxx . . $ stp_printer#driver., printer->long_namecxx . . $ stp_printer#long_name.);
998 found_dups++;
999 }
1000 }
1001 printer_item = stp_list_get_startcxx . . $ stp_list_get_start(44f6202a74729935).(printer_listcxx . . $ printer_list.);
1002 i = 0;
1003 while (printer_item)
1004 {
1005 printer = stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
1006 STPI_ASSERTcxx . . $ `src/main/gutenprint-internal.h:58:9`!(i < nelts, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1007 str_data[i] = printer->long_namecxx . . $ stp_printer#long_name.;
1008 printer_item = stp_list_item_nextcxx . . $ stp_list_item_next(83833ec172b48f23).(printer_item);
1009 i++;
1010 }
1011 qsortcxx . . $ qsort(ebb60b13a65e77d7).(str_data, nelts, sizeof(const char *), compare_namescxx . . $ compare_names(9148c8c3ff42c9d8).);
1012 for (i = 0; i < nelts - 1; i++)
1013 {
1014 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str_data[i], str_data[i+1]))
1015 {
1016 printer_item =
1017 stp_list_get_item_by_long_namecxx . . $ stp_list_get_item_by_long_name(27765cfe86595311).(printer_listcxx . . $ printer_list., str_data[i]);
1018 printer = stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
1019 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("Duplicate printer entry '%s' (%s)\n",
1020 printer->drivercxx . . $ stp_printer#driver., printer->long_namecxx . . $ stp_printer#long_name.);
1021 found_dups++;
1022 }
1023 }
1024 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(str_data);
1025 if (found_dups > 0)
1026 {
1027 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("FATAL Duplicate printers in printer list. Aborting!\n");
1028 stp_abortcxx . . $ stp_abort(49f6e7a06ebc5aa8).();
1029 }
1030 }
1031
1032 int
1033 stpi_family_registercxx . . $ stpi_family_register(29ae8ff464c7f7e5).(stp_list_tcxx . . $ stp_list_t# *family)
1034 {
1035 stp_list_item_tcxx . . $ stp_list_item_t# *printer_item;
1036 const stp_printer_tcxx . . $ stp_printer_t# *printer;
1037
1038 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1039 {
1040 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
1041 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).
1042 (STP_DBG_PRINTERScxx . . $ `include/gutenprint/util.h:181:9`!,
1043 "stpi_family_register(): initialising printer_list...\n");
1044 }
1045
1046 if (family)
1047 {
1048 /* Check for duplicates after loading printers */
1049 printer_item = stp_list_get_startcxx . . $ stp_list_get_start(44f6202a74729935).(family);
1050
1051 while(printer_item)
1052 {
1053 printer = (const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
1054 stp_list_item_createcxx . . $ stp_list_item_create(54f08bf465e39eec).(printer_listcxx . . $ printer_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, printer);
1055 printer_item = stp_list_item_nextcxx . . $ stp_list_item_next(83833ec172b48f23).(printer_item);
1056 }
1057 }
1058 return 0;
1059 }
1060
1061 int
1062 stpi_family_unregistercxx . . $ stpi_family_unregister(29ae8ff464c7f7e5).(stp_list_tcxx . . $ stp_list_t# *family)
1063 {
1064 stp_list_item_tcxx . . $ stp_list_item_t# *printer_item;
1065 stp_list_item_tcxx . . $ stp_list_item_t# *old_printer_item;
1066 const stp_printer_tcxx . . $ stp_printer_t# *printer;
1067
1068 if (printer_listcxx . . $ printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1069 {
1070 stpi_init_printer_listcxx . . $ stpi_init_printer_list(b126dc7c1de90089).();
1071 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).
1072 (STP_DBG_PRINTERScxx . . $ `include/gutenprint/util.h:181:9`!,
1073 "stpi_family_unregister(): initialising printer_list...\n");
1074 }
1075
1076 if (family)
1077 {
1078 printer_item = stp_list_get_startcxx . . $ stp_list_get_start(44f6202a74729935).(family);
1079
1080 while(printer_item)
1081 {
1082 printer = (const stp_printer_tcxx . . $ stp_printer_t# *) stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(printer_item);
1083 old_printer_item =
1084 stp_list_get_item_by_namecxx . . $ stp_list_get_item_by_name(27765cfe86595311).(printer_listcxx . . $ printer_list., printer->drivercxx . . $ stp_printer#driver.);
1085
1086 if (old_printer_item)
1087 stp_list_item_destroycxx . . $ stp_list_item_destroy(e8436428ff1ae51).(printer_listcxx . . $ printer_list., old_printer_item);
1088 printer_item = stp_list_item_nextcxx . . $ stp_list_item_next(83833ec172b48f23).(printer_item);
1089 }
1090 }
1091 return 0;
1092 }
1093
1094 static stp_printvars_tcxx . . $ stp_printvars_t# *
1095 stp_printvars_create_from_xmltreecxx . . $ stp_printvars_create_from_xmltree(83bf31e67bf683a).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *printer,
1096 const char *family)
1097 {
1098 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *prop; /* Temporary node pointer */
1099 const char *stmp; /* Temporary string */
1100 char *sbuf;
1101 stp_printvars_tcxx . . $ stp_printvars_t# *outprintvars;
1102 outprintvars = stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(stp_printvars_tcxx . . $ stp_printvars_t#));
1103 if (!outprintvars)
1104 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1105 outprintvars->printvarscxx . . $ stp_printvars#printvars. = stp_vars_createcxx . . $ stp_vars_create(ca9164ca858eeb6f).();
1106 if (outprintvars->printvarscxx . . $ stp_printvars#printvars. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1107 {
1108 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(outprintvars);
1109 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1110 }
1111 stmp = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "name");
1112 if (!stmp)
1113 {
1114 stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(outprintvars->printvarscxx . . $ stp_printvars#printvars.);
1115 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(outprintvars);
1116 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1117 }
1118 sbuf = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(strlencxx . . $ strlen(751346f8406fd082).(family) + strlencxx . . $ strlen(751346f8406fd082).("::") + strlencxx . . $ strlen(751346f8406fd082).(stmp) + 1);
1119 strcpycxx . . $ strcpy(b7b3a83273496486).(sbuf, family);
1120 strcatcxx . . $ strcat(b7b3a83273496486).(sbuf, "::");
1121 strcatcxx . . $ strcat(b7b3a83273496486).(sbuf, stmp);
1122 outprintvars->namecxx . . $ stp_printvars#name. = sbuf;
1123 prop = printer->childcxx . . $ stp_mxml_node_s#child.;
1124 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).(STP_DBG_XMLcxx . . $ `include/gutenprint/util.h:182:9`!, ">>stp_printvars_create_from_xmltree: %p, %s\n",
1125 (void *) (outprintvars->printvarscxx . . $ stp_printvars#printvars.), outprintvars->namecxx . . $ stp_printvars#name.);
1126 stp_vars_fill_from_xmltreecxx . . $ stp_vars_fill_from_xmltree(e89569e122f4e348).(prop, outprintvars->printvarscxx . . $ stp_printvars#printvars.);
1127 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).(STP_DBG_XMLcxx . . $ `include/gutenprint/util.h:182:9`!, "<<stp_printvars_create_from_xmltree: %p, %s\n",
1128 (void *) (outprintvars->printvarscxx . . $ stp_printvars#printvars.), outprintvars->namecxx . . $ stp_printvars#name.);
1129 return outprintvars;
1130 }
1131
1132
1133 /*
1134 * Parse the printer node, and return the generated printer. Returns
1135 * NULL on failure.
1136 */
1137 static stp_printer_tcxx . . $ stp_printer_t#*
1138 stp_printer_create_from_xmltreecxx . . $ stp_printer_create_from_xmltree(7a0cbcaa6a0d0d15).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *printer, /* The printer node */
1139 const char *family, /* Family name */
1140 const stp_printfuncs_tcxx . . $ stp_printfuncs_t# *printfuncs)
1141 /* Family printfuncs */
1142 {
1143 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *prop; /* Temporary node pointer */
1144 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *child;
1145 const char *stmp; /* Temporary string */
1146 stp_printer_tcxx . . $ stp_printer_t# *outprinter; /* Generated printer */
1147 size_t slen = 0;
1148 int
1149 driver = 0, /* Check driver */
1150 long_name = 0;
1151
1152 outprinter = stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64).(sizeof(stp_printer_tcxx . . $ stp_printer_t#));
1153 if (!outprinter)
1154 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1155 stmp = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "parameters");
1156 if (stmp && !stp_find_paramscxx . . $ stp_find_params(804f7a8dd81ba9b5).(stmp, family))
1157 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("stp_printer_create_from_xmltree: cannot find parameters %s::%s\n",
1158 family, stmp);
1159 if (stmp && stp_find_paramscxx . . $ stp_find_params(804f7a8dd81ba9b5).(stmp, family))
1160 outprinter->printvarscxx . . $ stp_printer#printvars. = stp_vars_create_copycxx . . $ stp_vars_create_copy(d6c73ebbfa1de3f9).(stp_find_paramscxx . . $ stp_find_params(804f7a8dd81ba9b5).(stmp, family));
1161 else
1162 outprinter->printvarscxx . . $ stp_printer#printvars. = stp_vars_createcxx . . $ stp_vars_create(ca9164ca858eeb6f).();
1163 if (outprinter->printvarscxx . . $ stp_printer#printvars. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1164 {
1165 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(outprinter);
1166 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1167 }
1168
1169 stmp = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "driver");
1170 stp_set_drivercxx . . $ stp_set_driver(f1526d77388867f8).(outprinter->printvarscxx . . $ stp_printer#printvars., (const char *) stmp);
1171
1172 outprinter->long_namecxx . . $ stp_printer#long_name. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "name"));
1173 outprinter->manufacturercxx . . $ stp_printer#manufacturer. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "manufacturer"));
1174 outprinter->modelcxx . . $ stp_printer#model. = stp_xmlstrtolcxx . . $ stp_xmlstrtol(3c95bd14d5d5d286).(stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "model"));
1175 outprinter->familycxx . . $ stp_printer#family. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).((const char *) family);
1176 stmp = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "deviceid");
1177 if (stmp)
1178 outprinter->device_idcxx . . $ stp_printer#device_id. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(stmp);
1179
1180 child = printer->childcxx . . $ stp_mxml_node_s#child.;
1181 while (child)
1182 {
1183 if (child->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_TEXTcxx . . $ STP_MXML_TEXT.)
1184 {
1185 if (outprinter->commentcxx . . $ stp_printer#comment.)
1186 {
1187 size_t oslen = slen;
1188 slen += strlencxx . . $ strlen(751346f8406fd082).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
1189 if (child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..whitespacecxx . . $ stp_mxml_text_s#whitespace.)
1190 slen += 1;
1191 outprinter->commentcxx . . $ stp_printer#comment. = stp_realloccxx . . $ stp_realloc(417ab160f6baadc6).(outprinter->commentcxx . . $ stp_printer#comment., slen + 1);
1192 (void) memsetcxx . . $ memset(d1de1e4fb215f1c6).(outprinter->commentcxx . . $ stp_printer#comment. + oslen, 0, slen - oslen);
1193 if (child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..whitespacecxx . . $ stp_mxml_text_s#whitespace.)
1194 outprinter->commentcxx . . $ stp_printer#comment.[oslen++] = ' ';
1195 strncatcxx . . $ strncat(255158a415b673b0).(outprinter->commentcxx . . $ stp_printer#comment. + oslen,
1196 child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string., slen - oslen);
1197 }
1198 else
1199 {
1200 outprinter->commentcxx . . $ stp_printer#comment. = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(child->valuecxx . . $ stp_mxml_node_s#value..textcxx . . $ stp_mxml_value_u#text..stringcxx . . $ stp_mxml_text_s#string.);
1201 slen = strlencxx . . $ strlen(751346f8406fd082).(outprinter->commentcxx . . $ stp_printer#comment.);
1202 }
1203 }
1204 child = child->nextcxx . . $ stp_mxml_node_s#next.;
1205 }
1206
1207 if (stp_get_drivercxx . . $ stp_get_driver(4be828c28602b542).(outprinter->printvarscxx . . $ stp_printer#printvars.))
1208 driver = 1;
1209 if (outprinter->long_namecxx . . $ stp_printer#long_name.)
1210 long_name = 1;
1211
1212 outprinter->printfuncscxx . . $ stp_printer#printfuncs. = printfuncs;
1213
1214 prop = printer->childcxx . . $ stp_mxml_node_s#child.;
1215 stp_vars_fill_from_xmltreecxx . . $ stp_vars_fill_from_xmltree(e89569e122f4e348).(prop, outprinter->printvarscxx . . $ stp_printer#printvars.);
1216 if (driver && long_name && printfuncs)
1217 {
1218 if (stp_get_debug_levelcxx . . $ stp_get_debug_level(f708dce9a8856c70).() & STP_DBG_XMLcxx . . $ `include/gutenprint/util.h:182:9`!)
1219 {
1220 stmp = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(printer, "driver");
1221 stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("stp_printer_create_from_xmltree: printer: %s\n", stmp);
1222 }
1223 outprinter->drivercxx . . $ stp_printer#driver. = stp_get_drivercxx . . $ stp_get_driver(4be828c28602b542).(outprinter->printvarscxx . . $ stp_printer#printvars.);
1224 return outprinter;
1225 }
1226 stp_freecxx . . $ stp_free(5d22bdacc48458e8).(outprinter);
1227 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1228 }
1229
1230 /*
1231 * Parse the <family> node.
1232 */
1233 static void
1234 stpi_xml_process_familycxx . . $ stpi_xml_process_family(6927777f14b5e2a1).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *family) /* The family node */
1235 {
1236 stp_list_tcxx . . $ stp_list_t# *family_module_list = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; /* List of valid families */
1237 stp_list_item_tcxx . . $ stp_list_item_t# *family_module_item; /* Current family */
1238 const char *family_name; /* Name of family */
1239 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *printer; /* printer child node */
1240 stp_module_tcxx . . $ stp_module_t# *family_module_data; /* Family module data */
1241 stp_family_tcxx . . $ stp_family_t# *family_data = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; /* Family data */
1242 int family_valid = 0; /* Is family valid? */
1243
1244 family_module_list = stp_module_get_classcxx . . $ stp_module_get_class(5daf92c7a5979f1b).(STP_MODULE_CLASS_FAMILYcxx . . $ STP_MODULE_CLASS_FAMILY.);
1245 if (!family_module_list)
1246 return;
1247
1248 family_name = stp_mxmlElementGetAttrcxx . . $ stp_mxmlElementGetAttr(42933e0d82869bb1).(family, "name");
1249 family_module_item = stp_list_get_startcxx . . $ stp_list_get_start(44f6202a74729935).(family_module_list);
1250 while (family_module_item)
1251 {
1252 family_module_data = (stp_module_tcxx . . $ stp_module_t# *)
1253 stp_list_item_get_datacxx . . $ stp_list_item_get_data(9a5daa75441a53b5).(family_module_item);
1254 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(family_name, family_module_data->namecxx . . $ stp_module#name.))
1255 {
1256 stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).(STP_DBG_XMLcxx . . $ `include/gutenprint/util.h:182:9`!,
1257 "stpi_xml_process_family: family module: %s\n",
1258 family_module_data->namecxx . . $ stp_module#name.);
1259 family_data = family_module_data->symscxx . . $ stp_module#syms.;
1260 if (family_data->printer_listcxx . . $ stp_family#printer_list. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1261 family_data->printer_listcxx . . $ stp_family#printer_list. = stp_list_createcxx . . $ stp_list_create(728167c67729d082).();
1262 family_valid = 1;
1263 }
1264 family_module_item = stp_list_item_nextcxx . . $ stp_list_item_next(83833ec172b48f23).(family_module_item);
1265 }
1266
1267 printer = family->childcxx . . $ stp_mxml_node_s#child.;
1268 while (family_valid && printer)
1269 {
1270 if (printer->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT.)
1271 {
1272 const char *printer_name = printer->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name.;
1273 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(printer_name, "printer"))
1274 {
1275 stp_printer_tcxx . . $ stp_printer_t# *outprinter =
1276 stp_printer_create_from_xmltreecxx . . $ stp_printer_create_from_xmltree(7a0cbcaa6a0d0d15).(printer, family_name,
1277 family_data->printfuncscxx . . $ stp_family#printfuncs.);
1278 if (outprinter)
1279 stp_list_item_createcxx . . $ stp_list_item_create(54f08bf465e39eec).(family_data->printer_listcxx . . $ stp_family#printer_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1280 outprinter);
1281 }
1282 else if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(printer_name, "parameters"))
1283 {
1284 stp_printvars_tcxx . . $ stp_printvars_t# *printvars =
1285 stp_printvars_create_from_xmltreecxx . . $ stp_printvars_create_from_xmltree(83bf31e67bf683a).(printer, family_name);
1286 if (printvars)
1287 {
1288 stpi_init_printvars_listcxx . . $ stpi_init_printvars_list(49f6e7a06ebc5aa8).();
1289 stp_list_item_createcxx . . $ stp_list_item_create(54f08bf465e39eec).(printvars_listcxx . . $ printvars_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, printvars);
1290 }
1291 }
1292 }
1293 printer = printer->nextcxx . . $ stp_mxml_node_s#next.;
1294 }
1295
1296 stp_list_destroycxx . . $ stp_list_destroy(29ae8ff464c7f7e5).(family_module_list);
1297 return;
1298 }
1299
1300 /*
1301 * Parse the <printdef> node.
1302 */
1303 static int
1304 stpi_xml_process_printdefcxx . . $ stpi_xml_process_printdef(add120f6a4c14e60).(stp_mxml_node_tcxx . . $ stp_mxml_node_t# *printdef, const char *file) /* The printdef node */
1305 {
1306 stp_mxml_node_tcxx . . $ stp_mxml_node_t# *family; /* Family child node */
1307 (void)file;
1308
1309 family = printdef->childcxx . . $ stp_mxml_node_s#child.;
1310 while (family)
1311 {
1312 if (family->typecxx . . $ stp_mxml_node_s#type. == STP_MXML_ELEMENTcxx . . $ STP_MXML_ELEMENT.)
1313 {
1314 const char *family_name = family->valuecxx . . $ stp_mxml_node_s#value..elementcxx . . $ stp_mxml_value_u#element..namecxx . . $ stp_mxml_value_s#name.;
1315 if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(family_name, "family"))
1316 {
1317 stpi_xml_process_familycxx . . $ stpi_xml_process_family(6927777f14b5e2a1).(family);
1318 }
1319 }
1320 family = family->nextcxx . . $ stp_mxml_node_s#next.;
1321 }
1322 return 1;
1323 }
1324
1325 void
1326 stpi_init_printercxx . . $ stpi_init_printer(49f6e7a06ebc5aa8).(void)
1327 {
1328 stp_register_xml_parsercxx . . $ stp_register_xml_parser(91857625fba69e1d).("printdef", stpi_xml_process_printdefcxx . . $ stpi_xml_process_printdef(add120f6a4c14e60).);
1329 }