2
Copyright (C) 2003, 2004 GraphicsMagick Group
3
Copyright (C) 2002 ImageMagick Studio
4
Copyright 1991-1999 E. I. du Pont de Nemours and Company
6
This program is covered by multiple licenses, which are described in
7
Copyright.txt. You should have received a copy of Copyright.txt with this
8
package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
10
ImageMagick Utility Methods.
12
#ifndef _MAGICK_UTILITY_H
13
#define _MAGICK_UTILITY_H
15
#if defined(__cplusplus) || defined(c_plusplus)
37
typedef struct _TokenInfo
55
#if !defined(__GNUC__) && !defined(__attribute__)
56
# define __attribute__(x) /*nothing*/
59
extern MagickExport char
60
*AcquireString(const char *),
61
*AllocateString(const char *),
62
*Base64Encode(const unsigned char *,const size_t,size_t *),
63
*EscapeString(const char *,const char),
64
*GetPageGeometry(const char *),
65
**ListFiles(const char *,const char *,long *),
66
*SetClientName(const char *),
67
**StringToArgv(const char *,int *),
68
**StringToList(const char *),
69
*TranslateText(const ImageInfo *,Image *,const char *);
71
extern MagickExport const char
72
*GetClientFilename(void),
73
*SetClientFilename(const char *),
76
*SetClientPath(const char *);
78
extern MagickExport double
79
StringToDouble(const char *,const double);
81
extern MagickExport int
82
GetGeometry(const char *,long *,long *,unsigned long *,unsigned long *),
83
GlobExpression(const char *,const char *),
84
LocaleNCompare(const char *,const char *,const size_t),
85
LocaleCompare(const char *,const char *),
86
GetMagickDimension(const char *str,double *width,double *height),
87
GetMagickGeometry(const char *,long *,long *,unsigned long *,unsigned long *),
88
SubstituteString(char **,const char*,const char *),
89
SystemCommand(const unsigned int,const char *),
90
Tokenizer(TokenInfo *,unsigned,char *,size_t,char *,char *,char *,char *,
91
char,char *,int *,char *);
93
extern MagickExport unsigned char
94
*Base64Decode(const char *, size_t *);
96
extern MagickExport unsigned int
97
CloneString(char **,const char *),
98
ConcatenateString(char **,const char *),
99
ExpandFilenames(int *,char ***),
100
GetExecutionPath(char *),
101
GetExecutionPathUsingName(char *),
102
IsAccessible(const char *),
103
IsAccessibleNoLogging(const char *),
104
IsAccessibleAndNotEmpty(const char *),
105
IsGeometry(const char *),
106
IsGlob(const char *);
108
extern MagickExport unsigned long
109
MultilineCensus(const char *);
111
extern MagickExport void
112
*AcquireMemory(const size_t),
113
AppendImageFormat(const char *,char *),
114
*CloneMemory(void *,const void *,const size_t),
115
DefineClientName(const char *),
116
DefineClientPathAndName(const char *),
117
ExpandFilename(char *),
118
FormatSize(const magick_int64_t size,char *format),
119
GetPathComponent(const char *,PathType,char *),
120
GetToken(const char *,char **,char *),
121
LiberateMemory(void **),
124
ReacquireMemory(void **,const size_t),
126
SetGeometry(const Image *,RectangleInfo *),
127
TemporaryFilename(char *);
129
extern MagickExport void
130
FormatString(char *,const char *,...) __attribute__((format (printf,2,3)));
132
#if defined(MAGICK_IMPLEMENTATION)
137
#define MagickAllocateMemory(type,size) ((type) malloc((size_t) (size)))
140
Free memory and set pointer to NULL
142
#define MagickFreeMemory(memory) \
154
Reallocate memory using provided pointer. If pointer value is null,
155
then allocate new memory. If reallocation fails then free memory,
156
setting pointer to NULL.
157
C++ does not accept the final memory=_magick_mp without a cast.
159
#define MagickReallocMemory(memory,size) \
163
_magick_mp=malloc((size_t) (size)); \
166
_magick_mp=realloc(memory,(size_t) (size)); \
167
if (_magick_mp == 0) \
174
Force argument into range accepted by <ctype.h> functions.
176
#define CTYPE_ARG(value) ((int) ((unsigned char) (value)))
178
#endif /* defined(MAGICK_IMPLEMENTATION) */
180
#if defined(__cplusplus) || defined(c_plusplus)