extern "C" {
#endif
-extern MagickPrivate MagickBooleanType
- ConstituteComponentGenesis(void);
-
-extern MagickPrivate void
- ConstituteComponentTerminus(void);
-
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#include "MagickCore/utility.h"
#include "MagickCore/utility-private.h"
\f
-static SemaphoreInfo
- *constitute_semaphore = (SemaphoreInfo *) NULL;
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-+ C o n s t i t u t e C o m p o n e n t G e n e s i s %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ConstituteComponentGenesis() instantiates the constitute component.
-%
-% The format of the ConstituteComponentGenesis method is:
-%
-% MagickBooleanType ConstituteComponentGenesis(void)
-%
-*/
-MagickPrivate MagickBooleanType ConstituteComponentGenesis(void)
-{
- constitute_semaphore=AcquireSemaphoreInfo();
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-+ C o n s t i t u t e C o m p o n e n t T e r m i n u s %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ConstituteComponentTerminus() destroys the constitute component.
-%
-% The format of the ConstituteComponentTerminus method is:
-%
-% ConstituteComponentTerminus(void)
-%
-*/
-MagickPrivate void ConstituteComponentTerminus(void)
-{
- if (constitute_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&constitute_semaphore);
- RelinquishSemaphoreInfo(&constitute_semaphore);
-}
-\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
image=DestroyImage(image);
}
image=NewImageList();
- if (constitute_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&constitute_semaphore);
if ((magick_info == (const MagickInfo *) NULL) ||
(GetImageDecoder(magick_info) == (DecodeImageHandler *) NULL))
{
{
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & DecoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
image=GetImageDecoder(magick_info)(read_info,exception);
if ((thread_support & DecoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
else
{
MaxTextExtent);
*read_info->filename='\0';
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(delegate_info->semaphore);
(void) InvokeDelegate(read_info,image,read_info->magick,(char *) NULL,
exception);
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(delegate_info->semaphore);
image=DestroyImageList(image);
read_info->temporary=MagickTrue;
(void) SetImageInfo(read_info,0,exception);
}
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & DecoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
image=(Image *) (GetImageDecoder(magick_info))(read_info,exception);
if ((thread_support & DecoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
if (read_info->temporary != MagickFalse)
{
(void) CloseBlob(image);
}
}
- if (constitute_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&constitute_semaphore);
if ((magick_info != (const MagickInfo *) NULL) &&
(GetImageEncoder(magick_info) != (EncodeImageHandler *) NULL))
{
*/
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & EncoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
status=GetImageEncoder(magick_info)(write_info,image,exception);
if ((thread_support & EncoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
else
{
*/
*write_info->filename='\0';
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(delegate_info->semaphore);
status=InvokeDelegate(write_info,image,(char *) NULL,
write_info->magick,exception);
if (GetDelegateThreadSupport(delegate_info) == MagickFalse)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(delegate_info->semaphore);
(void) CopyMagickString(image->filename,filename,MaxTextExtent);
}
else
*/
thread_support=GetMagickThreadSupport(magick_info);
if ((thread_support & EncoderThreadSupport) == 0)
- LockSemaphoreInfo(constitute_semaphore);
+ LockSemaphoreInfo(magick_info->semaphore);
status=GetImageEncoder(magick_info)(write_info,image,exception);
if ((thread_support & EncoderThreadSupport) == 0)
- UnlockSemaphoreInfo(constitute_semaphore);
+ UnlockSemaphoreInfo(magick_info->semaphore);
}
}
}
static LinkedListInfo *AcquireDelegateCache(const char *filename,
ExceptionInfo *exception)
{
-#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- return(LoadDelegateCache(DelegateMap,"built-in",0,exception));
-#else
const StringInfo
*option;
status=MagickTrue;
options=GetConfigureOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
while (option != (const StringInfo *) NULL)
{
status&=LoadDelegateCache((const char *) GetStringInfoDatum(option),
GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
+#endif
options=DestroyConfigureOptions(options);
- if ((delegate_cache == (LinkedListInfo *) NULL) ||
- (IfMagickTrue(IsLinkedListEmpty(delegate_cache))))
+ if (IfMagickTrue(IsLinkedListEmpty(delegate_cache)))
status&=LoadDelegateCache(DelegateMap,"built-in",0,exception);
return(delegate_cache);
-#endif
}
\f
/*
p->encode=DestroyString(p->encode);
if (p->commands != (char *) NULL)
p->commands=DestroyString(p->commands);
+ if (p->semaphore != (SemaphoreInfo *) NULL)
+ p->semaphore=RelinquishSemaphoreInfo(&p->semaphore);
p=(DelegateInfo *) RelinquishMagickMemory(p);
return((void *) NULL);
}
if (LocaleCompare((char *) keyword,"thread-support") == 0)
{
delegate_info->thread_support=IsStringTrue(token);
+ if (delegate_info->thread_support != MagickFalse)
+ delegate_info->semaphore=AcquireSemaphoreInfo();
break;
}
break;
extern "C" {
#endif
+#include <stdarg.h>
+#include "MagickCore/semaphore.h"
+
typedef struct _DelegateInfo
{
char
thread_support,
spawn,
stealth;
+
+ SemaphoreInfo
+ *semaphore;
size_t
signature;
static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename,
const char *locale,ExceptionInfo *exception)
{
-#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- return(LoadLocaleCache(LocaleMap,"built-in",locale,0,exception));
-#else
const StringInfo
*option;
status=MagickTrue;
options=GetLocaleOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
while (option != (const StringInfo *) NULL)
{
status&=LoadLocaleCache((const char *) GetStringInfoDatum(option),
GetStringInfoPath(option),locale,0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
+#endif
options=DestroyLocaleOptions(options);
- if ((locale_cache == (SplayTreeInfo *) NULL) ||
- (GetNumberOfNodesInSplayTree(locale_cache) == 0))
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
+ if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
{
options=GetLocaleOptions("english.xml",exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
options=DestroyLocaleOptions(options);
}
- if ((locale_cache == (SplayTreeInfo *) NULL) ||
- (GetNumberOfNodesInSplayTree(locale_cache) == 0))
+#endif
+ if (GetNumberOfNodesInSplayTree(locale_cache) == 0)
status&=LoadLocaleCache(LocaleMap,"built-in",locale,0,exception);
return(locale_cache);
-#endif
}
\f
#if defined(MAGICKCORE_HAVE_STRTOD_L)
p->description=DestroyString(p->description);
if (p->name != (char *) NULL)
p->name=DestroyString(p->name);
+ if (p->semaphore != (SemaphoreInfo *) NULL)
+ p->semaphore=RelinquishSemaphoreInfo(&p->semaphore);
return(RelinquishMagickMemory(p));
}
(void) ColorComponentGenesis();
(void) TypeComponentGenesis();
(void) MimeComponentGenesis();
- (void) ConstituteComponentGenesis();
(void) AnnotateComponentGenesis();
#if defined(MAGICKCORE_X11_DELEGATE)
(void) XComponentGenesis();
XComponentTerminus();
#endif
AnnotateComponentTerminus();
- ConstituteComponentTerminus();
MimeComponentTerminus();
TypeComponentTerminus();
ColorComponentTerminus();
extern "C" {
#endif
+#include <stdarg.h>
+#include "MagickCore/semaphore.h"
+
typedef enum
{
UndefinedFormatType,
MagickBooleanType
stealth;
+ SemaphoreInfo
+ *semaphore;
+
size_t
signature;
} MagickInfo;
**RelinquishMagickMatrix(double **,const size_t);
extern MagickExport MagickBooleanType
- GaussJordanElimination(double **,double **,const size_t,const size_t),
GetMatrixElement(const MatrixInfo *,const ssize_t,const ssize_t,void *),
NullMatrix(MatrixInfo *),
SetMatrixElement(const MatrixInfo *,const ssize_t,const ssize_t,const void *);
GetMatrixColumns(const MatrixInfo *),
GetMatrixRows(const MatrixInfo *);
-extern MagickExport void
- LeastSquaresAddTerms(double **,double **,const double *,const double *,
- const size_t,const size_t);
-
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
%
% The format of the RelinquishSemaphoreInfo method is:
%
-% void RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
+% SemaphoreInfo *RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
%
% A description of each parameter follows:
%
% o semaphore_info: Specifies a pointer to an SemaphoreInfo structure.
%
*/
-MagickExport void RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
+MagickExport SemaphoreInfo *RelinquishSemaphoreInfo(
+ SemaphoreInfo **semaphore_info)
{
assert(semaphore_info != (SemaphoreInfo **) NULL);
assert((*semaphore_info) != (SemaphoreInfo *) NULL);
(*semaphore_info)->signature=(~MagickSignature);
*semaphore_info=(SemaphoreInfo *) RelinquishSemaphoreMemory(*semaphore_info);
UnlockMagickMutex();
+ return((SemaphoreInfo *) NULL);
}
\f
/*
SemaphoreInfo;
extern MagickExport SemaphoreInfo
- *AcquireSemaphoreInfo(void);
+ *AcquireSemaphoreInfo(void),
+ *RelinquishSemaphoreInfo(SemaphoreInfo **);
extern MagickExport void
ActivateSemaphoreInfo(SemaphoreInfo **),
LockSemaphoreInfo(SemaphoreInfo *),
- RelinquishSemaphoreInfo(SemaphoreInfo **),
UnlockSemaphoreInfo(SemaphoreInfo *);
#if defined(__cplusplus) || defined(c_plusplus)
static SplayTreeInfo *AcquireTypeCache(const char *filename,
ExceptionInfo *exception)
{
-#if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
- return(LoadTypeCache(TypeMap,"built-in",0,exception));
-#else
char
*font_path,
path[MaxTextExtent];
*path='\0';
options=GetConfigureOptions(filename,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
while (option != (const StringInfo *) NULL)
{
(void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
+#endif
options=DestroyConfigureOptions(options);
font_path=GetEnvironmentValue("MAGICK_FONT_PATH");
+#if !defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT)
if (font_path != (char *) NULL)
{
char
}
font_path=DestroyString(font_path);
}
- if ((type_cache == (SplayTreeInfo *) NULL) ||
- (GetNumberOfNodesInSplayTree(type_cache) == 0))
+#endif
+ if (GetNumberOfNodesInSplayTree(type_cache) == 0)
status&=LoadTypeCache(TypeMap,"built-in",0,exception);
return(type_cache);
-#endif
}
\f
/*
#include "MagickCore/profile.h"
#include "MagickCore/property.h"
#include "MagickCore/quantum-private.h"
+#include "MagickCore/semaphore.h"
#include "MagickCore/static.h"
#include "MagickCore/statistic.h"
#include "MagickCore/string_.h"
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_LIBOPENJP2_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJP2Image;
entry->encoder=(EncodeImageHandler *) WriteJP2Image;
#include "MagickCore/property.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/resource_.h"
+#include "MagickCore/semaphore.h"
#include "MagickCore/splay-tree.h"
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
#endif
entry=SetMagickInfo("JPEG");
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_JPEG_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJPEGImage;
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("JPG");
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_JPEG_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJPEGImage;
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("PJPEG");
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
#if defined(MAGICKCORE_JPEG_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadJPEGImage;
entry->encoder=(EncodeImageHandler *) WriteJPEGImage;
entry->format_type=ImplicitFormatType;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString("Raw CCITT Group4");
entry->mime_type=ConstantString("image/tiff");
entry->module=ConstantString("TIFF");
entry->endian_support=MagickTrue;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString("Pyramid encoded TIFF");
entry->mime_type=ConstantString("image/tiff");
entry->module=ConstantString("TIFF");
entry->seekable_stream=MagickTrue;
entry->stealth=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString(TIFFDescription);
if (*version != '\0')
entry->version=ConstantString(version);
entry->endian_support=MagickTrue;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString(TIFFDescription);
if (*version != '\0')
entry->version=ConstantString(version);
entry->endian_support=MagickTrue;
entry->seekable_stream=MagickTrue;
entry->thread_support=NoThreadSupport;
+ entry->semaphore=AcquireSemaphoreInfo();
entry->description=ConstantString("Tagged Image File Format (64-bit)");
if (*version != '\0')
entry->version=ConstantString(version);