File indexing completed on 2025-01-30 10:11:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef MAGICKCORE_STUDIO_H
0019 #define MAGICKCORE_STUDIO_H
0020
0021 #if defined(__cplusplus) || defined(c_plusplus)
0022 extern "C" {
0023 #endif
0024
0025 #if defined(WIN32) || defined(WIN64)
0026 # define MAGICKCORE_WINDOWS_SUPPORT
0027 #else
0028 # define MAGICKCORE_POSIX_SUPPORT
0029 #endif
0030
0031 #define MAGICKCORE_IMPLEMENTATION 1
0032
0033 #if !defined(MAGICKCORE_CONFIG_H)
0034 # define MAGICKCORE_CONFIG_H
0035 #include "MagickCore/magick-config.h"
0036 # if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
0037 # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
0038 #endif
0039 #if defined(_magickcore_const) && !defined(const)
0040 # define const _magickcore_const
0041 #endif
0042 #if defined(_magickcore_inline) && !defined(inline)
0043 # define inline _magickcore_inline
0044 #endif
0045 # if defined(__cplusplus) || defined(c_plusplus)
0046 # undef inline
0047 # endif
0048 #endif
0049
0050 #if defined(MAGICKCORE_NAMESPACE_PREFIX)
0051 # include "MagickCore/methods.h"
0052 #endif
0053
0054 #if !defined(const)
0055 # define STDC
0056 #endif
0057
0058
0059 #if defined(MAGICKCORE_NDEBUG)
0060 #define NDEBUG 1
0061 #endif
0062
0063 #include <stdarg.h>
0064 #include <stdio.h>
0065 #if defined(MAGICKCORE_HAVE_SYS_STAT_H)
0066 # include <sys/stat.h>
0067 #endif
0068 #if defined(MAGICKCORE_STDC_HEADERS)
0069 # include <stdlib.h>
0070 # include <stddef.h>
0071 #else
0072 # if defined(MAGICKCORE_HAVE_STDLIB_H)
0073 # include <stdlib.h>
0074 # endif
0075 #endif
0076 #if !defined(magick_restrict)
0077 # if !defined(_magickcore_restrict)
0078 # define magick_restrict restrict
0079 # else
0080 # define magick_restrict _magickcore_restrict
0081 # endif
0082 #endif
0083 #if defined(MAGICKCORE_HAVE_STRING_H)
0084 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
0085 # include <memory.h>
0086 # endif
0087 # include <string.h>
0088 #endif
0089 #if defined(MAGICKCORE_HAVE_STRINGS_H)
0090 # include <strings.h>
0091 #endif
0092 #if defined(MAGICKCORE_HAVE_INTTYPES_H)
0093 # include <inttypes.h>
0094 #endif
0095 #if defined(MAGICKCORE_HAVE_STDINT_H)
0096 # include <stdint.h>
0097 #endif
0098 #if defined(MAGICKCORE_HAVE_UNISTD_H)
0099 # include <unistd.h>
0100 #endif
0101 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
0102 #define _CRTDBG_MAP_ALLOC
0103 #endif
0104 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
0105 # include <io.h>
0106 #if !defined(__CYGWIN__)
0107 # include <direct.h>
0108 #endif
0109 # if !defined(MAGICKCORE_HAVE_STRERROR)
0110 # define HAVE_STRERROR
0111 # endif
0112 #endif
0113
0114 #include <ctype.h>
0115 #include <locale.h>
0116 #include <errno.h>
0117 #include <fcntl.h>
0118 #include <math.h>
0119 #include <time.h>
0120 #include <limits.h>
0121 #include <signal.h>
0122 #include <assert.h>
0123
0124 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
0125 # include <xlocale.h>
0126 #endif
0127 #if defined(MAGICKCORE_THREAD_SUPPORT)
0128 # include <pthread.h>
0129 #endif
0130 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
0131 # if !defined(__CYGWIN__)
0132 # if defined(MAGICKCORE_DPC_SUPPORT)
0133 # include <winsock2.h>
0134 # ifdef _MSC_VER
0135 # pragma comment (lib, "ws2_32.lib")
0136 # endif
0137 # endif
0138 # include <ws2tcpip.h>
0139 # endif
0140 #endif
0141 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
0142 # include <sys/syslimits.h>
0143 #endif
0144 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
0145 # include <arm/limits.h>
0146 #endif
0147
0148 #if defined(MAGICKCORE_HAVE_CL_CL_H)
0149 # include <CL/cl.h>
0150 # define MAGICKCORE_OPENCL_SUPPORT 1
0151 #endif
0152 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
0153 # include <OpenCL/cl.h>
0154 # define MAGICKCORE_OPENCL_SUPPORT 1
0155 #endif
0156
0157 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
0158 # include <omp.h>
0159 # define MAGICKCORE_OPENMP_SUPPORT 1
0160 #endif
0161
0162 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
0163 ssize_t pread(int,void *,size_t,off_t);
0164 #endif
0165
0166 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
0167 ssize_t pwrite(int,const void *,size_t,off_t);
0168 #endif
0169
0170 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
0171 extern size_t strlcpy(char *,const char *,size_t);
0172 #endif
0173
0174 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
0175 extern int vsnprintf(char *,size_t,const char *,va_list);
0176 #endif
0177
0178 #include "MagickCore/method-attribute.h"
0179
0180 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
0181 # include <sys/types.h>
0182 # include <sys/stat.h>
0183 # if defined(MAGICKCORE_POSIX_SUPPORT)
0184 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
0185 # define dirent direct
0186 # define NAMLEN(dirent) (dirent)->d_namlen
0187 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
0188 # include <sys/ndir.h>
0189 # endif
0190 # if defined(MAGICKCORE_HAVE_SYS_DIR_H)
0191 # include <sys/dir.h>
0192 # endif
0193 # if defined(MAGICKCORE_HAVE_NDIR_H)
0194 # include <ndir.h>
0195 # endif
0196 # else
0197 # include <dirent.h>
0198 # define NAMLEN(dirent) strlen((dirent)->d_name)
0199 # endif
0200 # include <sys/wait.h>
0201 # include <pwd.h>
0202 # endif
0203 # if !defined(S_ISDIR)
0204 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
0205 # endif
0206 # if !defined(S_ISREG)
0207 # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
0208 # endif
0209 # include "MagickCore/magick-type.h"
0210 # if !defined(MAGICKCORE_WINDOWS_SUPPORT)
0211 # include <sys/time.h>
0212 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
0213 # include <sys/times.h>
0214 # endif
0215 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
0216 # include <sys/resource.h>
0217 # endif
0218 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
0219 # include <sys/mman.h>
0220 # endif
0221 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
0222 # include <sys/sendfile.h>
0223 # endif
0224 # if defined(MAGICKCORE_HAVE_SYS_SOCKET_H)
0225 # include <sys/socket.h>
0226 # endif
0227 # if defined(MAGICKCORE_HAVE_SYS_UIO_H)
0228 # include <sys/uio.h>
0229 # endif
0230 #endif
0231 #else
0232 # include <types.h>
0233 # include <stat.h>
0234 # include "MagickCore/magick-type.h"
0235 #endif
0236
0237 #if defined(S_IRUSR) && defined(S_IWUSR)
0238 # define S_MODE (S_IRUSR | S_IWUSR)
0239 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
0240 # define S_MODE (_S_IREAD | _S_IWRITE)
0241 #else
0242 # define S_MODE 0600
0243 #endif
0244
0245 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
0246 # include "MagickCore/nt-base.h"
0247 #endif
0248 #ifdef __VMS
0249 # include "MagickCore/vms.h"
0250 #endif
0251
0252 #undef HAVE_CONFIG_H
0253 #undef gamma
0254 #undef index
0255 #undef pipe
0256 #undef y1
0257
0258
0259
0260
0261 #if defined(MAGICKCORE_POSIX_SUPPORT) && !( defined(__OS2__) || defined( vms ) )
0262 # define DirectorySeparator "/"
0263 # define DirectoryListSeparator ':'
0264 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
0265 # define Exit exit
0266 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
0267 # define X11_PREFERENCES_PATH "~/."
0268 # define ProcessPendingEvents(text)
0269 # define ReadCommandlLine(argc,argv)
0270 # define SetNotifyHandlers
0271 #else
0272 # ifdef __VMS
0273 # define X11_APPLICATION_PATH "decw$system_defaults:"
0274 # define DirectorySeparator ""
0275 # define DirectoryListSeparator ';'
0276 # define EditorOptions ""
0277 # define Exit exit
0278 # define IsBasenameSeparator(c) \
0279 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
0280 # define MAGICKCORE_LIBRARY_PATH "sys$login:"
0281 # define MAGICKCORE_SHARE_PATH "sys$login:"
0282 # define X11_PREFERENCES_PATH "decw$user_defaults:"
0283 # define ProcessPendingEvents(text)
0284 # define ReadCommandlLine(argc,argv)
0285 # define SetNotifyHandlers
0286 # endif
0287 # if defined(__OS2__)
0288 # define DirectorySeparator "\\"
0289 # define DirectoryListSeparator ';'
0290 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
0291 # define Exit exit
0292 # define IsBasenameSeparator(c) \
0293 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
0294 # define PreferencesDefaults "~\."
0295 # define ProcessPendingEvents(text)
0296 # define ReadCommandlLine(argc,argv)
0297 # define SetNotifyHandlers
0298 #endif
0299 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
0300 # define DirectorySeparator "\\"
0301 # define DirectoryListSeparator ';'
0302 # define EditorOptions ""
0303 # define IsBasenameSeparator(c) \
0304 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
0305 # define ProcessPendingEvents(text)
0306 # if !defined(X11_PREFERENCES_PATH)
0307 # define X11_PREFERENCES_PATH "~\\."
0308 # endif
0309 # define ReadCommandlLine(argc,argv)
0310 # define SetNotifyHandlers \
0311 SetErrorHandler(NTErrorHandler); \
0312 SetWarningHandler(NTWarningHandler)
0313 # endif
0314
0315 #endif
0316
0317
0318
0319
0320 #if !defined(STDIN_FILENO)
0321 #define STDIN_FILENO 0x00
0322 #endif
0323
0324 #if !defined(O_BINARY)
0325 #define O_BINARY 0x00
0326 #endif
0327
0328 #if !defined(PATH_MAX)
0329 #define PATH_MAX 4096
0330 #endif
0331
0332 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
0333 # define MAGICKCORE_MODULES_SUPPORT
0334 #endif
0335
0336 #if defined(_MAGICKMOD_)
0337 # undef MAGICKCORE_BUILD_MODULES
0338 # define MAGICKCORE_BUILD_MODULES
0339 #endif
0340
0341
0342
0343
0344 #define MagickMaxRecursionDepth 600
0345 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
0346 #if defined(_MSC_VER)
0347 # define DisableMSCWarning(nr) __pragma(warning(push)) \
0348 __pragma(warning(disable:nr))
0349 # define RestoreMSCWarning __pragma(warning(pop))
0350 #else
0351 # define DisableMSCWarning(nr)
0352 # define RestoreMSCWarning
0353 #endif
0354
0355 #if defined(__cplusplus) || defined(c_plusplus)
0356 }
0357 #endif
0358
0359 #endif