studio.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004 
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007 
00008     https://imagemagick.org/script/license.php
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore private application programming interface declarations.
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 # 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(MAGICKCORE_NAMESPACE_PREFIX)
00055 # include "magick/methods.h"
00056 #endif
00057 
00058 #if !defined(const)
00059 #  define STDC
00060 #endif
00061 
00062 #include <stdarg.h>
00063 #include <stdio.h>
00064 #if defined(MAGICKCORE_HAVE_SYS_STAT_H)
00065 # include <sys/stat.h>
00066 #endif
00067 #if defined(MAGICKCORE_STDC_HEADERS)
00068 # include <stdlib.h>
00069 # include <stddef.h>
00070 #else
00071 # if defined(MAGICKCORE_HAVE_STDLIB_H)
00072 #  include <stdlib.h>
00073 # endif
00074 #endif
00075 #if !defined(magick_restrict)
00076 # if !defined(_magickcore_restrict)
00077 #  define magick_restrict restrict
00078 # else
00079 #  define magick_restrict _magickcore_restrict
00080 # endif
00081 #endif
00082 #if defined(MAGICKCORE_HAVE_STRING_H)
00083 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
00084 #  include <memory.h>
00085 # endif
00086 # include <string.h>
00087 #endif
00088 #if defined(MAGICKCORE_HAVE_STRINGS_H)
00089 # include <strings.h>
00090 #endif
00091 #if defined(MAGICKCORE_HAVE_INTTYPES_H)
00092 # include <inttypes.h>
00093 #endif
00094 #if defined(MAGICKCORE_HAVE_STDINT_H)
00095 # include <stdint.h>
00096 #endif
00097 #if defined(MAGICKCORE_HAVE_UNISTD_H)
00098 # include <unistd.h>
00099 #endif
00100 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
00101 #define _CRTDBG_MAP_ALLOC
00102 #endif
00103 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00104 # include <io.h>
00105 #if !defined(__CYGWIN__)
00106 # include <direct.h>
00107 #endif
00108 # if !defined(MAGICKCORE_HAVE_STRERROR)
00109 #  define HAVE_STRERROR
00110 # endif
00111 #endif
00112 
00113 #include <ctype.h>
00114 #include <locale.h>
00115 #include <errno.h>
00116 #include <fcntl.h>
00117 #include <math.h>
00118 #include <time.h>
00119 #include <limits.h>
00120 #include <signal.h>
00121 #include <assert.h>
00122 
00123 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
00124 # include <xlocale.h>
00125 #endif
00126 #if defined(MAGICKCORE_THREAD_SUPPORT)
00127 # include <pthread.h>
00128 #endif
00129 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00130 #if !defined(__CYGWIN__)
00131 #include <winsock2.h>
00132 #include <ws2tcpip.h>
00133 #endif
00134 #include <windows.h>
00135 #pragma comment (lib, "ws2_32.lib")
00136 #endif
00137 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
00138 # include <sys/syslimits.h>
00139 #endif
00140 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
00141 # include <arm/limits.h>
00142 #endif
00143 
00144 #if defined(MAGICKCORE__OPENCL) && !defined(MAGICK_PIXEL_RGBA)
00145 #if defined(MAGICKCORE_HAVE_CL_CL_H)
00146 #  include <CL/cl.h>
00147 #endif
00148 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
00149 #  include <OpenCL/cl.h>
00150 #endif
00151 #  define MAGICKCORE_OPENCL_SUPPORT  1
00152 #endif
00153 
00154 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
00155 #  include <omp.h>
00156 #  define MAGICKCORE_OPENMP_SUPPORT  1
00157 #endif
00158 
00159 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00160 ssize_t pread(int,void *,size_t,off_t);
00161 #endif
00162 
00163 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00164 ssize_t pwrite(int,const void *,size_t,off_t);
00165 #endif
00166 
00167 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00168 extern size_t strlcpy(char *,const char *,size_t);
00169 #endif
00170 
00171 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00172 extern int vsnprintf(char *,size_t,const char *,va_list);
00173 #endif
00174 
00175 #include "magick/method-attribute.h"
00176 
00177 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
00178 # include <sys/types.h>
00179 # include <sys/stat.h>
00180 # if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
00181 # include <sys/timeb.h>
00182 # endif
00183 # if defined(MAGICKCORE_POSIX_SUPPORT)
00184 #  if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00185 #   define dirent direct
00186 #   define NAMLEN(dirent) (dirent)->d_namlen
00187 #   if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00188 #    include <sys/ndir.h>
00189 #   endif
00190 #   if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00191 #    include <sys/dir.h>
00192 #   endif
00193 #   if defined(MAGICKCORE_HAVE_NDIR_H)
00194 #    include <ndir.h>
00195 #   endif
00196 #  else
00197 #   include <dirent.h>
00198 #   define NAMLEN(dirent) strlen((dirent)->d_name)
00199 #  endif
00200 #  include <sys/wait.h>
00201 #  include <pwd.h>
00202 # endif
00203 # if !defined(S_ISDIR)
00204 #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00205 # endif
00206 # if !defined(S_ISREG)
00207 #  define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00208 # endif
00209 # include "magick/magick-type.h"
00210 # if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00211 #  include <sys/time.h>
00212 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00213 #  include <sys/times.h>
00214 # endif
00215 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00216 #  include <sys/resource.h>
00217 # endif
00218 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
00219 #  include <sys/mman.h>
00220 # endif
00221 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
00222 #  include <sys/sendfile.h>
00223 # endif
00224 # if defined(MAGICKCORE_HAVE_SYS_SOCKET_H)
00225 #  include <sys/socket.h>
00226 # endif
00227 # if defined(MAGICKCORE_HAVE_SYS_UIO_H)
00228 #  include <sys/uio.h>
00229 # endif
00230 #endif
00231 #else
00232 # include <types.h>
00233 # include <stat.h>
00234 # if defined(macintosh)
00235 #  if !defined(DISABLE_SIOUX)
00236 #   include <SIOUX.h>
00237 #   include <console.h>
00238 #  endif
00239 #  include <unix.h>
00240 # endif
00241 # include "magick/magick-type.h"
00242 #endif
00243 
00244 #if defined(S_IRUSR) && defined(S_IWUSR)
00245 # define S_MODE (S_IRUSR | S_IWUSR)
00246 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
00247 # define S_MODE (_S_IREAD | _S_IWRITE)
00248 #else
00249 # define S_MODE  0600
00250 #endif
00251 
00252 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00253 # include "magick/nt-base.h"
00254 #endif
00255 #if defined(macintosh)
00256 # include "magick/mac.h"
00257 #endif
00258 #if defined(vms)
00259 # include "magick/vms.h"
00260 #endif
00261 
00262 #undef HAVE_CONFIG_H
00263 #undef gamma
00264 #undef index
00265 #undef pipe
00266 #undef y1
00267 
00268 /*
00269   Review these platform specific definitions.
00270 */
00271 #if ( defined(MAGICKCORE_POSIX_SUPPORT) && !defined(__OS2__) ) && !defined( __VMS ) 
00272 # define DirectorySeparator  "/"
00273 # define DirectoryListSeparator  ':'
00274 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00275 # define Exit  exit
00276 # define IsBasenameSeparator(c)  ((c) == '/' ? MagickTrue : MagickFalse)
00277 # define X11_PREFERENCES_PATH  "~/."
00278 # define ProcessPendingEvents(text)
00279 # define ReadCommandlLine(argc,argv)
00280 # define SetNotifyHandlers
00281 #else
00282 # if defined(vms)
00283 #  define X11_APPLICATION_PATH  "decw$system_defaults:"
00284 #  define DirectorySeparator  ""
00285 #  define DirectoryListSeparator  ';'
00286 #  define EditorOptions  ""
00287 #  define Exit  exit
00288 #  define IsBasenameSeparator(c) \
00289   (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00290 #  define MAGICKCORE_LIBRARY_PATH  "sys$login:"
00291 #  define MAGICKCORE_SHARE_PATH  "sys$login:"
00292 #  define X11_PREFERENCES_PATH  "decw$user_defaults:"
00293 #  define ProcessPendingEvents(text)
00294 #  define ReadCommandlLine(argc,argv)
00295 #  define SetNotifyHandlers
00296 # endif
00297 # if defined(__OS2__)
00298 #   define DirectorySeparator  "\\"
00299 #   define DirectoryListSeparator  ';'
00300 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00301 # define Exit  exit
00302 #  define IsBasenameSeparator(c) \
00303   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00304 # define PreferencesDefaults  "~\."
00305 # define ProcessPendingEvents(text)
00306 # define ReadCommandlLine(argc,argv)
00307 # define SetNotifyHandlers
00308 #endif
00309 # if defined(macintosh)
00310 #  define X11_APPLICATION_PATH  "/usr/lib/X11/app-defaults/"
00311 #  define DirectorySeparator  ":"
00312 #  define DirectoryListSeparator  ';'
00313 #  define EditorOptions ""
00314 #  define IsBasenameSeparator(c)  ((c) == ':' ? MagickTrue : MagickFalse)
00315 #  define MAGICKCORE_LIBRARY_PATH  ""
00316 #  define MAGICKCORE_SHARE_PATH  ""
00317 #  define X11_PREFERENCES_PATH  "~/."
00318 #  if defined(DISABLE_SIOUX)
00319 #   define ReadCommandlLine(argc,argv)
00320 #   define SetNotifyHandlers \
00321      SetFatalErrorHandler(MacFatalErrorHandler); \
00322      SetErrorHandler(MACErrorHandler); \
00323      SetWarningHandler(MACWarningHandler)
00324 #  else
00325 #   define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
00326 #   define SetNotifyHandlers \
00327      SetErrorHandler(MACErrorHandler); \
00328      SetWarningHandler(MACWarningHandler)
00329 #  endif
00330 # endif
00331 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
00332 #  define DirectorySeparator  "\\"
00333 #  define DirectoryListSeparator  ';'
00334 #  define EditorOptions ""
00335 #  define IsBasenameSeparator(c) \
00336   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00337 #  define ProcessPendingEvents(text)
00338 #  if !defined(X11_PREFERENCES_PATH)
00339 #    define X11_PREFERENCES_PATH  "~\\."
00340 #  endif
00341 #  define ReadCommandlLine(argc,argv)
00342 #  define SetNotifyHandlers \
00343     SetErrorHandler(NTErrorHandler); \
00344     SetWarningHandler(NTWarningHandler)
00345 #  if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00346 #    define HAVE_TIFFCONF_H
00347 #  endif
00348 # endif
00349 
00350 #endif
00351 
00352 /*
00353   Define system symbols if not already defined.
00354 */
00355 #if !defined(STDIN_FILENO)
00356 #define STDIN_FILENO  0x00
00357 #endif
00358 
00359 #if !defined(O_BINARY)
00360 #define O_BINARY  0x00
00361 #endif
00362 
00363 #if !defined(PATH_MAX)
00364 #define PATH_MAX  4096
00365 #endif
00366 
00367 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
00368 #  define MAGICKCORE_MODULES_SUPPORT
00369 #endif
00370 
00371 #if defined(_MAGICKMOD_)
00372 # undef MAGICKCORE_BUILD_MODULES
00373 # define MAGICKCORE_BUILD_MODULES
00374 #endif
00375 
00376 /*
00377   Magick defines.
00378 */
00379 #define MagickMaxRecursionDepth  600
00380 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
00381 #if defined(_MSC_VER)
00382 # define DisableMSCWarning(nr) __pragma(warning(push)) \
00383   __pragma(warning(disable:nr))
00384 # define RestoreMSCWarning __pragma(warning(pop))
00385 #else
00386 # define DisableMSCWarning(nr)
00387 # define RestoreMSCWarning
00388 #endif
00389 
00390 #if defined(__cplusplus) || defined(c_plusplus)
00391 }
00392 #endif
00393 
00394 #endif

Generated on 9 Oct 2020 for MagickCore by  doxygen 1.6.1