| 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>:411: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 <math.h> |
| 34 | #include <limits.h> |
| 35 | #if defined(HAVE_VARARGS_H) && !defined(HAVE_STDARG_Hcxx . . $ `../../config.h:118:9`!) |
| 36 | #include <varargs.h> |
| 37 | #else |
| 38 | #include <stdarg.h> |
| 39 | #endif |
| 40 | #include <string.h> |
| 41 | #include <stdio.h> |
| 42 | #include <stdlib.h> |
| 43 | #include <sys/types.h> |
| 44 | #include <sys/stat.h> |
| 45 | #include <unistd.h> |
| 46 | #include "generic-options.h"cxx . . $ `<file>/src/main/generic-options.h`/ |
| 47 | |
| 48 | #define FMINcxx . . $ `src/main/print-util.c:48:9`!(a, b) ((a) < (b) ? (a) : (b)) |
| 49 | |
| 50 | static stp_outfunc_tcxx . . $ stp_outfunc_t# global_errfunccxx . . $ global_errfunc.; |
| 51 | static void *global_errdatacxx . . $ global_errdata.; |
| 52 | static stp_outfunc_tcxx . . $ stp_outfunc_t# global_dbgfunccxx . . $ global_dbgfunc.; |
| 53 | static void *global_dbgdatacxx . . $ global_dbgdata.; |
| 54 | |
| 55 | typedef structcxx . . $ $anonymous_type_1122aea64078db45_0# |
| 56 | { |
| 57 | stp_outfunc_tcxx . . $ stp_outfunc_t# ofunccxx . . $ $anonymous_type_1122aea64078db45_0#ofunc.; |
| 58 | void *odatacxx . . $ $anonymous_type_1122aea64078db45_0#odata.; |
| 59 | char *datacxx . . $ $anonymous_type_1122aea64078db45_0#data.; |
| 60 | size_t bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes.; |
| 61 | } debug_msgbuf_tcxx . . $ debug_msgbuf_t#; |
| 62 | |
| 63 | /* |
| 64 | * We cannot avoid use of the (non-ANSI) vsnprintf here; ANSI does |
| 65 | * not provide a safe, length-limited sprintf function. |
| 66 | */ |
| 67 | |
| 68 | #define STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format) \ |
| 69 | { \ |
| 70 | int current_allocation = 64; /* vsnprintf returns int */ \ |
| 71 | result = stp_malloc(current_allocation); \ |
| 72 | while (current_allocation < INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`! / 2) \ |
| 73 | { \ |
| 74 | va_list args; \ |
| 75 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); \ |
| 76 | bytes = vsnprintf(result, current_allocation, format, args); \ |
| 77 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); \ |
| 78 | if (bytes >= 0 && bytes < current_allocation) \ |
| 79 | break; \ |
| 80 | else \ |
| 81 | { \ |
| 82 | stp_free (result); \ |
| 83 | if (bytes < 0) \ |
| 84 | current_allocation *= 2; \ |
| 85 | else \ |
| 86 | current_allocation = bytes + 1; \ |
| 87 | result = stp_malloc(current_allocation); \ |
| 88 | } \ |
| 89 | } \ |
| 90 | } |
| 91 | |
| 92 | void |
| 93 | stp_zprintfcxx . . $ stp_zprintf(7aef7aa9b820d38).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *format, ...) |
| 94 | { |
| 95 | char *result; |
| 96 | int bytes; |
| 97 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format); |
| 98 | (stp_get_outfunccxx . . $ stp_get_outfunc(62d2c926a148e2bf).(v))((void *)(stp_get_outdatacxx . . $ stp_get_outdata(817585d40f809196).(v)), result, bytes); |
| 99 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(result); |
| 100 | } |
| 101 | |
| 102 | void |
| 103 | stp_asprintfcxx . . $ stp_asprintf(816f0239e6d49b84).(char **strp, const char *format, ...) |
| 104 | { |
| 105 | char *result; |
| 106 | int bytes; |
| 107 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format); |
| 108 | *strp = result; |
| 109 | } |
| 110 | |
| 111 | void |
| 112 | stp_catprintfcxx . . $ stp_catprintf(816f0239e6d49b84).(char **strp, const char *format, ...) |
| 113 | { |
| 114 | char *result1; |
| 115 | char *result2; |
| 116 | int bytes; |
| 117 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result1, bytes, format); |
| 118 | stp_asprintfcxx . . $ stp_asprintf(816f0239e6d49b84).(&result2, "%s%s", *strp, result1); |
| 119 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(result1); |
| 120 | *strp = result2; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | void |
| 125 | stp_zfwritecxx . . $ stp_zfwrite(e7e85bda1a353e8c).(const char *buf, size_t bytes, size_t nitems, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 126 | { |
| 127 | (stp_get_outfunccxx . . $ stp_get_outfunc(62d2c926a148e2bf).(v))((void *)(stp_get_outdatacxx . . $ stp_get_outdata(817585d40f809196).(v)), buf, bytes * nitems); |
| 128 | } |
| 129 | |
| 130 | void |
| 131 | stp_write_rawcxx . . $ stp_write_raw(9db79402c27454b9).(const stp_raw_tcxx . . $ stp_raw_t# *raw, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 132 | { |
| 133 | (stp_get_outfunccxx . . $ stp_get_outfunc(62d2c926a148e2bf).(v))((void *)(stp_get_outdatacxx . . $ stp_get_outdata(817585d40f809196).(v)), raw->datacxx . . $ $anonymous_type_c987533f3b833c82_4#data., raw->bytescxx . . $ $anonymous_type_c987533f3b833c82_4#bytes.); |
| 134 | } |
| 135 | |
| 136 | void |
| 137 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(int ch, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 138 | { |
| 139 | unsigned char a = (unsigned char) ch; |
| 140 | (stp_get_outfunccxx . . $ stp_get_outfunc(62d2c926a148e2bf).(v))((void *)(stp_get_outdatacxx . . $ stp_get_outdata(817585d40f809196).(v)), (char *) &a, 1); |
| 141 | } |
| 142 | |
| 143 | #define BYTEcxx . . $ `src/main/print-util.c:143:9`!(expr, byteno) (((expr) >> (8 * byteno)) & 0xff) |
| 144 | |
| 145 | void |
| 146 | stp_put16_lecxx . . $ stp_put16_le(20aa715745d84a3b).(unsigned short sh, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 147 | { |
| 148 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(sh, 0), v); |
| 149 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(sh, 1), v); |
| 150 | } |
| 151 | |
| 152 | void |
| 153 | stp_put16_becxx . . $ stp_put16_be(20aa715745d84a3b).(unsigned short sh, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 154 | { |
| 155 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(sh, 1), v); |
| 156 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(sh, 0), v); |
| 157 | } |
| 158 | |
| 159 | void |
| 160 | stp_put32_lecxx . . $ stp_put32_le(87c88da2971ff9c0).(unsigned int in, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 161 | { |
| 162 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 0), v); |
| 163 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 1), v); |
| 164 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 2), v); |
| 165 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 3), v); |
| 166 | } |
| 167 | |
| 168 | void |
| 169 | stp_put32_becxx . . $ stp_put32_be(87c88da2971ff9c0).(unsigned int in, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 170 | { |
| 171 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 3), v); |
| 172 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 2), v); |
| 173 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 1), v); |
| 174 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(BYTEcxx . . $ `src/main/print-util.c:143:9`!(in, 0), v); |
| 175 | } |
| 176 | |
| 177 | void |
| 178 | stp_putscxx . . $ stp_puts(35a89ecf160f646a).(const char *s, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 179 | { |
| 180 | (stp_get_outfunccxx . . $ stp_get_outfunc(62d2c926a148e2bf).(v))((void *)(stp_get_outdatacxx . . $ stp_get_outdata(817585d40f809196).(v)), s, strlencxx . . $ strlen(751346f8406fd082).(s)); |
| 181 | } |
| 182 | |
| 183 | void |
| 184 | stp_putrawcxx . . $ stp_putraw(9db79402c27454b9).(const stp_raw_tcxx . . $ stp_raw_t# *r, const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 185 | { |
| 186 | (stp_get_outfunccxx . . $ stp_get_outfunc(62d2c926a148e2bf).(v))((void *)(stp_get_outdatacxx . . $ stp_get_outdata(817585d40f809196).(v)), r->datacxx . . $ $anonymous_type_c987533f3b833c82_4#data., r->bytescxx . . $ $anonymous_type_c987533f3b833c82_4#bytes.); |
| 187 | } |
| 188 | |
| 189 | void |
| 190 | stp_send_commandcxx . . $ stp_send_command(6c1d4952f19f3c82).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *command, |
| 191 | const char *format, ...) |
| 192 | { |
| 193 | unsigned int i = 0; |
| 194 | char fchar; |
| 195 | const char *out_str; |
| 196 | const stp_raw_tcxx . . $ stp_raw_t# *out_raw; |
| 197 | unsigned short byte_count = 0; |
| 198 | va_listcxx . . $ va_list# args; |
| 199 | |
| 200 | if (strlencxx . . $ strlen(751346f8406fd082).(format) > 0) |
| 201 | { |
| 202 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 203 | for (i = 0; i < strlencxx . . $ strlen(751346f8406fd082).(format); i++) |
| 204 | { |
| 205 | switch (format[i]) |
| 206 | { |
| 207 | case 'a': |
| 208 | case 'b': |
| 209 | case 'B': |
| 210 | case 'd': |
| 211 | case 'D': |
| 212 | break; |
| 213 | case 'c': |
| 214 | (void) va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int); |
| 215 | byte_count += 1; |
| 216 | break; |
| 217 | case 'h': |
| 218 | case 'H': |
| 219 | (void) va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int); |
| 220 | byte_count += 2; |
| 221 | break; |
| 222 | case 'l': |
| 223 | case 'L': |
| 224 | (void) va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int); |
| 225 | byte_count += 4; |
| 226 | break; |
| 227 | case 'r': |
| 228 | out_raw = va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, const stp_raw_t *); |
| 229 | byte_count += out_raw->bytescxx . . $ $anonymous_type_c987533f3b833c82_4#bytes.; |
| 230 | break; |
| 231 | case 's': |
| 232 | out_str = va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, const char *); |
| 233 | byte_count += strlencxx . . $ strlen(751346f8406fd082).(out_str); |
| 234 | break; |
| 235 | } |
| 236 | } |
| 237 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 238 | } |
| 239 | |
| 240 | stp_putscxx . . $ stp_puts(35a89ecf160f646a).(command, v); |
| 241 | |
| 242 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 243 | while ((fchar = format[0]) != '\0') |
| 244 | { |
| 245 | switch (fchar) |
| 246 | { |
| 247 | case 'a': |
| 248 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(byte_count, v); |
| 249 | break; |
| 250 | case 'b': |
| 251 | stp_put16_lecxx . . $ stp_put16_le(20aa715745d84a3b).(byte_count, v); |
| 252 | break; |
| 253 | case 'B': |
| 254 | stp_put16_becxx . . $ stp_put16_be(20aa715745d84a3b).(byte_count, v); |
| 255 | break; |
| 256 | case 'd': |
| 257 | stp_put32_lecxx . . $ stp_put32_le(87c88da2971ff9c0).(byte_count, v); |
| 258 | break; |
| 259 | case 'D': |
| 260 | stp_put32_becxx . . $ stp_put32_be(87c88da2971ff9c0).(byte_count, v); |
| 261 | break; |
| 262 | case 'c': |
| 263 | stp_putccxx . . $ stp_putc(a57e1a3820493fb).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int), v); |
| 264 | break; |
| 265 | case 'h': |
| 266 | stp_put16_lecxx . . $ stp_put16_le(20aa715745d84a3b).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int), v); |
| 267 | break; |
| 268 | case 'H': |
| 269 | stp_put16_becxx . . $ stp_put16_be(20aa715745d84a3b).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int), v); |
| 270 | break; |
| 271 | case 'l': |
| 272 | stp_put32_lecxx . . $ stp_put32_le(87c88da2971ff9c0).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int), v); |
| 273 | break; |
| 274 | case 'L': |
| 275 | stp_put32_becxx . . $ stp_put32_be(87c88da2971ff9c0).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, unsigned int), v); |
| 276 | break; |
| 277 | case 's': |
| 278 | stp_putscxx . . $ stp_puts(35a89ecf160f646a).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, const char *), v); |
| 279 | break; |
| 280 | case 'r': |
| 281 | stp_putrawcxx . . $ stp_putraw(9db79402c27454b9).(va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, const stp_raw_t *), v); |
| 282 | break; |
| 283 | } |
| 284 | format++; |
| 285 | } |
| 286 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 287 | } |
| 288 | |
| 289 | void |
| 290 | stp_set_global_errfunccxx . . $ stp_set_global_errfunc(aab424bde820e7a4).(stp_outfunc_tcxx . . $ stp_outfunc_t# val) |
| 291 | { |
| 292 | global_errfunccxx . . $ global_errfunc. = val; |
| 293 | } |
| 294 | |
| 295 | stp_outfunc_tcxx . . $ stp_outfunc_t# |
| 296 | stp_get_global_errfunccxx . . $ stp_get_global_errfunc(30dded74b9903998).(void) |
| 297 | { |
| 298 | return global_errfunccxx . . $ global_errfunc.; |
| 299 | } |
| 300 | |
| 301 | void |
| 302 | stp_set_global_errdatacxx . . $ stp_set_global_errdata(5d22bdacc48458e8).(void *val) |
| 303 | { |
| 304 | global_errdatacxx . . $ global_errdata. = val; |
| 305 | } |
| 306 | |
| 307 | void * |
| 308 | stp_get_global_errdatacxx . . $ stp_get_global_errdata(50c7df7de5344ebb).(void) |
| 309 | { |
| 310 | return global_errdatacxx . . $ global_errdata.; |
| 311 | } |
| 312 | |
| 313 | void |
| 314 | stp_set_global_dbgfunccxx . . $ stp_set_global_dbgfunc(aab424bde820e7a4).(stp_outfunc_tcxx . . $ stp_outfunc_t# val) |
| 315 | { |
| 316 | global_dbgfunccxx . . $ global_dbgfunc. = val; |
| 317 | } |
| 318 | |
| 319 | stp_outfunc_tcxx . . $ stp_outfunc_t# |
| 320 | stp_get_global_dbgfunccxx . . $ stp_get_global_dbgfunc(30dded74b9903998).(void) |
| 321 | { |
| 322 | return global_dbgfunccxx . . $ global_dbgfunc.; |
| 323 | } |
| 324 | |
| 325 | void |
| 326 | stp_set_global_dbgdatacxx . . $ stp_set_global_dbgdata(5d22bdacc48458e8).(void *val) |
| 327 | { |
| 328 | global_dbgdatacxx . . $ global_dbgdata. = val; |
| 329 | } |
| 330 | |
| 331 | void * |
| 332 | stp_get_global_dbgdatacxx . . $ stp_get_global_dbgdata(50c7df7de5344ebb).(void) |
| 333 | { |
| 334 | return global_dbgdatacxx . . $ global_dbgdata.; |
| 335 | } |
| 336 | |
| 337 | void |
| 338 | stp_eprintfcxx . . $ stp_eprintf(7aef7aa9b820d38).(const stp_vars_tcxx . . $ stp_vars_t# *v, const char *format, ...) |
| 339 | { |
| 340 | int bytes; |
| 341 | stp_outfunc_tcxx . . $ stp_outfunc_t# errfunc = stp_get_errfunccxx . . $ stp_get_errfunc(62d2c926a148e2bf).(v); |
| 342 | if (! errfunc) |
| 343 | errfunc = global_errfunccxx . . $ global_errfunc.; |
| 344 | void * errdata = stp_get_errdatacxx . . $ stp_get_errdata(817585d40f809196).(v); |
| 345 | if (! errdata) |
| 346 | errdata = global_errdatacxx . . $ global_errdata.; |
| 347 | if (errfunc) |
| 348 | { |
| 349 | char *result; |
| 350 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format); |
| 351 | errfunc(errdata, result, bytes); |
| 352 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(result); |
| 353 | } |
| 354 | else |
| 355 | { |
| 356 | va_listcxx . . $ va_list# args; |
| 357 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 358 | vfprintfcxx . . $ vfprintf(bded311e54d67f9c).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, format, args); |
| 359 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | void |
| 364 | stp_erputccxx . . $ stp_erputc(d4f767463ce0a6b3).(int ch) |
| 365 | { |
| 366 | if (global_errfunccxx . . $ global_errfunc.) |
| 367 | { |
| 368 | char c[1]; |
| 369 | c[0] = (char) ch; |
| 370 | global_errfunccxx . . $ global_errfunc.(global_errdatacxx . . $ global_errdata., c, 1); |
| 371 | } |
| 372 | else |
| 373 | putccxx . . $ putc(b1cd03d6c470d1bd).(ch, stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 374 | } |
| 375 | |
| 376 | void |
| 377 | stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).(const char *format, ...) |
| 378 | { |
| 379 | if (global_errfunccxx . . $ global_errfunc.) |
| 380 | { |
| 381 | int bytes; |
| 382 | char *result; |
| 383 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format); |
| 384 | global_errfunccxx . . $ global_errfunc.(global_errdatacxx . . $ global_errdata., result, bytes); |
| 385 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(result); |
| 386 | } |
| 387 | else |
| 388 | { |
| 389 | va_listcxx . . $ va_list# args; |
| 390 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 391 | vfprintfcxx . . $ vfprintf(bded311e54d67f9c).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, format, args); |
| 392 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | static unsigned long stpi_debug_levelcxx . . $ stpi_debug_level. = 0; |
| 397 | |
| 398 | static void |
| 399 | stpi_init_debugcxx . . $ stpi_init_debug(49f6e7a06ebc5aa8).(void) |
| 400 | { |
| 401 | static int debug_initialized = 0; |
| 402 | if (!debug_initialized) |
| 403 | { |
| 404 | const char *dval = getenvcxx . . $ getenv(a8b8e32347182212).("STP_DEBUG"); |
| 405 | debug_initialized = 1; |
| 406 | if (dval) |
| 407 | { |
| 408 | stpi_debug_levelcxx . . $ stpi_debug_level. = strtoulcxx . . $ strtoul(31746e8d6ec49860).(dval, 0, 0); |
| 409 | stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("Gutenprint %s %s\n", VERSIONcxx . . $ `../../config.h:204:9`!, RELEASE_DATEcxx . . $ `../../config.h:190:9`!); |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | unsigned long |
| 415 | stp_get_debug_levelcxx . . $ stp_get_debug_level(f708dce9a8856c70).(void) |
| 416 | { |
| 417 | stpi_init_debugcxx . . $ stpi_init_debug(49f6e7a06ebc5aa8).(); |
| 418 | return stpi_debug_levelcxx . . $ stpi_debug_level.; |
| 419 | } |
| 420 | |
| 421 | void |
| 422 | stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(unsigned long level, const stp_vars_tcxx . . $ stp_vars_t# *v, const char *format, ...) |
| 423 | { |
| 424 | stpi_init_debugcxx . . $ stpi_init_debug(49f6e7a06ebc5aa8).(); |
| 425 | if (level & stpi_debug_levelcxx . . $ stpi_debug_level.) |
| 426 | { |
| 427 | stp_outfunc_tcxx . . $ stp_outfunc_t# dbgfunc = stp_get_dbgfunccxx . . $ stp_get_dbgfunc(62d2c926a148e2bf).(v); |
| 428 | if (! dbgfunc) |
| 429 | dbgfunc = global_dbgfunccxx . . $ global_dbgfunc.; |
| 430 | if (! dbgfunc) |
| 431 | dbgfunc = stp_get_errfunccxx . . $ stp_get_errfunc(62d2c926a148e2bf).(v); |
| 432 | if (! dbgfunc) |
| 433 | dbgfunc = global_errfunccxx . . $ global_errfunc.; |
| 434 | void *dbgdata = stp_get_dbgdatacxx . . $ stp_get_dbgdata(817585d40f809196).(v); |
| 435 | if (! dbgdata) |
| 436 | dbgdata = global_dbgdatacxx . . $ global_dbgdata.; |
| 437 | if (! dbgdata) |
| 438 | dbgdata = stp_get_errdatacxx . . $ stp_get_errdata(817585d40f809196).(v); |
| 439 | if (! dbgdata) |
| 440 | dbgdata = global_errdatacxx . . $ global_errdata.; |
| 441 | if (dbgfunc) |
| 442 | { |
| 443 | int bytes; |
| 444 | char *result; |
| 445 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format); |
| 446 | dbgfunc(dbgdata, result, bytes); |
| 447 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(result); |
| 448 | } |
| 449 | else |
| 450 | { |
| 451 | va_listcxx . . $ va_list# args; |
| 452 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 453 | vfprintfcxx . . $ vfprintf(bded311e54d67f9c).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, format, args); |
| 454 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | void |
| 460 | stp_deprintfcxx . . $ stp_deprintf(3d303ebd7ab3b1e3).(unsigned long level, const char *format, ...) |
| 461 | { |
| 462 | stpi_init_debugcxx . . $ stpi_init_debug(49f6e7a06ebc5aa8).(); |
| 463 | if (level & stpi_debug_levelcxx . . $ stpi_debug_level.) |
| 464 | { |
| 465 | if (global_dbgfunccxx . . $ global_dbgfunc.) |
| 466 | { |
| 467 | int bytes; |
| 468 | char *result; |
| 469 | STPI_VASPRINTFcxx . . $ `src/main/print-util.c:68:9`!(result, bytes, format); |
| 470 | global_dbgfunccxx . . $ global_dbgfunc.(global_dbgdatacxx . . $ global_dbgdata., result, bytes); |
| 471 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(result); |
| 472 | } |
| 473 | else |
| 474 | { |
| 475 | va_listcxx . . $ va_list# args; |
| 476 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, format); |
| 477 | vfprintfcxx . . $ vfprintf(bded311e54d67f9c).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, format, args); |
| 478 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | static void |
| 484 | fill_buffer_writefunccxx . . $ fill_buffer_writefunc(8e4e5e8cac233c6a).(void *priv, const char *buffer, size_t bytes) |
| 485 | { |
| 486 | debug_msgbuf_tcxx . . $ debug_msgbuf_t# *msgbuf = (debug_msgbuf_tcxx . . $ debug_msgbuf_t# *) priv; |
| 487 | if (msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes. == 0) |
| 488 | msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data. = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(bytes + 1); |
| 489 | else |
| 490 | msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data. = stp_realloccxx . . $ stp_realloc(417ab160f6baadc6).(msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data., msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes. + bytes + 1); |
| 491 | memcpycxx . . $ memcpy(cc817cb175f282d).(msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data. + msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes., buffer, bytes); |
| 492 | msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes. += bytes; |
| 493 | msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data.[msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes.] = '\0'; |
| 494 | } |
| 495 | |
| 496 | void |
| 497 | stp_init_debug_messagescxx . . $ stp_init_debug_messages(1a97b8462f9f913c).(stp_vars_tcxx . . $ stp_vars_t# *v) |
| 498 | { |
| 499 | int verified_flag = stp_get_verifiedcxx . . $ stp_get_verified(b1be75487ade2f93).(v); |
| 500 | debug_msgbuf_tcxx . . $ debug_msgbuf_t# *msgbuf = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(sizeof(debug_msgbuf_tcxx . . $ debug_msgbuf_t#)); |
| 501 | msgbuf->ofunccxx . . $ $anonymous_type_1122aea64078db45_0#ofunc. = stp_get_dbgfunccxx . . $ stp_get_dbgfunc(62d2c926a148e2bf).(v); |
| 502 | msgbuf->odatacxx . . $ $anonymous_type_1122aea64078db45_0#odata. = stp_get_dbgdatacxx . . $ stp_get_dbgdata(817585d40f809196).(v); |
| 503 | msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 504 | msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes. = 0; |
| 505 | stp_set_dbgfunccxx . . $ stp_set_dbgfunc(d4e9cdcd927ed799).((stp_vars_tcxx . . $ stp_vars_t# *) v, fill_buffer_writefunccxx . . $ fill_buffer_writefunc(8e4e5e8cac233c6a).); |
| 506 | stp_set_dbgdatacxx . . $ stp_set_dbgdata(da98ca80e19bc349).((stp_vars_tcxx . . $ stp_vars_t# *) v, msgbuf); |
| 507 | stp_set_verifiedcxx . . $ stp_set_verified(c8b26ae77f1a10bd).((stp_vars_tcxx . . $ stp_vars_t# *) v, verified_flag); |
| 508 | } |
| 509 | |
| 510 | void |
| 511 | stp_flush_debug_messagescxx . . $ stp_flush_debug_messages(1a97b8462f9f913c).(stp_vars_tcxx . . $ stp_vars_t# *v) |
| 512 | { |
| 513 | int verified_flag = stp_get_verifiedcxx . . $ stp_get_verified(b1be75487ade2f93).(v); |
| 514 | debug_msgbuf_tcxx . . $ debug_msgbuf_t# *msgbuf = (debug_msgbuf_tcxx . . $ debug_msgbuf_t# *)stp_get_dbgdatacxx . . $ stp_get_dbgdata(817585d40f809196).(v); |
| 515 | stp_set_dbgfunccxx . . $ stp_set_dbgfunc(d4e9cdcd927ed799).((stp_vars_tcxx . . $ stp_vars_t# *) v, msgbuf->ofunccxx . . $ $anonymous_type_1122aea64078db45_0#ofunc.); |
| 516 | stp_set_dbgdatacxx . . $ stp_set_dbgdata(da98ca80e19bc349).((stp_vars_tcxx . . $ stp_vars_t# *) v, msgbuf->odatacxx . . $ $anonymous_type_1122aea64078db45_0#odata.); |
| 517 | stp_set_verifiedcxx . . $ stp_set_verified(c8b26ae77f1a10bd).((stp_vars_tcxx . . $ stp_vars_t# *) v, verified_flag); |
| 518 | if (msgbuf->bytescxx . . $ $anonymous_type_1122aea64078db45_0#bytes. > 0) |
| 519 | { |
| 520 | /* |
| 521 | * Messages aren't tagged by debug value, so we force them |
| 522 | * out if any debug flag is set. |
| 523 | */ |
| 524 | stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).((unsigned long) -1, v, "%s", msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data.); |
| 525 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(msgbuf->datacxx . . $ $anonymous_type_1122aea64078db45_0#data.); |
| 526 | } |
| 527 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(msgbuf); |
| 528 | } |
| 529 | |
| 530 | /* pointers to the allocation functions to use, which may be set by |
| 531 | client applications */ |
| 532 | void *(*stp_malloc_funccxx . . $ stp_malloc_func.)(size_t size) = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).; |
| 533 | void *(*stpi_realloc_funccxx . . $ stpi_realloc_func.)(void *ptr, size_t size) = realloccxx . . $ realloc(417ab160f6baadc6).; |
| 534 | void (*stpi_free_funccxx . . $ stpi_free_func.)(void *ptr) = freecxx . . $ free(5d22bdacc48458e8).; |
| 535 | |
| 536 | void * |
| 537 | stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64). (size_t size) |
| 538 | { |
| 539 | register void *memptr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 540 | |
| 541 | if ((memptr = stp_malloc_funccxx . . $ stp_malloc_func. (size)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 542 | { |
| 543 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("Virtual memory exhausted.\n", stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 544 | stp_abortcxx . . $ stp_abort(49f6e7a06ebc5aa8).(); |
| 545 | } |
| 546 | return (memptr); |
| 547 | } |
| 548 | |
| 549 | void * |
| 550 | stp_zalloccxx . . $ stp_zalloc(bfcfa4d6b7f7ef64). (size_t size) |
| 551 | { |
| 552 | register void *memptr = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(size); |
| 553 | (void) memsetcxx . . $ memset(d1de1e4fb215f1c6).(memptr, 0, size); |
| 554 | return (memptr); |
| 555 | } |
| 556 | |
| 557 | void * |
| 558 | stp_realloccxx . . $ stp_realloc(417ab160f6baadc6). (void *ptr, size_t size) |
| 559 | { |
| 560 | register void *memptr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 561 | |
| 562 | if (size > 0 && ((memptr = stpi_realloc_funccxx . . $ stpi_realloc_func. (ptr, size)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 563 | { |
| 564 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("Virtual memory exhausted.\n", stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 565 | stp_abortcxx . . $ stp_abort(49f6e7a06ebc5aa8).(); |
| 566 | } |
| 567 | return (memptr); |
| 568 | } |
| 569 | |
| 570 | void |
| 571 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(void *ptr) |
| 572 | { |
| 573 | stpi_free_funccxx . . $ stpi_free_func.(ptr); |
| 574 | } |
| 575 | |
| 576 | int |
| 577 | stp_initcxx . . $ stp_init(b126dc7c1de90089).(void) |
| 578 | { |
| 579 | static int stpi_is_initialised = 0; |
| 580 | if (!stpi_is_initialised) |
| 581 | { |
| 582 | /* Things that are only initialised once */ |
| 583 | /* Set up gettext */ |
| 584 | #ifdef HAVE_LOCALE_Hcxx . . $ `../../config.h:97:9`! |
| 585 | char *locale = setlocalecxx . . $ setlocale(10ed28bce9115888). (LC_ALLcxx . . $ `<external>/3736975272097309885/locale.h:41:9`!, ""); |
| 586 | if (locale) |
| 587 | { |
| 588 | locale = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(locale); |
| 589 | } |
| 590 | #endif |
| 591 | #ifdef ENABLE_NLScxx . . $ `../../config.h:18:9`! |
| 592 | bindtextdomaincxx . . $ bindtextdomain(a713fe7b9a57cf96). (PACKAGEcxx . . $ `../../config.h:169:9`!, PACKAGE_LOCALE_DIRcxx . . $ `<built-in>:413:9`!); |
| 593 | textdomaincxx . . $ textdomain(a8b8e32347182212).(PACKAGEcxx . . $ `../../config.h:169:9`!); |
| 594 | #endif |
| 595 | #ifdef HAVE_LOCALE_Hcxx . . $ `../../config.h:97:9`! |
| 596 | if (locale) |
| 597 | { |
| 598 | setlocalecxx . . $ setlocale(10ed28bce9115888).(LC_ALLcxx . . $ `<external>/3736975272097309885/locale.h:41:9`!, locale); |
| 599 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(locale); |
| 600 | } |
| 601 | #endif |
| 602 | stpi_init_debugcxx . . $ stpi_init_debug(49f6e7a06ebc5aa8).(); |
| 603 | stp_xml_preinitcxx . . $ stp_xml_preinit(49f6e7a06ebc5aa8).(); |
| 604 | stpi_init_printercxx . . $ stpi_init_printer(49f6e7a06ebc5aa8).(); |
| 605 | stpi_init_dithercxx . . $ stpi_init_dither(49f6e7a06ebc5aa8).(); |
| 606 | /* Load modules */ |
| 607 | if (stp_module_loadcxx . . $ stp_module_load(b126dc7c1de90089).()) |
| 608 | return 1; |
| 609 | /* Load XML data */ |
| 610 | if (stp_xml_init_defaultscxx . . $ stp_xml_init_defaults(b126dc7c1de90089).()) |
| 611 | return 1; |
| 612 | /* Initialise modules */ |
| 613 | if (stp_module_initcxx . . $ stp_module_init(b126dc7c1de90089).()) |
| 614 | return 1; |
| 615 | /* Set up defaults for core parameters */ |
| 616 | stp_initialize_printer_defaultscxx . . $ stp_initialize_printer_defaults(49f6e7a06ebc5aa8).(); |
| 617 | } |
| 618 | |
| 619 | stpi_is_initialised = 1; |
| 620 | return 0; |
| 621 | } |
| 622 | |
| 623 | size_t |
| 624 | stp_strlencxx . . $ stp_strlen(751346f8406fd082).(const char *s) |
| 625 | { |
| 626 | return strlencxx . . $ strlen(751346f8406fd082).(s); |
| 627 | } |
| 628 | |
| 629 | char * |
| 630 | stp_strndupcxx . . $ stp_strndup(2050848944e00d54).(const char *s, int n) |
| 631 | { |
| 632 | #if HAVE_DECL_STRNDUPcxx . . $ `../../config.h:50:9`! |
| 633 | return strndupcxx . . $ strndup(eabdfdef77619b3d).(s, n); |
| 634 | #else |
| 635 | char *ret; |
| 636 | if (!s || n < 0) |
| 637 | { |
| 638 | ret = stp_malloc(1); |
| 639 | ret[0] = 0; |
| 640 | return ret; |
| 641 | } |
| 642 | else |
| 643 | { |
| 644 | ret = stp_malloc(n + 1); |
| 645 | memcpy(ret, s, n); |
| 646 | ret[n] = 0; |
| 647 | return ret; |
| 648 | } |
| 649 | #endif |
| 650 | } |
| 651 | |
| 652 | char * |
| 653 | stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(const char *s) |
| 654 | { |
| 655 | #if HAVE_DECL_STRDUPcxx . . $ `../../config.h:46:9`! |
| 656 | return strdupcxx . . $ strdup(a8b8e32347182212).(s); |
| 657 | #else |
| 658 | char *ret; |
| 659 | if (!s) |
| 660 | { |
| 661 | ret = stp_malloc(1); |
| 662 | ret[0] = '\0'; |
| 663 | return ret; |
| 664 | } |
| 665 | else |
| 666 | return stp_strndup(s, stp_strlen(s)); |
| 667 | #endif |
| 668 | } |
| 669 | |
| 670 | const char * |
| 671 | stp_set_output_codesetcxx . . $ stp_set_output_codeset(fb58d2e09a2a1ce6).(const char *codeset) |
| 672 | { |
| 673 | #if defined(ENABLE_NLScxx . . $ `../../config.h:18:9`!) && !defined(__APPLE__) |
| 674 | return (const char *)(bind_textdomain_codesetcxx . . $ bind_textdomain_codeset(a713fe7b9a57cf96).(PACKAGEcxx . . $ `../../config.h:169:9`!, codeset)); |
| 675 | #else |
| 676 | return "US-ASCII"; |
| 677 | #endif |
| 678 | } |
| 679 | |
| 680 | stp_curve_tcxx . . $ stp_curve_t# * |
| 681 | stp_read_and_compose_curvescxx . . $ stp_read_and_compose_curves(5856d4b0d02a6c20).(const char *s1, const char *s2, |
| 682 | stp_curve_compose_tcxx . . $ stp_curve_compose_t# comp, |
| 683 | size_t piecewise_point_count) |
| 684 | { |
| 685 | stp_curve_tcxx . . $ stp_curve_t# *ret = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 686 | stp_curve_tcxx . . $ stp_curve_t# *t1 = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 687 | stp_curve_tcxx . . $ stp_curve_t# *t2 = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 688 | if (s1) |
| 689 | t1 = stp_curve_create_from_stringcxx . . $ stp_curve_create_from_string(fc1a54117bc5f637).(s1); |
| 690 | if (s2) |
| 691 | t2 = stp_curve_create_from_stringcxx . . $ stp_curve_create_from_string(fc1a54117bc5f637).(s2); |
| 692 | if (t1 && t2) |
| 693 | { |
| 694 | if (stp_curve_is_piecewisecxx . . $ stp_curve_is_piecewise(bc3348f13b0b16e6).(t1) && stp_curve_is_piecewisecxx . . $ stp_curve_is_piecewise(bc3348f13b0b16e6).(t2)) |
| 695 | { |
| 696 | stp_curve_resamplecxx . . $ stp_curve_resample(bc87752a72bd695e).(t1, piecewise_point_count); |
| 697 | stp_curve_resamplecxx . . $ stp_curve_resample(bc87752a72bd695e).(t2, piecewise_point_count); |
| 698 | } |
| 699 | stp_curve_composecxx . . $ stp_curve_compose(116ca8de2bc26c87).(&ret, t1, t2, comp, -1); |
| 700 | } |
| 701 | if (ret) |
| 702 | { |
| 703 | stp_curve_destroycxx . . $ stp_curve_destroy(357dc05c3c24eef1).(t1); |
| 704 | stp_curve_destroycxx . . $ stp_curve_destroy(357dc05c3c24eef1).(t2); |
| 705 | return ret; |
| 706 | } |
| 707 | else if (t1) |
| 708 | { |
| 709 | if(t2) |
| 710 | stp_curve_destroycxx . . $ stp_curve_destroy(357dc05c3c24eef1).(t2); |
| 711 | return t1; |
| 712 | } |
| 713 | else |
| 714 | return t2; |
| 715 | } |
| 716 | |
| 717 | void |
| 718 | stp_merge_printvarscxx . . $ stp_merge_printvars(352fcd689be2d739).(stp_vars_tcxx . . $ stp_vars_t# *user, const stp_vars_tcxx . . $ stp_vars_t# *print) |
| 719 | { |
| 720 | int i; |
| 721 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# params = stp_get_parameter_listcxx . . $ stp_get_parameter_list(817585d40f809196).(print); |
| 722 | int count = stp_parameter_list_countcxx . . $ stp_parameter_list_count(2e8e543e1193434e).(params); |
| 723 | stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, user, "Merging printvars from %s\n", |
| 724 | stp_get_drivercxx . . $ stp_get_driver(4be828c28602b542).(print)); |
| 725 | for (i = 0; i < count; i++) |
| 726 | { |
| 727 | const stp_parameter_tcxx . . $ stp_parameter_t# *p = stp_parameter_list_paramcxx . . $ stp_parameter_list_param(f24b23997c12c6a6).(params, i); |
| 728 | if (p->p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type. == STP_PARAMETER_TYPE_DOUBLEcxx . . $ STP_PARAMETER_TYPE_DOUBLE. && |
| 729 | p->p_classcxx . . $ $anonymous_type_c987533f3b833c82_8#p_class. == STP_PARAMETER_CLASS_OUTPUTcxx . . $ STP_PARAMETER_CLASS_OUTPUT. && |
| 730 | stp_check_float_parametercxx . . $ stp_check_float_parameter(cff2817d3dcc2695).(print, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_DEFAULTEDcxx . . $ STP_PARAMETER_DEFAULTED.)) |
| 731 | { |
| 732 | stp_parameter_tcxx . . $ stp_parameter_t# desc; |
| 733 | double prnval = stp_get_float_parametercxx . . $ stp_get_float_parameter(ac3b1c02c916f219).(print, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 734 | double usrval; |
| 735 | stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(print, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., &desc); |
| 736 | if (stp_check_float_parametercxx . . $ stp_check_float_parameter(cff2817d3dcc2695).(user, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.)) |
| 737 | usrval = stp_get_float_parametercxx . . $ stp_get_float_parameter(ac3b1c02c916f219).(user, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 738 | else |
| 739 | usrval = desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#dbl.; |
| 740 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., "Gamma") == 0) |
| 741 | usrval /= prnval; |
| 742 | else |
| 743 | usrval *= prnval; |
| 744 | if (usrval < desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..lowercxx . . $ $anonymous_type_c987533f3b833c82_5#lower.) |
| 745 | usrval = desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..lowercxx . . $ $anonymous_type_c987533f3b833c82_5#lower.; |
| 746 | else if (usrval > desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.) |
| 747 | usrval = desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.; |
| 748 | if (!stp_check_float_parametercxx . . $ stp_check_float_parameter(cff2817d3dcc2695).(user, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.)) |
| 749 | { |
| 750 | stp_clear_float_parametercxx . . $ stp_clear_float_parameter(f1526d77388867f8).(user, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 751 | stp_set_default_float_parametercxx . . $ stp_set_default_float_parameter(bd523a1c1fbe60d3).(user, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., usrval); |
| 752 | } |
| 753 | else |
| 754 | stp_set_float_parametercxx . . $ stp_set_float_parameter(bd523a1c1fbe60d3).(user, p->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., usrval); |
| 755 | stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc); |
| 756 | } |
| 757 | } |
| 758 | stp_dprintfcxx . . $ stp_dprintf(13526ca24396f6ac).(STP_DBG_VARScxx . . $ `include/gutenprint/util.h:183:9`!, user, "Exiting merge printvars\n"); |
| 759 | stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(params); |
| 760 | } |
| 761 | |
| 762 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# |
| 763 | stp_get_parameter_listcxx . . $ stp_get_parameter_list(817585d40f809196).(const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 764 | { |
| 765 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# *ret = stp_parameter_list_createcxx . . $ stp_parameter_list_create(50c7df7de5344ebb).(); |
| 766 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# *tmp_list; |
| 767 | |
| 768 | tmp_list = stp_printer_list_parameterscxx . . $ stp_printer_list_parameters(817585d40f809196).(v); |
| 769 | stp_parameter_list_appendcxx . . $ stp_parameter_list_append(b6570c89ea41c2e0).(ret, tmp_list); |
| 770 | stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(tmp_list); |
| 771 | |
| 772 | tmp_list = stp_color_list_parameterscxx . . $ stp_color_list_parameters(817585d40f809196).(v); |
| 773 | stp_parameter_list_appendcxx . . $ stp_parameter_list_append(b6570c89ea41c2e0).(ret, tmp_list); |
| 774 | stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(tmp_list); |
| 775 | |
| 776 | tmp_list = stp_list_generic_parameterscxx . . $ stp_list_generic_parameters(817585d40f809196).(v); |
| 777 | stp_parameter_list_appendcxx . . $ stp_parameter_list_append(b6570c89ea41c2e0).(ret, tmp_list); |
| 778 | stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(tmp_list); |
| 779 | |
| 780 | return ret; |
| 781 | } |
| 782 | |
| 783 | void |
| 784 | stp_abortcxx . . $ stp_abort(49f6e7a06ebc5aa8).(void) |
| 785 | { |
| 786 | if (stp_get_debug_levelcxx . . $ stp_get_debug_level(f708dce9a8856c70).() > 0) |
| 787 | { |
| 788 | int i = *((volatile int *) 0); |
| 789 | stp_erprintfcxx . . $ stp_erprintf(326aeb464d16410c).("Crashing here...%d\n", i); |
| 790 | } |
| 791 | abortcxx . . $ abort(8df32a62017fbbf6).(); |
| 792 | } |
| 793 | |
| 794 | time_tcxx . . $ time_t# |
| 795 | stpi_timecxx . . $ stpi_time(7f38134db6521d23).(time_tcxx . . $ time_t# *t) |
| 796 | { |
| 797 | if (stp_get_debug_levelcxx . . $ stp_get_debug_level(f708dce9a8856c70).() & STP_DBG_STATIC_TIMEcxx . . $ `include/gutenprint/util.h:193:9`!) |
| 798 | { |
| 799 | if (t) |
| 800 | *t = (time_tcxx . . $ time_t#) 0; |
| 801 | return (time_tcxx . . $ time_t#) 0; |
| 802 | } |
| 803 | else |
| 804 | return timecxx . . $ time(7f38134db6521d23).(t); |
| 805 | } |