Changeset 7325
- Timestamp:
- 04/03/12 09:14:42 (14 months ago)
- File:
-
- 1 edited
-
ImageMagick/trunk/MagickWand/magick-cli.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ImageMagick/trunk/MagickWand/magick-cli.c
r7319 r7325 58 58 59 59 /* verbose debugging, 60 1 - option type 61 2 - source of option 62 3 - mnemonic lookup 63 4 - output options/artifacts 60 3 - option type details 61 9 - output options/artifacts/propertys 64 62 */ 65 63 #define MagickCommandDebug 0 … … 76 74 } 77 75 78 #if MagickCommandDebug >= 476 #if MagickCommandDebug >= 9 79 77 static void OutputOptions(ImageInfo *image_info) 80 78 { … … 83 81 *value; 84 82 85 (void) FormatLocaleFile(stdout," Image_InfoOptions:\n");83 (void) FormatLocaleFile(stdout," Global Options:\n"); 86 84 ResetImageOptionIterator(image_info); 87 85 while ((option=GetNextImageOption(image_info)) != (const char *) NULL ) { … … 109 107 } 110 108 ResetImageArtifactIterator(image); 109 } 110 111 static void OutputProperties(Image *image,ExceptionInfo *exception) 112 { 113 const char 114 *property, 115 *value; 116 117 (void) FormatLocaleFile(stdout," Image Properity:\n"); 118 ResetImagePropertyIterator(image); 119 while ((property=GetNextImageProperty(image)) != (const char *) NULL ) { 120 (void) FormatLocaleFile(stdout," %s: ",property); 121 value=GetImageProperty(image,property,exception); 122 if (value != (const char *) NULL) 123 (void) FormatLocaleFile(stdout,"%s\n",value); 124 } 125 ResetImagePropertyIterator(image); 111 126 } 112 127 #endif … … 215 230 count=option_info->type; 216 231 option_type=(CommandOptionFlags) option_info->flags; 217 #if MagickCommandDebug >= 2232 #if 0 218 233 (void) FormatLocaleFile(stderr, "Script: %u,%u: \"%s\" matched \"%s\"\n", 219 234 cli_wand->line, cli_wand->line, option, option_info->mnemonic ); … … 224 239 if ( option_type == UndefinedOptionFlag || 225 240 (option_type & NonMagickOptionFlag) != 0 ) { 226 #if MagickCommandDebug 227 (void) FormatLocaleFile(stderr, "Script Non-Option: \"%s\"\n", option); 241 #if MagickCommandDebug >= 3 242 (void) FormatLocaleFile(stderr, "Script %u,%u Non-Option: \"%s\"\n", 243 cli_wand->line, cli_wand->line, option); 228 244 #endif 229 245 if ( IfMagickFalse(IsCommandOption(option))) … … 252 268 CloneString(&arg2,(char *)NULL); 253 269 254 #if MagickCommandDebug 270 #if MagickCommandDebug >= 3 255 271 (void) FormatLocaleFile(stderr, 256 "Script Option: \"%s\" \tCount: %d Flags: %04x Args: \"%s\" \"%s\"\n",257 option,(int)count,option_type,arg1,arg2);272 "Script %u,%u Option: \"%s\" Count: %d Flags: %04x Args: \"%s\" \"%s\"\n", 273 cli_wand->line,cli_wand->line,option,count,option_type,arg1,arg2); 258 274 #endif 259 275 … … 292 308 293 309 next_token: 294 #if MagickCommandDebug >= 4310 #if MagickCommandDebug >= 9 295 311 OutputOptions(cli_wand->wand.image_info); 296 if ( cli_wand->wand.images != (Image *)NULL ) 312 if ( cli_wand->wand.images != (Image *)NULL ) { 297 313 OutputArtifacts(cli_wand->wand.images); 314 OutputProperties(cli_wand->wand.images,cli_wand->wand.exception); 315 } 298 316 #endif 299 317 if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) … … 301 319 } 302 320 303 #if MagickCommandDebug 321 #if MagickCommandDebug >= 3 304 322 (void) FormatLocaleFile(stderr, "Script End: %d\n", token_info->status); 305 323 #endif … … 426 444 count=option_info->type; 427 445 option_type=(CommandOptionFlags) option_info->flags; 428 #if MagickCommandDebug >= 2446 #if 0 429 447 (void) FormatLocaleFile(stderr, "CLI %d: \"%s\" matched \"%s\"\n", 430 448 i, argv[i], option_info->mnemonic ); … … 434 452 if ( option_type == UndefinedOptionFlag || 435 453 (option_type & NonMagickOptionFlag) != 0 ) { 436 #if MagickCommandDebug 437 (void) FormatLocaleFile(stderr, "CLI Non-Option: \"%s\"\n", option);454 #if MagickCommandDebug >= 3 455 (void) FormatLocaleFile(stderr, "CLI %d Non-Option: \"%s\"\n", i, option); 438 456 #endif 439 457 if ( IfMagickFalse(IsCommandOption(option) ) && … … 462 480 arg2 = ( count >= 2 ) ? argv[i+2] : (char *)NULL; 463 481 464 #if MagickCommandDebug 482 #if MagickCommandDebug >= 3 465 483 (void) FormatLocaleFile(stderr, 466 "CLI Option: \"%s\" \tCount: %d Flags: %04x Args: \"%s\" \"%s\"\n",467 option,(int)count,option_type,arg1,arg2);484 "CLI %u Option: \"%s\" Count: %d Flags: %04x Args: \"%s\" \"%s\"\n", 485 i,option,count,option_type,arg1,arg2); 468 486 #endif 469 487 … … 497 515 498 516 next_argument: 499 #if MagickCommandDebug >= 4517 #if MagickCommandDebug >= 9 500 518 OutputOptions(cli_wand->wand.image_info); 501 if ( cli_wand->wand.images != (Image *)NULL ) 519 if ( cli_wand->wand.images != (Image *)NULL ) { 502 520 OutputArtifacts(cli_wand->wand.images); 521 OutputProperties(cli_wand->wand.images,cli_wand->wand.exception); 522 } 503 523 #endif 504 524 if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) … … 518 538 cli_wand->line=i; 519 539 520 #if MagickCommandDebug 521 (void) FormatLocaleFile(stderr, "CLI Write File: \"%s\"\n", option );540 #if MagickCommandDebug >= 3 541 (void) FormatLocaleFile(stderr, "CLI %d Write File: \"%s\"\n", i, option ); 522 542 #endif 523 543
Note: See TracChangeset
for help on using the changeset viewer.
