#include "MagickCore/utility-private.h"
#include "MagickCore/version.h"
#include "MagickCore/xml-tree.h"
+#include "MagickCore/xml-tree-private.h"
\f
/*
Define declarations.
static MagickBooleanType
IsLogCacheInstantiated(ExceptionInfo *),
- LoadLogCache(const char *,const char *,const size_t,ExceptionInfo *);
+ LoadLogCache(LinkedListInfo *,const char *,const char *,const size_t,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
option=(const StringInfo *) GetNextValueInLinkedList(options);
while (option != (const StringInfo *) NULL)
{
- status&=LoadLogCache((const char *) GetStringInfoDatum(option),
+ status&=LoadLogCache(log_cache,(const char *) GetStringInfoDatum(option),
GetStringInfoPath(option),0,exception);
option=(const StringInfo *) GetNextValueInLinkedList(options);
}
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% IsLogCacheInstantiated() determines if the log list is instantiated. If not,
-% it instantiates the list and returns it.
+% IsLogCacheInstantiated() determines if the log list is instantiated. If
+% not, it instantiates the list and returns it.
%
% The format of the IsLogInstantiated method is:
%
size_t
mask;
+ if (LogHandlers[j].name == (const char *) NULL)
+ break;
mask=1;
mask<<=j;
if ((log_info[i]->handler_mask & mask) != 0)
ExceptionInfo
*exception;
- log_semaphore=AcquireSemaphoreInfo();
+ if (log_semaphore == (SemaphoreInfo *) NULL)
+ log_semaphore=AcquireSemaphoreInfo();
exception=AcquireExceptionInfo();
(void) GetLogInfo("*",exception);
exception=DestroyExceptionInfo(exception);
"encoding=\"UTF-8\" standalone=\"yes\"?>\n");
(void) FormatLocaleFile(log_info->file,"<log>\n");
}
- (void) FormatLocaleFile(log_info->file," <event>%s</event>\n",text);
+ (void) FormatLocaleFile(log_info->file," <event>%s</event>\n",text);
(void) fflush(log_info->file);
}
if ((log_info->handler_mask & MethodHandler) != 0)
%
% The format of the LoadLogCache method is:
%
-% MagickBooleanType LoadLogCache(const char *xml,const char *filename,
-% const size_t depth,ExceptionInfo *exception)
+% MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+% const char *filename,const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType LoadLogCache(const char *xml,const char *filename,
- const size_t depth,ExceptionInfo *exception)
+static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
+ const char *filename,const size_t depth,ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
*/
if (xml == (const char *) NULL)
return(MagickFalse);
- if (log_cache == (LinkedListInfo *) NULL)
- {
- log_cache=NewLinkedList(0);
- if (log_cache == (LinkedListInfo *) NULL)
- {
- ThrowFileException(exception,ResourceLimitError,
- "MemoryAllocationFailed",filename);
- return(MagickFalse);
- }
- }
status=MagickTrue;
token=AcquireString((const char *) xml);
for (q=(const char *) xml; *q != '\0'; )
(void) CopyMagickString(path,token,MaxTextExtent);
else
(void) ConcatenateMagickString(path,token,MaxTextExtent);
- xml=FileToString(path,~0UL,exception);
+ xml=FileToXML(path,~0UL);
if (xml != (char *) NULL)
{
- status&=LoadLogCache(xml,path,depth+1,exception);
+ status&=LoadLogCache(log_cache,xml,path,depth+1,
+ exception);
xml=DestroyString(xml);
}
}