studio.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2009 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.
00006   obtain a copy of the License at
00007 
00008     http://www.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(__CYGWIN32__)
00026 #  if !defined(__CYGWIN__)
00027 #    define __CYGWIN__ __CYGWIN32__
00028 #  endif
00029 #endif
00030 
00031 #if defined(_WIN32) || defined(WIN32)
00032 #  if !defined(__WINDOWS__)
00033 #    if defined(_WIN32)
00034 #      define __WINDOWS__ _WIN32
00035 #    else
00036 #      if defined(WIN32)
00037 #        define __WINDOWS__ WIN32
00038 #      endif
00039 #    endif
00040 #  endif
00041 #endif
00042 
00043 #if defined(_WIN64) || defined(WIN64)
00044 #  if !defined(__WINDOWS__)
00045 #    if defined(_WIN64)
00046 #      define __WINDOWS__ _WIN64
00047 #    else
00048 #      if defined(WIN64)
00049 #        define __WINDOWS__ WIN64
00050 #      endif
00051 #    endif
00052 #  endif
00053 #endif
00054 
00055 #if !defined(vms) && !defined(macintosh) && !defined(__WINDOWS__)
00056 # define MAGICKCORE_POSIX_SUPPORT
00057 #endif
00058 
00059 #define MAGICKCORE_IMPLEMENTATION  1
00060 
00061 #if !defined(_MAGICKCORE_CONFIG_H)
00062 # define _MAGICKCORE_CONFIG_H
00063 # if !defined(vms) && !defined(macintosh)
00064 #  include "magick/magick-config.h"
00065 # else
00066 #  include "magick-config.h"
00067 # endif
00068 #if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
00069 # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
00070 #endif
00071 #if defined(_magickcore_const) && !defined(const)
00072 # define const _magickcore_const
00073 #endif
00074 #if defined(_magickcore_inline) && !defined(inline)
00075 # define inline _magickcore_inline
00076 #endif
00077 # if defined(__cplusplus) || defined(c_plusplus)
00078 #  undef inline
00079 # endif
00080 #if defined(_magickcore_restrict) && !defined(__restrict)
00081 # define __restrict _magickcore_restrict
00082 #endif
00083 #endif
00084 
00085 #if defined(MAGICKCORE_NAMESPACE_PREFIX)
00086 # include "magick/methods.h"
00087 #endif
00088 
00089 #if !defined(const)
00090 #  define STDC
00091 #endif
00092 
00093 #if defined(__BORLANDC__) && defined(_DLL)
00094 #  pragma message("BCBMagick lib DLL export interface")
00095 #  define _MAGICKDLL_
00096 #  define _MAGICKLIB_
00097 #  define MAGICKCORE_MODULES_SUPPORT
00098 #  undef MAGICKCORE_BUILD_MODULES
00099 #endif
00100 
00101 #if defined(__WINDOWS__)
00102 # if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB)
00103 #  define _MAGICKDLL_
00104 # endif
00105 # if defined(_MAGICKDLL_)
00106 #  if defined(_VISUALC_)
00107 #   pragma warning( disable: 4273 )  /* Disable the dll linkage warnings */
00108 #  endif
00109 #  if !defined(_MAGICKLIB_)
00110 #   define MagickExport  __declspec(dllimport)
00111 #   if defined(_VISUALC_)
00112 #    pragma message( "MagickCore lib DLL import interface" )
00113 #   endif
00114 #  else
00115 #   define MagickExport  __declspec(dllexport)
00116 #   if defined(_VISUALC_)
00117 #    pragma message( "MagickCore lib DLL export interface" )
00118 #   endif
00119 #  endif
00120 # else
00121 #  define MagickExport
00122 #  if defined(_VISUALC_)
00123 #   pragma message( "MagickCore lib static interface" )
00124 #  endif
00125 # endif
00126 
00127 # if defined(_DLL) && !defined(_LIB)
00128 #  define ModuleExport  __declspec(dllexport)
00129 #  if defined(_VISUALC_)
00130 #   pragma message( "MagickCore module DLL export interface" )
00131 #  endif
00132 # else
00133 #  define ModuleExport
00134 #  if defined(_VISUALC_)
00135 #   pragma message( "MagickCore module static interface" )
00136 #  endif
00137 
00138 # endif
00139 # define MagickGlobal __declspec(thread)
00140 # if defined(_VISUALC_)
00141 #  pragma warning(disable : 4018)
00142 #  pragma warning(disable : 4068)
00143 #  pragma warning(disable : 4244)
00144 #  pragma warning(disable : 4142)
00145 #  pragma warning(disable : 4800)
00146 #  pragma warning(disable : 4786)
00147 #  pragma warning(disable : 4996)
00148 # endif
00149 #else
00150 # define MagickExport
00151 # define ModuleExport
00152 # define MagickGlobal
00153 #endif
00154 
00155 #define MagickSignature  0xabacadabUL
00156 #if !defined(MaxTextExtent)
00157 # define MaxTextExtent  4096
00158 #endif
00159 
00160 #include <stdarg.h>
00161 #include <stdio.h>
00162 #if defined(__WINDOWS__) && defined(_DEBUG)
00163 #define _CRTDBG_MAP_ALLOC
00164 #endif
00165 #include <stdlib.h>
00166 #if !defined(__WINDOWS__)
00167 # include <unistd.h>
00168 #else
00169 # include <direct.h>
00170 # if !defined(MAGICKCORE_HAVE_STRERROR)
00171 #  define HAVE_STRERROR
00172 # endif
00173 #endif
00174 
00175 #if defined(MAGICKCORE_HAVE_STRINGS_H)
00176 # include <strings.h>
00177 #endif
00178 #include <string.h>
00179 #include <ctype.h>
00180 #include <locale.h>
00181 #include <errno.h>
00182 #include <fcntl.h>
00183 #include <math.h>
00184 #include <time.h>
00185 #include <limits.h>
00186 #include <signal.h>
00187 #include <assert.h>
00188 
00189 #if defined(MAGICKCORE_HAVE_PTHREAD)
00190 # include <pthread.h>
00191 #elif defined(__WINDOWS__)
00192 #  define MAGICKCORE_HAVE_WINTHREADS  1
00193 #include <windows.h>
00194 #endif
00195 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
00196 # include <sys/syslimits.h>
00197 #endif
00198 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
00199 # include <arm/limits.h>
00200 #endif
00201 
00202 #if defined(MAGICKCORE_HAVE_CL_CL_H)
00203 #  include <CL/cl.h>
00204 #  define MAGICKCORE_OPENCL_SUPPORT  1
00205 #endif
00206 
00207 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
00208 #  include <OpenCL/cl.h>
00209 #  define MAGICKCORE_OPENCL_SUPPORT  1
00210 #endif
00211 
00212 #if defined(_OPENMP) && (_OPENMP >= 200203)
00213 #  include <omp.h>
00214 #  define MAGICKCORE_OPENMP_SUPPORT  1
00215 #endif
00216 
00217 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00218 ssize_t pread(int,void *,size_t,off_t);
00219 #endif
00220 
00221 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00222 ssize_t pwrite(int,const void *,size_t,off_t);
00223 #endif
00224 
00225 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00226 extern size_t strlcpy(char *,const char *,size_t);
00227 #endif
00228 
00229 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00230 extern int vsnprintf(char *,size_t,const char *,va_list);
00231 #endif
00232 
00233 #if !defined(magick_attribute)
00234 #  if (defined(__GNUC__) && (__GNUC__ > 3))
00235 #    define magick_attribute  __attribute__
00236 #  else
00237 #    define magick_attribute(x)  /* nothing */
00238 #  endif
00239 #endif
00240 
00241 #if !defined(magick_unused)
00242 #  if (defined(__GNUC__) && (__GNUC__ > 3))
00243 #     define magick_unused(x)  magick_unused_ ## x __attribute__((unused))
00244 #  elif defined(__LCLINT__)
00245 #    define magick_unused(x) /*@unused@*/ x
00246 #  else
00247 #    define magick_unused(x) x
00248 #  endif
00249 #endif
00250 
00251 #if defined(__WINDOWS__) || defined(MAGICKCORE_POSIX_SUPPORT)
00252 # include <sys/types.h>
00253 # include <sys/stat.h>
00254 # if defined(MAGICKCORE_HAVE_FTIME)
00255 # include <sys/timeb.h>
00256 # endif
00257 # if defined(MAGICKCORE_POSIX_SUPPORT)
00258 #  if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00259 #   define dirent direct
00260 #   define NAMLEN(dirent) (dirent)->d_namlen
00261 #   if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00262 #    include <sys/ndir.h>
00263 #   endif
00264 #   if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00265 #    include <sys/dir.h>
00266 #   endif
00267 #   if defined(MAGICKCORE_HAVE_NDIR_H)
00268 #    include <ndir.h>
00269 #   endif
00270 #  else
00271 #   include <dirent.h>
00272 #   define NAMLEN(dirent) strlen((dirent)->d_name)
00273 #  endif
00274 #  include <sys/wait.h>
00275 #  include <pwd.h>
00276 # endif
00277 # if !defined(S_ISDIR)
00278 #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00279 # endif
00280 # if !defined(S_ISREG)
00281 #  define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00282 # endif
00283 # include "magick/magick-type.h"
00284 # if !defined(__WINDOWS__)
00285 #  include <sys/time.h>
00286 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00287 #  include <sys/times.h>
00288 # endif
00289 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00290 #  include <sys/resource.h>
00291 # endif
00292 #endif
00293 #else
00294 # include <types.h>
00295 # include <stat.h>
00296 # if defined(macintosh)
00297 #  if !defined(DISABLE_SIOUX)
00298 #   include <SIOUX.h>
00299 #   include <console.h>
00300 #  endif
00301 #  include <unix.h>
00302 # endif
00303 # include "magick/magick-type.h"
00304 #endif
00305 
00306 #if defined(S_IRUSR) && defined(S_IWUSR)
00307 # define S_MODE (S_IRUSR | S_IWUSR)
00308 #elif defined (__WINDOWS__)
00309 # define S_MODE (_S_IREAD | _S_IWRITE)
00310 #else
00311 # define S_MODE  0600
00312 #endif
00313 
00314 #if defined(__WINDOWS__)
00315 # include "magick/nt-base.h"
00316 #endif
00317 #if defined(macintosh)
00318 # include "magick/mac.h"
00319 #endif
00320 #if defined(vms)
00321 # include "magick/vms.h"
00322 #endif
00323 
00324 #undef HAVE_CONFIG_H
00325 #undef gamma
00326 #undef index
00327 #undef pipe
00328 #undef y1
00329 
00330 /*
00331   Review these platform specific definitions.
00332 */
00333 #if defined(MAGICKCORE_POSIX_SUPPORT) && !defined(__OS2__)
00334 # define DirectorySeparator  "/"
00335 # define DirectoryListSeparator  ':'
00336 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00337 # define Exit  exit
00338 # define IsBasenameSeparator(c)  ((c) == '/' ? MagickTrue : MagickFalse)
00339 # define X11_PREFERENCES_PATH  "~/."
00340 # define ProcessPendingEvents(text)
00341 # define ReadCommandlLine(argc,argv)
00342 # define SetNotifyHandlers
00343 #else
00344 # if defined(vms)
00345 #  define X11_APPLICATION_PATH  "decw$system_defaults:"
00346 #  define DirectorySeparator  ""
00347 #  define DirectoryListSeparator  ';'
00348 #  define EditorOptions  ""
00349 #  define Exit  exit
00350 #  define IsBasenameSeparator(c) \
00351   (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00352 #  define MAGICKCORE_LIBRARY_PATH  "sys$login:"
00353 #  define MAGICKCORE_CODER_PATH  "sys$login:"
00354 #  define MAGICKCORE_FILTER_PATH  "sys$login:"
00355 #  define MAGICKCORE_SHARE_PATH  "sys$login:"
00356 #  define X11_PREFERENCES_PATH  "decw$user_defaults:"
00357 #  define ProcessPendingEvents(text)
00358 #  define ReadCommandlLine(argc,argv)
00359 #  define SetNotifyHandlers
00360 # endif
00361 # if defined(__OS2__)
00362 #   define DirectorySeparator  "\\"
00363 #   define DirectoryListSeparator  ';'
00364 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00365 # define Exit  exit
00366 #  define IsBasenameSeparator(c) \
00367   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00368 # define PreferencesDefaults  "~\."
00369 # define ProcessPendingEvents(text)
00370 # define ReadCommandlLine(argc,argv)
00371 # define SetNotifyHandlers
00372 #endif
00373 # if defined(macintosh)
00374 #  define X11_APPLICATION_PATH  "/usr/lib/X11/app-defaults/"
00375 #  define DirectorySeparator  ":"
00376 #  define DirectoryListSeparator  ';'
00377 #  define EditorOptions ""
00378 #  define IsBasenameSeparator(c)  ((c) == ':' ? MagickTrue : MagickFalse)
00379 #  define MAGICKCORE_LIBRARY_PATH  ""
00380 #  define MAGICKCORE_CODER_PATH  ""
00381 #  define MAGICKCORE_FILTER_PATH  ""
00382 #  define MAGICKCORE_SHARE_PATH  ""
00383 #  define X11_PREFERENCES_PATH  "~/."
00384 #  if defined(DISABLE_SIOUX)
00385 #   define ReadCommandlLine(argc,argv)
00386 #   define SetNotifyHandlers \
00387      SetFatalErrorHandler(MacFatalErrorHandler); \
00388      SetErrorHandler(MACErrorHandler); \
00389      SetWarningHandler(MACWarningHandler)
00390 #  else
00391 #   define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
00392 #   define SetNotifyHandlers \
00393      SetErrorHandler(MACErrorHandler); \
00394      SetWarningHandler(MACWarningHandler)
00395 #  endif
00396 # endif
00397 # if defined(__WINDOWS__)
00398 #  define DirectorySeparator  "\\"
00399 #  define DirectoryListSeparator  ';'
00400 #  define EditorOptions ""
00401 #  define IsBasenameSeparator(c) \
00402   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00403 #  define ProcessPendingEvents(text)
00404 #  if !defined(X11_PREFERENCES_PATH)
00405 #    define X11_PREFERENCES_PATH  "~\\."
00406 #  endif
00407 #  define ReadCommandlLine(argc,argv)
00408 #  define SetNotifyHandlers \
00409     SetErrorHandler(NTErrorHandler); \
00410     SetWarningHandler(NTWarningHandler)
00411 #  undef sleep
00412 #  define sleep(seconds)  Sleep(seconds*1000)
00413 #  if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00414 #    define HAVE_TIFFCONF_H
00415 #  endif
00416 # endif
00417 
00418 #endif
00419 
00420 /*
00421   Define system symbols if not already defined.
00422 */
00423 #if !defined(STDIN_FILENO)
00424 #define STDIN_FILENO  0x00
00425 #endif
00426 
00427 #if !defined(O_BINARY)
00428 #define O_BINARY  0x00
00429 #endif
00430 
00431 #if !defined(PATH_MAX)
00432 #define PATH_MAX  4096
00433 #endif
00434 
00435 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(__WINDOWS__) && defined(_DLL) && !defined(_LIB))
00436 #  define MAGICKCORE_MODULES_SUPPORT
00437 #endif
00438 
00439 #if defined(_MAGICKMOD_)
00440 # undef MAGICKCORE_BUILD_MODULES
00441 # define MAGICKCORE_BUILD_MODULES
00442 #endif
00443 
00444 /*
00445   I/O defines.
00446 */
00447 #if defined(__WINDOWS__) && !defined(Windows95) && !defined(__BORLANDC__)
00448 #define MagickSeek(file,offset,whence)  _lseeki64(file,offset,whence)
00449 #define MagickTell(file)  _telli64(file)
00450 #else
00451 #define MagickSeek(file,offset,whence)  lseek(file,offset,whence)
00452 #define MagickTell(file) tell(file)
00453 #endif
00454 
00455 /*
00456   Magick defines.
00457 */
00458 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
00459 
00460 #if defined(__cplusplus) || defined(c_plusplus)
00461 }
00462 #endif
00463 
00464 #endif

Generated on 19 Nov 2009 for MagickCore by  doxygen 1.6.1