]> granicus.if.org Git - imagemagick/commitdiff
Adding coder headers with coder.xml will no longer be supported.
authorDirk Lemstra <dirk@lemstra.org>
Thu, 4 Oct 2018 21:20:08 +0000 (23:20 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Thu, 4 Oct 2018 21:20:08 +0000 (23:20 +0200)
ChangeLog
MagickCore/coder.c
MagickCore/coder.h
Make.com
Makefile.in
QuickStart.txt
config/ImageMagick.rc
config/Makefile.am

index 0b451cb5f25e61d692afa07b127f09483f3017b3..1b742279efbdb51f5109f5a01a1341188d667061 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2018-10-04  7.0.8-13 Dirk Lemstra <dirk@lem.....org>
   * Adding coder headers with magic.xml will no longer be supported.
+  * Adding coder aliases with coder.xml will no longer be supported.
 
 2018-09-16  7.0.8-12 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.8-12, GIT revision 14843:cb5cf1959:20180923
index d798e9382ba458951e500f52b0ee07bf8fa460e7..e190b422ebd34454e6204e41abc001e52f7d9a50 100644 (file)
 #include "MagickCore/xml-tree.h"
 #include "MagickCore/xml-tree-private.h"
 \f
-/*
-  Define declarations.
-*/
-#define MagickCoderFilename  "coder.xml"
-\f
 /*
   Typedef declarations.
 */
@@ -270,9 +265,7 @@ static SplayTreeInfo
   Forward declarations.
 */
 static MagickBooleanType
-  IsCoderTreeInstantiated(ExceptionInfo *),
-  LoadCoderCache(SplayTreeInfo *,const char *,const char *,const size_t,
-    ExceptionInfo *);
+  IsCoderTreeInstantiated(ExceptionInfo *);
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -319,8 +312,7 @@ static void *DestroyCoderNode(void *coder_info)
   return(RelinquishMagickMemory(p));
 }
 
-static SplayTreeInfo *AcquireCoderCache(const char *filename,
-  ExceptionInfo *exception)
+static SplayTreeInfo *AcquireCoderCache(ExceptionInfo *exception)
 {
   MagickStatusType
     status;
@@ -332,33 +324,11 @@ static SplayTreeInfo *AcquireCoderCache(const char *filename,
     *cache;
 
   /*
-    Load external coder map.
+    Load built-in coder map.
   */
   cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory,
     DestroyCoderNode);
   status=MagickTrue;
-#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
-  {
-    const StringInfo
-      *option;
-
-    LinkedListInfo
-      *options;
-
-    options=GetConfigureOptions(filename,exception);
-    option=(const StringInfo *) GetNextValueInLinkedList(options);
-    while (option != (const StringInfo *) NULL)
-    {
-      status&=LoadCoderCache(cache,(const char *) GetStringInfoDatum(option),
-        GetStringInfoPath(option),0,exception);
-      option=(const StringInfo *) GetNextValueInLinkedList(options);
-    }
-    options=DestroyConfigureOptions(options);
-  }
-#endif
-  /*
-    Load built-in coder map.
-  */
   for (i=0; i < (ssize_t) (sizeof(CoderMap)/sizeof(*CoderMap)); i++)
   {
     CoderInfo
@@ -682,7 +652,7 @@ static MagickBooleanType IsCoderTreeInstantiated(ExceptionInfo *exception)
         ActivateSemaphoreInfo(&coder_semaphore);
       LockSemaphoreInfo(coder_semaphore);
       if (coder_cache == (SplayTreeInfo *) NULL)
-        coder_cache=AcquireCoderCache(MagickCoderFilename,exception);
+        coder_cache=AcquireCoderCache(exception);
       UnlockSemaphoreInfo(coder_semaphore);
     }
   return(coder_cache != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
@@ -762,204 +732,3 @@ MagickExport MagickBooleanType ListCoderInfo(FILE *file,
   (void) fflush(file);
   return(MagickTrue);
 }
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-+   L o a d C o d e r C a c h e                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  LoadCoderCache() loads the coder configurations which provides a
-%  mapping between coder attributes and a coder name.
-%
-%  The format of the LoadCoderCache coder is:
-%
-%      MagickBooleanType LoadCoderCache(SplayTreeInfo *cache,const char *xml,
-%        const char *filename,const size_t depth,ExceptionInfo *exception)
-%
-%  A description of each parameter follows:
-%
-%    o xml:  The coder list in XML format.
-%
-%    o filename:  The coder list filename.
-%
-%    o depth: depth of <include /> statements.
-%
-%    o exception: return any errors or warnings in this structure.
-%
-*/
-static MagickBooleanType LoadCoderCache(SplayTreeInfo *cache,const char *xml,
-  const char *filename,const size_t depth,ExceptionInfo *exception)
-{
-  char
-    keyword[MagickPathExtent],
-    *token;
-
-  const char
-    *q;
-
-  CoderInfo
-    *coder_info;
-
-  MagickStatusType
-    status;
-
-  size_t
-    extent;
-
-  /*
-    Load the coder map file.
-  */
-  (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
-    "Loading coder configuration file \"%s\" ...",filename);
-  if (xml == (const char *) NULL)
-    return(MagickFalse);
-  status=MagickTrue;
-  coder_info=(CoderInfo *) NULL;
-  token=AcquireString(xml);
-  extent=strlen(token)+MagickPathExtent;
-  for (q=(char *) xml; *q != '\0'; )
-  {
-    /*
-      Interpret XML.
-    */
-    GetNextToken(q,&q,extent,token);
-    if (*token == '\0')
-      break;
-    (void) CopyMagickString(keyword,token,MagickPathExtent);
-    if (LocaleNCompare(keyword,"<!DOCTYPE",9) == 0)
-      {
-        /*
-          Doctype element.
-        */
-        while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
-          GetNextToken(q,&q,extent,token);
-        continue;
-      }
-    if (LocaleNCompare(keyword,"<!--",4) == 0)
-      {
-        /*
-          Comment element.
-        */
-        while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
-          GetNextToken(q,&q,extent,token);
-        continue;
-      }
-    if (LocaleCompare(keyword,"<include") == 0)
-      {
-        /*
-          Include element.
-        */
-        while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
-        {
-          (void) CopyMagickString(keyword,token,MagickPathExtent);
-          GetNextToken(q,&q,extent,token);
-          if (*token != '=')
-            continue;
-          GetNextToken(q,&q,extent,token);
-          if (LocaleCompare(keyword,"file") == 0)
-            {
-              if (depth > MagickMaxRecursionDepth)
-                (void) ThrowMagickException(exception,GetMagickModule(),
-                  ConfigureError,"IncludeNodeNestedTooDeeply","`%s'",token);
-              else
-                {
-                  char
-                    path[MagickPathExtent],
-                    *file_xml;
-
-                  GetPathComponent(filename,HeadPath,path);
-                  if (*path != '\0')
-                    (void) ConcatenateMagickString(path,DirectorySeparator,
-                      MagickPathExtent);
-                  if (*token == *DirectorySeparator)
-                    (void) CopyMagickString(path,token,MagickPathExtent);
-                  else
-                    (void) ConcatenateMagickString(path,token,MagickPathExtent);
-                  file_xml=FileToXML(path,~0UL);
-                  if (file_xml != (char *) NULL)
-                    {
-                      status&=LoadCoderCache(cache,file_xml,path,depth+1,
-                        exception);
-                      file_xml=DestroyString(file_xml);
-                    }
-                }
-            }
-        }
-        continue;
-      }
-    if (LocaleCompare(keyword,"<coder") == 0)
-      {
-        /*
-          Coder element.
-        */
-        coder_info=(CoderInfo *) AcquireCriticalMemory(sizeof(*coder_info));
-        (void) memset(coder_info,0,sizeof(*coder_info));
-        coder_info->path=ConstantString(filename);
-        coder_info->exempt=MagickFalse;
-        coder_info->signature=MagickCoreSignature;
-        continue;
-      }
-    if (coder_info == (CoderInfo *) NULL)
-      continue;
-    if ((LocaleCompare(keyword,"/>") == 0) ||
-        (LocaleCompare(keyword,"</policy>") == 0))
-      {
-        status=AddValueToSplayTree(cache,ConstantString(coder_info->magick),
-          coder_info);
-        if (status == MagickFalse)
-          (void) ThrowMagickException(exception,GetMagickModule(),
-            ResourceLimitError,"MemoryAllocationFailed","`%s'",
-            coder_info->magick);
-        coder_info=(CoderInfo *) NULL;
-        continue;
-      }
-    GetNextToken(q,(const char **) NULL,extent,token);
-    if (*token != '=')
-      continue;
-    GetNextToken(q,&q,extent,token);
-    GetNextToken(q,&q,extent,token);
-    switch (*keyword)
-    {
-      case 'M':
-      case 'm':
-      {
-        if (LocaleCompare((char *) keyword,"magick") == 0)
-          {
-            coder_info->magick=ConstantString(token);
-            break;
-          }
-        break;
-      }
-      case 'N':
-      case 'n':
-      {
-        if (LocaleCompare((char *) keyword,"name") == 0)
-          {
-            coder_info->name=ConstantString(token);
-            break;
-          }
-        break;
-      }
-      case 'S':
-      case 's':
-      {
-        if (LocaleCompare((char *) keyword,"stealth") == 0)
-          {
-            coder_info->stealth=IsStringTrue(token);
-            break;
-          }
-        break;
-      }
-      default:
-        break;
-    }
-  }
-  token=(char *) RelinquishMagickMemory(token);
-  return(status != 0 ? MagickTrue : MagickFalse);
-}
index ecb474c6656a8c9a0984ba388fc299337635b912..180cca4e4ac52628f2825ef8b072abde95e35163 100644 (file)
@@ -28,11 +28,11 @@ typedef struct _CoderInfo
     *path,
     *magick,
     *name;
-                                                                                
+
   MagickBooleanType
     exempt,
     stealth;
-                                                                                
+
   size_t
     signature;
 } CoderInfo;
index b5a6a84a88a6dc6d4fda1dce745004f778cc65d0..2b0b70c3ed59e12356ba8e47a99d98b7972a837e 100644 (file)
--- a/Make.com
+++ b/Make.com
@@ -215,7 +215,6 @@ $set def [-]
 $copy [.config]colors.xml sys$login:colors.xml
 $copy [.config]log.xml sys$login:log.xml
 $copy [.www.source]delegates.xml sys$login:delegates.xml
-$copy [.config]coder.xml sys$login:coder.xml
 $copy [.www.source]type.xml sys$login:type.xml
 $copy [.config]locale.xml sys$login:locale.xml
 $copy [.config]english.xml sys$login:english.xml
index c1047aec357bdf37520580e027f426b95daf26ed..33c1ca4419a35b08230e29ce0c290982839c066e 100644 (file)
@@ -3044,7 +3044,6 @@ configsharearch_DATA = \
 # (share/ImageMagick-version)
 configlibdir = $(CONFIGURE_PATH)
 configlib_DATA = \
-       config/coder.xml \
        config/colors.xml \
        config/delegates.xml \
        config/log.xml \
@@ -3061,7 +3060,6 @@ configlib_DATA = \
 
 CONFIG_EXTRA_DIST = \
        config/cmyk.icm \
-       config/coder.xml \
        config/colors.xml \
        config/config.h.in \
        config/delegates.xml.in \
index c96a6153d65cccc01d813f048b751b931e918ab1..65f17ca8b8d8d8777cdb5bcf61a54e170d1320cb 100644 (file)
@@ -62,7 +62,7 @@ Unix/Linux/Darwin/Mac OS X/Cygwin/MinGW Install:
     Configuration Files
 
       ImageMagick depends on a number of external configuration files which
-      include colors.xml, delegates.xml, coder.xml, and others.
+      include colors.xml, delegates.xml, and others.
       ImageMagick searches for configuration files in the following order, and
       loads them if found:
 
index 6450188fb62941a8c90ff1e968ddcdb5f38755db..9816ba2f4d043be604a3e37b171b604dbf38591f 100644 (file)
@@ -49,16 +49,15 @@ END
 //
 /////////////////////////////////////////////////////////////////////////////
 
-CODER.XML      IMAGEMAGICK DISCARDABLE "..\\bin\\coder.xml"
-COLORS.XML     IMAGEMAGICK DISCARDABLE "..\\bin\\colors.xml"
-CONFIGURE.XML     IMAGEMAGICK DISCARDABLE "..\\bin\\configure.xml"
-DELEGATES.XML  IMAGEMAGICK DISCARDABLE "..\\bin\\delegates.xml"
-ENGLISH.XML    IMAGEMAGICK DISCARDABLE "..\\bin\\english.xml"
-LOCALE.XML     IMAGEMAGICK DISCARDABLE "..\\bin\\locale.xml"
-LOG.XML        IMAGEMAGICK DISCARDABLE "..\\bin\\log.xml"
-THRESHOLDS.XML  IMAGEMAGICK DISCARDABLE "..\\bin\\thresholds.xml"
-TYPE.XML       IMAGEMAGICK DISCARDABLE "..\\bin\\type.xml"
-TYPE-GHOSTSCRIPT.XML  IMAGEMAGICK DISCARDABLE "..\\bin\\type-ghostscript.xml"
+COLORS.XML           IMAGEMAGICK DISCARDABLE "..\\bin\\colors.xml"
+CONFIGURE.XML        IMAGEMAGICK DISCARDABLE "..\\bin\\configure.xml"
+DELEGATES.XML        IMAGEMAGICK DISCARDABLE "..\\bin\\delegates.xml"
+ENGLISH.XML          IMAGEMAGICK DISCARDABLE "..\\bin\\english.xml"
+LOCALE.XML           IMAGEMAGICK DISCARDABLE "..\\bin\\locale.xml"
+LOG.XML              IMAGEMAGICK DISCARDABLE "..\\bin\\log.xml"
+THRESHOLDS.XML       IMAGEMAGICK DISCARDABLE "..\\bin\\thresholds.xml"
+TYPE.XML             IMAGEMAGICK DISCARDABLE "..\\bin\\type.xml"
+TYPE-GHOSTSCRIPT.XML IMAGEMAGICK DISCARDABLE "..\\bin\\type-ghostscript.xml"
 
 
 /////////////////////////////////////////////////////////////////////////////
index 4ce78fdd48bc11bc5ca670ed6fa04c3c09008a43..9a17ab54fc9715bc62a88bc6cfa738036c9b2a37 100644 (file)
@@ -32,7 +32,6 @@ configsharearch_DATA = \
 # (share/ImageMagick-version)
 configlibdir =  $(CONFIGURE_PATH)
 configlib_DATA = \
-       config/coder.xml \
        config/colors.xml \
        config/delegates.xml \
        config/log.xml \
@@ -49,7 +48,6 @@ configlib_DATA = \
 
 CONFIG_EXTRA_DIST = \
        config/cmyk.icm \
-       config/coder.xml \
        config/colors.xml \
        config/config.h.in \
        config/delegates.xml.in \