#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
#endif
#endif
+#if defined(MAGICKCORE_WINDOWS_SUPPORT)
+# include "MagickCore/nt-feature.h"
+#endif
\f
/*
Define declarations.
*/
static MagickBooleanType
IsTypeTreeInstantiated(ExceptionInfo *),
- LoadTypeCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadTypeCache(SplayTreeInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
static SplayTreeInfo *AcquireTypeCache(const char *filename,
ExceptionInfo *exception)
{
- char
- *font_path,
- path[MaxTextExtent];
-
- const StringInfo
- *option;
-
- LinkedListInfo
- *options;
-
MagickStatusType
status;
if (type_cache == (SplayTreeInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
status=MagickTrue;
- *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);
- status&=LoadTypeCache((const char *) GetStringInfoDatum(option),
- GetStringInfoPath(option),0,exception);
+ char
+ *font_path,
+ path[MaxTextExtent];
+
+ const StringInfo
+ *option;
+
+ LinkedListInfo
+ *options;
+
+ *path='\0';
+ options=GetConfigureOptions(filename,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)
+ while (option != (const StringInfo *) NULL)
{
- char
- *option;
-
- /*
- Search MAGICK_FONT_PATH.
- */
- (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
- DirectorySeparator,filename);
- option=FileToString(path,~0UL,exception);
- if (option != (void *) NULL)
- {
- status&=LoadTypeCache(option,path,0,exception);
- option=DestroyString(option);
- }
- font_path=DestroyString(font_path);
+ (void) CopyMagickString(path,GetStringInfoPath(option),MaxTextExtent);
+ status&=LoadTypeCache(type_cache,(const char *)
+ GetStringInfoDatum(option),GetStringInfoPath(option),0,exception);
+ option=(const StringInfo *) GetNextValueInLinkedList(options);
}
+ options=DestroyConfigureOptions(options);
+ font_path=GetEnvironmentValue("MAGICK_FONT_PATH");
+ if (font_path != (char *) NULL)
+ {
+ char
+ *option;
+
+ /*
+ Search MAGICK_FONT_PATH.
+ */
+ (void) FormatLocaleString(path,MaxTextExtent,"%s%s%s",font_path,
+ DirectorySeparator,filename);
+ option=FileToString(path,~0UL,exception);
+ if (option != (void *) NULL)
+ {
+ status&=LoadTypeCache(type_cache,option,path,0,exception);
+ option=DestroyString(option);
+ }
+ font_path=DestroyString(font_path);
+ }
+ }
#endif
if (GetNumberOfNodesInSplayTree(type_cache) == 0)
- status&=LoadTypeCache(TypeMap,"built-in",0,exception);
+ status&=LoadTypeCache(type_cache,TypeMap,"built-in",0,exception);
return(type_cache);
}
\f
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% IsTypeTreeInstantiated() etermines if the type tree is instantiated. If
+% IsTypeTreeInstantiated() determines if the type tree is instantiated. If
% not, it instantiates the tree and returns it.
%
% The format of the IsTypeInstantiated method is:
%
% The format of the LoadTypeCache method is:
%
-% MagickBooleanType LoadTypeCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
+% const char *xml,const char *filename,const size_t depth,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
return(MagickTrue);
}
-static MagickBooleanType LoadTypeCache(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
+ const char *xml,const char *filename,const size_t depth,
+ ExceptionInfo *exception)
{
char
font_path[MaxTextExtent],
"Loading type configure file \"%s\" ...",filename);
if (xml == (const char *) NULL)
return(MagickFalse);
- if (type_cache == (SplayTreeInfo *) NULL)
- {
- type_cache=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL,
- DestroyTypeNode);
- if (type_cache == (SplayTreeInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
type_info=(TypeInfo *) NULL;
token=AcquireString(xml);
sans_exception=DestroyExceptionInfo(sans_exception);
if (xml != (char *) NULL)
{
- status=LoadTypeCache(xml,path,depth+1,exception);
+ status&=LoadTypeCache(type_cache,xml,path,depth+1,
+ exception);
xml=(char *) RelinquishMagickMemory(xml);
}
}
*/
MagickPrivate MagickBooleanType TypeComponentGenesis(void)
{
- type_semaphore=AcquireSemaphoreInfo();
+ if (type_semaphore == (SemaphoreInfo *) NULL)
+ type_semaphore=AcquireSemaphoreInfo();
return(MagickTrue);
}
\f