00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MAGICKCORE_STUDIO_H
00019 #define MAGICKCORE_STUDIO_H
00020
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024
00025 #if defined(WIN32) || defined(WIN64)
00026 # define MAGICKCORE_WINDOWS_SUPPORT
00027 #else
00028 # define MAGICKCORE_POSIX_SUPPORT
00029 #endif
00030
00031 #define MAGICKCORE_IMPLEMENTATION 1
00032
00033 #if !defined(MAGICKCORE_CONFIG_H)
00034 # define MAGICKCORE_CONFIG_H
00035 #include "MagickCore/magick-config.h"
00036 # if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
00037 # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
00038 #endif
00039 #if defined(_magickcore_const) && !defined(const)
00040 # define const _magickcore_const
00041 #endif
00042 #if defined(_magickcore_inline) && !defined(inline)
00043 # define inline _magickcore_inline
00044 #endif
00045 # if defined(__cplusplus) || defined(c_plusplus)
00046 # undef inline
00047 # endif
00048 #endif
00049
00050 #if defined(MAGICKCORE_NAMESPACE_PREFIX)
00051 # include "MagickCore/methods.h"
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(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
00097 #define _CRTDBG_MAP_ALLOC
00098 #endif
00099 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00100 # include <io.h>
00101 #if !defined(__CYGWIN__)
00102 # include <direct.h>
00103 #endif
00104 # if !defined(MAGICKCORE_HAVE_STRERROR)
00105 # define HAVE_STRERROR
00106 # endif
00107 #endif
00108
00109 #include <ctype.h>
00110 #include <locale.h>
00111 #include <errno.h>
00112 #include <fcntl.h>
00113 #include <math.h>
00114 #include <time.h>
00115 #include <limits.h>
00116 #include <signal.h>
00117 #include <assert.h>
00118
00119 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
00120 # include <xlocale.h>
00121 #endif
00122 #if defined(MAGICKCORE_THREAD_SUPPORT)
00123 # include <pthread.h>
00124 #endif
00125 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00126 #if !defined(__CYGWIN__)
00127 #include <winsock2.h>
00128 #include <ws2tcpip.h>
00129 #endif
00130 #include <windows.h>
00131 #ifdef _MSC_VER
00132 #pragma comment (lib, "ws2_32.lib")
00133 #endif
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)
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 #include "MagickCore/method-attribute.h"
00174
00175 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
00176 # include <sys/types.h>
00177 # include <sys/stat.h>
00178 # if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
00179 # include <sys/timeb.h>
00180 # endif
00181 # if defined(MAGICKCORE_POSIX_SUPPORT)
00182 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00183 # define dirent direct
00184 # define NAMLEN(dirent) (dirent)->d_namlen
00185 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00186 # include <sys/ndir.h>
00187 # endif
00188 # if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00189 # include <sys/dir.h>
00190 # endif
00191 # if defined(MAGICKCORE_HAVE_NDIR_H)
00192 # include <ndir.h>
00193 # endif
00194 # else
00195 # include <dirent.h>
00196 # define NAMLEN(dirent) strlen((dirent)->d_name)
00197 # endif
00198 # include <sys/wait.h>
00199 # include <pwd.h>
00200 # endif
00201 # if !defined(S_ISDIR)
00202 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00203 # endif
00204 # if !defined(S_ISREG)
00205 # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00206 # endif
00207 # include "MagickCore/magick-type.h"
00208 # if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00209 # include <sys/time.h>
00210 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00211 # include <sys/times.h>
00212 # endif
00213 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00214 # include <sys/resource.h>
00215 # endif
00216 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
00217 # include <sys/mman.h>
00218 # endif
00219 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
00220 # include <sys/sendfile.h>
00221 # endif
00222 # if defined(MAGICKCORE_HAVE_SYS_SOCKET_H)
00223 # include <sys/socket.h>
00224 # endif
00225 # if defined(MAGICKCORE_HAVE_SYS_UIO_H)
00226 # include <sys/uio.h>
00227 # endif
00228 #endif
00229 #else
00230 # include <types.h>
00231 # include <stat.h>
00232 # if defined(macintosh)
00233 # if !defined(DISABLE_SIOUX)
00234 # include <SIOUX.h>
00235 # include <console.h>
00236 # endif
00237 # include <unix.h>
00238 # endif
00239 # include "MagickCore/magick-type.h"
00240 #endif
00241
00242 #if defined(S_IRUSR) && defined(S_IWUSR)
00243 # define S_MODE (S_IRUSR | S_IWUSR)
00244 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
00245 # define S_MODE (_S_IREAD | _S_IWRITE)
00246 #else
00247 # define S_MODE 0600
00248 #endif
00249
00250 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00251 # include "MagickCore/nt-base.h"
00252 #endif
00253 #ifdef __VMS
00254 # include "MagickCore/vms.h"
00255 #endif
00256
00257 #undef HAVE_CONFIG_H
00258 #undef gamma
00259 #undef index
00260 #undef pipe
00261 #undef y1
00262
00263
00264
00265
00266 #if defined(MAGICKCORE_POSIX_SUPPORT) && !( defined(__OS2__) || defined( vms ) )
00267 # define DirectorySeparator "/"
00268 # define DirectoryListSeparator ':'
00269 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
00270 # define Exit exit
00271 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
00272 # define X11_PREFERENCES_PATH "~/."
00273 # define ProcessPendingEvents(text)
00274 # define ReadCommandlLine(argc,argv)
00275 # define SetNotifyHandlers
00276 #else
00277 # ifdef __VMS
00278 # define X11_APPLICATION_PATH "decw$system_defaults:"
00279 # define DirectorySeparator ""
00280 # define DirectoryListSeparator ';'
00281 # define EditorOptions ""
00282 # define Exit exit
00283 # define IsBasenameSeparator(c) \
00284 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00285 # define MAGICKCORE_LIBRARY_PATH "sys$login:"
00286 # define MAGICKCORE_SHARE_PATH "sys$login:"
00287 # define X11_PREFERENCES_PATH "decw$user_defaults:"
00288 # define ProcessPendingEvents(text)
00289 # define ReadCommandlLine(argc,argv)
00290 # define SetNotifyHandlers
00291 # endif
00292 # if defined(__OS2__)
00293 # define DirectorySeparator "\\"
00294 # define DirectoryListSeparator ';'
00295 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
00296 # define Exit exit
00297 # define IsBasenameSeparator(c) \
00298 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00299 # define PreferencesDefaults "~\."
00300 # define ProcessPendingEvents(text)
00301 # define ReadCommandlLine(argc,argv)
00302 # define SetNotifyHandlers
00303 #endif
00304 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
00305 # define DirectorySeparator "\\"
00306 # define DirectoryListSeparator ';'
00307 # define EditorOptions ""
00308 # define IsBasenameSeparator(c) \
00309 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00310 # define ProcessPendingEvents(text)
00311 # if !defined(X11_PREFERENCES_PATH)
00312 # define X11_PREFERENCES_PATH "~\\."
00313 # endif
00314 # define ReadCommandlLine(argc,argv)
00315 # define SetNotifyHandlers \
00316 SetErrorHandler(NTErrorHandler); \
00317 SetWarningHandler(NTWarningHandler)
00318 # if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00319 # define HAVE_TIFFCONF_H
00320 # endif
00321 # endif
00322
00323 #endif
00324
00325
00326
00327
00328 #if !defined(STDIN_FILENO)
00329 #define STDIN_FILENO 0x00
00330 #endif
00331
00332 #if !defined(O_BINARY)
00333 #define O_BINARY 0x00
00334 #endif
00335
00336 #if !defined(PATH_MAX)
00337 #define PATH_MAX 4096
00338 #endif
00339
00340 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
00341 # define MAGICKCORE_MODULES_SUPPORT
00342 #endif
00343
00344 #if defined(_MAGICKMOD_)
00345 # undef MAGICKCORE_BUILD_MODULES
00346 # define MAGICKCORE_BUILD_MODULES
00347 #endif
00348
00349
00350
00351
00352 #define MagickMaxRecursionDepth 600
00353 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
00354 #if defined(_MSC_VER)
00355 # define DisableMSCWarning(nr) __pragma(warning(push)) \
00356 __pragma(warning(disable:nr))
00357 # define RestoreMSCWarning __pragma(warning(pop))
00358 #else
00359 # define DisableMSCWarning(nr)
00360 # define RestoreMSCWarning
00361 #endif
00362
00363 #if defined(__cplusplus) || defined(c_plusplus)
00364 }
00365 #endif
00366
00367 #endif