This source file includes following definitions.
- GetMagickCopyright
- GetMagickDelegates
- GetMagickFeatures
- GetMagickHomeURL
- GetMagickLicense
- GetMagickPackageName
- GetMagickQuantumDepth
- GetMagickQuantumRange
- GetMagickReleaseDate
- CRC32
- GetMagickSignature
- GetMagickVersion
- ListMagickVersion
#include "magick/studio.h"
#include "magick/configure.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/hashmap.h"
#include "magick/locale_.h"
#include "magick/option.h"
#include "magick/string_.h"
#include "magick/utility.h"
#include "magick/version.h"
#include "magick/version-private.h"
#define MagickURLFilename "index.html"
MagickExport const char *GetMagickCopyright(void)
{
return(MagickCopyright);
}
MagickExport const char *GetMagickDelegates(void)
{
return ""
#if defined(MAGICKCORE_AUTOTRACE_DELEGATE)
"autotrace "
#endif
#if defined(MAGICKCORE_BZLIB_DELEGATE)
"bzlib "
#endif
#if defined(MAGICKCORE_CAIRO_DELEGATE)
"cairo "
#endif
#if defined(MAGICKCORE_DJVU_DELEGATE)
"djvu "
#endif
#if defined(MAGICKCORE_DPS_DELEGATE)
"dps "
#endif
#if defined(MAGICKCORE_EMF_DELEGATE)
"emf "
#endif
#if defined(MAGICKCORE_FFTW_DELEGATE)
"fftw "
#endif
#if defined(MAGICKCORE_FONTCONFIG_DELEGATE)
"fontconfig "
#endif
#if defined(MAGICKCORE_FREETYPE_DELEGATE)
"freetype "
#endif
#if defined(MAGICKCORE_FPX_DELEGATE)
"fpx "
#endif
#if defined(MAGICKCORE_GS_DELEGATE)
"gslib "
#endif
#if defined(MAGICKCORE_GVC_DELEGATE)
"gvc "
#endif
#if defined(MAGICKCORE_JBIG_DELEGATE)
"jbig "
#endif
#if defined(MAGICKCORE_JPEG_DELEGATE) && defined(MAGICKCORE_PNG_DELEGATE)
"jng "
#endif
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
"jp2 "
#endif
#if defined(MAGICKCORE_JPEG_DELEGATE)
"jpeg "
#endif
#if defined(MAGICKCORE_LCMS_DELEGATE)
"lcms "
#endif
#if defined(MAGICKCORE_LQR_DELEGATE)
"lqr "
#endif
#if defined(MAGICKCORE_LTDL_DELEGATE)
"ltdl "
#endif
#if defined(MAGICKCORE_LZMA_DELEGATE)
"lzma "
#endif
#if defined(MAGICKCORE_OPENEXR_DELEGATE)
"openexr "
#endif
#if defined(MAGICKCORE_PANGOCAIRO_DELEGATE)
"pangocairo "
#endif
#if defined(MAGICKCORE_PNG_DELEGATE)
"png "
#endif
#if defined(MAGICKCORE_DPS_DELEGATE) || defined(MAGICKCORE_GS_DELEGATE) || defined(WIN32)
"ps "
#endif
#if defined(MAGICKCORE_RSVG_DELEGATE)
"rsvg "
#endif
#if defined(MAGICKCORE_TIFF_DELEGATE)
"tiff "
#endif
#if defined(MAGICKCORE_WEBP_DELEGATE)
"webp "
#endif
#if defined(MAGICKCORE_WMF_DELEGATE) || defined (MAGICKCORE_WMFLITE_DELEGATE)
"wmf "
#endif
#if defined(MAGICKCORE_X11_DELEGATE)
"x "
#endif
#if defined(MAGICKCORE_XML_DELEGATE)
"xml "
#endif
#if defined(MAGICKCORE_ZLIB_DELEGATE)
"zlib"
#endif
;
}
MagickExport const char *GetMagickFeatures(void)
{
return ""
#if defined(MAGICKCORE_CIPHER_SUPPORT)
"Cipher "
#endif
#if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
"Debug "
#endif
#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_HAVE_SOCKET) && defined(MAGICKCORE_THREAD_SUPPORT)
"DPC "
#endif
#if defined(MAGICKCORE_HDRI_SUPPORT)
"HDRI "
#endif
#if defined(MAGICKCORE_BUILD_MODULES) || defined(_DLL)
"Modules "
#endif
#if defined(MAGICKCORE_OPENCL_SUPPORT)
"OpenCL "
#endif
#if defined(MAGICKCORE_OPENMP_SUPPORT)
"OpenMP "
#endif
#if defined(ZERO_CONFIGURATION_SUPPORT)
"Zero-configuration "
#endif
;
}
MagickExport char *GetMagickHomeURL(void)
{
char
path[MaxTextExtent];
const char
*element;
ExceptionInfo
*exception;
LinkedListInfo
*paths;
exception=AcquireExceptionInfo();
paths=GetConfigurePaths(MagickURLFilename,exception);
exception=DestroyExceptionInfo(exception);
if (paths == (LinkedListInfo *) NULL)
return(ConstantString(MagickHomeURL));
element=(const char *) GetNextValueInLinkedList(paths);
while (element != (const char *) NULL)
{
(void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",element,
DirectorySeparator,MagickURLFilename);
if (IsPathAccessible(path) != MagickFalse)
return(ConstantString(path));
element=(const char *) GetNextValueInLinkedList(paths);
}
return(ConstantString(MagickHomeURL));
}
MagickExport const char *GetMagickLicense(void)
{
return(MagickAuthoritativeLicense);
}
MagickExport const char *GetMagickPackageName(void)
{
return(MagickPackageName);
}
MagickExport const char *GetMagickQuantumDepth(size_t *depth)
{
if (depth != (size_t *) NULL)
*depth=(size_t) MAGICKCORE_QUANTUM_DEPTH;
return(MagickQuantumDepth);
}
MagickExport const char *GetMagickQuantumRange(size_t *range)
{
if (range != (size_t *) NULL)
*range=(size_t) QuantumRange;
return(MagickQuantumRange);
}
MagickExport const char *GetMagickReleaseDate(void)
{
return(MagickReleaseDate);
}
static unsigned int CRC32(const unsigned char *message,const size_t length)
{
register ssize_t
i;
static MagickBooleanType
crc_initial = MagickFalse;
static unsigned int
crc_xor[256];
unsigned int
crc;
if (crc_initial == MagickFalse)
{
register unsigned int
i;
unsigned int
alpha;
for (i=0; i < 256; i++)
{
register ssize_t
j;
alpha=i;
for (j=0; j < 8; j++)
alpha=(alpha & 0x01) ? (0xEDB88320 ^ (alpha >> 1)) : (alpha >> 1);
crc_xor[i]=alpha;
}
crc_initial=MagickTrue;
}
crc=0xFFFFFFFF;
for (i=0; i < (ssize_t) length; i++)
crc=crc_xor[(crc ^ message[i]) & 0xff] ^ (crc >> 8);
return(crc ^ 0xFFFFFFFF);
}
MagickExport unsigned int GetMagickSignature(const StringInfo *nonce)
{
register unsigned char
*p;
StringInfo
*version;
unsigned int
signature;
version=AcquireStringInfo(MaxTextExtent);
p=GetStringInfoDatum(version);
signature=MAGICKCORE_QUANTUM_DEPTH;
(void) memcpy(p,&signature,sizeof(signature));
p+=sizeof(signature);
signature=MAGICKCORE_HDRI_ENABLE;
(void) memcpy(p,&signature,sizeof(signature));
p+=sizeof(signature);
signature=MagickLibInterface;
(void) memcpy(p,&signature,sizeof(signature));
p+=sizeof(signature);
signature=1;
(void) memcpy(p,&signature,sizeof(signature));
p+=sizeof(signature);
SetStringInfoLength(version,p-GetStringInfoDatum(version));
if (nonce != (const StringInfo *) NULL)
ConcatenateStringInfo(version,nonce);
signature=CRC32(GetStringInfoDatum(version),GetStringInfoLength(version));
version=DestroyStringInfo(version);
return(signature);
}
MagickExport const char *GetMagickVersion(size_t *version)
{
if (version != (size_t *) NULL)
*version=MagickLibVersion;
return(MagickVersion);
}
MagickExport void ListMagickVersion(FILE *file)
{
(void) FormatLocaleFile(file,"Version: %s\n",
GetMagickVersion((size_t *) NULL));
(void) FormatLocaleFile(file,"Copyright: %s\n",GetMagickCopyright());
(void) FormatLocaleFile(file,"License: %s\n",GetMagickLicense());
#if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_MSC_FULL_VER)
(void) FormatLocaleFile(file,"Visual C++: %d\n",_MSC_FULL_VER);
#endif
(void) FormatLocaleFile(file,"Features: %s\n",GetMagickFeatures());
(void) FormatLocaleFile(file,"Delegates (built-in): %s\n",
GetMagickDelegates());
}