MagickCore  6.9.11
Convert, Edit, Or Compose Bitmap Images
delegate.c File Reference
#include "magick/studio.h"
#include "magick/artifact.h"
#include "magick/attribute.h"
#include "magick/blob.h"
#include "magick/client.h"
#include "magick/configure.h"
#include "magick/constitute.h"
#include "magick/delegate.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/hashmap.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/memory_.h"
#include "magick/nt-base-private.h"
#include "magick/option.h"
#include "magick/policy.h"
#include "magick/property.h"
#include "magick/resource_.h"
#include "magick/semaphore.h"
#include "magick/signature.h"
#include "magick/string_.h"
#include "magick/token.h"
#include "magick/token-private.h"
#include "magick/utility.h"
#include "magick/utility-private.h"
#include "magick/xml-tree.h"
#include "magick/xml-tree-private.h"
Include dependency graph for delegate.c:

Macros

#define DelegateFilename   "delegates.xml"
 
#define ExtendInterpretText(string_length)
 
#define AppendKeyValue2Text(key, value)
 
#define AppendString2Text(string)
 

Functions

static MagickBooleanType IsDelegateCacheInstantiated (ExceptionInfo *)
 
static MagickBooleanType LoadDelegateCache (LinkedListInfo *, const char *, const char *, const size_t, ExceptionInfo *)
 
static LinkedListInfoAcquireDelegateCache (const char *filename, ExceptionInfo *exception)
 
MagickExport MagickBooleanType DelegateComponentGenesis (void)
 
static void * DestroyDelegate (void *delegate_info)
 
MagickExport void DelegateComponentTerminus (void)
 
MagickExport int ExternalDelegateCommand (const MagickBooleanType asynchronous, const MagickBooleanType verbose, const char *command, char *message, ExceptionInfo *exception)
 
static char * SanitizeDelegateString (const char *source)
 
static char * GetMagickPropertyLetter (const ImageInfo *image_info, Image *image, const char letter)
 
static char * InterpretDelegateProperties (const ImageInfo *image_info, Image *image, const char *embed_text)
 
MagickExport char * GetDelegateCommand (const ImageInfo *image_info, Image *image, const char *decode, const char *encode, ExceptionInfo *exception)
 
MagickExport const char * GetDelegateCommands (const DelegateInfo *delegate_info)
 
MagickExport const DelegateInfoGetDelegateInfo (const char *decode, const char *encode, ExceptionInfo *exception)
 
static int DelegateInfoCompare (const void *x, const void *y)
 
MagickExport const DelegateInfo ** GetDelegateInfoList (const char *pattern, size_t *number_delegates, ExceptionInfo *exception)
 
static int DelegateCompare (const void *x, const void *y)
 
MagickExport char ** GetDelegateList (const char *pattern, size_t *number_delegates, ExceptionInfo *exception)
 
MagickExport ssize_t GetDelegateMode (const DelegateInfo *delegate_info)
 
MagickExport MagickBooleanType GetDelegateThreadSupport (const DelegateInfo *delegate_info)
 
static MagickBooleanType CopyDelegateFile (const char *source, const char *destination, const MagickBooleanType overwrite)
 
MagickExport MagickBooleanType InvokeDelegate (ImageInfo *image_info, Image *image, const char *decode, const char *encode, ExceptionInfo *exception)
 
MagickExport MagickBooleanType ListDelegateInfo (FILE *file, ExceptionInfo *exception)
 

Variables

static const char * DelegateMap
 
static LinkedListInfodelegate_cache = (LinkedListInfo *) NULL
 
static SemaphoreInfodelegate_semaphore = (SemaphoreInfo *) NULL
 

Macro Definition Documentation

◆ AppendKeyValue2Text

#define AppendKeyValue2Text (   key,
  value 
)
Value:
{ \
size_t length=strlen(key)+strlen(value)+2; \
if ((size_t) (q-interpret_text+length+1) >= extent) \
{ \
extent+=length; \
interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \
MaxTextExtent,sizeof(*interpret_text)); \
if (interpret_text == (char *) NULL) \
return((char *) NULL); \
q=interpret_text+strlen(interpret_text); \
} \
q+=FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \
}
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
Definition: locale.c:497
MagickExport void * ResizeQuantumMemory(void *memory, const size_t count, const size_t quantum)
Definition: memory.c:1408
#define MaxTextExtent
Definition: method-attribute.h:89

◆ AppendString2Text

#define AppendString2Text (   string)
Value:
{ \
size_t length=strlen((string)); \
if ((size_t) (q-interpret_text+length+1) >= extent) \
{ \
extent+=length; \
interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \
MaxTextExtent,sizeof(*interpret_text)); \
if (interpret_text == (char *) NULL) \
return((char *) NULL); \
q=interpret_text+strlen(interpret_text); \
} \
(void) CopyMagickString(q,(string),extent); \
q+=length; \
}
MagickExport size_t CopyMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
Definition: string.c:753
MagickExport void * ResizeQuantumMemory(void *memory, const size_t count, const size_t quantum)
Definition: memory.c:1408
#define MaxTextExtent
Definition: method-attribute.h:89

◆ DelegateFilename

#define DelegateFilename   "delegates.xml"

◆ ExtendInterpretText

#define ExtendInterpretText (   string_length)
Value:
{ \
size_t length=(string_length); \
if ((size_t) (q-interpret_text+length+1) >= extent) \
{ \
extent+=length; \
interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \
MaxTextExtent,sizeof(*interpret_text)); \
if (interpret_text == (char *) NULL) \
return((char *) NULL); \
q=interpret_text+strlen(interpret_text); \
} \
}
MagickExport void * ResizeQuantumMemory(void *memory, const size_t count, const size_t quantum)
Definition: memory.c:1408
#define MaxTextExtent
Definition: method-attribute.h:89

Function Documentation

◆ AcquireDelegateCache()

◆ CopyDelegateFile()

static MagickBooleanType CopyDelegateFile ( const char *  source,
const char *  destination,
const MagickBooleanType  overwrite 
)
static

◆ DelegateCompare()

static int DelegateCompare ( const void *  x,
const void *  y 
)
static

References LocaleCompare().

Referenced by GetDelegateList().

◆ DelegateComponentGenesis()

MagickExport MagickBooleanType DelegateComponentGenesis ( void  )

◆ DelegateComponentTerminus()

MagickExport void DelegateComponentTerminus ( void  )

References ActivateSemaphoreInfo(), delegate_cache, delegate_semaphore, DestroyDelegate(), DestroyLinkedList(), DestroySemaphoreInfo(), LockSemaphoreInfo(), and UnlockSemaphoreInfo().

Referenced by MagickCoreTerminus().

Here is the caller graph for this function:

◆ DelegateInfoCompare()

static int DelegateInfoCompare ( const void *  x,
const void *  y 
)
static

References LocaleCompare().

Referenced by GetDelegateInfoList().

◆ DestroyDelegate()

◆ ExternalDelegateCommand()

MagickExport int ExternalDelegateCommand ( const MagickBooleanType  asynchronous,
const MagickBooleanType  verbose,
const char *  command,
char *  message,
ExceptionInfo exception 
)

References ConcatenateMagickString(), DelegateError, DelegatePolicyDomain, DestroyString(), ExecutePolicyRights, FormatLocaleFile(), GetMagickModule, IsRightsAuthorized(), MACSystemCommand(), MagickFalse, MaxTextExtent, PolicyError, RelinquishMagickMemory(), SanitizeString(), StringToArgv(), and ThrowMagickException().

Referenced by InvokeDelegate(), and SystemCommand().

Here is the caller graph for this function:

◆ GetDelegateCommand()

◆ GetDelegateCommands()

MagickExport const char* GetDelegateCommands ( const DelegateInfo delegate_info)

◆ GetDelegateInfo()

◆ GetDelegateInfoList()

MagickExport const DelegateInfo** GetDelegateInfoList ( const char *  pattern,
size_t *  number_delegates,
ExceptionInfo exception 
)

◆ GetDelegateList()

◆ GetDelegateMode()

MagickExport ssize_t GetDelegateMode ( const DelegateInfo delegate_info)

References GetMagickModule, LogMagickEvent(), MagickCoreSignature, _DelegateInfo::mode, _DelegateInfo::signature, and TraceEvent.

Referenced by WriteImage().

Here is the caller graph for this function:

◆ GetDelegateThreadSupport()

◆ GetMagickPropertyLetter()

◆ InterpretDelegateProperties()

◆ InvokeDelegate()

◆ IsDelegateCacheInstantiated()

◆ ListDelegateInfo()

◆ LoadDelegateCache()

◆ SanitizeDelegateString()

static char* SanitizeDelegateString ( const char *  source)
static

References AcquireString().

Referenced by GetMagickPropertyLetter().

Variable Documentation

◆ delegate_cache

◆ delegate_semaphore

◆ DelegateMap

const char* DelegateMap
static

Referenced by AcquireDelegateCache().