Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:58:55

0001 /*
0002   Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
0003   dedicated to making software imaging solutions freely available.
0004 
0005   You may not use this file except in compliance with the License.  You may
0006   obtain a copy of the License at
0007 
0008     https://imagemagick.org/script/license.php
0009 
0010   Unless required by applicable law or agreed to in writing, software
0011   distributed under the License is distributed on an "AS IS" BASIS,
0012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013   See the License for the specific language governing permissions and
0014   limitations under the License.
0015 
0016   MagickCore private application programming interface declarations.
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 /* Define to 1 if assertions should be disabled. */
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 # define NOMINMAX
0106 # include <io.h>
0107 #if !defined(__CYGWIN__)
0108 # include <direct.h>
0109 #endif
0110 # if !defined(MAGICKCORE_HAVE_STRERROR)
0111 #  define HAVE_STRERROR
0112 # endif
0113 #endif
0114 
0115 #include <ctype.h>
0116 #include <locale.h>
0117 #include <errno.h>
0118 #include <fcntl.h>
0119 #include <math.h>
0120 #include <time.h>
0121 #include <limits.h>
0122 #include <signal.h>
0123 #include <assert.h>
0124 
0125 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
0126 # include <xlocale.h>
0127 #endif
0128 #if defined(MAGICKCORE_THREAD_SUPPORT)
0129 # include <pthread.h>
0130 #endif
0131 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
0132 #  if !defined(__CYGWIN__)
0133 #    if defined(MAGICKCORE_DPC_SUPPORT)
0134 #      include <winsock2.h>
0135 #      ifdef _MSC_VER
0136 #        pragma comment (lib, "ws2_32.lib")
0137 #      endif
0138 #    endif
0139 #    include <ws2tcpip.h>
0140 #  endif
0141 #endif
0142 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
0143 # include <sys/syslimits.h>
0144 #endif
0145 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
0146 # include <arm/limits.h>
0147 #endif
0148 
0149 #if defined(MAGICKCORE_HAVE_CL_CL_H)
0150 #  define MAGICKCORE_OPENCL_SUPPORT  1
0151 #endif
0152 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
0153 #  define MAGICKCORE_OPENCL_SUPPORT  1
0154 #endif
0155 
0156 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
0157 #  include <omp.h>
0158 #  define MAGICKCORE_OPENMP_SUPPORT  1
0159 #endif
0160 
0161 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
0162 ssize_t pread(int,void *,size_t,off_t);
0163 #endif
0164 
0165 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
0166 ssize_t pwrite(int,const void *,size_t,off_t);
0167 #endif
0168 
0169 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
0170 extern size_t strlcpy(char *,const char *,size_t);
0171 #endif
0172 
0173 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
0174 extern int vsnprintf(char *,size_t,const char *,va_list);
0175 #endif
0176 
0177 #include "MagickCore/method-attribute.h"
0178 
0179 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
0180 # include <sys/types.h>
0181 # include <sys/stat.h>
0182 # if defined(MAGICKCORE_POSIX_SUPPORT)
0183 #  if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
0184 #   define dirent direct
0185 #   define NAMLEN(dirent) (dirent)->d_namlen
0186 #   if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
0187 #    include <sys/ndir.h>
0188 #   endif
0189 #   if defined(MAGICKCORE_HAVE_SYS_DIR_H)
0190 #    include <sys/dir.h>
0191 #   endif
0192 #   if defined(MAGICKCORE_HAVE_NDIR_H)
0193 #    include <ndir.h>
0194 #   endif
0195 #  else
0196 #   include <dirent.h>
0197 #   define NAMLEN(dirent) strlen((dirent)->d_name)
0198 #  endif
0199 #  include <sys/wait.h>
0200 #  include <pwd.h>
0201 # endif
0202 # if !defined(S_ISDIR)
0203 #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
0204 # endif
0205 # if !defined(S_ISREG)
0206 #  define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
0207 # endif
0208 # include "MagickCore/magick-type.h"
0209 # if !defined(MAGICKCORE_WINDOWS_SUPPORT)
0210 #  include <sys/time.h>
0211 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
0212 #  include <sys/times.h>
0213 # endif
0214 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
0215 #  include <sys/resource.h>
0216 # endif
0217 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
0218 #  include <sys/mman.h>
0219 # endif
0220 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
0221 #  include <sys/sendfile.h>
0222 # endif
0223 # if defined(MAGICKCORE_HAVE_SYS_SOCKET_H)
0224 #  include <sys/socket.h>
0225 # endif
0226 # if defined(MAGICKCORE_HAVE_SYS_UIO_H)
0227 #  include <sys/uio.h>
0228 # endif
0229 #endif
0230 #else
0231 # include <types.h>
0232 # include <stat.h>
0233 # include "MagickCore/magick-type.h"
0234 #endif
0235 
0236 #if defined(S_IRUSR) && defined(S_IWUSR)
0237 # define S_MODE (S_IRUSR | S_IWUSR)
0238 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
0239 # define S_MODE (_S_IREAD | _S_IWRITE)
0240 #else
0241 # define S_MODE  0600
0242 #endif
0243 
0244 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
0245 # include "MagickCore/nt-base.h"
0246 #endif
0247 #ifdef __VMS
0248 # include "MagickCore/vms.h"
0249 #endif
0250 
0251 #undef HAVE_CONFIG_H
0252 #undef gamma
0253 #undef index
0254 #undef pipe
0255 #undef y1
0256 
0257 /*
0258   Review these platform specific definitions.
0259 */
0260 #if defined(MAGICKCORE_POSIX_SUPPORT) &&  !( defined(__OS2__) || defined( vms ) )
0261 # define DirectorySeparator  "/"
0262 # define DirectoryListSeparator  ':'
0263 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
0264 # define Exit  exit
0265 # define IsBasenameSeparator(c)  ((c) == '/' ? MagickTrue : MagickFalse)
0266 # define X11_PREFERENCES_PATH  "~/."
0267 # define ProcessPendingEvents(text)
0268 # define ReadCommandlLine(argc,argv)
0269 # define SetNotifyHandlers
0270 #else
0271 # ifdef __VMS
0272 #  define X11_APPLICATION_PATH  "decw$system_defaults:"
0273 #  define DirectorySeparator  ""
0274 #  define DirectoryListSeparator  ';'
0275 #  define EditorOptions  ""
0276 #  define Exit  exit
0277 #  define IsBasenameSeparator(c) \
0278   (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
0279 #  define MAGICKCORE_LIBRARY_ABSOLUTE_PATH  "sys$login:"
0280 #  define MAGICKCORE_SHARE_PATH  "sys$login:"
0281 #  define X11_PREFERENCES_PATH  "decw$user_defaults:"
0282 #  define ProcessPendingEvents(text)
0283 #  define ReadCommandlLine(argc,argv)
0284 #  define SetNotifyHandlers
0285 # endif
0286 # if defined(__OS2__)
0287 #   define DirectorySeparator  "\\"
0288 #   define DirectoryListSeparator  ';'
0289 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
0290 # define Exit  exit
0291 #  define IsBasenameSeparator(c) \
0292   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
0293 # define PreferencesDefaults  "~\."
0294 # define ProcessPendingEvents(text)
0295 # define ReadCommandlLine(argc,argv)
0296 # define SetNotifyHandlers
0297 #endif
0298 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
0299 #  define DirectorySeparator  "\\"
0300 #  define DirectoryListSeparator  ';'
0301 #  define EditorOptions ""
0302 #  define IsBasenameSeparator(c) \
0303   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
0304 #  define ProcessPendingEvents(text)
0305 #  if !defined(X11_PREFERENCES_PATH)
0306 #    define X11_PREFERENCES_PATH  "~\\."
0307 #  endif
0308 #  define ReadCommandlLine(argc,argv)
0309 #  define SetNotifyHandlers \
0310     SetErrorHandler(NTErrorHandler); \
0311     SetWarningHandler(NTWarningHandler)
0312 # endif
0313 
0314 #endif
0315 
0316 /*
0317   Define system symbols if not already defined.
0318 */
0319 #if !defined(STDIN_FILENO)
0320 #define STDIN_FILENO  0x00
0321 #endif
0322 
0323 #if !defined(O_BINARY)
0324 #define O_BINARY  0x00
0325 #endif
0326 
0327 #if !defined(PATH_MAX)
0328 #define PATH_MAX  4096
0329 #endif
0330 
0331 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
0332 #  define MAGICKCORE_MODULES_SUPPORT
0333 #endif
0334 
0335 #if defined(_MAGICKMOD_)
0336 # undef MAGICKCORE_BUILD_MODULES
0337 # define MAGICKCORE_BUILD_MODULES
0338 #endif
0339 
0340 /*
0341   Magick defines.
0342 */
0343 #define MagickMaxRecursionDepth  600
0344 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
0345 #if defined(_MSC_VER)
0346 # define DisableMSCWarning(nr) __pragma(warning(push)) \
0347   __pragma(warning(disable:nr))
0348 # define RestoreMSCWarning __pragma(warning(pop))
0349 #else
0350 # define DisableMSCWarning(nr)
0351 # define RestoreMSCWarning
0352 #endif
0353 
0354 #if defined(__cplusplus) || defined(c_plusplus)
0355 }
0356 #endif
0357 
0358 #endif