| 1 | /* |
| 2 | * Gutenprint based raster filter for the Common UNIX Printing System. |
| 3 | * |
| 4 | * Copyright 1993-2008 by Mike Sweet. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the Free |
| 8 | * Software Foundation; either version 2 of the License, or (at your option) |
| 9 | * any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * Contents: |
| 20 | * |
| 21 | * main() - Main entry and processing of driver. |
| 22 | * cups_writefunc() - Write data to a file... |
| 23 | * cancel_job() - Cancel the current job... |
| 24 | * Image_get_appname() - Get the application we are running. |
| 25 | * Image_get_row() - Get one row of the image. |
| 26 | * Image_height() - Return the height of an image. |
| 27 | * Image_init() - Initialize an image. |
| 28 | * Image_conclude() - Close the progress display. |
| 29 | * Image_width() - Return the width of an image. |
| 30 | */ |
| 31 | |
| 32 | /* |
| 33 | * Include necessary headers... |
| 34 | */ |
| 35 | |
| 36 | #pragma GCC diagnostic push |
| 37 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
| 38 | |
| 39 | #if 0 |
| 40 | #define ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 41 | #endif |
| 42 | |
| 43 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:411:9`! |
| 44 | #include <config.h>cxx . . $ `<file>/config.h`/ |
| 45 | #endif |
| 46 | #include <cups/cups.h> |
| 47 | #include <cups/ppd.h> |
| 48 | #include <cups/raster.h> |
| 49 | #include <signal.h> |
| 50 | #include <string.h> |
| 51 | #include <stdlib.h> |
| 52 | #include <unistd.h> |
| 53 | #include <fcntl.h> |
| 54 | #include <errno.h> |
| 55 | #include <sys/times.h> |
| 56 | #include <strings.h> |
| 57 | #include <sys/time.h> |
| 58 | #ifdef HAVE_LIMITS_Hcxx . . $ `config.h:94:9`! |
| 59 | #include <limits.h> |
| 60 | #endif |
| 61 | #include "i18n.h"cxx . . $ `<file>/src/cups/i18n.h`/ |
| 62 | #include <gutenprint/xml.h>cxx . . $ `<file>/include/gutenprint/xml.h`/ |
| 63 | |
| 64 | /* Solaris with gcc has problems because gcc's limits.h doesn't #define */ |
| 65 | /* this */ |
| 66 | #ifndef CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`! |
| 67 | #define CHAR_BIT 8 |
| 68 | #endif |
| 69 | |
| 70 | /* |
| 71 | * Structure for page raster data... |
| 72 | */ |
| 73 | |
| 74 | #if (CUPS_VERSION_MAJORcxx . . $ `<external>/15740376750114838746/cups.h:47:11`! > 1 || (CUPS_VERSION_MAJORcxx . . $ `<external>/15740376750114838746/cups.h:47:11`! == 1 && CUPS_VERSION_MINORcxx . . $ `<external>/15740376750114838746/cups.h:48:11`! > 1)) |
| 75 | #define CUPS_HEADER_Tcxx . . $ `src/cups/rastertogutenprint.c:75:9`! cups_page_header2_t |
| 76 | #define CUPS_READ_HEADERcxx . . $ `src/cups/rastertogutenprint.c:76:9`! cupsRasterReadHeader2 |
| 77 | #else |
| 78 | #define CUPS_HEADER_T cups_page_header_t |
| 79 | #define CUPS_READ_HEADER cupsRasterReadHeader |
| 80 | #endif |
| 81 | |
| 82 | typedef structcxx . . $ $anonymous_type_9fad8097beddd8b9_0# |
| 83 | { |
| 84 | cups_raster_tcxx . . $ cups_raster_t# *rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras.; /* Raster stream to read from */ |
| 85 | int pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page.; /* Current page number */ |
| 86 | unsigned int rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row.; /* Current row number */ |
| 87 | int leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left.; |
| 88 | int rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right.; |
| 89 | int bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#bottom.; |
| 90 | int topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#top.; |
| 91 | unsigned int widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#width.; |
| 92 | unsigned int heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#height.; |
| 93 | int left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left_trim.; |
| 94 | int right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right_trim.; |
| 95 | int top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#top_trim.; |
| 96 | int bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#bottom_trim.; |
| 97 | unsigned int adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width.; |
| 98 | unsigned int adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height.; |
| 99 | stp_dimension_tcxx . . $ stp_dimension_t# d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left.; |
| 100 | stp_dimension_tcxx . . $ stp_dimension_t# d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.; |
| 101 | stp_dimension_tcxx . . $ stp_dimension_t# d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.; |
| 102 | stp_dimension_tcxx . . $ stp_dimension_t# d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top.; |
| 103 | stp_dimension_tcxx . . $ stp_dimension_t# d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width.; |
| 104 | stp_dimension_tcxx . . $ stp_dimension_t# d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height.; |
| 105 | stp_dimension_tcxx . . $ stp_dimension_t# d_left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left_trim.; |
| 106 | stp_dimension_tcxx . . $ stp_dimension_t# d_right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right_trim.; |
| 107 | stp_dimension_tcxx . . $ stp_dimension_t# d_bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom_trim.; |
| 108 | stp_dimension_tcxx . . $ stp_dimension_t# d_top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top_trim.; |
| 109 | int last_percentcxx . . $ $anonymous_type_9fad8097beddd8b9_0#last_percent.; |
| 110 | int shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit.; |
| 111 | CUPS_HEADER_Tcxx . . $ `src/cups/rastertogutenprint.c:75:9`! headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header.; /* Page header from file */ |
| 112 | } cups_image_tcxx . . $ cups_image_t#; |
| 113 | |
| 114 | static void cups_writefunccxx . . $ cups_writefunc(8e4e5e8cac233c6a).(void *file, const char *buf, size_t bytes); |
| 115 | static void cups_errfunccxx . . $ cups_errfunc(8e4e5e8cac233c6a).(void *file, const char *buf, size_t bytes); |
| 116 | static void cups_dbgfunccxx . . $ cups_dbgfunc(8e4e5e8cac233c6a).(void *file, const char *buf, size_t bytes); |
| 117 | static void cancel_jobcxx . . $ cancel_job(d4f767463ce0a6b3).(int sig); |
| 118 | static const char *Image_get_appnamecxx . . $ Image_get_appname(97b8a1c82bcbc822).(stp_image_tcxx . . $ stp_image_t# *image); |
| 119 | static stp_image_status_tcxx . . $ stp_image_status_t# Image_get_rowcxx . . $ Image_get_row(c6bbe34ec0bddcf0).(stp_image_tcxx . . $ stp_image_t# *image, |
| 120 | unsigned char *data, |
| 121 | size_t byte_limit, int row); |
| 122 | static int Image_heightcxx . . $ Image_height(ba31fd85910919f2).(stp_image_tcxx . . $ stp_image_t# *image); |
| 123 | static int Image_widthcxx . . $ Image_width(ba31fd85910919f2).(stp_image_tcxx . . $ stp_image_t# *image); |
| 124 | static void Image_concludecxx . . $ Image_conclude(7010b42a94b47a79).(stp_image_tcxx . . $ stp_image_t# *image); |
| 125 | static void Image_initcxx . . $ Image_init(7010b42a94b47a79).(stp_image_tcxx . . $ stp_image_t# *image); |
| 126 | |
| 127 | static stp_image_tcxx . . $ stp_image_t# theImagecxx . . $ theImage. = |
| 128 | { |
| 129 | Image_initcxx . . $ Image_init(7010b42a94b47a79)., |
| 130 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* reset */ |
| 131 | Image_widthcxx . . $ Image_width(ba31fd85910919f2)., |
| 132 | Image_heightcxx . . $ Image_height(ba31fd85910919f2)., |
| 133 | Image_get_rowcxx . . $ Image_get_row(c6bbe34ec0bddcf0)., |
| 134 | Image_get_appnamecxx . . $ Image_get_appname(97b8a1c82bcbc822)., |
| 135 | Image_concludecxx . . $ Image_conclude(7010b42a94b47a79)., |
| 136 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! |
| 137 | }; |
| 138 | |
| 139 | static volatile stp_image_status_tcxx . . $ stp_image_status_t# Image_statuscxx . . $ Image_status. = STP_IMAGE_STATUS_OKcxx . . $ STP_IMAGE_STATUS_OK.; |
| 140 | static double total_bytes_printedcxx . . $ total_bytes_printed. = 0; |
| 141 | static int print_messages_as_errorscxx . . $ print_messages_as_errors. = 0; |
| 142 | static int suppress_messagescxx . . $ suppress_messages. = 0; |
| 143 | static int suppress_verbose_messagescxx . . $ suppress_verbose_messages. = 0; |
| 144 | static const stp_string_list_tcxx . . $ stp_string_list_t# *pocxx . . $ po. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 145 | #ifdef ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 146 | static const char *save_file_name = NULL; |
| 147 | static const char *load_file_name = NULL; |
| 148 | #endif /* ENABLE_CUPS_LOAD_SAVE_OPTIONS */ |
| 149 | |
| 150 | #pragma GCC diagnostic ignored "-Wformat-nonliteral" |
| 151 | #pragma GCC diagnostic push |
| 152 | #pragma GCC diagnostic ignored "-Wcast-qual" |
| 153 | static inline void * |
| 154 | cast_safecxx . . $ cast_safe(3343d82129b43479).(const void *ptr) |
| 155 | { |
| 156 | return (void *)ptr; |
| 157 | } |
| 158 | #pragma GCC diagnostic pop |
| 159 | |
| 160 | static void |
| 161 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(stp_vars_tcxx . . $ stp_vars_t# *v, const char *name, const char *val) |
| 162 | { |
| 163 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 164 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set special string %s to %s\n", name, val); |
| 165 | stp_set_string_parametercxx . . $ stp_set_string_parameter(7405204ff890c7b8).(v, name, val); |
| 166 | } |
| 167 | |
| 168 | |
| 169 | static void |
| 170 | set_special_parametercxx . . $ set_special_parameter(8ec0183b6ab8ae2d).(stp_vars_tcxx . . $ stp_vars_t# *v, const char *name, int choice) |
| 171 | { |
| 172 | stp_parameter_tcxx . . $ stp_parameter_t# desc; |
| 173 | stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(v, name, &desc); |
| 174 | if (desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type. == STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST.) |
| 175 | { |
| 176 | #if 0 |
| 177 | if (stp_check_string_parameter(v, name, STP_PARAMETER_ACTIVE)) |
| 178 | { |
| 179 | if (! suppress_messages) |
| 180 | fprintf(stderr, "DEBUG: Gutenprint: Not overriding special parameter %s (%s)\n", |
| 181 | name, stp_get_string_parameter(v, name)); |
| 182 | } |
| 183 | else |
| 184 | #endif |
| 185 | if (choice < 0) |
| 186 | { |
| 187 | stp_clear_string_parametercxx . . $ stp_clear_string_parameter(f1526d77388867f8).(v, name); |
| 188 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 189 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Clear special parameter %s\n", |
| 190 | name); |
| 191 | } |
| 192 | else if (choice >= (int)stp_string_list_countcxx . . $ stp_string_list_count(53b7214102d1daf6).(desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str.)) |
| 193 | { |
| 194 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 195 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Unable to set Gutenprint option %s " |
| 196 | "(%d > %d)!\n"), name, choice, |
| 197 | stp_string_list_countcxx . . $ stp_string_list_count(53b7214102d1daf6).(desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str.)); |
| 198 | } |
| 199 | else |
| 200 | { |
| 201 | stp_set_string_parametercxx . . $ stp_set_string_parameter(7405204ff890c7b8). |
| 202 | (v, name, stp_string_list_paramcxx . . $ stp_string_list_param(1d71fb1c8ad3926a).(desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., choice)->namecxx . . $ $anonymous_type_cb0224bbe5755622_0#name.); |
| 203 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 204 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set special parameter %s to choice %d (%s)\n", |
| 205 | name, choice, |
| 206 | stp_string_list_paramcxx . . $ stp_string_list_param(1d71fb1c8ad3926a).(desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., choice)->namecxx . . $ $anonymous_type_cb0224bbe5755622_0#name.); |
| 207 | } |
| 208 | } |
| 209 | else |
| 210 | { |
| 211 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 212 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Unable to set special %s: not a string\n", |
| 213 | name); |
| 214 | } |
| 215 | stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc); |
| 216 | } |
| 217 | |
| 218 | static void |
| 219 | print_debug_blockcxx . . $ print_debug_block(d533188743335c78).(const stp_vars_tcxx . . $ stp_vars_t# *v, const cups_image_tcxx . . $ cups_image_t# *cups) |
| 220 | { |
| 221 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Page data:\n"); |
| 222 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: MediaClass = \"%s\"\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaClasscxx . . $ cups_page_header2_s#MediaClass.); |
| 223 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: MediaColor = \"%s\"\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaColorcxx . . $ cups_page_header2_s#MediaColor.); |
| 224 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: MediaType = \"%s\"\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaTypecxx . . $ cups_page_header2_s#MediaType.); |
| 225 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: OutputType = \"%s\"\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..OutputTypecxx . . $ cups_page_header2_s#OutputType.); |
| 226 | |
| 227 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: AdvanceDistance = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..AdvanceDistancecxx . . $ cups_page_header2_s#AdvanceDistance.); |
| 228 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: AdvanceMedia = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..AdvanceMediacxx . . $ cups_page_header2_s#AdvanceMedia.); |
| 229 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Collate = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Collatecxx . . $ cups_page_header2_s#Collate.); |
| 230 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: CutMedia = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..CutMediacxx . . $ cups_page_header2_s#CutMedia.); |
| 231 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Duplex = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Duplexcxx . . $ cups_page_header2_s#Duplex.); |
| 232 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: HWResolution = [ %d %d ]\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[0], |
| 233 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[1]); |
| 234 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ImagingBoundingBox = [ %d %d %d %d ]\n", |
| 235 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..ImagingBoundingBoxcxx . . $ cups_page_header2_s#ImagingBoundingBox.[0], cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..ImagingBoundingBoxcxx . . $ cups_page_header2_s#ImagingBoundingBox.[1], |
| 236 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..ImagingBoundingBoxcxx . . $ cups_page_header2_s#ImagingBoundingBox.[2], cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..ImagingBoundingBoxcxx . . $ cups_page_header2_s#ImagingBoundingBox.[3]); |
| 237 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: InsertSheet = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..InsertSheetcxx . . $ cups_page_header2_s#InsertSheet.); |
| 238 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Jog = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Jogcxx . . $ cups_page_header2_s#Jog.); |
| 239 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: LeadingEdge = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..LeadingEdgecxx . . $ cups_page_header2_s#LeadingEdge.); |
| 240 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Margins = [ %d %d ]\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Marginscxx . . $ cups_page_header2_s#Margins.[0], |
| 241 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Marginscxx . . $ cups_page_header2_s#Margins.[1]); |
| 242 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ManualFeed = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..ManualFeedcxx . . $ cups_page_header2_s#ManualFeed.); |
| 243 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: MediaPosition = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaPositioncxx . . $ cups_page_header2_s#MediaPosition.); |
| 244 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: MediaWeight = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaWeightcxx . . $ cups_page_header2_s#MediaWeight.); |
| 245 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: MirrorPrint = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MirrorPrintcxx . . $ cups_page_header2_s#MirrorPrint.); |
| 246 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: NegativePrint = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..NegativePrintcxx . . $ cups_page_header2_s#NegativePrint.); |
| 247 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: NumCopies = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..NumCopiescxx . . $ cups_page_header2_s#NumCopies.); |
| 248 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Orientation = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Orientationcxx . . $ cups_page_header2_s#Orientation.); |
| 249 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: OutputFaceUp = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..OutputFaceUpcxx . . $ cups_page_header2_s#OutputFaceUp.); |
| 250 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: PageSize = [ %d %d ]\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0], |
| 251 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1]); |
| 252 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Separations = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Separationscxx . . $ cups_page_header2_s#Separations.); |
| 253 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: TraySwitch = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..TraySwitchcxx . . $ cups_page_header2_s#TraySwitch.); |
| 254 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Tumble = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Tumblecxx . . $ cups_page_header2_s#Tumble.); |
| 255 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsWidth = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsWidthcxx . . $ cups_page_header2_s#cupsWidth.); |
| 256 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsHeight = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.); |
| 257 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cups->width = %u\n", cups->widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#width.); |
| 258 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cups->height = %u\n", cups->heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#height.); |
| 259 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cups->adjusted_width = %u\n", cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width.); |
| 260 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cups->adjusted_height = %u\n", cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height.); |
| 261 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsMediaType = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsMediaTypecxx . . $ cups_page_header2_s#cupsMediaType.); |
| 262 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsBitsPerColor = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerColorcxx . . $ cups_page_header2_s#cupsBitsPerColor.); |
| 263 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsBitsPerPixel = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerPixelcxx . . $ cups_page_header2_s#cupsBitsPerPixel.); |
| 264 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsBytesPerLine = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBytesPerLinecxx . . $ cups_page_header2_s#cupsBytesPerLine.); |
| 265 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsColorOrder = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsColorOrdercxx . . $ cups_page_header2_s#cupsColorOrder.); |
| 266 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsColorSpace = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsColorSpacecxx . . $ cups_page_header2_s#cupsColorSpace.); |
| 267 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsCompression = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsCompressioncxx . . $ cups_page_header2_s#cupsCompression.); |
| 268 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsRowCount = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsRowCountcxx . . $ cups_page_header2_s#cupsRowCount.); |
| 269 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsRowFeed = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsRowFeedcxx . . $ cups_page_header2_s#cupsRowFeed.); |
| 270 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: cupsRowStep = %d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsRowStepcxx . . $ cups_page_header2_s#cupsRowStep.); |
| 271 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: shrink page to fit %d\n", cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit.); |
| 272 | stp_vars_print_errorcxx . . $ stp_vars_print_error(6fd78d57b3b855ce).(v, "DEBUG"); |
| 273 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: End page data\n"); |
| 274 | } |
| 275 | |
| 276 | static int |
| 277 | printer_supports_bwcxx . . $ printer_supports_bw(b1be75487ade2f93).(const stp_vars_tcxx . . $ stp_vars_t# *v) |
| 278 | { |
| 279 | stp_parameter_tcxx . . $ stp_parameter_t# desc; |
| 280 | int status = 0; |
| 281 | stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(v, "PrintingMode", &desc); |
| 282 | if (stp_string_list_is_presentcxx . . $ stp_string_list_is_present(bf726c32497cc2b).(desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., "BW")) |
| 283 | status = 1; |
| 284 | stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc); |
| 285 | return status; |
| 286 | } |
| 287 | |
| 288 | static void |
| 289 | validate_optionscxx . . $ validate_options(60353a28572a6850).(stp_vars_tcxx . . $ stp_vars_t# *v, cups_image_tcxx . . $ cups_image_t# *cups) |
| 290 | { |
| 291 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# params = stp_get_parameter_listcxx . . $ stp_get_parameter_list(817585d40f809196).(v); |
| 292 | int nparams = stp_parameter_list_countcxx . . $ stp_parameter_list_count(2e8e543e1193434e).(params); |
| 293 | int i; |
| 294 | (void)cups; |
| 295 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 296 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Validating options\n"); |
| 297 | for (i = 0; i < nparams; i++) |
| 298 | { |
| 299 | const stp_parameter_tcxx . . $ stp_parameter_t# *param = stp_parameter_list_paramcxx . . $ stp_parameter_list_param(f24b23997c12c6a6).(params, i); |
| 300 | stp_parameter_tcxx . . $ stp_parameter_t# desc; |
| 301 | stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(v, param->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., &desc); |
| 302 | if (desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type. == STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST.) |
| 303 | { |
| 304 | if (!stp_string_list_is_presentcxx . . $ stp_string_list_is_present(bf726c32497cc2b). |
| 305 | (desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#str., stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.))) |
| 306 | { |
| 307 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 308 | { |
| 309 | const char *val = stp_get_string_parametercxx . . $ stp_get_string_parameter(3e3ce5d385745545).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 310 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Clearing string %s (%s)\n", |
| 311 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val ? val : "(null)"); |
| 312 | } |
| 313 | stp_clear_string_parametercxx . . $ stp_clear_string_parameter(f1526d77388867f8).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 314 | if (!desc.read_onlycxx . . $ $anonymous_type_c987533f3b833c82_8#read_only. && desc.is_mandatorycxx . . $ $anonymous_type_c987533f3b833c82_8#is_mandatory. && desc.is_activecxx . . $ $anonymous_type_c987533f3b833c82_8#is_active.) |
| 315 | { |
| 316 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 317 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Setting default string %s to %s\n", |
| 318 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str. ? desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str. : "(null)"); |
| 319 | stp_set_string_parametercxx . . $ stp_set_string_parameter(7405204ff890c7b8).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str.); |
| 320 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., "PageSize") == 0) |
| 321 | { |
| 322 | const stp_papersize_tcxx . . $ stp_papersize_t# *ps = |
| 323 | stp_describe_papersizecxx . . $ stp_describe_papersize(977e5bf217e59ec).(v, desc.defltcxx . . $ $anonymous_type_c987533f3b833c82_8#deflt..strcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_10#str.); |
| 324 | if (ps->widthcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#width. > 0) |
| 325 | { |
| 326 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 327 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Setting page width to %.3f\n", |
| 328 | ps->widthcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#width.); |
| 329 | if (ps->widthcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#width. < stp_get_page_widthcxx . . $ stp_get_page_width(7f9a8d44e8193bba).(v)) |
| 330 | stp_set_page_widthcxx . . $ stp_set_page_width(8ce3003bda9b93be).(v, ps->widthcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#width.); |
| 331 | } |
| 332 | if (ps->heightcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#height. > 0) |
| 333 | { |
| 334 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 335 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Setting page height to %.3f\n", |
| 336 | ps->heightcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#height.); |
| 337 | if (ps->heightcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#height. < stp_get_page_heightcxx . . $ stp_get_page_height(7f9a8d44e8193bba).(v)) |
| 338 | stp_set_page_heightcxx . . $ stp_set_page_height(8ce3003bda9b93be).(v, ps->heightcxx . . $ $anonymous_type_51fd7f0ef3c7bff0_2#height.); |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | } |
| 344 | stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc); |
| 345 | } |
| 346 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 347 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Done validating options\n"); |
| 348 | stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(params); |
| 349 | } |
| 350 | |
| 351 | static stp_vars_tcxx . . $ stp_vars_t# * |
| 352 | initialize_pagecxx . . $ initialize_page(abb082e9fd205acd).(cups_image_tcxx . . $ cups_image_t# *cups, const stp_vars_tcxx . . $ stp_vars_t# *default_settings, |
| 353 | const char *page_size_name) |
| 354 | { |
| 355 | stp_dimension_tcxx . . $ stp_dimension_t# tmp_left, tmp_right, tmp_top, tmp_bottom; |
| 356 | stp_vars_tcxx . . $ stp_vars_t# *v = stp_vars_create_copycxx . . $ stp_vars_create_copy(d6c73ebbfa1de3f9).(default_settings); |
| 357 | |
| 358 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 359 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Initialize page\n"); |
| 360 | |
| 361 | if (cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerColorcxx . . $ cups_page_header2_s#cupsBitsPerColor. == 16) |
| 362 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "ChannelBitDepth", "16"); |
| 363 | else |
| 364 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "ChannelBitDepth", "8"); |
| 365 | switch (cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsColorSpacecxx . . $ cups_page_header2_s#cupsColorSpace.) |
| 366 | { |
| 367 | case CUPS_CSPACE_Wcxx . . $ CUPS_CSPACE_W. : |
| 368 | /* DyeSub photo printers don't support black & white ink! */ |
| 369 | if (printer_supports_bwcxx . . $ printer_supports_bw(b1be75487ade2f93).(v)) |
| 370 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PrintingMode", "BW"); |
| 371 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputImageType", "Whitescale"); |
| 372 | break; |
| 373 | case CUPS_CSPACE_Kcxx . . $ CUPS_CSPACE_K. : |
| 374 | /* DyeSub photo printers don't support black & white ink! */ |
| 375 | if (printer_supports_bwcxx . . $ printer_supports_bw(b1be75487ade2f93).(v)) |
| 376 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PrintingMode", "BW"); |
| 377 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputImageType", "Grayscale"); |
| 378 | break; |
| 379 | case CUPS_CSPACE_RGBcxx . . $ CUPS_CSPACE_RGB. : |
| 380 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PrintingMode", "Color"); |
| 381 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputImageType", "RGB"); |
| 382 | break; |
| 383 | case CUPS_CSPACE_CMYcxx . . $ CUPS_CSPACE_CMY. : |
| 384 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PrintingMode", "Color"); |
| 385 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputImageType", "CMY"); |
| 386 | break; |
| 387 | case CUPS_CSPACE_CMYKcxx . . $ CUPS_CSPACE_CMYK. : |
| 388 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PrintingMode", "Color"); |
| 389 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputImageType", "CMYK"); |
| 390 | break; |
| 391 | case CUPS_CSPACE_KCMYcxx . . $ CUPS_CSPACE_KCMY. : |
| 392 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PrintingMode", "Color"); |
| 393 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputImageType", "KCMY"); |
| 394 | break; |
| 395 | default : |
| 396 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint detected a bad colorspace " |
| 397 | "(%d)!\n"), cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsColorSpacecxx . . $ cups_page_header2_s#cupsColorSpace.); |
| 398 | break; |
| 399 | } |
| 400 | |
| 401 | set_special_parametercxx . . $ set_special_parameter(8ec0183b6ab8ae2d).(v, "Resolution", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsCompressioncxx . . $ cups_page_header2_s#cupsCompression. - 1); |
| 402 | |
| 403 | set_special_parametercxx . . $ set_special_parameter(8ec0183b6ab8ae2d).(v, "Quality", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsRowFeedcxx . . $ cups_page_header2_s#cupsRowFeed. - 1); |
| 404 | |
| 405 | if (strlencxx . . $ strlen(751346f8406fd082).(cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaClasscxx . . $ cups_page_header2_s#MediaClass.) > 0) |
| 406 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "InputSlot", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaClasscxx . . $ cups_page_header2_s#MediaClass.); |
| 407 | |
| 408 | if (strlencxx . . $ strlen(751346f8406fd082).(cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaTypecxx . . $ cups_page_header2_s#MediaType.) > 0) |
| 409 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "MediaType", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..MediaTypecxx . . $ cups_page_header2_s#MediaType.); |
| 410 | |
| 411 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 412 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: PageSize = %dx%d\n", cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0], |
| 413 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1]); |
| 414 | |
| 415 | if (page_size_name) |
| 416 | { |
| 417 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(page_size_name, "Custom") == 0) |
| 418 | { |
| 419 | if (!suppress_messagescxx . . $ suppress_messages.) |
| 420 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Using custom page size for (%d, %d)\n", |
| 421 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1], cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 422 | stp_set_page_widthcxx . . $ stp_set_page_width(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 423 | stp_set_page_heightcxx . . $ stp_set_page_height(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1]); |
| 424 | } |
| 425 | else if (stp_describe_papersizecxx . . $ stp_describe_papersize(977e5bf217e59ec).(v, page_size_name)) |
| 426 | { |
| 427 | stp_dimension_tcxx . . $ stp_dimension_t# width, height; |
| 428 | if (!suppress_messagescxx . . $ suppress_messages.) |
| 429 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Using page size %s with (%d, %d)\n", |
| 430 | page_size_name, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1], cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 431 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "PageSize", page_size_name); |
| 432 | stp_get_media_sizecxx . . $ stp_get_media_size(2eafa46ec96dc268).(v, &width, &height); |
| 433 | if (width > 0) |
| 434 | stp_set_page_widthcxx . . $ stp_set_page_width(8ce3003bda9b93be).(v, width); |
| 435 | else |
| 436 | stp_set_page_widthcxx . . $ stp_set_page_width(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 437 | if (height > 0) |
| 438 | stp_set_page_heightcxx . . $ stp_set_page_height(8ce3003bda9b93be).(v, height); |
| 439 | else |
| 440 | stp_set_page_heightcxx . . $ stp_set_page_height(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1]); |
| 441 | } |
| 442 | else |
| 443 | { |
| 444 | if (!suppress_messagescxx . . $ suppress_messages.) |
| 445 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Can't find page size %s with (%d, %d), using custom page size\n", |
| 446 | page_size_name, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1], cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 447 | stp_set_page_widthcxx . . $ stp_set_page_width(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 448 | stp_set_page_heightcxx . . $ stp_set_page_height(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1]); |
| 449 | } |
| 450 | } |
| 451 | else |
| 452 | { |
| 453 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 454 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: No named media size for (%d, %d)\n", |
| 455 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1], cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 456 | stp_set_page_widthcxx . . $ stp_set_page_width(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[0]); |
| 457 | stp_set_page_heightcxx . . $ stp_set_page_height(8ce3003bda9b93be).(v, cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..PageSizecxx . . $ cups_page_header2_s#PageSize.[1]); |
| 458 | } |
| 459 | |
| 460 | /* |
| 461 | * Duplex |
| 462 | * Note that the names MUST match those in the printer driver(s) |
| 463 | */ |
| 464 | |
| 465 | if (cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Duplexcxx . . $ cups_page_header2_s#Duplex. != 0) |
| 466 | { |
| 467 | if (cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Tumblecxx . . $ cups_page_header2_s#Tumble. != 0) |
| 468 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "Duplex", "DuplexTumble"); |
| 469 | else |
| 470 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "Duplex", "DuplexNoTumble"); |
| 471 | } |
| 472 | |
| 473 | cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. = |
| 474 | (stp_check_int_parametercxx . . $ stp_check_int_parameter(cff2817d3dcc2695).(v, "CUPSShrinkPage", STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.) ? |
| 475 | stp_get_int_parametercxx . . $ stp_get_int_parameter(b1e629819c29df09).(v, "CUPSShrinkPage") : 0); |
| 476 | |
| 477 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, "JobMode", "Job"); |
| 478 | validate_optionscxx . . $ validate_options(60353a28572a6850).(v, cups); |
| 479 | stp_get_media_sizecxx . . $ stp_get_media_size(2eafa46ec96dc268).(v, &(cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width.), &(cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height.)); |
| 480 | stp_get_maximum_imageable_areacxx . . $ stp_get_maximum_imageable_area(25e50967534aa153).(v, &tmp_left, &tmp_right, |
| 481 | &tmp_bottom, &tmp_top); |
| 482 | stp_get_imageable_areacxx . . $ stp_get_imageable_area(25e50967534aa153).(v, &(cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left.), &(cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.), |
| 483 | &(cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.), &(cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top.)); |
| 484 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 485 | { |
| 486 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: limits w %.3f l %.3f r %.3f h %.3f t %.3f b %.3f\n", |
| 487 | cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width., cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left., cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right., cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height., cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top., cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.); |
| 488 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: max limits l %.3f r %.3f t %.3f b %.3f\n", |
| 489 | tmp_left, tmp_right, tmp_top, tmp_bottom); |
| 490 | } |
| 491 | |
| 492 | if (tmp_left < 0) |
| 493 | tmp_left = 0; |
| 494 | if (tmp_top < 0) |
| 495 | tmp_top = 0; |
| 496 | if (tmp_right > tmp_left + cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width.) |
| 497 | tmp_right = cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width.; |
| 498 | if (tmp_bottom > tmp_top + cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height.) |
| 499 | tmp_bottom = cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height.; |
| 500 | if (tmp_left <= cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left.) |
| 501 | { |
| 502 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. != 1) |
| 503 | { |
| 504 | cups->d_left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left_trim. = cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left. - tmp_left; |
| 505 | tmp_left = cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left.; |
| 506 | } |
| 507 | else |
| 508 | cups->d_left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left_trim. = 0; |
| 509 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 510 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: left margin %.3f\n", cups->d_left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left_trim.); |
| 511 | } |
| 512 | else |
| 513 | { |
| 514 | cups->d_left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left_trim. = 0; |
| 515 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 516 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Adjusting left margin from %.3f to %.3f\n", |
| 517 | cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left., tmp_left); |
| 518 | cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left. = tmp_left; |
| 519 | } |
| 520 | if (tmp_right >= cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.) |
| 521 | { |
| 522 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. != 1) |
| 523 | { |
| 524 | cups->d_right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right_trim. = tmp_right - cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.; |
| 525 | tmp_right = cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.; |
| 526 | } |
| 527 | else |
| 528 | cups->d_right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right_trim. = 0; |
| 529 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 530 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: right margin %.3f\n", cups->d_right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right_trim.); |
| 531 | } |
| 532 | else |
| 533 | { |
| 534 | cups->d_right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right_trim. = 0; |
| 535 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 536 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Adjusting right margin from %.3f to %.3f\n", |
| 537 | cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right., tmp_right); |
| 538 | cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right. = tmp_right; |
| 539 | } |
| 540 | if (tmp_top <= cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top.) |
| 541 | { |
| 542 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. != 1) |
| 543 | { |
| 544 | cups->d_top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top_trim. = cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top. - tmp_top; |
| 545 | tmp_top = cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top.; |
| 546 | } |
| 547 | else |
| 548 | cups->d_top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top_trim. = 0; |
| 549 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 550 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: top margin %.3f\n", cups->d_top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top_trim.); |
| 551 | } |
| 552 | else |
| 553 | { |
| 554 | cups->d_top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top_trim. = 0; |
| 555 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 556 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Adjusting top margin from %.3f to %.3f\n", |
| 557 | cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top., tmp_top); |
| 558 | cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top. = tmp_top; |
| 559 | } |
| 560 | if (tmp_bottom >= cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.) |
| 561 | { |
| 562 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. != 1) |
| 563 | { |
| 564 | cups->d_bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom_trim. = tmp_bottom - cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.; |
| 565 | tmp_bottom = cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.; |
| 566 | } |
| 567 | else |
| 568 | cups->d_bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom_trim. = 0; |
| 569 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 570 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: bottom margin %.3f\n", cups->d_bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom_trim.); |
| 571 | } |
| 572 | else |
| 573 | { |
| 574 | cups->d_bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom_trim. = 0; |
| 575 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 576 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Adjusting bottom margin from %.3f to %.3f\n", |
| 577 | cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom., tmp_bottom); |
| 578 | cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom. = tmp_bottom; |
| 579 | } |
| 580 | |
| 581 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. == 2) |
| 582 | { |
| 583 | stp_dimension_tcxx . . $ stp_dimension_t# t_left, t_right, t_bottom, t_top; |
| 584 | stp_get_imageable_areacxx . . $ stp_get_imageable_area(25e50967534aa153).(v, &(t_left), &(t_right), &(t_bottom), &(t_top)); |
| 585 | stp_set_widthcxx . . $ stp_set_width(8ce3003bda9b93be).(v, t_right - t_left); |
| 586 | stp_set_heightcxx . . $ stp_set_height(8ce3003bda9b93be).(v, t_bottom - t_top); |
| 587 | stp_set_leftcxx . . $ stp_set_left(8ce3003bda9b93be).(v, t_left); |
| 588 | stp_set_topcxx . . $ stp_set_top(8ce3003bda9b93be).(v, t_top); |
| 589 | } |
| 590 | else |
| 591 | { |
| 592 | stp_set_widthcxx . . $ stp_set_width(8ce3003bda9b93be).(v, cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right. - cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left.); |
| 593 | stp_set_heightcxx . . $ stp_set_height(8ce3003bda9b93be).(v, cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom. - cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top.); |
| 594 | stp_set_leftcxx . . $ stp_set_left(8ce3003bda9b93be).(v, cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left.); |
| 595 | stp_set_topcxx . . $ stp_set_top(8ce3003bda9b93be).(v, cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top.); |
| 596 | } |
| 597 | |
| 598 | cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right. = cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width. - cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.; |
| 599 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. == 1) |
| 600 | cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width. = tmp_right - tmp_left; |
| 601 | else |
| 602 | cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width. = cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width. - cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left. - cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right.; |
| 603 | cups->widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#width. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[0] * cups->d_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_width. / 72; |
| 604 | cups->leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[0] * cups->d_leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left. / 72; |
| 605 | cups->rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[0] * cups->d_rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right. / 72; |
| 606 | cups->left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left_trim. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[0] * cups->d_left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_left_trim. / 72; |
| 607 | cups->right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right_trim. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[0] * cups->d_right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_right_trim. / 72; |
| 608 | cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width. = cups->widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#width.; |
| 609 | if (cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width. > cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsWidthcxx . . $ cups_page_header2_s#cupsWidth.) |
| 610 | cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsWidthcxx . . $ cups_page_header2_s#cupsWidth.; |
| 611 | |
| 612 | cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom. = cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height. - cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.; |
| 613 | if (cups->shrink_to_fitcxx . . $ $anonymous_type_9fad8097beddd8b9_0#shrink_to_fit. == 1) |
| 614 | cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height. = tmp_bottom - tmp_top; |
| 615 | else |
| 616 | cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height. = cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height. - cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top. - cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom.; |
| 617 | cups->heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#height. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[1] * cups->d_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_height. / 72; |
| 618 | cups->topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#top. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[1] * cups->d_topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top. / 72; |
| 619 | cups->bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#bottom. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[1] * cups->d_bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom. / 72; |
| 620 | cups->top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#top_trim. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[1] * cups->d_top_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_top_trim. / 72; |
| 621 | cups->bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#bottom_trim. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..HWResolutioncxx . . $ cups_page_header2_s#HWResolution.[1] * cups->d_bottom_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#d_bottom_trim. / 72; |
| 622 | cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height. = cups->heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#height.; |
| 623 | if (cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height. > cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.) |
| 624 | cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height. = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.; |
| 625 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 626 | { |
| 627 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: CUPS settings w %d l %d r %d h %d t %d b %d\n", |
| 628 | cups->widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#width., cups->leftcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left., cups->rightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right., |
| 629 | cups->heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#height., cups->topcxx . . $ $anonymous_type_9fad8097beddd8b9_0#top., cups->bottomcxx . . $ $anonymous_type_9fad8097beddd8b9_0#bottom.); |
| 630 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: adjusted w %d h %d\n", |
| 631 | cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width., cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height.); |
| 632 | |
| 633 | } |
| 634 | |
| 635 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 636 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: End initialize page\n"); |
| 637 | return v; |
| 638 | } |
| 639 | |
| 640 | static void |
| 641 | purge_excess_datacxx . . $ purge_excess_data(3c71af23d1686348).(cups_image_tcxx . . $ cups_image_t# *cups) |
| 642 | { |
| 643 | char *buffer = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBytesPerLinecxx . . $ cups_page_header2_s#cupsBytesPerLine.); |
| 644 | if (buffer) |
| 645 | { |
| 646 | if (! suppress_messagescxx . . $ suppress_messages. && ! suppress_verbose_messagescxx . . $ suppress_verbose_messages. ) |
| 647 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG2: Gutenprint: Purging %d row%s\n", |
| 648 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight. - cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row., |
| 649 | ((cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight. - cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row.) == 1 ? "" : "s")); |
| 650 | while (cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. < cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.) |
| 651 | { |
| 652 | cupsRasterReadPixelscxx . . $ cupsRasterReadPixels(9ddae4733e0a3aac).(cups->rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras., (unsigned char *)buffer, |
| 653 | cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBytesPerLinecxx . . $ cups_page_header2_s#cupsBytesPerLine.); |
| 654 | cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. ++; |
| 655 | } |
| 656 | } |
| 657 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(buffer); |
| 658 | } |
| 659 | |
| 660 | static void |
| 661 | set_all_optionscxx . . $ set_all_options(6bf5fd2cd0bd972c).(stp_vars_tcxx . . $ stp_vars_t# *v, cups_option_tcxx . . $ cups_option_t# *options, int num_options, |
| 662 | ppd_file_tcxx . . $ ppd_file_t# *ppd) |
| 663 | { |
| 664 | stp_parameter_list_tcxx . . $ stp_parameter_list_t# params = stp_get_parameter_listcxx . . $ stp_get_parameter_list(817585d40f809196).(v); |
| 665 | int nparams = stp_parameter_list_countcxx . . $ stp_parameter_list_count(2e8e543e1193434e).(params); |
| 666 | int i; |
| 667 | const char *val; /* CUPS option value */ |
| 668 | ppd_option_tcxx . . $ ppd_option_t# *ppd_option; |
| 669 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 670 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set options:\n"); |
| 671 | val = cupsGetOptioncxx . . $ cupsGetOption(f94493ec94b51df4).("StpiShrinkOutput", num_options, options); |
| 672 | if (!val) |
| 673 | { |
| 674 | ppd_option = ppdFindOptioncxx . . $ ppdFindOption(d10a4e0d924a673c).(ppd, "StpiShrinkOutput"); |
| 675 | if (ppd_option) |
| 676 | val = ppd_option->defchoicecxx . . $ ppd_option_s#defchoice.; |
| 677 | } |
| 678 | if (val) |
| 679 | { |
| 680 | if (!strcasecmpcxx . . $ strcasecmp(5ae29d726ae57f88).(val, "crop")) |
| 681 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, "CUPSShrinkPage", 0); |
| 682 | else if (!strcasecmpcxx . . $ strcasecmp(5ae29d726ae57f88).(val, "expand")) |
| 683 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, "CUPSShrinkPage", 2); |
| 684 | else |
| 685 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, "CUPSShrinkPage", 1); |
| 686 | } |
| 687 | else |
| 688 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, "CUPSShrinkPage", 1); |
| 689 | for (i = 0; i < nparams; i++) |
| 690 | { |
| 691 | const stp_parameter_tcxx . . $ stp_parameter_t# *param = stp_parameter_list_paramcxx . . $ stp_parameter_list_param(f24b23997c12c6a6).(params, i); |
| 692 | stp_parameter_tcxx . . $ stp_parameter_t# desc; |
| 693 | char *ppd_option_name = stp_malloccxx . . $ stp_malloc(bfcfa4d6b7f7ef64).(strlencxx . . $ strlen(751346f8406fd082).(param->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.) + 8); /* StpFineFOO\0 */ |
| 694 | |
| 695 | stp_describe_parametercxx . . $ stp_describe_parameter(dfd5b9531b51a6d2).(v, param->namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., &desc); |
| 696 | if (desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type. == STP_PARAMETER_TYPE_DOUBLEcxx . . $ STP_PARAMETER_TYPE_DOUBLE.) |
| 697 | { |
| 698 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(ppd_option_name, "Stp%s", desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 699 | val = cupsGetOptioncxx . . $ cupsGetOption(f94493ec94b51df4).(ppd_option_name, num_options, options); |
| 700 | if (!val) |
| 701 | { |
| 702 | ppd_option = ppdFindOptioncxx . . $ ppdFindOption(d10a4e0d924a673c).(ppd, ppd_option_name); |
| 703 | if (ppd_option) |
| 704 | val = ppd_option->defchoicecxx . . $ ppd_option_s#defchoice.; |
| 705 | } |
| 706 | if (val && !strncasecmpcxx . . $ strncasecmp(fd278af2f295fa2e).(val, "Custom.", 7)) |
| 707 | { |
| 708 | double dval = atofcxx . . $ atof(9a18bdb0e56c1bc2).(val + 7); |
| 709 | |
| 710 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 711 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set float %s to %f\n", |
| 712 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., dval); |
| 713 | if (dval > desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.) |
| 714 | dval = desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.; |
| 715 | stp_set_float_parametercxx . . $ stp_set_float_parameter(bd523a1c1fbe60d3).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., dval); |
| 716 | } |
| 717 | else if (val && strlencxx . . $ strlen(751346f8406fd082).(val) > 0 && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "None") != 0) |
| 718 | { |
| 719 | double fine_val = 0; |
| 720 | if (strchrcxx . . $ strchr(2050848944e00d54).(val, (int) '.')) |
| 721 | { |
| 722 | fine_val = atofcxx . . $ atof(9a18bdb0e56c1bc2).(val); |
| 723 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 724 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set float %s to %f (%s)\n", |
| 725 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., fine_val, val); |
| 726 | } |
| 727 | else |
| 728 | { |
| 729 | double coarse_val = atofcxx . . $ atof(9a18bdb0e56c1bc2).(val) * 0.001; |
| 730 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(ppd_option_name, "StpFine%s", desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 731 | val = cupsGetOptioncxx . . $ cupsGetOption(f94493ec94b51df4).(ppd_option_name, num_options, options); |
| 732 | if (!val) |
| 733 | { |
| 734 | ppd_option = ppdFindOptioncxx . . $ ppdFindOption(d10a4e0d924a673c).(ppd, ppd_option_name); |
| 735 | if (ppd_option) |
| 736 | val = ppd_option->defchoicecxx . . $ ppd_option_s#defchoice.; |
| 737 | } |
| 738 | if (val && strlencxx . . $ strlen(751346f8406fd082).(val) > 0 && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "None") != 0) |
| 739 | fine_val = atofcxx . . $ atof(9a18bdb0e56c1bc2).(val) * 0.001; |
| 740 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 741 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set float %s to %f + %f\n", |
| 742 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., coarse_val, fine_val); |
| 743 | fine_val += coarse_val; |
| 744 | } |
| 745 | if (fine_val > desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.) |
| 746 | fine_val = desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..uppercxx . . $ $anonymous_type_c987533f3b833c82_5#upper.; |
| 747 | if (fine_val < desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..lowercxx . . $ $anonymous_type_c987533f3b833c82_5#lower.) |
| 748 | fine_val = desc.boundscxx . . $ $anonymous_type_c987533f3b833c82_8#bounds..dblcxx . . $ $anonymous_type_c987533f3b833c82_8#$anonymous_type_9#dbl..lowercxx . . $ $anonymous_type_c987533f3b833c82_5#lower.; |
| 749 | stp_set_float_parametercxx . . $ stp_set_float_parameter(bd523a1c1fbe60d3).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., fine_val); |
| 750 | } |
| 751 | } |
| 752 | else |
| 753 | { |
| 754 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(ppd_option_name, "Stp%s", desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 755 | val = cupsGetOptioncxx . . $ cupsGetOption(f94493ec94b51df4).(ppd_option_name, num_options, options); |
| 756 | if (!val) |
| 757 | { |
| 758 | ppd_option = ppdFindOptioncxx . . $ ppdFindOption(d10a4e0d924a673c).(ppd, ppd_option_name); |
| 759 | if (ppd_option) |
| 760 | val = ppd_option->defchoicecxx . . $ ppd_option_s#defchoice.; |
| 761 | } |
| 762 | if (val && ((strlencxx . . $ strlen(751346f8406fd082).(val) > 0 && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(val, "None") != 0) || |
| 763 | (desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type. == STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST.))) |
| 764 | { |
| 765 | stp_curve_tcxx . . $ stp_curve_t# *curve; |
| 766 | stp_raw_tcxx . . $ stp_raw_t# *raw; |
| 767 | switch (desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type.) |
| 768 | { |
| 769 | case STP_PARAMETER_TYPE_STRING_LISTcxx . . $ STP_PARAMETER_TYPE_STRING_LIST.: |
| 770 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 771 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set string %s to %s\n", |
| 772 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val); |
| 773 | set_string_parametercxx . . $ set_string_parameter(7405204ff890c7b8).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val); |
| 774 | break; |
| 775 | case STP_PARAMETER_TYPE_INTcxx . . $ STP_PARAMETER_TYPE_INT.: |
| 776 | if (!strncasecmpcxx . . $ strncasecmp(fd278af2f295fa2e).(val, "Custom.", 7)) |
| 777 | val += 7; |
| 778 | |
| 779 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 780 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set int %s to %s (%d)\n", |
| 781 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val, atoicxx . . $ atoi(5c4306d8553b3696).(val)); |
| 782 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., atoicxx . . $ atoi(5c4306d8553b3696).(val)); |
| 783 | break; |
| 784 | case STP_PARAMETER_TYPE_DIMENSIONcxx . . $ STP_PARAMETER_TYPE_DIMENSION.: |
| 785 | if (!strncasecmpcxx . . $ strncasecmp(fd278af2f295fa2e).(val, "Custom.", 7)) |
| 786 | val += 7; |
| 787 | |
| 788 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 789 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set dimension %s to %s (%d)\n", |
| 790 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val, atoicxx . . $ atoi(5c4306d8553b3696).(val)); |
| 791 | |
| 792 | stp_set_dimension_parametercxx . . $ stp_set_dimension_parameter(bd523a1c1fbe60d3).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., atoicxx . . $ atoi(5c4306d8553b3696).(val)); |
| 793 | break; |
| 794 | case STP_PARAMETER_TYPE_BOOLEANcxx . . $ STP_PARAMETER_TYPE_BOOLEAN.: |
| 795 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 796 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set bool %s to %s (%d)\n", |
| 797 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val, strcasecmpcxx . . $ strcasecmp(5ae29d726ae57f88).(val, "true") == 0 ? 1 : 0); |
| 798 | stp_set_boolean_parametercxx . . $ stp_set_boolean_parameter(8ec0183b6ab8ae2d). |
| 799 | (v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., strcasecmpcxx . . $ strcasecmp(5ae29d726ae57f88).(val, "true") == 0 ? 1 : 0); |
| 800 | break; |
| 801 | case STP_PARAMETER_TYPE_CURVEcxx . . $ STP_PARAMETER_TYPE_CURVE.: |
| 802 | curve = stp_curve_create_from_stringcxx . . $ stp_curve_create_from_string(fc1a54117bc5f637).(val); |
| 803 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 804 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set curve %s to %s\n", |
| 805 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., curve ? val : "(NULL)"); |
| 806 | if (curve) |
| 807 | { |
| 808 | stp_set_curve_parametercxx . . $ stp_set_curve_parameter(434798a77903eb98).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., curve); |
| 809 | stp_curve_destroycxx . . $ stp_curve_destroy(357dc05c3c24eef1).(curve); |
| 810 | } |
| 811 | break; |
| 812 | case STP_PARAMETER_TYPE_RAWcxx . . $ STP_PARAMETER_TYPE_RAW.: /* figure this out later, too */ |
| 813 | raw = stp_xmlstrtorawcxx . . $ stp_xmlstrtoraw(62ebf526a09225cc).(val); |
| 814 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 815 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Set raw %s to %s\n", |
| 816 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., raw ? val : "(NULL)"); |
| 817 | if (raw) |
| 818 | { |
| 819 | stp_set_raw_parametercxx . . $ stp_set_raw_parameter(6253b5f4b2d3feda).(v, desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., raw->datacxx . . $ $anonymous_type_c987533f3b833c82_4#data., raw->bytescxx . . $ $anonymous_type_c987533f3b833c82_4#bytes.); |
| 820 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(cast_safecxx . . $ cast_safe(3343d82129b43479).(raw->datacxx . . $ $anonymous_type_c987533f3b833c82_4#data.)); |
| 821 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(raw); |
| 822 | } |
| 823 | break; |
| 824 | case STP_PARAMETER_TYPE_FILEcxx . . $ STP_PARAMETER_TYPE_FILE.: /* Probably not, security hole */ |
| 825 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 826 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Ignoring option %s %s type %d\n", |
| 827 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val, desc.p_typecxx . . $ $anonymous_type_c987533f3b833c82_8#p_type.); |
| 828 | break; |
| 829 | default: |
| 830 | break; |
| 831 | } |
| 832 | } |
| 833 | else if (val) |
| 834 | { |
| 835 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 836 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Not setting %s to '%s'\n", |
| 837 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name., val); |
| 838 | } |
| 839 | else |
| 840 | { |
| 841 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 842 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Not setting %s to (null)\n", |
| 843 | desc.namecxx . . $ $anonymous_type_c987533f3b833c82_8#name.); |
| 844 | } |
| 845 | } |
| 846 | stp_parameter_description_destroycxx . . $ stp_parameter_description_destroy(6259b4d9050bb586).(&desc); |
| 847 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(ppd_option_name); |
| 848 | } |
| 849 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 850 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: End options\n"); |
| 851 | stp_parameter_list_destroycxx . . $ stp_parameter_list_destroy(5d22bdacc48458e8).(params); |
| 852 | } |
| 853 | |
| 854 | #ifdef ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 855 | static void |
| 856 | save_options(const char *save_name, const stp_vars_t *v) |
| 857 | { |
| 858 | FILE *f_options; |
| 859 | int i; |
| 860 | stp_vars_t *c = stp_vars_create(); |
| 861 | stp_parameter_list_t params = stp_get_parameter_list(v); |
| 862 | stp_parameter_t desc; |
| 863 | stp_mxml_node_t *mxml = NULL; |
| 864 | int param_count; |
| 865 | |
| 866 | if (!params) |
| 867 | { |
| 868 | stp_vars_destroy(c); |
| 869 | return; |
| 870 | } |
| 871 | f_options = fopen(save_name, "w"); |
| 872 | if (!f_options) |
| 873 | { |
| 874 | stp_parameter_list_destroy(params); |
| 875 | stp_vars_destroy(c); |
| 876 | return; |
| 877 | } |
| 878 | param_count = stp_parameter_list_count(params); |
| 879 | stp_set_driver(c, stp_get_driver(v)); |
| 880 | if (!suppress_messages) |
| 881 | fprintf(stderr, "DEBUG: Gutenprint: Saving parameters to %s\n", save_name); |
| 882 | for (i = 0; i < param_count; i++) |
| 883 | { |
| 884 | const stp_parameter_t *lparam = |
| 885 | stp_parameter_list_param(params, i); |
| 886 | stp_describe_parameter(v, lparam->name, &desc); |
| 887 | if (desc.read_only || !strcmp(desc.name, "ChannelBitDepth") || |
| 888 | !stp_parameter_has_category_value(v, &desc, "Color", "Yes")) |
| 889 | { |
| 890 | if (!suppress_messages) |
| 891 | fprintf(stderr, "DEBUG: Gutenprint: skipping non-color %s\n", |
| 892 | desc.name); |
| 893 | stp_parameter_description_destroy(&desc); |
| 894 | continue; |
| 895 | } |
| 896 | switch (desc.p_type) |
| 897 | { |
| 898 | case STP_PARAMETER_TYPE_STRING_LIST: |
| 899 | if (stp_check_string_parameter(v, desc.name, |
| 900 | STP_PARAMETER_DEFAULTED)) |
| 901 | { |
| 902 | if (!suppress_messages) |
| 903 | fprintf(stderr, "DEBUG: Gutenprint: SAVING string %s %s\n", |
| 904 | desc.name, stp_get_string_parameter(v, desc.name)); |
| 905 | stp_set_string_parameter(c, desc.name, |
| 906 | stp_get_string_parameter(v, desc.name)); |
| 907 | } |
| 908 | else if (desc.is_mandatory) |
| 909 | { |
| 910 | if (!suppress_messages) |
| 911 | fprintf(stderr, "DEBUG: Gutenprint: SAVING defaulted string %s %s\n", |
| 912 | desc.name, desc.deflt.str); |
| 913 | stp_set_string_parameter(c, desc.name, desc.deflt.str); |
| 914 | } |
| 915 | else if (!suppress_messages) |
| 916 | fprintf(stderr, "DEBUG: Gutenprint: skipping string %s\n", desc.name); |
| 917 | break; |
| 918 | case STP_PARAMETER_TYPE_RAW: |
| 919 | if (stp_check_raw_parameter(v, desc.name, |
| 920 | STP_PARAMETER_DEFAULTED)) |
| 921 | { |
| 922 | const stp_raw_t *raw = stp_get_raw_parameter(v, desc.name); |
| 923 | if (!suppress_messages) |
| 924 | fprintf(stderr, "DEBUG: Gutenprint: SAVING raw %s\n", desc.name); |
| 925 | stp_set_raw_parameter(c, desc.name, raw->data, raw->bytes); |
| 926 | } |
| 927 | else if (!suppress_messages) |
| 928 | fprintf(stderr, "DEBUG: Gutenprint: skipping raw %s\n", |
| 929 | desc.name); |
| 930 | break; |
| 931 | case STP_PARAMETER_TYPE_BOOLEAN: |
| 932 | if (stp_check_boolean_parameter(v, desc.name, STP_PARAMETER_DEFAULTED)) |
| 933 | { |
| 934 | if (!suppress_messages) |
| 935 | fprintf(stderr, "DEBUG: Gutenprint: SAVING bool %s %d\n", |
| 936 | desc.name, stp_get_boolean_parameter(v, desc.name)); |
| 937 | stp_set_boolean_parameter(c, desc.name, |
| 938 | stp_get_boolean_parameter(v, desc.name)); |
| 939 | } |
| 940 | else if (desc.is_mandatory) |
| 941 | { |
| 942 | if (!suppress_messages) |
| 943 | fprintf(stderr, "DEBUG: Gutenprint: SAVING defaulted bool %s %d\n", |
| 944 | desc.name, desc.deflt.boolean); |
| 945 | stp_set_boolean_parameter(c, desc.name, desc.deflt.boolean); |
| 946 | } |
| 947 | else if (!suppress_messages) |
| 948 | fprintf(stderr, "DEBUG: Gutenprint: skipping bool %s\n", desc.name); |
| 949 | break; |
| 950 | case STP_PARAMETER_TYPE_INT: |
| 951 | if (stp_check_int_parameter(v, desc.name, STP_PARAMETER_DEFAULTED)) |
| 952 | { |
| 953 | if (!suppress_messages) |
| 954 | fprintf(stderr, "DEBUG: Gutenprint: SAVING int %s %d\n", |
| 955 | desc.name, stp_get_int_parameter(v, desc.name)); |
| 956 | stp_set_int_parameter(c, desc.name, stp_get_int_parameter(v, desc.name)); |
| 957 | } |
| 958 | else if (desc.is_mandatory) |
| 959 | { |
| 960 | if (!suppress_messages) |
| 961 | fprintf(stderr, "DEBUG: Gutenprint: SAVING defaulted int %s %d\n", |
| 962 | desc.name, desc.deflt.integer); |
| 963 | stp_set_int_parameter(c, desc.name, desc.deflt.integer); |
| 964 | } |
| 965 | else if (!suppress_messages) |
| 966 | fprintf(stderr, "DEBUG: Gutenprint: skipping int %s\n", desc.name); |
| 967 | break; |
| 968 | case STP_PARAMETER_TYPE_DOUBLE: |
| 969 | if (stp_check_float_parameter(v, desc.name, STP_PARAMETER_DEFAULTED)) |
| 970 | { |
| 971 | if (!suppress_messages) |
| 972 | fprintf(stderr, "DEBUG: Gutenprint: SAVING float %s %f\n", |
| 973 | desc.name, stp_get_float_parameter(v, desc.name)); |
| 974 | stp_set_float_parameter(c, desc.name, |
| 975 | stp_get_float_parameter(v, desc.name)); |
| 976 | } |
| 977 | else if (desc.is_mandatory) |
| 978 | { |
| 979 | if (!suppress_messages) |
| 980 | fprintf(stderr, "DEBUG: Gutenprint: SAVING defaulted float %s %f\n", |
| 981 | desc.name, desc.deflt.dbl); |
| 982 | stp_set_float_parameter(c, desc.name, desc.deflt.dbl); |
| 983 | } |
| 984 | else if (!suppress_messages) |
| 985 | fprintf(stderr, "DEBUG: Gutenprint: skipping float %s\n", desc.name); |
| 986 | break; |
| 987 | case STP_PARAMETER_TYPE_DIMENSION: |
| 988 | if (stp_check_dimension_parameter(v, desc.name, STP_PARAMETER_DEFAULTED)) |
| 989 | { |
| 990 | if (!suppress_messages) |
| 991 | fprintf(stderr, "DEBUG: Gutenprint: SAVING dimension %s %d\n", |
| 992 | desc.name, stp_get_dimension_parameter(v, desc.name)); |
| 993 | stp_set_dimension_parameter(c, desc.name, |
| 994 | stp_get_dimension_parameter(v, desc.name)); |
| 995 | } |
| 996 | else if (desc.is_mandatory) |
| 997 | { |
| 998 | if (!suppress_messages) |
| 999 | fprintf(stderr, "DEBUG: Gutenprint: SAVING defaulted dimension %s %d\n", |
| 1000 | desc.name, desc.deflt.dimension); |
| 1001 | stp_set_dimension_parameter(c, desc.name, desc.deflt.dimension); |
| 1002 | } |
| 1003 | else if (!suppress_messages) |
| 1004 | fprintf(stderr, "DEBUG: Gutenprint: skipping dimension %s\n", desc.name); |
| 1005 | break; |
| 1006 | case STP_PARAMETER_TYPE_CURVE: |
| 1007 | if (stp_check_curve_parameter(v, desc.name, STP_PARAMETER_DEFAULTED)) |
| 1008 | { |
| 1009 | if (!suppress_messages) |
| 1010 | fprintf(stderr, "DEBUG: Gutenprint: SAVING curve %s\n", desc.name); |
| 1011 | stp_set_curve_parameter(c, desc.name, |
| 1012 | stp_get_curve_parameter(v, desc.name)); |
| 1013 | } |
| 1014 | else if (desc.is_mandatory) |
| 1015 | { |
| 1016 | if (!suppress_messages) |
| 1017 | fprintf(stderr, "DEBUG: Gutenprint: SAVING defaulted curve %s\n", desc.name); |
| 1018 | stp_set_curve_parameter(c, desc.name, desc.deflt.curve); |
| 1019 | } |
| 1020 | else if (!suppress_messages) |
| 1021 | fprintf(stderr, "DEBUG: Gutenprint: skipping curve %s\n", |
| 1022 | desc.name); |
| 1023 | break; |
| 1024 | default: |
| 1025 | if (!suppress_messages) |
| 1026 | fprintf(stderr, "DEBUG: Gutenprint: Ignoring unknown type parameter %s (%d)\n", |
| 1027 | desc.name, desc.p_type); |
| 1028 | break; |
| 1029 | } |
| 1030 | stp_parameter_description_destroy(&desc); |
| 1031 | } |
| 1032 | stp_parameter_list_destroy(params); |
| 1033 | mxml = stp_xmltree_create_from_vars(c); |
| 1034 | if (mxml) |
| 1035 | { |
| 1036 | fputs("<?xml version=\"1.0\"?>\n\n", f_options); |
| 1037 | stp_mxmlSaveFile(mxml, f_options, STP_MXML_NO_CALLBACK); |
| 1038 | stp_mxmlDelete(mxml); |
| 1039 | } |
| 1040 | (void) fclose(f_options); |
| 1041 | stp_vars_destroy(c); |
| 1042 | if (!suppress_messages) |
| 1043 | fprintf(stderr, "DEBUG: Gutenprint: Done saving parameters to %s\n", save_name); |
| 1044 | } |
| 1045 | |
| 1046 | static stp_vars_t * |
| 1047 | load_options(const char *load_name) |
| 1048 | { |
| 1049 | FILE *f_options = fopen(load_name, "r"); |
| 1050 | if (f_options) |
| 1051 | { |
| 1052 | stp_vars_t *settings = NULL; |
| 1053 | stp_mxml_node_t *mxml; |
| 1054 | mxml = stp_mxmlLoadFile(NULL, f_options, STP_MXML_NO_CALLBACK); |
| 1055 | if (mxml) |
| 1056 | { |
| 1057 | stp_mxml_node_t *nxml = |
| 1058 | stp_mxmlFindElement(mxml, mxml, "vars", NULL, NULL, |
| 1059 | STP_MXML_DESCEND); |
| 1060 | if (nxml) |
| 1061 | { |
| 1062 | settings = stp_vars_create_from_xmltree_ref(nxml->child, mxml); |
| 1063 | if (! suppress_messages) |
| 1064 | fprintf(stderr, "DEBUG: Gutenprint: loading options from %s\n", |
| 1065 | load_file_name); |
| 1066 | if (! suppress_messages) |
| 1067 | stp_vars_print_error(settings, "DEBUG"); |
| 1068 | } |
| 1069 | } |
| 1070 | else |
| 1071 | fprintf(stderr, "DEBUG: Unable to load options from %s\n", |
| 1072 | load_file_name); |
| 1073 | fclose(f_options); |
| 1074 | return settings; |
| 1075 | } |
| 1076 | return NULL; |
| 1077 | } |
| 1078 | |
| 1079 | #endif /* ENABLE_CUPS_LOAD_SAVE_OPTIONS */ |
| 1080 | |
| 1081 | /* |
| 1082 | * 'main()' - Main entry and processing of driver. |
| 1083 | */ |
| 1084 | |
| 1085 | int /* O - Exit status */ |
| 1086 | maincxx . . $ main(afcd3168fc1188a4).(int argc, /* I - Number of command-line arguments */ |
| 1087 | char *argv[]) /* I - Command-line arguments */ |
| 1088 | { |
| 1089 | int fd; /* File descriptor */ |
| 1090 | cups_image_tcxx . . $ cups_image_t# cups; /* CUPS image */ |
| 1091 | const char *ppdfile; /* PPD environment variable */ |
| 1092 | ppd_file_tcxx . . $ ppd_file_t# *ppd; /* PPD file */ |
| 1093 | ppd_size_tcxx . . $ ppd_size_t# *size; |
| 1094 | const stp_printer_tcxx . . $ stp_printer_t# *printer; /* Printer driver */ |
| 1095 | int num_options; /* Number of CUPS options */ |
| 1096 | cups_option_tcxx . . $ cups_option_t# *options; /* CUPS options */ |
| 1097 | stp_vars_tcxx . . $ stp_vars_t# *v = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1098 | stp_vars_tcxx . . $ stp_vars_t# *default_settings; |
| 1099 | int initialized_job = 0; |
| 1100 | const char *version_id; |
| 1101 | struct tmscxx . . $ tms# tms; |
| 1102 | long clocks_per_sec; |
| 1103 | struct timevalcxx . . $ timeval# t1, t2; |
| 1104 | char *page_size_name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1105 | int aborted = 0; |
| 1106 | #ifdef ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 1107 | stp_vars_t *loaded_settings = NULL; |
| 1108 | #endif /* ENABLE_CUPS_LOAD_SAVE_OPTIONS */ |
| 1109 | |
| 1110 | |
| 1111 | /* |
| 1112 | * Don't buffer error/status messages... |
| 1113 | */ |
| 1114 | |
| 1115 | setbufcxx . . $ setbuf(a7c976899de42135).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1116 | |
| 1117 | if (getenvcxx . . $ getenv(a8b8e32347182212).("STP_SUPPRESS_MESSAGES")) |
| 1118 | suppress_messagescxx . . $ suppress_messages. = 1; |
| 1119 | |
| 1120 | if (getenvcxx . . $ getenv(a8b8e32347182212).("STP_SUPPRESS_VERBOSE_MESSAGES")) |
| 1121 | suppress_verbose_messagescxx . . $ suppress_verbose_messages. = 1; |
| 1122 | |
| 1123 | /* |
| 1124 | * Initialize libgutenprint |
| 1125 | */ |
| 1126 | |
| 1127 | pocxx . . $ po. = stp_i18n_loadcxx . . $ stp_i18n_load(f2f2e30b05a373a0).(getenvcxx . . $ getenv(a8b8e32347182212).("LANG")); |
| 1128 | |
| 1129 | theImagecxx . . $ theImage..repcxx . . $ stp_image#rep. = ∪︀ |
| 1130 | |
| 1131 | (void) gettimeofdaycxx . . $ gettimeofday(ee8865a94200b3d6).(&t1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1132 | stp_set_global_errfunccxx . . $ stp_set_global_errfunc(aab424bde820e7a4).(cups_errfunccxx . . $ cups_errfunc(8e4e5e8cac233c6a).); |
| 1133 | stp_set_global_dbgfunccxx . . $ stp_set_global_dbgfunc(aab424bde820e7a4).(cups_dbgfunccxx . . $ cups_dbgfunc(8e4e5e8cac233c6a).); |
| 1134 | stp_set_global_errdatacxx . . $ stp_set_global_errdata(5d22bdacc48458e8).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 1135 | stp_set_global_dbgdatacxx . . $ stp_set_global_dbgdata(5d22bdacc48458e8).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 1136 | stp_initcxx . . $ stp_init(b126dc7c1de90089).(); |
| 1137 | version_id = stp_get_versioncxx . . $ stp_get_version(33a1f659e94feb42).(); |
| 1138 | default_settings = stp_vars_createcxx . . $ stp_vars_create(ca9164ca858eeb6f).(); |
| 1139 | stp_set_outfunccxx . . $ stp_set_outfunc(d4e9cdcd927ed799).(default_settings, cups_writefunccxx . . $ cups_writefunc(8e4e5e8cac233c6a).); |
| 1140 | stp_set_outdatacxx . . $ stp_set_outdata(da98ca80e19bc349).(default_settings, stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!); |
| 1141 | |
| 1142 | /* |
| 1143 | * Check for valid arguments... |
| 1144 | */ |
| 1145 | if (argc < 6 || argc > 7) |
| 1146 | { |
| 1147 | /* |
| 1148 | * We don't have the correct number of arguments; write an error message |
| 1149 | * and return. |
| 1150 | */ |
| 1151 | |
| 1152 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("Usage: rastertoprinter job-id user title copies " |
| 1153 | "options [file]\n")); |
| 1154 | return (1); |
| 1155 | } |
| 1156 | |
| 1157 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1158 | { |
| 1159 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ============================================================\n"); |
| 1160 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n"); |
| 1161 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: %s Starting\n", version_id); |
| 1162 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: command line: %s '%s' '%s' '%s' '%s' %s%s%s%s\n", |
| 1163 | argv[0], argv[1], argv[2], argv[3], argv[4], "<args>", |
| 1164 | argc >= 7 ? " '" : "", |
| 1165 | argc >= 7 ? argv[6] : "", |
| 1166 | argc >= 7 ? "'" : ""); |
| 1167 | } |
| 1168 | |
| 1169 | /* |
| 1170 | * Get the PPD file... |
| 1171 | */ |
| 1172 | |
| 1173 | if ((ppdfile = getenvcxx . . $ getenv(a8b8e32347182212).("PPD")) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1174 | { |
| 1175 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: No PPD file, unable to continue!\n")); |
| 1176 | return (1); |
| 1177 | } |
| 1178 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1179 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: using PPD file %s\n", ppdfile); |
| 1180 | |
| 1181 | if ((ppd = ppdOpenFilecxx . . $ ppdOpenFile(552a65b81d3f6a06).(ppdfile)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1182 | { |
| 1183 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint was unable to load PPD file " |
| 1184 | "\"%s\"!\n"), ppdfile); |
| 1185 | return (1); |
| 1186 | } |
| 1187 | |
| 1188 | if (ppd->modelnamecxx . . $ ppd_file_s#modelname. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1189 | { |
| 1190 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint did not find a ModelName " |
| 1191 | "attribute in PPD file \"%s\"!\n"), ppdfile); |
| 1192 | ppdClosecxx . . $ ppdClose(85fea6107b9319a3).(ppd); |
| 1193 | return (1); |
| 1194 | } |
| 1195 | |
| 1196 | if (ppd->nicknamecxx . . $ ppd_file_s#nickname. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1197 | { |
| 1198 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint did not find a NickName attribute " |
| 1199 | "in PPD file \"%s\"!\n"), ppdfile); |
| 1200 | ppdClosecxx . . $ ppdClose(85fea6107b9319a3).(ppd); |
| 1201 | return (1); |
| 1202 | } |
| 1203 | else if (strlencxx . . $ strlen(751346f8406fd082).(ppd->nicknamecxx . . $ ppd_file_s#nickname.) < |
| 1204 | strlencxx . . $ strlen(751346f8406fd082).(ppd->modelnamecxx . . $ ppd_file_s#modelname.) + strlencxx . . $ strlen(751346f8406fd082).(CUPS_PPD_NICKNAME_STRINGcxx . . $ `config.h:11:9`!) + 3) |
| 1205 | { |
| 1206 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint found a corrupted NickName " |
| 1207 | "attribute in PPD file \"%s\"!\n"), ppdfile); |
| 1208 | ppdClosecxx . . $ ppdClose(85fea6107b9319a3).(ppd); |
| 1209 | return (1); |
| 1210 | } |
| 1211 | else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(ppd->nicknamecxx . . $ ppd_file_s#nickname. + strlencxx . . $ strlen(751346f8406fd082).(ppd->modelnamecxx . . $ ppd_file_s#modelname.) + |
| 1212 | strlencxx . . $ strlen(751346f8406fd082).(CUPS_PPD_NICKNAME_STRINGcxx . . $ `config.h:11:9`!), version_id) != 0 && |
| 1213 | (strlencxx . . $ strlen(751346f8406fd082).(ppd->nicknamecxx . . $ ppd_file_s#nickname. + strlencxx . . $ strlen(751346f8406fd082).(ppd->modelnamecxx . . $ ppd_file_s#modelname.) + |
| 1214 | strlencxx . . $ strlen(751346f8406fd082).(CUPS_PPD_NICKNAME_STRINGcxx . . $ `config.h:11:9`!)) < strlencxx . . $ strlen(751346f8406fd082).(version_id) || |
| 1215 | !((strncmpcxx . . $ strncmp(fd278af2f295fa2e).(ppd->nicknamecxx . . $ ppd_file_s#nickname. + strlencxx . . $ strlen(751346f8406fd082).(ppd->modelnamecxx . . $ ppd_file_s#modelname.) + |
| 1216 | strlencxx . . $ strlen(751346f8406fd082).(CUPS_PPD_NICKNAME_STRINGcxx . . $ `config.h:11:9`!), version_id, |
| 1217 | strlencxx . . $ strlen(751346f8406fd082).(version_id)) == 0) && |
| 1218 | *(ppd->nicknamecxx . . $ ppd_file_s#nickname. + strlencxx . . $ strlen(751346f8406fd082).(ppd->modelnamecxx . . $ ppd_file_s#modelname.) + |
| 1219 | strlencxx . . $ strlen(751346f8406fd082).(CUPS_PPD_NICKNAME_STRINGcxx . . $ `config.h:11:9`!)) != ' '))) |
| 1220 | { |
| 1221 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: The PPD version (%s) is not compatible with " |
| 1222 | "Gutenprint %s. Please run `%scups-genppdupdate' as administrator.\n"), |
| 1223 | ppd->nicknamecxx . . $ ppd_file_s#nickname.+strlencxx . . $ strlen(751346f8406fd082).(ppd->modelnamecxx . . $ ppd_file_s#modelname.)+strlencxx . . $ strlen(751346f8406fd082).(CUPS_PPD_NICKNAME_STRINGcxx . . $ `config.h:11:9`!), |
| 1224 | version_id, SBINDIRcxx . . $ `<built-in>:413:9`!); |
| 1225 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: If you have upgraded your version of Gutenprint\n"); |
| 1226 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: recently, you must reinstall all printer queues.\n"); |
| 1227 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: If the previous installed version of Gutenprint\n"); |
| 1228 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: was 5.0.0 or higher, you can use the `cups-genppdupdate'\n"); |
| 1229 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: program to do this; if the previous installed version\n"); |
| 1230 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: was older, you can use the Modify Printer command via\n"); |
| 1231 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: the CUPS web interface: http://localhost:631/printers.\n"); |
| 1232 | ppdClosecxx . . $ ppdClose(85fea6107b9319a3).(ppd); |
| 1233 | return 1; |
| 1234 | } |
| 1235 | |
| 1236 | /* |
| 1237 | * Get the STP options, if any... |
| 1238 | */ |
| 1239 | |
| 1240 | num_options = cupsParseOptionscxx . . $ cupsParseOptions(8ce04f6acf44e960).(argv[5], 0, &options); |
| 1241 | ppdMarkDefaultscxx . . $ ppdMarkDefaults(85fea6107b9319a3).(ppd); |
| 1242 | cupsMarkOptionscxx . . $ cupsMarkOptions(a867e2a16ab0909).(ppd, num_options, options); |
| 1243 | size = ppdPageSizecxx . . $ ppdPageSize(7c3790419cafdc57).(ppd, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1244 | |
| 1245 | if (size) |
| 1246 | page_size_name = stp_strdupcxx . . $ stp_strdup(a8b8e32347182212).(size->namecxx . . $ ppd_size_s#name.); |
| 1247 | |
| 1248 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1249 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: CUPS option count is %d (%d bytes)\n", |
| 1250 | num_options, (int)strlencxx . . $ strlen(751346f8406fd082).(argv[5])); |
| 1251 | |
| 1252 | if (num_options > 0) |
| 1253 | { |
| 1254 | int i; |
| 1255 | for (i = 0; i < num_options; i++) |
| 1256 | { |
| 1257 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1258 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: CUPS option %d %s = %s\n", |
| 1259 | i, options[i].namecxx . . $ cups_option_s#name., options[i].valuecxx . . $ cups_option_s#value.); |
| 1260 | #ifdef ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 1261 | if (!strcmp(options[i].name, "SaveFileName")) |
| 1262 | save_file_name = options[i].value; |
| 1263 | if (!strcmp(options[i].name, "LoadFileName")) |
| 1264 | load_file_name = options[i].value; |
| 1265 | #endif /* ENABLE_CUPS_LOAD_SAVE_OPTIONS */ |
| 1266 | } |
| 1267 | } |
| 1268 | |
| 1269 | /* |
| 1270 | * Figure out which driver to use... |
| 1271 | */ |
| 1272 | |
| 1273 | printer = stp_get_printer_by_drivercxx . . $ stp_get_printer_by_driver(5594043bc706389b).(ppd->modelnamecxx . . $ ppd_file_s#modelname.); |
| 1274 | if (!printer) |
| 1275 | printer = stp_get_printer_by_long_namecxx . . $ stp_get_printer_by_long_name(5594043bc706389b).(ppd->modelnamecxx . . $ ppd_file_s#modelname.); |
| 1276 | |
| 1277 | if (printer == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1278 | { |
| 1279 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Unable to find Gutenprint driver named " |
| 1280 | "\"%s\"!\n"), ppd->modelnamecxx . . $ ppd_file_s#modelname.); |
| 1281 | ppdClosecxx . . $ ppdClose(85fea6107b9319a3).(ppd); |
| 1282 | return (1); |
| 1283 | } |
| 1284 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1285 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Driver %s\n", ppd->modelnamecxx . . $ ppd_file_s#modelname.); |
| 1286 | |
| 1287 | /* |
| 1288 | * Open the page stream... |
| 1289 | */ |
| 1290 | |
| 1291 | if (argc == 7) |
| 1292 | { |
| 1293 | if ((fd = opencxx . . $ open(e156e3aa1e5c4ad1).(argv[6], O_RDONLYcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:43:9`!)) == -1) |
| 1294 | { |
| 1295 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint was unable to open raster file " |
| 1296 | "\"%s\" - %s"), argv[6], strerrorcxx . . $ strerror(ff224f080444ee45).(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 1297 | sleepcxx . . $ sleep(2141b656ce2cc063).(1); |
| 1298 | return (1); |
| 1299 | } |
| 1300 | } |
| 1301 | else |
| 1302 | fd = 0; |
| 1303 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1304 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Using fd %d\n", fd); |
| 1305 | |
| 1306 | stp_set_printer_defaultscxx . . $ stp_set_printer_defaults(34fc32b65e92740).(default_settings, printer); |
| 1307 | #ifdef ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 1308 | if (load_file_name) |
| 1309 | loaded_settings = load_options(load_file_name); |
| 1310 | #endif /* ENABLE_CUPS_LOAD_SAVE_OPTIONS */ |
| 1311 | stp_set_float_parametercxx . . $ stp_set_float_parameter(bd523a1c1fbe60d3).(default_settings, "AppGamma", 1.0); |
| 1312 | set_all_optionscxx . . $ set_all_options(6bf5fd2cd0bd972c).(default_settings, options, num_options, ppd); |
| 1313 | |
| 1314 | cupsFreeOptionscxx . . $ cupsFreeOptions(99c8671c3a6aa563).(num_options, options); |
| 1315 | ppdClosecxx . . $ ppdClose(85fea6107b9319a3).(ppd); |
| 1316 | |
| 1317 | cups.rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras. = cupsRasterOpencxx . . $ cupsRasterOpen(fba8898a2703f00f).(fd, CUPS_RASTER_READcxx . . $ CUPS_RASTER_READ.); |
| 1318 | |
| 1319 | /* |
| 1320 | * Process pages as needed... |
| 1321 | */ |
| 1322 | |
| 1323 | cups.pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. = 0; |
| 1324 | |
| 1325 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1326 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: About to start printing loop.\n"); |
| 1327 | |
| 1328 | /* |
| 1329 | * Read the first page header, which we need in order to set up |
| 1330 | * the page. |
| 1331 | */ |
| 1332 | signalcxx . . $ signal(c2d516773f91faf8).(SIGTERMcxx . . $ `<external>/11773118241360591791/signum-generic.h:53:9`!, cancel_jobcxx . . $ cancel_job(d4f767463ce0a6b3).); |
| 1333 | while (CUPS_READ_HEADERcxx . . $ `src/cups/rastertogutenprint.c:76:9`!(cups.rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras., &cups.headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header.)) |
| 1334 | { |
| 1335 | /* |
| 1336 | * We don't know how many pages we're going to print, and |
| 1337 | * we need to call stp_end_job at the completion of the job. |
| 1338 | * Therefore, we need to keep v in scope after the termination |
| 1339 | * of the loop to permit calling stp_end_job then. Therefore, |
| 1340 | * we have to free the previous page's stp_vars_t at the start |
| 1341 | * of the loop. |
| 1342 | */ |
| 1343 | if (v) |
| 1344 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(v); |
| 1345 | |
| 1346 | /* |
| 1347 | * Setup printer driver variables... |
| 1348 | */ |
| 1349 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1350 | { |
| 1351 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ================ Printing page %d ================\n", cups.pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. + 1); |
| 1352 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "PAGE: %d %d\n", cups.pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. + 1, cups.headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..NumCopiescxx . . $ cups_page_header2_s#NumCopies.); |
| 1353 | } |
| 1354 | v = initialize_pagecxx . . $ initialize_page(abb082e9fd205acd).(&cups, default_settings, page_size_name); |
| 1355 | #ifdef ENABLE_CUPS_LOAD_SAVE_OPTIONS |
| 1356 | if (loaded_settings) |
| 1357 | stp_copy_vars_from(v, loaded_settings); |
| 1358 | if (save_file_name) |
| 1359 | { |
| 1360 | save_options(save_file_name, v); |
| 1361 | save_file_name = NULL; |
| 1362 | } |
| 1363 | #endif /* ENABLE_CUPS_LOAD_SAVE_OPTIONS */ |
| 1364 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1365 | { |
| 1366 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Interim page settings:\n"); |
| 1367 | stp_vars_print_errorcxx . . $ stp_vars_print_error(6fd78d57b3b855ce).(v, "DEBUG"); |
| 1368 | } |
| 1369 | |
| 1370 | stp_merge_printvarscxx . . $ stp_merge_printvars(352fcd689be2d739).(v, stp_printer_get_defaultscxx . . $ stp_printer_get_defaults(961f21647a798a4c).(printer)); |
| 1371 | |
| 1372 | /* Pass along Collation settings */ |
| 1373 | stp_set_boolean_parametercxx . . $ stp_set_boolean_parameter(8ec0183b6ab8ae2d).(v, "Collate", cups.headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..Collatecxx . . $ cups_page_header2_s#Collate.); |
| 1374 | stp_set_boolean_parameter_activecxx . . $ stp_set_boolean_parameter_active(9e15dbe4857cde8c).(v, "Collate", STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.); |
| 1375 | /* Pass along Copy settings */ |
| 1376 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, "NumCopies", cups.headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..NumCopiescxx . . $ cups_page_header2_s#NumCopies.); |
| 1377 | stp_set_int_parameter_activecxx . . $ stp_set_int_parameter_active(9e15dbe4857cde8c).(v, "NumCopies", STP_PARAMETER_ACTIVEcxx . . $ STP_PARAMETER_ACTIVE.); |
| 1378 | /* Pass along the page number */ |
| 1379 | stp_set_int_parametercxx . . $ stp_set_int_parameter(8ec0183b6ab8ae2d).(v, "PageNumber", cups.pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page.); |
| 1380 | cups.rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. = 0; |
| 1381 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1382 | print_debug_blockcxx . . $ print_debug_block(d533188743335c78).(v, &cups); |
| 1383 | print_messages_as_errorscxx . . $ print_messages_as_errors. = 1; |
| 1384 | |
| 1385 | if (!initialized_job) |
| 1386 | { |
| 1387 | stp_start_jobcxx . . $ stp_start_job(be5d09c432b01f95).(v, &theImagecxx . . $ theImage.); |
| 1388 | initialized_job = 1; |
| 1389 | } |
| 1390 | |
| 1391 | if (!stp_printcxx . . $ stp_print(be5d09c432b01f95).(v, &theImagecxx . . $ theImage.)) |
| 1392 | { |
| 1393 | if (Image_statuscxx . . $ Image_status. != STP_IMAGE_STATUS_ABORTcxx . . $ STP_IMAGE_STATUS_ABORT.) |
| 1394 | { |
| 1395 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Options failed to verify.\n"); |
| 1396 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Make sure that you are using ESP Ghostscript rather\n"); |
| 1397 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: than GNU or AFPL Ghostscript with CUPS.\n"); |
| 1398 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: If this is not the cause, set LogLevel to debug to identify the problem.\n"); |
| 1399 | } |
| 1400 | aborted = 1; |
| 1401 | break; |
| 1402 | } |
| 1403 | print_messages_as_errorscxx . . $ print_messages_as_errors. = 0; |
| 1404 | |
| 1405 | fflushcxx . . $ fflush(89bc1efcdac0ca22).(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!); |
| 1406 | |
| 1407 | /* |
| 1408 | * Purge any remaining bitmap data... |
| 1409 | */ |
| 1410 | if (cups.rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. < cups.headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.) |
| 1411 | purge_excess_datacxx . . $ purge_excess_data(3c71af23d1686348).(&cups); |
| 1412 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1413 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ================ Done printing page %d ================\n", cups.pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. + 1); |
| 1414 | cups.pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. ++; |
| 1415 | } |
| 1416 | if (v) |
| 1417 | { |
| 1418 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1419 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: %s job\n", |
| 1420 | aborted ? "Aborted" : "Ending"); |
| 1421 | stp_end_jobcxx . . $ stp_end_job(be5d09c432b01f95).(v, &theImagecxx . . $ theImage.); |
| 1422 | fflushcxx . . $ fflush(89bc1efcdac0ca22).(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!); |
| 1423 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(v); |
| 1424 | } |
| 1425 | cupsRasterClosecxx . . $ cupsRasterClose(d86514c19ad58cf4).(cups.rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras.); |
| 1426 | (void) timescxx . . $ times(b7784555a095e99d).(&tms); |
| 1427 | (void) gettimeofdaycxx . . $ gettimeofday(ee8865a94200b3d6).(&t2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1428 | clocks_per_sec = sysconfcxx . . $ sysconf(dc1f09c09fbff20f).(_SC_CLK_TCKcxx . . $ `<external>/6393649343499073842/confname.h:78:9`!); |
| 1429 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: stats %.0fB, %.3fu, %.3fs, %.3fel\n", |
| 1430 | total_bytes_printedcxx . . $ total_bytes_printed., |
| 1431 | (double) tms.tms_utimecxx . . $ tms#tms_utime. / clocks_per_sec, |
| 1432 | (double) tms.tms_stimecxx . . $ tms#tms_stime. / clocks_per_sec, |
| 1433 | (double) (t2.tv_seccxx . . $ timeval#tv_sec. - t1.tv_seccxx . . $ timeval#tv_sec.) + |
| 1434 | ((double) (t2.tv_useccxx . . $ timeval#tv_usec. - t1.tv_useccxx . . $ timeval#tv_usec.)) / 1000000.0); |
| 1435 | if (!suppress_messagescxx . . $ suppress_messages.) |
| 1436 | { |
| 1437 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"); |
| 1438 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: ============================================================\n"); |
| 1439 | } |
| 1440 | stp_vars_destroycxx . . $ stp_vars_destroy(1a97b8462f9f913c).(default_settings); |
| 1441 | if (page_size_name) |
| 1442 | stp_freecxx . . $ stp_free(5d22bdacc48458e8).(page_size_name); |
| 1443 | if (fd != 0) |
| 1444 | closecxx . . $ close(7864480464b09eea).(fd); |
| 1445 | return aborted ? 1 : 0; |
| 1446 | } |
| 1447 | |
| 1448 | |
| 1449 | /* |
| 1450 | * 'cups_writefunc()' - Write data to a file... |
| 1451 | */ |
| 1452 | |
| 1453 | static void |
| 1454 | cups_writefunccxx . . $ cups_writefunc(8e4e5e8cac233c6a).(void *file, const char *buf, size_t bytes) |
| 1455 | { |
| 1456 | FILEcxx . . $ FILE# *prn = (FILEcxx . . $ FILE# *)file; |
| 1457 | total_bytes_printedcxx . . $ total_bytes_printed. += bytes; |
| 1458 | fwritecxx . . $ fwrite(ab0609fa07c47d6e).(buf, 1, bytes, prn); |
| 1459 | } |
| 1460 | |
| 1461 | static void |
| 1462 | cups_errfunccxx . . $ cups_errfunc(8e4e5e8cac233c6a).(void *file, const char *buf, size_t bytes) |
| 1463 | { |
| 1464 | size_t next_nl = 0; |
| 1465 | size_t where = 0; |
| 1466 | FILEcxx . . $ FILE# *prn = (FILEcxx . . $ FILE# *)file; |
| 1467 | while (where < bytes) |
| 1468 | { |
| 1469 | if (bytes - where > 6 && strncmpcxx . . $ strncmp(fd278af2f295fa2e).(buf, "ERROR:", 6) == 0) |
| 1470 | { |
| 1471 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("ERROR: Gutenprint:", prn); |
| 1472 | buf += 6; |
| 1473 | } |
| 1474 | else if (print_messages_as_errorscxx . . $ print_messages_as_errors.) |
| 1475 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("ERROR: Gutenprint: ", prn); |
| 1476 | else if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).(buf, "DEBUG", 5) != 0) |
| 1477 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("DEBUG: Gutenprint: ", prn); |
| 1478 | while (next_nl < bytes) |
| 1479 | { |
| 1480 | if (buf[next_nl++] == '\n') |
| 1481 | break; |
| 1482 | } |
| 1483 | fwritecxx . . $ fwrite(ab0609fa07c47d6e).(buf + where, 1, next_nl - where, prn); |
| 1484 | where = next_nl; |
| 1485 | } |
| 1486 | } |
| 1487 | |
| 1488 | static void |
| 1489 | cups_dbgfunccxx . . $ cups_dbgfunc(8e4e5e8cac233c6a).(void *file, const char *buf, size_t bytes) |
| 1490 | { |
| 1491 | size_t next_nl = 0; |
| 1492 | size_t where = 0; |
| 1493 | FILEcxx . . $ FILE# *prn = (FILEcxx . . $ FILE# *)file; |
| 1494 | while (where < bytes) |
| 1495 | { |
| 1496 | if (bytes - where > 6 && strncmpcxx . . $ strncmp(fd278af2f295fa2e).(buf, "ERROR:", 6) == 0) |
| 1497 | { |
| 1498 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("ERROR: Gutenprint:", prn); |
| 1499 | buf += 6; |
| 1500 | } |
| 1501 | else if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).(buf, "DEBUG", 5) != 0) |
| 1502 | fputscxx . . $ fputs(874fa6a5e59ab9bd).("DEBUG: Gutenprint: ", prn); |
| 1503 | while (next_nl < bytes) |
| 1504 | { |
| 1505 | if (buf[next_nl++] == '\n') |
| 1506 | break; |
| 1507 | } |
| 1508 | fwritecxx . . $ fwrite(ab0609fa07c47d6e).(buf + where, 1, next_nl - where, prn); |
| 1509 | where = next_nl; |
| 1510 | } |
| 1511 | } |
| 1512 | |
| 1513 | |
| 1514 | /* |
| 1515 | * 'cancel_job()' - Cancel the current job... |
| 1516 | */ |
| 1517 | |
| 1518 | static void |
| 1519 | cancel_jobcxx . . $ cancel_job(d4f767463ce0a6b3).(int sig) /* I - Signal */ |
| 1520 | { |
| 1521 | (void)sig; |
| 1522 | Image_statuscxx . . $ Image_status. = STP_IMAGE_STATUS_ABORTcxx . . $ STP_IMAGE_STATUS_ABORT.; |
| 1523 | } |
| 1524 | |
| 1525 | /* |
| 1526 | * 'Image_get_appname()' - Get the application we are running. |
| 1527 | */ |
| 1528 | |
| 1529 | static const char * /* O - Application name */ |
| 1530 | Image_get_appnamecxx . . $ Image_get_appname(97b8a1c82bcbc822).(stp_image_tcxx . . $ stp_image_t# *image) /* I - Image */ |
| 1531 | { |
| 1532 | (void)image; |
| 1533 | |
| 1534 | return ("CUPS driver based on Gutenprint"); |
| 1535 | } |
| 1536 | |
| 1537 | |
| 1538 | /* |
| 1539 | * 'Image_get_row()' - Get one row of the image. |
| 1540 | */ |
| 1541 | |
| 1542 | static void |
| 1543 | throwaway_datacxx . . $ throwaway_data(b7caca76d4597091).(int amount, cups_image_tcxx . . $ cups_image_t# *cups) |
| 1544 | { |
| 1545 | unsigned char trash[4096]; /* Throwaway */ |
| 1546 | int block_count = amount / 4096; |
| 1547 | int leftover = amount % 4096; |
| 1548 | while (block_count > 0) |
| 1549 | { |
| 1550 | cupsRasterReadPixelscxx . . $ cupsRasterReadPixels(9ddae4733e0a3aac).(cups->rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras., trash, 4096); |
| 1551 | block_count--; |
| 1552 | } |
| 1553 | if (leftover) |
| 1554 | cupsRasterReadPixelscxx . . $ cupsRasterReadPixels(9ddae4733e0a3aac).(cups->rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras., trash, leftover); |
| 1555 | } |
| 1556 | |
| 1557 | static stp_image_status_tcxx . . $ stp_image_status_t# |
| 1558 | Image_get_rowcxx . . $ Image_get_row(c6bbe34ec0bddcf0).(stp_image_tcxx . . $ stp_image_t# *image, /* I - Image */ |
| 1559 | unsigned char *data, /* O - Row */ |
| 1560 | size_t byte_limit, /* I - how many bytes in data */ |
| 1561 | int row) /* I - Row number */ |
| 1562 | { |
| 1563 | cups_image_tcxx . . $ cups_image_t# *cups; /* CUPS image */ |
| 1564 | int i; /* Looping var */ |
| 1565 | int bytes_per_line; |
| 1566 | int margin; |
| 1567 | stp_image_status_tcxx . . $ stp_image_status_t# tmp_image_status = Image_statuscxx . . $ Image_status.; |
| 1568 | unsigned char *orig = data; /* Temporary pointer */ |
| 1569 | static int warned = 0; /* Error warning printed? */ |
| 1570 | int new_percent; |
| 1571 | int left_margin, right_margin; |
| 1572 | (void)byte_limit; |
| 1573 | |
| 1574 | if ((cups = (cups_image_tcxx . . $ cups_image_t# *)(image->repcxx . . $ stp_image#rep.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1575 | { |
| 1576 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint image is not initialized! " |
| 1577 | "Please report this bug to " |
| 1578 | "[email protected]\n")); |
| 1579 | return STP_IMAGE_STATUS_ABORTcxx . . $ STP_IMAGE_STATUS_ABORT.; |
| 1580 | } |
| 1581 | bytes_per_line = |
| 1582 | ((cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width. * cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerPixelcxx . . $ cups_page_header2_s#cupsBitsPerPixel.) + CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`! - 1) / |
| 1583 | CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`!; |
| 1584 | |
| 1585 | left_margin = ((cups->left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left_trim. * cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerPixelcxx . . $ cups_page_header2_s#cupsBitsPerPixel.) + CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`! - 1) / |
| 1586 | CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`!; |
| 1587 | right_margin = ((cups->right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right_trim. * cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerPixelcxx . . $ cups_page_header2_s#cupsBitsPerPixel.) + CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`! - 1) / |
| 1588 | CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`!; |
| 1589 | margin = cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBytesPerLinecxx . . $ cups_page_header2_s#cupsBytesPerLine. - left_margin - bytes_per_line - |
| 1590 | right_margin; |
| 1591 | |
| 1592 | if (cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. < cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.) |
| 1593 | { |
| 1594 | if (! suppress_messagescxx . . $ suppress_messages. && ! suppress_verbose_messagescxx . . $ suppress_verbose_messages.) |
| 1595 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG2: Gutenprint: Reading %d %d\n", |
| 1596 | bytes_per_line, cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row.); |
| 1597 | while (cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. <= (unsigned int)row && cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. < cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.) |
| 1598 | { |
| 1599 | if (left_margin > 0) |
| 1600 | { |
| 1601 | if (! suppress_messagescxx . . $ suppress_messages. && ! suppress_verbose_messagescxx . . $ suppress_verbose_messages.) |
| 1602 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG2: Gutenprint: Tossing left %d (%d)\n", |
| 1603 | left_margin, cups->left_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#left_trim.); |
| 1604 | throwaway_datacxx . . $ throwaway_data(b7caca76d4597091).(left_margin, cups); |
| 1605 | } |
| 1606 | cupsRasterReadPixelscxx . . $ cupsRasterReadPixels(9ddae4733e0a3aac).(cups->rascxx . . $ $anonymous_type_9fad8097beddd8b9_0#ras., data, bytes_per_line); |
| 1607 | cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. ++; |
| 1608 | if (margin + right_margin > 0) |
| 1609 | { |
| 1610 | if (! suppress_messagescxx . . $ suppress_messages. && ! suppress_verbose_messagescxx . . $ suppress_verbose_messages.) |
| 1611 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG2: Gutenprint: Tossing right %d (%d) + %d\n", |
| 1612 | right_margin, cups->right_trimcxx . . $ $anonymous_type_9fad8097beddd8b9_0#right_trim., margin); |
| 1613 | throwaway_datacxx . . $ throwaway_data(b7caca76d4597091).(margin + right_margin, cups); |
| 1614 | } |
| 1615 | } |
| 1616 | } |
| 1617 | else |
| 1618 | { |
| 1619 | switch (cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsColorSpacecxx . . $ cups_page_header2_s#cupsColorSpace.) |
| 1620 | { |
| 1621 | case CUPS_CSPACE_Kcxx . . $ CUPS_CSPACE_K.: |
| 1622 | case CUPS_CSPACE_CMYKcxx . . $ CUPS_CSPACE_CMYK.: |
| 1623 | case CUPS_CSPACE_KCMYcxx . . $ CUPS_CSPACE_KCMY.: |
| 1624 | case CUPS_CSPACE_CMYcxx . . $ CUPS_CSPACE_CMY.: |
| 1625 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(data, 0, bytes_per_line); |
| 1626 | break; |
| 1627 | case CUPS_CSPACE_RGBcxx . . $ CUPS_CSPACE_RGB.: |
| 1628 | case CUPS_CSPACE_Wcxx . . $ CUPS_CSPACE_W.: |
| 1629 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(data, ((1 << CHAR_BITcxx . . $ `<external>/67164224788392828/limits.h:64:9`!) - 1), bytes_per_line); |
| 1630 | break; |
| 1631 | default: |
| 1632 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("ERROR: Gutenprint detected a bad colorspace " |
| 1633 | "(%d)!\n"), cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsColorSpacecxx . . $ cups_page_header2_s#cupsColorSpace.); |
| 1634 | return STP_IMAGE_STATUS_ABORTcxx . . $ STP_IMAGE_STATUS_ABORT.; |
| 1635 | } |
| 1636 | } |
| 1637 | |
| 1638 | /* |
| 1639 | * This exists to print non-ADSC input which has messed up the job |
| 1640 | * input, such as that generated by psnup. The output is barely |
| 1641 | * legible, but it's better than the garbage output otherwise. |
| 1642 | */ |
| 1643 | data = orig; |
| 1644 | if (cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsBitsPerPixelcxx . . $ cups_page_header2_s#cupsBitsPerPixel. == 1) |
| 1645 | { |
| 1646 | if (warned == 0) |
| 1647 | { |
| 1648 | fputscxx . . $ fputs(874fa6a5e59ab9bd).(_cxx . . $ `src/cups/i18n.h:28:9`!("WARNING: Gutenprint detected a bad color depth (1). " |
| 1649 | "Output quality is degraded. Are you using psnup or " |
| 1650 | "non-ADSC PostScript?\n"), stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 1651 | warned = 1; |
| 1652 | } |
| 1653 | for (i = cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width. - 1; i >= 0; i--) |
| 1654 | { |
| 1655 | if ( (data[i/8] >> (7 - i%8)) &0x1) |
| 1656 | data[i]=255; |
| 1657 | else |
| 1658 | data[i]=0; |
| 1659 | } |
| 1660 | } |
| 1661 | |
| 1662 | new_percent = (int) (100.0 * cups->rowcxx . . $ $anonymous_type_9fad8097beddd8b9_0#row. / cups->headercxx . . $ $anonymous_type_9fad8097beddd8b9_0#header..cupsHeightcxx . . $ cups_page_header2_s#cupsHeight.); |
| 1663 | if (new_percent > cups->last_percentcxx . . $ $anonymous_type_9fad8097beddd8b9_0#last_percent.) |
| 1664 | { |
| 1665 | if (! suppress_verbose_messagescxx . . $ suppress_verbose_messages.) |
| 1666 | { |
| 1667 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("INFO: Printing page %d, %d%%\n"), |
| 1668 | cups->pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. + 1, new_percent); |
| 1669 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "ATTR: job-media-progress=%d\n", new_percent); |
| 1670 | } |
| 1671 | cups->last_percentcxx . . $ $anonymous_type_9fad8097beddd8b9_0#last_percent. = new_percent; |
| 1672 | } |
| 1673 | |
| 1674 | if (tmp_image_status != STP_IMAGE_STATUS_OKcxx . . $ STP_IMAGE_STATUS_OK.) |
| 1675 | { |
| 1676 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1677 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Image status %d\n", tmp_image_status); |
| 1678 | } |
| 1679 | return tmp_image_status; |
| 1680 | } |
| 1681 | |
| 1682 | |
| 1683 | /* |
| 1684 | * 'Image_height()' - Return the height of an image. |
| 1685 | */ |
| 1686 | |
| 1687 | static int /* O - Height in pixels */ |
| 1688 | Image_heightcxx . . $ Image_height(ba31fd85910919f2).(stp_image_tcxx . . $ stp_image_t# *image) /* I - Image */ |
| 1689 | { |
| 1690 | cups_image_tcxx . . $ cups_image_t# *cups; /* CUPS image */ |
| 1691 | |
| 1692 | |
| 1693 | if ((cups = (cups_image_tcxx . . $ cups_image_t# *)(image->repcxx . . $ stp_image#rep.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1694 | return (0); |
| 1695 | |
| 1696 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1697 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Image_height %d\n", cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height.); |
| 1698 | return (cups->adjusted_heightcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_height.); |
| 1699 | } |
| 1700 | |
| 1701 | |
| 1702 | /* |
| 1703 | * 'Image_init()' - Initialize an image. |
| 1704 | */ |
| 1705 | |
| 1706 | static void |
| 1707 | Image_initcxx . . $ Image_init(7010b42a94b47a79).(stp_image_tcxx . . $ stp_image_t# *image) /* I - Image */ |
| 1708 | { |
| 1709 | cups_image_tcxx . . $ cups_image_t# *cups; /* CUPS image */ |
| 1710 | |
| 1711 | if ((cups = (cups_image_tcxx . . $ cups_image_t# *)(image->repcxx . . $ stp_image#rep.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1712 | return; |
| 1713 | cups->last_percentcxx . . $ $anonymous_type_9fad8097beddd8b9_0#last_percent. = 0; |
| 1714 | |
| 1715 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1716 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("INFO: Starting page %d...\n"), cups->pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. + 1); |
| 1717 | /* cups->page + 1 because users expect 1-based counting */ |
| 1718 | } |
| 1719 | |
| 1720 | /* |
| 1721 | * 'Image_progress_conclude()' - Close the progress display. |
| 1722 | */ |
| 1723 | |
| 1724 | static void |
| 1725 | Image_concludecxx . . $ Image_conclude(7010b42a94b47a79).(stp_image_tcxx . . $ stp_image_t# *image) /* I - Image */ |
| 1726 | { |
| 1727 | cups_image_tcxx . . $ cups_image_t# *cups; /* CUPS image */ |
| 1728 | |
| 1729 | |
| 1730 | if ((cups = (cups_image_tcxx . . $ cups_image_t# *)(image->repcxx . . $ stp_image#rep.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1731 | return; |
| 1732 | |
| 1733 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1734 | stp_i18n_printfcxx . . $ stp_i18n_printf(d760234632dcafcb).(pocxx . . $ po., _cxx . . $ `src/cups/i18n.h:28:9`!("INFO: Finished page %d...\n"), cups->pagecxx . . $ $anonymous_type_9fad8097beddd8b9_0#page. + 1); |
| 1735 | } |
| 1736 | |
| 1737 | /* |
| 1738 | * 'Image_width()' - Return the width of an image. |
| 1739 | */ |
| 1740 | |
| 1741 | static int /* O - Width in pixels */ |
| 1742 | Image_widthcxx . . $ Image_width(ba31fd85910919f2).(stp_image_tcxx . . $ stp_image_t# *image) /* I - Image */ |
| 1743 | { |
| 1744 | cups_image_tcxx . . $ cups_image_t# *cups; /* CUPS image */ |
| 1745 | |
| 1746 | |
| 1747 | if ((cups = (cups_image_tcxx . . $ cups_image_t# *)(image->repcxx . . $ stp_image#rep.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1748 | return (0); |
| 1749 | |
| 1750 | if (! suppress_messagescxx . . $ suppress_messages.) |
| 1751 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "DEBUG: Gutenprint: Image_width %d\n", cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width.); |
| 1752 | return (cups->adjusted_widthcxx . . $ $anonymous_type_9fad8097beddd8b9_0#adjusted_width.); |
| 1753 | } |