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