- Timestamp:
- Sep 18, 2012, 3:53:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r33511 r34448 25 25 $PSTAMP_SELECT_WEIGHT 26 26 $PSTAMP_SELECT_CMF 27 $PSTAMP_SELECT_SOURCES 27 28 $PSTAMP_SELECT_PSF 28 29 $PSTAMP_SELECT_BACKMDL … … 32 33 $PSTAMP_SELECT_UNCONV 33 34 $PSTAMP_RESTORE_BACKGROUND 35 $PSTAMP_USE_IMFILE_ID 36 $PSTAMP_NO_WAIT_FOR_UPDATE 34 37 $PSTAMP_REQUEST_UNCENSORED 35 38 $PSTAMP_REQUIRE_UNCENSORED 36 $PSTAMP_USE_IMFILE_ID37 $PSTAMP_NO_WAIT_FOR_UPDATE38 39 $PSTAMP_SUCCESS 39 40 $PSTAMP_FIRST_ERROR_CODE … … 59 60 our $PSTAMP_RANGE_IN_PIXELS = 2; 60 61 62 # Definition of the bits in OPTION_MASK 61 63 our $PSTAMP_SELECT_IMAGE = 1; 62 64 our $PSTAMP_SELECT_MASK = 2; 63 65 our $PSTAMP_SELECT_VARIANCE = 4; 64 66 our $PSTAMP_SELECT_WEIGHT = 4; 67 our $PSTAMP_SELECT_SOURCES = 8; 65 68 our $PSTAMP_SELECT_CMF = 8; 66 69 our $PSTAMP_SELECT_PSF = 16; 67 70 our $PSTAMP_SELECT_BACKMDL = 32; 68 71 our $PSTAMP_SELECT_JPEG = 64; 72 # unused 128 73 # unused 256 69 74 our $PSTAMP_SELECT_UNCOMPRESSED = 512; 70 our $PSTAMP_SELECT_INVERSE = 1024;71 our $PSTAMP_SELECT_UNCONV = 2048;72 our $PSTAMP_RESTORE_BACKGROUND = 4096;73 74 our $PSTAMP_USE_IMFILE_ID = 16384; 75 75 our $PSTAMP_SELECT_INVERSE = 1024; 76 our $PSTAMP_SELECT_UNCONV = 2048; 77 our $PSTAMP_RESTORE_BACKGROUND = 4096; 78 # unused 8192 79 80 our $PSTAMP_USE_IMFILE_ID = 16384; 76 81 our $PSTAMP_NO_WAIT_FOR_UPDATE = 32768; 77 our $PSTAMP_REQUEST_UNCENSORED = 1 << 16;78 our $PSTAMP_REQUIRE_UNCENSORED = 1 << 17;82 our $PSTAMP_REQUEST_UNCENSORED = 0x10000; 83 our $PSTAMP_REQUIRE_UNCENSORED = 0x20000; 79 84 80 85 # job and result codes … … 162 167 my $fields_output; 163 168 { 164 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ";169 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USERNAME EMAIL"; 165 170 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 166 171 run(command => $command, verbose => $verbose); 167 172 $fields_output = join "", @$stdout_buf; 168 173 } 169 my (undef, $extname, $extver, $req_name ) = split " ", $fields_output;174 my (undef, $extname, $extver, $req_name, $action, $username, $email) = split " ", $fields_output; 170 175 171 176 # make sure the file contains what we are expecting … … 174 179 if !$extname or ($extname ne "PS1_PS_REQUEST"); 175 180 die "REQ_NAME not found in $request_file_name" if (!$req_name); 176 die "wrong EXTVER $extver found in $request_file_name" if ($extver ne " 1");181 die "wrong EXTVER $extver found in $request_file_name" if ($extver ne "2" and $extver ne "1"); 177 182 178 183 my %header; … … 180 185 $header{EXTVER} = $extver; 181 186 $header{EXTNAME} = $extname; 187 if ($extver > 1) { 188 $header{ACTION} = $action; 189 $header{USER} = $username; 190 $header{EMAIL} = $email; 191 } else { 192 $header{ACTION} = $action = "PROCESS"; 193 $header{USERNAME} = 'null'; 194 $header{EMAIL} = 'null'; 195 } 196 197 if ($action eq "LIST") { 198 return (\%header, undef); 199 } elsif ($action ne "PROCESS") { 200 die "unexpected request ACTION found: $action in $request_file_name"; 201 } 202 182 203 183 204 #
Note:
See TracChangeset
for help on using the changeset viewer.
