/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % R e l i n q u i s h U n i q u e F i l e R e s o u r c e % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % RelinquishUniqueFileResource() relinquishes a unique file resource. % % The format of the RelinquishUniqueFileResource() method is: % % MagickBooleanType RelinquishUniqueFileResource(const char *path) % % A description of each parameter follows: % % o name: the name of the temporary resource. % */ MagickExport MagickBooleanType RelinquishUniqueFileResource(const char *path) { char cache_path[MaxTextExtent]; assert(path != (const char *) NULL); (void) LogMagickEvent(ResourceEvent,GetMagickModule(),"%s",path); if (temporary_resources != (SplayTreeInfo *) NULL) { register char *p; ResetSplayTreeIterator(temporary_resources); p=(char *) GetNextKeyInSplayTree(temporary_resources); while (p != (char *) NULL) { if (LocaleCompare(p,path) == 0) break; p=(char *) GetNextKeyInSplayTree(temporary_resources); } if (p != (char *) NULL) (void) DeleteNodeFromSplayTree(temporary_resources,p); } (void) CopyMagickString(cache_path,path,MaxTextExtent); AppendImageFormat("cache",cache_path); (void) remove_utf8(cache_path); return(remove_utf8(path) == 0 ? MagickTrue : MagickFalse); }
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % G e t N e x t I m a g e R e g i s t r y % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % GetNextImageRegistry() gets the next image registry value. % % The format of the GetNextImageRegistry method is: % % char *GetNextImageRegistry(void) % */ MagickExport char *GetNextImageRegistry(void) { if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); if (registry == (void *) NULL) return((char *) NULL); return((char *) GetNextKeyInSplayTree(registry)); }
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % + A s y n c h r o n o u s R e s o u r c e C o m p o n e n t T e r m i n u s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % AsynchronousResourceComponentTerminus() destroys the resource environment. % It differs from ResourceComponentTerminus() in that it can be called from a % asynchronous signal handler. % % The format of the ResourceComponentTerminus() method is: % % ResourceComponentTerminus(void) % */ MagickPrivate void AsynchronousResourceComponentTerminus(void) { const char *path; if (temporary_resources == (SplayTreeInfo *) NULL) return; /* Remove any lingering temporary files. */ ResetSplayTreeIterator(temporary_resources); path=(const char *) GetNextKeyInSplayTree(temporary_resources); while (path != (const char *) NULL) { (void) remove_utf8(path); path=(const char *) GetNextKeyInSplayTree(temporary_resources); } }
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % + A s y n c h r o n o u s D e s t r o y M a g i c k R e s o u r c e s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % AsynchronousDestroyMagickResources() destroys the resource environment. % It differs from DestroyMagickResources() in that it can be called from a % asynchronous signal handler. % % The format of the DestroyMagickResources() method is: % % DestroyMagickResources(void) % */ MagickExport void AsynchronousDestroyMagickResources(void) { const char *path; if (temporary_resources == (SplayTreeInfo *) NULL) return; /* Remove any lingering temporary files. */ ResetSplayTreeIterator(temporary_resources); path=(const char *) GetNextKeyInSplayTree(temporary_resources); while (path != (const char *) NULL) { (void) remove(path); path=(const char *) GetNextKeyInSplayTree(temporary_resources); } }
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % G e t N e x t I m a g e A r t i f a c t % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % GetNextImageArtifact() gets the next image artifact value. % % The format of the GetNextImageArtifact method is: % % char *GetNextImageArtifact(const Image *image) % % A description of each parameter follows: % % o image: the image. % */ MagickExport char *GetNextImageArtifact(const Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->artifacts == (void *) NULL) return((char *) NULL); return((char *) GetNextKeyInSplayTree((SplayTreeInfo *) image->artifacts)); }