]> granicus.if.org Git - imagemagick/blobdiff - magick/configure.c
(no commit message)
[imagemagick] / magick / configure.c
index c4c569c0e6d90886c60f0a677f8c31b753c87710..ab519324c209bdd5062c1ec8e8bb3577ebb51fb0 100644 (file)
@@ -17,7 +17,7 @@
 %                                 July 2003                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -114,8 +114,7 @@ static MagickBooleanType
 */
 MagickExport MagickBooleanType ConfigureComponentGenesis(void)
 {
-  assert(configure_semaphore == (SemaphoreInfo *) NULL);
-  configure_semaphore=AllocateSemaphoreInfo();
+  AcquireSemaphoreInfo(&configure_semaphore);
   return(MagickTrue);
 }
 \f
@@ -287,7 +286,7 @@ MagickExport const ConfigureInfo *GetConfigureInfo(const char *name,
 %  The format of the GetConfigureInfoList function is:
 %
 %      const ConfigureInfo **GetConfigureInfoList(const char *pattern,
-%        unsigned long *number_options,ExceptionInfo *exception)
+%        size_t *number_options,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -322,7 +321,7 @@ static int ConfigureInfoCompare(const void *x,const void *y)
 #endif
 
 MagickExport const ConfigureInfo **GetConfigureInfoList(const char *pattern,
-  unsigned long *number_options,ExceptionInfo *exception)
+  size_t *number_options,ExceptionInfo *exception)
 {
   const ConfigureInfo
     **options;
@@ -330,7 +329,7 @@ MagickExport const ConfigureInfo **GetConfigureInfoList(const char *pattern,
   register const ConfigureInfo
     *p;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -338,7 +337,7 @@ MagickExport const ConfigureInfo **GetConfigureInfoList(const char *pattern,
   */
   assert(pattern != (char *) NULL);
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
-  assert(number_options != (unsigned long *) NULL);
+  assert(number_options != (size_t *) NULL);
   *number_options=0;
   p=GetConfigureInfo("*",exception);
   if (p == (const ConfigureInfo *) NULL)
@@ -363,7 +362,7 @@ MagickExport const ConfigureInfo **GetConfigureInfoList(const char *pattern,
   UnlockSemaphoreInfo(configure_semaphore);
   qsort((void *) options,(size_t) i,sizeof(*options),ConfigureInfoCompare);
   options[i]=(ConfigureInfo *) NULL;
-  *number_options=(unsigned long) i;
+  *number_options=(size_t) i;
   return(options);
 }
 \f
@@ -384,7 +383,7 @@ MagickExport const ConfigureInfo **GetConfigureInfoList(const char *pattern,
 %  The format of the GetConfigureList function is:
 %
 %      char **GetConfigureList(const char *pattern,
-%        unsigned long *number_options,ExceptionInfo *exception)
+%        size_t *number_options,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -416,7 +415,7 @@ static int ConfigureCompare(const void *x,const void *y)
 #endif
 
 MagickExport char **GetConfigureList(const char *pattern,
-  unsigned long *number_options,ExceptionInfo *exception)
+  size_t *number_options,ExceptionInfo *exception)
 {
   char
     **options;
@@ -424,7 +423,7 @@ MagickExport char **GetConfigureList(const char *pattern,
   register const ConfigureInfo
     *p;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -432,7 +431,7 @@ MagickExport char **GetConfigureList(const char *pattern,
   */
   assert(pattern != (char *) NULL);
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",pattern);
-  assert(number_options != (unsigned long *) NULL);
+  assert(number_options != (size_t *) NULL);
   *number_options=0;
   p=GetConfigureInfo("*",exception);
   if (p == (const ConfigureInfo *) NULL)
@@ -454,7 +453,7 @@ MagickExport char **GetConfigureList(const char *pattern,
   UnlockSemaphoreInfo(configure_semaphore);
   qsort((void *) options,(size_t) i,sizeof(*options),ConfigureCompare);
   options[i]=(char *) NULL;
-  *number_options=(unsigned long) i;
+  *number_options=(size_t) i;
   return(options);
 }
 \f
@@ -571,7 +570,7 @@ MagickExport LinkedListInfo *GetConfigureOptions(const char *filename,
       }
       paths=DestroyLinkedList(paths,RelinquishMagickMemory);
     }
-#if defined(__WINDOWS__)
+#if defined(MAGICKCORE_WINDOWS_SUPPORT)
   {
     char
       *blob;
@@ -679,7 +678,7 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
 #if defined(MAGICKCORE_SHARE_PATH)
   (void) AppendValueToLinkedList(paths,ConstantString(MAGICKCORE_SHARE_PATH));
 #endif
-#if defined(__WINDOWS__) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_CONFIGURE_PATH))
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_CONFIGURE_PATH))
   {
     char
       *registry_key;
@@ -750,6 +749,10 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
       (void) AppendValueToLinkedList(paths,ConstantString(path));
 #endif
     }
+  /*
+    Search current directory.
+  */
+  (void) AppendValueToLinkedList(paths,ConstantString(""));
 #endif
   {
     char
@@ -769,7 +772,7 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
         home=DestroyString(home);
       }
   }
-#if defined(__WINDOWS__)
+#if defined(MAGICKCORE_WINDOWS_SUPPORT)
   {
     char
       module_path[MaxTextExtent];
@@ -804,10 +807,6 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
       }
   }
 #endif
-  /*
-    Search current directory.
-  */
-  (void) AppendValueToLinkedList(paths,ConstantString(""));
   return(paths);
 }
 \f
@@ -917,13 +916,13 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
   const ConfigureInfo
     **configure_info;
 
-  long
+  ssize_t
     j;
 
-  register long
+  register ssize_t
     i;
 
-  unsigned long
+  size_t
     number_options;
 
   if (file == (const FILE *) NULL)
@@ -932,7 +931,7 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
   if (configure_info == (const ConfigureInfo **) NULL)
     return(MagickFalse);
   path=(const char *) NULL;
-  for (i=0; i < (long) number_options; i++)
+  for (i=0; i < (ssize_t) number_options; i++)
   {
     if (configure_info[i]->stealth != MagickFalse)
       continue;
@@ -950,7 +949,7 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
     if (configure_info[i]->name != (char *) NULL)
       name=configure_info[i]->name;
     (void) fprintf(file,"%s",name);
-    for (j=(long) strlen(name); j <= 12; j++)
+    for (j=(ssize_t) strlen(name); j <= 12; j++)
       (void) fprintf(file," ");
     (void) fprintf(file," ");
     value="unknown";
@@ -982,7 +981,7 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
 %  The format of the LoadConfigureList method is:
 %
 %      MagickBooleanType LoadConfigureList(const char *xml,const char *filename,
-%        const unsigned long depth,ExceptionInfo *exception)
+%        const size_t depth,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -996,7 +995,7 @@ MagickExport MagickBooleanType ListConfigureInfo(FILE *file,
 %
 */
 static MagickBooleanType LoadConfigureList(const char *xml,const char *filename,
-  const unsigned long depth,ExceptionInfo *exception)
+  const size_t depth,ExceptionInfo *exception)
 {
   char
     keyword[MaxTextExtent],
@@ -1210,7 +1209,7 @@ static MagickBooleanType LoadConfigureLists(const char *filename,
   MagickStatusType
     status;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -1227,7 +1226,7 @@ static MagickBooleanType LoadConfigureLists(const char *filename,
           return(MagickFalse);
         }
     }
-  for (i=0; i < (long) (sizeof(ConfigureMap)/sizeof(*ConfigureMap)); i++)
+  for (i=0; i < (ssize_t) (sizeof(ConfigureMap)/sizeof(*ConfigureMap)); i++)
   {
     ConfigureInfo
       *configure_info;