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 #pragma comment (lib, "ws2_32.lib")
00132 #endif
00133 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
00134 # include <sys/syslimits.h>
00135 #endif
00136 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
00137 # include <arm/limits.h>
00138 #endif
00139
00140 #if defined(MAGICKCORE__OPENCL)
00141 #if defined(MAGICKCORE_HAVE_CL_CL_H)
00142 # include <CL/cl.h>
00143 #endif
00144 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
00145 # include <OpenCL/cl.h>
00146 #endif
00147 # define MAGICKCORE_OPENCL_SUPPORT 1
00148 #endif
00149
00150 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
00151 # include <omp.h>
00152 # define MAGICKCORE_OPENMP_SUPPORT 1
00153 #endif
00154
00155 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00156 ssize_t pread(int,void *,size_t,off_t);
00157 #endif
00158
00159 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00160 ssize_t pwrite(int,const void *,size_t,off_t);
00161 #endif
00162
00163 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00164 extern size_t strlcpy(char *,const char *,size_t);
00165 #endif
00166
00167 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00168 extern int vsnprintf(char *,size_t,const char *,va_list);
00169 #endif
00170
00171 #include "MagickCore/method-attribute.h"
00172
00173 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_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(MAGICKCORE_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 "MagickCore/magick-type.h"
00206 # if !defined(MAGICKCORE_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 # include "MagickCore/magick-type.h"
00232 #endif
00233
00234 #if defined(S_IRUSR) && defined(S_IWUSR)
00235 # define S_MODE (S_IRUSR | S_IWUSR)
00236 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
00237 # define S_MODE (_S_IREAD | _S_IWRITE)
00238 #else
00239 # define S_MODE 0600
00240 #endif
00241
00242 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00243 # include "MagickCore/nt-base.h"
00244 #endif
00245 #ifdef __VMS
00246 # include "MagickCore/vms.h"
00247 #endif
00248
00249 #undef HAVE_CONFIG_H
00250 #undef gamma
00251 #undef index
00252 #undef pipe
00253 #undef y1
00254
00255
00256
00257
00258 #if defined(MAGICKCORE_POSIX_SUPPORT) && !( defined(__OS2__) || defined( vms ) )
00259 # define DirectorySeparator "/"
00260 # define DirectoryListSeparator ':'
00261 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
00262 # define Exit exit
00263 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
00264 # define X11_PREFERENCES_PATH "~/."
00265 # define ProcessPendingEvents(text)
00266 # define ReadCommandlLine(argc,argv)
00267 # define SetNotifyHandlers
00268 #else
00269 # ifdef __VMS
00270 # define X11_APPLICATION_PATH "decw$system_defaults:"
00271 # define DirectorySeparator ""
00272 # define DirectoryListSeparator ';'
00273 # define EditorOptions ""
00274 # define Exit exit
00275 # define IsBasenameSeparator(c) \
00276 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00277 # define MAGICKCORE_LIBRARY_PATH "sys$login:"
00278 # define MAGICKCORE_SHARE_PATH "sys$login:"
00279 # define X11_PREFERENCES_PATH "decw$user_defaults:"
00280 # define ProcessPendingEvents(text)
00281 # define ReadCommandlLine(argc,argv)
00282 # define SetNotifyHandlers
00283 # endif
00284 # if defined(__OS2__)
00285 # define DirectorySeparator "\\"
00286 # define DirectoryListSeparator ';'
00287 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
00288 # define Exit exit
00289 # define IsBasenameSeparator(c) \
00290 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00291 # define PreferencesDefaults "~\."
00292 # define ProcessPendingEvents(text)
00293 # define ReadCommandlLine(argc,argv)
00294 # define SetNotifyHandlers
00295 #endif
00296 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
00297 # define DirectorySeparator "\\"
00298 # define DirectoryListSeparator ';'
00299 # define EditorOptions ""
00300 # define IsBasenameSeparator(c) \
00301 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00302 # define ProcessPendingEvents(text)
00303 # if !defined(X11_PREFERENCES_PATH)
00304 # define X11_PREFERENCES_PATH "~\\."
00305 # endif
00306 # define ReadCommandlLine(argc,argv)
00307 # define SetNotifyHandlers \
00308 SetErrorHandler(NTErrorHandler); \
00309 SetWarningHandler(NTWarningHandler)
00310 # if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00311 # define HAVE_TIFFCONF_H
00312 # endif
00313 # endif
00314
00315 #endif
00316
00317
00318
00319
00320 #if !defined(STDIN_FILENO)
00321 #define STDIN_FILENO 0x00
00322 #endif
00323
00324 #if !defined(O_BINARY)
00325 #define O_BINARY 0x00
00326 #endif
00327
00328 #if !defined(PATH_MAX)
00329 #define PATH_MAX 4096
00330 #endif
00331
00332 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
00333 # define MAGICKCORE_MODULES_SUPPORT
00334 #endif
00335
00336 #if defined(_MAGICKMOD_)
00337 # undef MAGICKCORE_BUILD_MODULES
00338 # define MAGICKCORE_BUILD_MODULES
00339 #endif
00340
00341
00342
00343
00344 #define MagickMaxRecursionDepth 600
00345 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
00346 #if defined(_MSC_VER)
00347 # define DisableMSCWarning(nr) __pragma(warning(push)) \
00348 __pragma(warning(disable:nr))
00349 # define RestoreMSCWarning __pragma(warning(pop))
00350 #else
00351 # define DisableMSCWarning(nr)
00352 # define RestoreMSCWarning
00353 #endif
00354
00355 #if defined(__cplusplus) || defined(c_plusplus)
00356 }
00357 #endif
00358
00359 #endif