~ubuntu-branches/ubuntu/oneiric/imagemagick/oneiric-updates

« back to all changes in this revision

Viewing changes to magick/mime.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-06-15 11:05:28 UTC
  • mfrom: (6.2.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110615110528-08jgo07a4846xh8d
Tags: 8:6.6.0.4-3ubuntu1
* Resynchronise with Debian (LP: #797595).  Remaining changes:
  - Make ufraw-batch (universe) a suggestion instead of a recommendation.
  - Make debian/rules install target depend on check; they cannot reliably
    be run in parallel.
  - Don't set MAKEFLAGS in debian/rules; just pass it to the build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    *description,
71
71
    *pattern;
72
72
 
73
 
  ssize_t
 
73
  long
74
74
    priority;
75
75
 
76
76
  MagickOffsetType
82
82
  DataType
83
83
    data_type;
84
84
 
85
 
  ssize_t
 
85
  long
86
86
    mask,
87
87
    value;
88
88
 
98
98
  MagickBooleanType
99
99
    stealth;
100
100
 
101
 
  size_t
 
101
  unsigned long
102
102
    signature;
103
103
};
104
104
 
168
168
  EndianType
169
169
    endian;
170
170
 
 
171
  long
 
172
    value;
 
173
 
171
174
  register const MimeInfo
172
175
    *p;
173
176
 
174
177
  register const unsigned char
175
178
    *q;
176
179
 
177
 
  register ssize_t
 
180
  register long
178
181
    i;
179
182
 
180
 
  size_t
 
183
  unsigned long
181
184
    lsb_first;
182
185
 
183
 
  ssize_t
184
 
    value;
185
 
 
186
186
  assert(exception != (ExceptionInfo *) NULL);
187
187
  if ((mime_list == (LinkedListInfo *) NULL) ||
188
188
      (instantiate_mime == MagickFalse))
306
306
      case StringData:
307
307
      default:
308
308
      {
309
 
        for (i=0; i <= (ssize_t) p->extent; i++)
 
309
        for (i=0; i <= (long) p->extent; i++)
310
310
        {
311
311
          if ((size_t) (p->offset+i+p->length) > length)
312
312
            break;
345
345
%  The magic of the GetMimeInfoList function is:
346
346
%
347
347
%      const MimeInfo **GetMimeInfoList(const char *pattern,
348
 
%        size_t *number_aliases,ExceptionInfo *exception)
 
348
%        unsigned long *number_aliases,ExceptionInfo *exception)
349
349
%
350
350
%  A description of each parameter follows:
351
351
%
380
380
#endif
381
381
 
382
382
MagickExport const MimeInfo **GetMimeInfoList(const char *pattern,
383
 
  size_t *number_aliases,ExceptionInfo *exception)
 
383
  unsigned long *number_aliases,ExceptionInfo *exception)
384
384
{
385
385
  const MimeInfo
386
386
    **aliases;
388
388
  register const MimeInfo
389
389
    *p;
390
390
 
391
 
  register ssize_t
 
391
  register long
392
392
    i;
393
393
 
394
394
  /*
396
396
  */
397
397
  assert(pattern != (char *) NULL);
398
398
  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
399
 
  assert(number_aliases != (size_t *) NULL);
 
399
  assert(number_aliases != (unsigned long *) NULL);
400
400
  *number_aliases=0;
401
401
  p=GetMimeInfo((char *) NULL,(unsigned char *) "*",0,exception);
402
402
  if (p == (const MimeInfo *) NULL)
421
421
  UnlockSemaphoreInfo(mime_semaphore);
422
422
  qsort((void *) aliases,(size_t) i,sizeof(*aliases),MimeInfoCompare);
423
423
  aliases[i]=(MimeInfo *) NULL;
424
 
  *number_aliases=(size_t) i;
 
424
  *number_aliases=(unsigned long) i;
425
425
  return(aliases);
426
426
}
427
427
 
441
441
%
442
442
%  The format of the GetMimeList function is:
443
443
%
444
 
%      char **GetMimeList(const char *pattern,size_t *number_aliases,
 
444
%      char **GetMimeList(const char *pattern,unsigned long *number_aliases,
445
445
%        ExceptionInfo *exception)
446
446
%
447
447
%  A description of each parameter follows:
475
475
#endif
476
476
 
477
477
MagickExport char **GetMimeList(const char *pattern,
478
 
  size_t *number_aliases,ExceptionInfo *exception)
 
478
  unsigned long *number_aliases,ExceptionInfo *exception)
479
479
{
480
480
  char
481
481
    **aliases;
483
483
  register const MimeInfo
484
484
    *p;
485
485
 
486
 
  register ssize_t
 
486
  register long
487
487
    i;
488
488
 
489
489
  /*
491
491
  */
492
492
  assert(pattern != (char *) NULL);
493
493
  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
494
 
  assert(number_aliases != (size_t *) NULL);
 
494
  assert(number_aliases != (unsigned long *) NULL);
495
495
  *number_aliases=0;
496
496
  p=GetMimeInfo((char *) NULL,(unsigned char *) "*",0,exception);
497
497
  if (p == (const MimeInfo *) NULL)
513
513
  UnlockSemaphoreInfo(mime_semaphore);
514
514
  qsort((void *) aliases,(size_t) i,sizeof(*aliases),MimeCompare);
515
515
  aliases[i]=(char *) NULL;
516
 
  *number_aliases=(size_t) i;
 
516
  *number_aliases=(unsigned long) i;
517
517
  return(aliases);
518
518
}
519
519
 
650
650
  const MimeInfo
651
651
    **mime_info;
652
652
 
653
 
  ssize_t
 
653
  long
654
654
    j;
655
655
 
656
 
  register ssize_t
 
656
  register long
657
657
    i;
658
658
 
659
 
  size_t
 
659
  unsigned long
660
660
    number_aliases;
661
661
 
662
662
  if (file == (const FILE *) NULL)
666
666
    return(MagickFalse);
667
667
  j=0;
668
668
  path=(const char *) NULL;
669
 
  for (i=0; i < (ssize_t) number_aliases; i++)
 
669
  for (i=0; i < (long) number_aliases; i++)
670
670
  {
671
671
    if (mime_info[i]->stealth != MagickFalse)
672
672
      continue;
683
683
    (void) fprintf(file,"%s",mime_info[i]->type);
684
684
    if (strlen(mime_info[i]->type) <= 25)
685
685
      {
686
 
        for (j=(ssize_t) strlen(mime_info[i]->type); j <= 27; j++)
 
686
        for (j=(long) strlen(mime_info[i]->type); j <= 27; j++)
687
687
          (void) fprintf(file," ");
688
688
      }
689
689
    else
718
718
%  The format of the LoadMimeList method is:
719
719
%
720
720
%      MagickBooleanType LoadMimeList(const char *xml,const char *filename,
721
 
%        const size_t depth,ExceptionInfo *exception)
 
721
%        const unsigned long depth,ExceptionInfo *exception)
722
722
%
723
723
%  A description of each parameter follows:
724
724
%
732
732
%
733
733
*/
734
734
static MagickBooleanType LoadMimeList(const char *xml,const char *filename,
735
 
  const size_t depth,ExceptionInfo *exception)
 
735
  const unsigned long depth,ExceptionInfo *exception)
736
736
{
737
737
  const char
738
738
    *attribute;
886
886
        }
887
887
        token=DestroyString(token);
888
888
        if (mime_info->data_type != StringData)
889
 
          mime_info->value=(size_t) strtoul((char *) mime_info->magic,
890
 
            (char **) NULL,0);
 
889
          mime_info->value=strtol((char *) mime_info->magic,(char **) NULL,0);
891
890
      }
892
891
    attribute=GetXMLTreeAttribute(mime,"mask");
893
892
    if (attribute != (const char *) NULL)
894
 
      mime_info->mask=(size_t) strtoul(attribute,(char **) NULL,0);
 
893
      mime_info->mask=strtol(attribute,(char **) NULL,0);
895
894
    attribute=GetXMLTreeAttribute(mime,"offset");
896
895
    if (attribute != (const char *) NULL)
897
896
      {
907
906
      mime_info->pattern=ConstantString(attribute);
908
907
    attribute=GetXMLTreeAttribute(mime,"priority");
909
908
    if (attribute != (const char *) NULL)
910
 
      mime_info->priority=(ssize_t) strtol(attribute,(char **) NULL,0);
 
909
      mime_info->priority=strtol(attribute,(char **) NULL,0);
911
910
    attribute=GetXMLTreeAttribute(mime,"stealth");
912
911
    if (attribute != (const char *) NULL)
913
912
      mime_info->stealth=IsMagickTrue(attribute);