00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MAGICKWAND_STUDIO_H
00019 #define MAGICKWAND_STUDIO_H
00020
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024
00025 #if defined(WIN32) || defined(WIN64)
00026 # define MAGICKWAND_WINDOWS_SUPPORT
00027 #else
00028 # define MAGICKWAND_POSIX_SUPPORT
00029 #endif
00030
00031 #define MAGICKWAND_IMPLEMENTATION 1
00032
00033 #if !defined(MAGICKWAND_CONFIG_H)
00034 # define MAGICKWAND_CONFIG_H
00035 # if !defined(vms) && !defined(macintosh)
00036 # include "magick/magick-config.h"
00037 # else
00038 # include "magick-config.h"
00039 # endif
00040 #if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
00041 # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
00042 #endif
00043 #if defined(_magickcore_const) && !defined(const)
00044 # define const _magickcore_const
00045 #endif
00046 #if defined(_magickcore_inline) && !defined(inline)
00047 # define inline _magickcore_inline
00048 #endif
00049 # if defined(__cplusplus) || defined(c_plusplus)
00050 # undef inline
00051 # endif
00052 #endif
00053
00054 #if !defined(const)
00055 # define STDC
00056 #endif
00057
00058 #include <stdarg.h>
00059 #include <stdio.h>
00060 #if defined(MAGICKCORE_HAVE_SYS_STAT_H)
00061 # include <sys/stat.h>
00062 #endif
00063 #if defined(MAGICKCORE_STDC_HEADERS)
00064 # include <stdlib.h>
00065 # include <stddef.h>
00066 #else
00067 # if defined(MAGICKCORE_HAVE_STDLIB_H)
00068 # include <stdlib.h>
00069 # endif
00070 #endif
00071 #if !defined(magick_restrict)
00072 # if !defined(_magickcore_restrict)
00073 # define magick_restrict restrict
00074 # else
00075 # define magick_restrict _magickcore_restrict
00076 # endif
00077 #endif
00078 #if defined(MAGICKCORE_HAVE_STRING_H)
00079 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
00080 # include <memory.h>
00081 # endif
00082 # include <string.h>
00083 #endif
00084 #if defined(MAGICKCORE_HAVE_STRINGS_H)
00085 # include <strings.h>
00086 #endif
00087 #if defined(MAGICKCORE_HAVE_INTTYPES_H)
00088 # include <inttypes.h>
00089 #endif
00090 #if defined(MAGICKCORE_HAVE_STDINT_H)
00091 # include <stdint.h>
00092 #endif
00093 #if defined(MAGICKCORE_HAVE_UNISTD_H)
00094 # include <unistd.h>
00095 #endif
00096 #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
00097 #define _CRTDBG_MAP_ALLOC
00098 #endif
00099
00100 #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
00101 #define _CRTDBG_MAP_ALLOC
00102 #endif
00103 #if defined(MAGICKWAND_WINDOWS_SUPPORT)
00104 # include <io.h>
00105 #if !defined(__CYGWIN__)
00106 # include <direct.h>
00107 #endif
00108 # if !defined(MAGICKCORE_HAVE_STRERROR)
00109 # define HAVE_STRERROR
00110 # endif
00111 #endif
00112
00113 #include <ctype.h>
00114 #include <locale.h>
00115 #include <errno.h>
00116 #include <fcntl.h>
00117 #include <math.h>
00118 #include <time.h>
00119 #include <limits.h>
00120 #include <signal.h>
00121 #include <assert.h>
00122
00123 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
00124 # include <xlocale.h>
00125 #endif
00126 #if defined(MAGICKCORE_THREAD_SUPPORT)
00127 # include <pthread.h>
00128 #endif
00129 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
00130 # include <sys/syslimits.h>
00131 #endif
00132 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
00133 # include <arm/limits.h>
00134 #endif
00135
00136 #if defined(MAGICKCORE__OPENCL) && !defined(MAGICK_PIXEL_RGBA)
00137 #if defined(MAGICKCORE_HAVE_CL_CL_H)
00138 # include <CL/cl.h>
00139 #endif
00140 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
00141 # include <OpenCL/cl.h>
00142 #endif
00143 # define MAGICKCORE_OPENCL_SUPPORT 1
00144 #endif
00145
00146 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
00147 # include <omp.h>
00148 # define MAGICKCORE_OPENMP_SUPPORT 1
00149 #endif
00150
00151 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00152 ssize_t pread(int,void *,size_t,off_t);
00153 #endif
00154
00155 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00156 ssize_t pwrite(int,const void *,size_t,off_t);
00157 #endif
00158
00159 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00160 extern size_t strlcpy(char *,const char *,size_t);
00161 #endif
00162
00163 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00164 extern int vsnprintf(char *,size_t,const char *,va_list);
00165 #endif
00166
00167 #if defined(MAGICKWAND_WINDOWS_SUPPORT) || defined(MAGICKWAND_POSIX_SUPPORT)
00168 # include <sys/types.h>
00169 # include <sys/stat.h>
00170 # if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
00171 # include <sys/timeb.h>
00172 # endif
00173 # if defined(MAGICKWAND_POSIX_SUPPORT)
00174 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00175 # define dirent direct
00176 # define NAMLEN(dirent) (dirent)->d_namlen
00177 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00178 # include <sys/ndir.h>
00179 # endif
00180 # if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00181 # include <sys/dir.h>
00182 # endif
00183 # if defined(MAGICKCORE_HAVE_NDIR_H)
00184 # include <ndir.h>
00185 # endif
00186 # else
00187 # include <dirent.h>
00188 # define NAMLEN(dirent) strlen((dirent)->d_name)
00189 # endif
00190 # include <sys/wait.h>
00191 # include <pwd.h>
00192 # endif
00193 # if !defined(S_ISDIR)
00194 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00195 # endif
00196 # if !defined(S_ISREG)
00197 # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00198 # endif
00199 # include "wand/MagickWand.h"
00200 # if !defined(MAGICKWAND_WINDOWS_SUPPORT)
00201 # include <sys/time.h>
00202 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00203 # include <sys/times.h>
00204 # endif
00205 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00206 # include <sys/resource.h>
00207 # endif
00208 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
00209 # include <sys/mman.h>
00210 # endif
00211 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
00212 # include <sys/sendfile.h>
00213 # endif
00214 #endif
00215 #else
00216 # include <types.h>
00217 # include <stat.h>
00218 # if defined(macintosh)
00219 # if !defined(DISABLE_SIOUX)
00220 # include <SIOUX.h>
00221 # include <console.h>
00222 # endif
00223 # include <unix.h>
00224 # endif
00225 #endif
00226
00227 #if defined(S_IRUSR) && defined(S_IWUSR)
00228 # define S_MODE (S_IRUSR | S_IWUSR)
00229 #elif defined (MAGICKWAND_WINDOWS_SUPPORT)
00230 # define S_MODE (_S_IREAD | _S_IWRITE)
00231 #else
00232 # define S_MODE 0600
00233 #endif
00234
00235 #if defined(MAGICKWAND_WINDOWS_SUPPORT)
00236 # include "magick/nt-base.h"
00237 #endif
00238 #if defined(macintosh)
00239 # include "magick/mac.h"
00240 #endif
00241 #if defined(vms)
00242 # include "magick/vms.h"
00243 #endif
00244
00245 #include "wand/MagickWand.h"
00246
00247 #undef HAVE_CONFIG_H
00248 #undef gamma
00249 #undef index
00250 #undef pipe
00251 #undef y1
00252
00253
00254
00255
00256 #if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__)
00257 # define DirectorySeparator "/"
00258 # define DirectoryListSeparator ':'
00259 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
00260 # define Exit exit
00261 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
00262 # define X11_PREFERENCES_PATH "~/."
00263 # define ProcessPendingEvents(text)
00264 # define ReadCommandlLine(argc,argv)
00265 # define SetNotifyHandlers
00266 #else
00267 # if defined(vms)
00268 # define X11_APPLICATION_PATH "decw$system_defaults:"
00269 # define DirectorySeparator ""
00270 # define DirectoryListSeparator ';'
00271 # define EditorOptions ""
00272 # define Exit exit
00273 # define IsBasenameSeparator(c) \
00274 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00275 # define MAGICKCORE_LIBRARY_PATH "sys$login:"
00276 # define MAGICKCORE_SHARE_PATH "sys$login:"
00277 # define X11_PREFERENCES_PATH "decw$user_defaults:"
00278 # define ProcessPendingEvents(text)
00279 # define ReadCommandlLine(argc,argv)
00280 # define SetNotifyHandlers
00281 # endif
00282 # if defined(__OS2__)
00283 # define DirectorySeparator "\\"
00284 # define DirectoryListSeparator ';'
00285 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
00286 # define Exit exit
00287 # define IsBasenameSeparator(c) \
00288 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00289 # define PreferencesDefaults "~\."
00290 # define ProcessPendingEvents(text)
00291 # define ReadCommandlLine(argc,argv)
00292 # define SetNotifyHandlers
00293 #endif
00294 # if defined(macintosh)
00295 # define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/"
00296 # define DirectorySeparator ":"
00297 # define DirectoryListSeparator ';'
00298 # define EditorOptions ""
00299 # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse)
00300 # define MAGICKCORE_LIBRARY_PATH ""
00301 # define MAGICKCORE_SHARE_PATH ""
00302 # define X11_PREFERENCES_PATH "~/."
00303 # if defined(DISABLE_SIOUX)
00304 # define ReadCommandlLine(argc,argv)
00305 # define SetNotifyHandlers \
00306 SetFatalErrorHandler(MacFatalErrorHandler); \
00307 SetErrorHandler(MACErrorHandler); \
00308 SetWarningHandler(MACWarningHandler)
00309 # else
00310 # define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
00311 # define SetNotifyHandlers \
00312 SetErrorHandler(MACErrorHandler); \
00313 SetWarningHandler(MACWarningHandler)
00314 # endif
00315 # endif
00316 # if defined(MAGICKWAND_WINDOWS_SUPPORT)
00317 # define DirectorySeparator "\\"
00318 # define DirectoryListSeparator ';'
00319 # define EditorOptions ""
00320 # define IsBasenameSeparator(c) \
00321 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00322 # define ProcessPendingEvents(text)
00323 # if !defined(X11_PREFERENCES_PATH)
00324 # define X11_PREFERENCES_PATH "~\\."
00325 # endif
00326 # define ReadCommandlLine(argc,argv)
00327 # define SetNotifyHandlers \
00328 SetErrorHandler(NTErrorHandler); \
00329 SetWarningHandler(NTWarningHandler)
00330 # if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00331 # define HAVE_TIFFCONF_H
00332 # endif
00333 # endif
00334
00335 #endif
00336
00337
00338
00339
00340 #if !defined(STDIN_FILENO)
00341 #define STDIN_FILENO 0x00
00342 #endif
00343
00344 #if !defined(O_BINARY)
00345 #define O_BINARY 0x00
00346 #endif
00347
00348 #if !defined(PATH_MAX)
00349 #define PATH_MAX 4096
00350 #endif
00351
00352
00353
00354
00355 #if defined(_MSC_VER)
00356 # define DisableMSCWarning(nr) __pragma(warning(push)) \
00357 __pragma(warning(disable:nr))
00358 # define RestoreMSCWarning __pragma(warning(pop))
00359 #else
00360 # define DisableMSCWarning(nr)
00361 # define RestoreMSCWarning
00362 #endif
00363
00364 #if defined(__cplusplus) || defined(c_plusplus)
00365 }
00366 #endif
00367
00368 #endif