studio.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2019 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 #if defined(__cplusplus) || defined(c_plusplus)
00059 # define magick_module  _module   /* reserved word in C++(20) */
00060 #else
00061 # define magick_module  module
00062 #endif
00063 
00064 #include <stdarg.h>
00065 #include <stdio.h>
00066 #if defined(MAGICKCORE_HAVE_SYS_STAT_H)
00067 # include <sys/stat.h>
00068 #endif
00069 #if defined(MAGICKCORE_STDC_HEADERS)
00070 # include <stdlib.h>
00071 # include <stddef.h>
00072 #else
00073 # if defined(MAGICKCORE_HAVE_STDLIB_H)
00074 #  include <stdlib.h>
00075 # endif
00076 #endif
00077 #if !defined(magick_restrict)
00078 # if !defined(_magickcore_restrict)
00079 #  define magick_restrict restrict
00080 # else
00081 #  define magick_restrict _magickcore_restrict
00082 # endif
00083 #endif
00084 #if defined(MAGICKCORE_HAVE_STRING_H)
00085 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
00086 #  include <memory.h>
00087 # endif
00088 # include <string.h>
00089 #endif
00090 #if defined(MAGICKCORE_HAVE_STRINGS_H)
00091 # include <strings.h>
00092 #endif
00093 #if defined(MAGICKCORE_HAVE_INTTYPES_H)
00094 # include <inttypes.h>
00095 #endif
00096 #if defined(MAGICKCORE_HAVE_STDINT_H)
00097 # include <stdint.h>
00098 #endif
00099 #if defined(MAGICKCORE_HAVE_UNISTD_H)
00100 # include <unistd.h>
00101 #endif
00102 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
00103 #define _CRTDBG_MAP_ALLOC
00104 #endif
00105 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00106 # include <io.h>
00107 #if !defined(__CYGWIN__)
00108 # include <direct.h>
00109 #endif
00110 # if !defined(MAGICKCORE_HAVE_STRERROR)
00111 #  define HAVE_STRERROR
00112 # endif
00113 #endif
00114 
00115 #include <ctype.h>
00116 #include <locale.h>
00117 #include <errno.h>
00118 #include <fcntl.h>
00119 #include <math.h>
00120 #include <time.h>
00121 #include <limits.h>
00122 #include <signal.h>
00123 #include <assert.h>
00124 
00125 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
00126 # include <xlocale.h>
00127 #endif
00128 #if defined(MAGICKCORE_THREAD_SUPPORT)
00129 # include <pthread.h>
00130 #endif
00131 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
00132 #if !defined(__CYGWIN__)
00133 #include <winsock2.h>
00134 #include <ws2tcpip.h>
00135 #endif
00136 #include <windows.h>
00137 #pragma comment (lib, "ws2_32.lib")
00138 #endif
00139 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
00140 # include <sys/syslimits.h>
00141 #endif
00142 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
00143 # include <arm/limits.h>
00144 #endif
00145 
00146 #if defined(MAGICKCORE__OPENCL)
00147 #if defined(MAGICKCORE_HAVE_CL_CL_H)
00148 #  include <CL/cl.h>
00149 #endif
00150 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
00151 #  include <OpenCL/cl.h>
00152 #endif
00153 #  define MAGICKCORE_OPENCL_SUPPORT  1
00154 #endif
00155 
00156 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
00157 #  include <omp.h>
00158 #  define MAGICKCORE_OPENMP_SUPPORT  1
00159 #endif
00160 
00161 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00162 ssize_t pread(int,void *,size_t,off_t);
00163 #endif
00164 
00165 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00166 ssize_t pwrite(int,const void *,size_t,off_t);
00167 #endif
00168 
00169 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00170 extern size_t strlcpy(char *,const char *,size_t);
00171 #endif
00172 
00173 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00174 extern int vsnprintf(char *,size_t,const char *,va_list);
00175 #endif
00176 
00177 #include "MagickCore/method-attribute.h"
00178 
00179 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
00180 # include <sys/types.h>
00181 # include <sys/stat.h>
00182 # if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
00183 # include <sys/timeb.h>
00184 # endif
00185 # if defined(MAGICKCORE_POSIX_SUPPORT)
00186 #  if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00187 #   define dirent direct
00188 #   define NAMLEN(dirent) (dirent)->d_namlen
00189 #   if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00190 #    include <sys/ndir.h>
00191 #   endif
00192 #   if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00193 #    include <sys/dir.h>
00194 #   endif
00195 #   if defined(MAGICKCORE_HAVE_NDIR_H)
00196 #    include <ndir.h>
00197 #   endif
00198 #  else
00199 #   include <dirent.h>
00200 #   define NAMLEN(dirent) strlen((dirent)->d_name)
00201 #  endif
00202 #  include <sys/wait.h>
00203 #  include <pwd.h>
00204 # endif
00205 # if !defined(S_ISDIR)
00206 #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00207 # endif
00208 # if !defined(S_ISREG)
00209 #  define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00210 # endif
00211 # include "MagickCore/magick-type.h"
00212 # if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00213 #  include <sys/time.h>
00214 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00215 #  include <sys/times.h>
00216 # endif
00217 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00218 #  include <sys/resource.h>
00219 # endif
00220 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
00221 #  include <sys/mman.h>
00222 # endif
00223 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
00224 #  include <sys/sendfile.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 5 Aug 2019 for MagickCore by  doxygen 1.6.1