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 #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 # if defined(MAGICKCORE_HAVE_SYS_SOCKET_H)
00221 #  include <sys/socket.h>
00222 # endif
00223 # if defined(MAGICKCORE_HAVE_SYS_UIO_H)
00224 #  include <sys/uio.h>
00225 # endif
00226 #endif
00227 #else
00228 # include <types.h>
00229 # include <stat.h>
00230 # if defined(macintosh)
00231 #  if !defined(DISABLE_SIOUX)
00232 #   include <SIOUX.h>
00233 #   include <console.h>
00234 #  endif
00235 #  include <unix.h>
00236 # endif
00237 # include "MagickCore/magick-type.h"
00238 #endif
00239 
00240 #if defined(S_IRUSR) && defined(S_IWUSR)
00241 # define S_MODE (S_IRUSR | S_IWUSR)
00242 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
00243 # define S_MODE (_S_IREAD | _S_IWRITE)
00244 #else
00245 # define S_MODE  0600
00246 #endif
00247 
00248 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00249 # include "MagickCore/nt-base.h"
00250 #endif
00251 #ifdef __VMS
00252 # include "MagickCore/vms.h"
00253 #endif
00254 
00255 #undef HAVE_CONFIG_H
00256 #undef gamma
00257 #undef index
00258 #undef pipe
00259 #undef y1
00260 
00261 /*
00262   Review these platform specific definitions.
00263 */
00264 #if defined(MAGICKCORE_POSIX_SUPPORT) &&  !( defined(__OS2__) || defined( vms ) )
00265 # define DirectorySeparator  "/"
00266 # define DirectoryListSeparator  ':'
00267 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00268 # define Exit  exit
00269 # define IsBasenameSeparator(c)  ((c) == '/' ? MagickTrue : MagickFalse)
00270 # define X11_PREFERENCES_PATH  "~/."
00271 # define ProcessPendingEvents(text)
00272 # define ReadCommandlLine(argc,argv)
00273 # define SetNotifyHandlers
00274 #else
00275 # ifdef __VMS
00276 #  define X11_APPLICATION_PATH  "decw$system_defaults:"
00277 #  define DirectorySeparator  ""
00278 #  define DirectoryListSeparator  ';'
00279 #  define EditorOptions  ""
00280 #  define Exit  exit
00281 #  define IsBasenameSeparator(c) \
00282   (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00283 #  define MAGICKCORE_LIBRARY_PATH  "sys$login:"
00284 #  define MAGICKCORE_SHARE_PATH  "sys$login:"
00285 #  define X11_PREFERENCES_PATH  "decw$user_defaults:"
00286 #  define ProcessPendingEvents(text)
00287 #  define ReadCommandlLine(argc,argv)
00288 #  define SetNotifyHandlers
00289 # endif
00290 # if defined(__OS2__)
00291 #   define DirectorySeparator  "\\"
00292 #   define DirectoryListSeparator  ';'
00293 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00294 # define Exit  exit
00295 #  define IsBasenameSeparator(c) \
00296   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00297 # define PreferencesDefaults  "~\."
00298 # define ProcessPendingEvents(text)
00299 # define ReadCommandlLine(argc,argv)
00300 # define SetNotifyHandlers
00301 #endif
00302 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
00303 #  define DirectorySeparator  "\\"
00304 #  define DirectoryListSeparator  ';'
00305 #  define EditorOptions ""
00306 #  define IsBasenameSeparator(c) \
00307   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00308 #  define ProcessPendingEvents(text)
00309 #  if !defined(X11_PREFERENCES_PATH)
00310 #    define X11_PREFERENCES_PATH  "~\\."
00311 #  endif
00312 #  define ReadCommandlLine(argc,argv)
00313 #  define SetNotifyHandlers \
00314     SetErrorHandler(NTErrorHandler); \
00315     SetWarningHandler(NTWarningHandler)
00316 #  if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00317 #    define HAVE_TIFFCONF_H
00318 #  endif
00319 # endif
00320 
00321 #endif
00322 
00323 /*
00324   Define system symbols if not already defined.
00325 */
00326 #if !defined(STDIN_FILENO)
00327 #define STDIN_FILENO  0x00
00328 #endif
00329 
00330 #if !defined(O_BINARY)
00331 #define O_BINARY  0x00
00332 #endif
00333 
00334 #if !defined(PATH_MAX)
00335 #define PATH_MAX  4096
00336 #endif
00337 
00338 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
00339 #  define MAGICKCORE_MODULES_SUPPORT
00340 #endif
00341 
00342 #if defined(_MAGICKMOD_)
00343 # undef MAGICKCORE_BUILD_MODULES
00344 # define MAGICKCORE_BUILD_MODULES
00345 #endif
00346 
00347 /*
00348   Magick defines.
00349 */
00350 #define MagickMaxRecursionDepth  600
00351 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
00352 #if defined(_MSC_VER)
00353 # define DisableMSCWarning(nr) __pragma(warning(push)) \
00354   __pragma(warning(disable:nr))
00355 # define RestoreMSCWarning __pragma(warning(pop))
00356 #else
00357 # define DisableMSCWarning(nr)
00358 # define RestoreMSCWarning
00359 #endif
00360 
00361 #if defined(__cplusplus) || defined(c_plusplus)
00362 }
00363 #endif
00364 
00365 #endif

Generated on 9 Oct 2020 for MagickCore by  doxygen 1.6.1