studio.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2010 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 MAGICKORE_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(_OPENMP) && (_OPENMP >= 200203)
00203 #  include <omp.h>
00204 #  define MAGICKCORE_OPENMP_SUPPORT 1
00205 #endif
00206 
00207 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00208 ssize_t pread(int,void *,size_t,off_t);
00209 #endif
00210 
00211 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00212 ssize_t pwrite(int,const void *,size_t,off_t);
00213 #endif
00214 
00215 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00216 extern size_t strlcpy(char *,const char *,size_t);
00217 #endif
00218 
00219 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00220 extern int vsnprintf(char *,size_t,const char *,va_list);
00221 #endif
00222 
00223 #if !defined(magick_attribute)
00224 #  if !defined(__GNUC__)
00225 #    define magick_attribute(x)  /* nothing */
00226 #  else
00227 #    define magick_attribute  __attribute__
00228 #  endif
00229 #endif
00230 
00231 #if !defined(magick_unused)
00232 #  if defined(__GNUC__)
00233 #     define magick_unused(x)  magick_unused_ ## x __attribute__((unused))
00234 #  elif defined(__LCLINT__)
00235 #    define magick_unused(x) /*@unused@*/ x
00236 #  else
00237 #    define magick_unused(x) x
00238 #  endif
00239 #endif
00240 
00241 #if defined(__WINDOWS__) || defined(MAGICKCORE_POSIX_SUPPORT)
00242 # include <sys/types.h>
00243 # include <sys/stat.h>
00244 # if defined(MAGICKCORE_HAVE_FTIME)
00245 # include <sys/timeb.h>
00246 # endif
00247 # if defined(MAGICKCORE_POSIX_SUPPORT)
00248 #  if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00249 #   define dirent direct
00250 #   define NAMLEN(dirent) (dirent)->d_namlen
00251 #   if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00252 #    include <sys/ndir.h>
00253 #   endif
00254 #   if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00255 #    include <sys/dir.h>
00256 #   endif
00257 #   if defined(MAGICKCORE_HAVE_NDIR_H)
00258 #    include <ndir.h>
00259 #   endif
00260 #  else
00261 #   include <dirent.h>
00262 #   define NAMLEN(dirent) strlen((dirent)->d_name)
00263 #  endif
00264 #  include <sys/wait.h>
00265 #  include <pwd.h>
00266 # endif
00267 # if !defined(S_ISDIR)
00268 #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00269 # endif
00270 # if !defined(S_ISREG)
00271 #  define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00272 # endif
00273 # include "magick/magick-type.h"
00274 # if !defined(__WINDOWS__)
00275 #  include <sys/time.h>
00276 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00277 #  include <sys/times.h>
00278 # endif
00279 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00280 #  include <sys/resource.h>
00281 # endif
00282 #endif
00283 #else
00284 # include <types.h>
00285 # include <stat.h>
00286 # if defined(macintosh)
00287 #  if !defined(DISABLE_SIOUX)
00288 #   include <SIOUX.h>
00289 #   include <console.h>
00290 #  endif
00291 #  include <unix.h>
00292 # endif
00293 # include "magick/magick-type.h"
00294 #endif
00295 
00296 #if defined(S_IRUSR) && defined(S_IWUSR)
00297 # define S_MODE (S_IRUSR | S_IWUSR)
00298 #elif defined (__WINDOWS__)
00299 # define S_MODE (_S_IREAD | _S_IWRITE)
00300 #else
00301 # define S_MODE  0600
00302 #endif
00303 
00304 #if defined(__WINDOWS__)
00305 # include "magick/nt-base.h"
00306 #endif
00307 #if defined(macintosh)
00308 # include "magick/mac.h"
00309 #endif
00310 #if defined(vms)
00311 # include "magick/vms.h"
00312 #endif
00313 
00314 #undef gamma
00315 #undef index
00316 #undef pipe
00317 #undef y1
00318 
00319 /*
00320   Review these platform specific definitions.
00321 */
00322 #if defined(MAGICKCORE_POSIX_SUPPORT) && !defined(__OS2__)
00323 # define DirectorySeparator  "/"
00324 # define DirectoryListSeparator  ':'
00325 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00326 # define Exit  exit
00327 # define IsBasenameSeparator(c)  ((c) == '/' ? MagickTrue : MagickFalse)
00328 # define X11_PREFERENCES_PATH  "~/."
00329 # define ProcessPendingEvents(text)
00330 # define ReadCommandlLine(argc,argv)
00331 # define SetNotifyHandlers
00332 #else
00333 # if defined(vms)
00334 #  define X11_APPLICATION_PATH  "decw$system_defaults:"
00335 #  define DirectorySeparator  ""
00336 #  define DirectoryListSeparator  ';'
00337 #  define EditorOptions  ""
00338 #  define Exit  exit
00339 #  define IsBasenameSeparator(c) \
00340   (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00341 #  define MAGICKCORE_LIBRARY_PATH  "sys$login:"
00342 #  define MAGICKCORE_CODER_PATH  "sys$login:"
00343 #  define MAGICKCORE_FILTER_PATH  "sys$login:"
00344 #  define MAGICKCORE_SHARE_PATH  "sys$login:"
00345 #  define X11_PREFERENCES_PATH  "decw$user_defaults:"
00346 #  define ProcessPendingEvents(text)
00347 #  define ReadCommandlLine(argc,argv)
00348 #  define SetNotifyHandlers
00349 # endif
00350 # if defined(__OS2__)
00351 #   define DirectorySeparator  "\\"
00352 #   define DirectoryListSeparator  ';'
00353 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00354 # define Exit  exit
00355 #  define IsBasenameSeparator(c) \
00356   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00357 # define PreferencesDefaults  "~\."
00358 # define ProcessPendingEvents(text)
00359 # define ReadCommandlLine(argc,argv)
00360 # define SetNotifyHandlers
00361 #endif
00362 # if defined(macintosh)
00363 #  define X11_APPLICATION_PATH  "/usr/lib/X11/app-defaults/"
00364 #  define DirectorySeparator  ":"
00365 #  define DirectoryListSeparator  ';'
00366 #  define EditorOptions ""
00367 #  define IsBasenameSeparator(c)  ((c) == ':' ? MagickTrue : MagickFalse)
00368 #  define MAGICKCORE_LIBRARY_PATH  ""
00369 #  define MAGICKCORE_CODER_PATH  ""
00370 #  define MAGICKCORE_FILTER_PATH  ""
00371 #  define MAGICKCORE_SHARE_PATH  ""
00372 #  define X11_PREFERENCES_PATH  "~/."
00373 #  if defined(DISABLE_SIOUX)
00374 #   define ReadCommandlLine(argc,argv)
00375 #   define SetNotifyHandlers \
00376      SetFatalErrorHandler(MacFatalErrorHandler); \
00377      SetErrorHandler(MACErrorHandler); \
00378      SetWarningHandler(MACWarningHandler)
00379 #  else
00380 #   define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
00381 #   define SetNotifyHandlers \
00382      SetErrorHandler(MACErrorHandler); \
00383      SetWarningHandler(MACWarningHandler)
00384 #  endif
00385 # endif
00386 # if defined(__WINDOWS__)
00387 #  define DirectorySeparator  "\\"
00388 #  define DirectoryListSeparator  ';'
00389 #  define EditorOptions ""
00390 #  define IsBasenameSeparator(c) \
00391   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00392 #  define ProcessPendingEvents(text)
00393 #  if !defined(X11_PREFERENCES_PATH)
00394 #    define X11_PREFERENCES_PATH  "~\\."
00395 #  endif
00396 #  define ReadCommandlLine(argc,argv)
00397 #  define SetNotifyHandlers \
00398     SetErrorHandler(NTErrorHandler); \
00399     SetWarningHandler(NTWarningHandler)
00400 #  undef sleep
00401 #  define sleep(seconds)  Sleep(seconds*1000)
00402 #  if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00403 #    define HAVE_TIFFCONF_H
00404 #  endif
00405 # endif
00406 
00407 #endif
00408 
00409 /*
00410   Define system symbols if not already defined.
00411 */
00412 #if !defined(STDIN_FILENO)
00413 #define STDIN_FILENO  0x00
00414 #endif
00415 
00416 #if !defined(O_BINARY)
00417 #define O_BINARY  0x00
00418 #endif
00419 
00420 #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(__WINDOWS__) && defined(_DLL) && !defined(_LIB))
00421 #  define MAGICKCORE_MODULES_SUPPORT
00422 #endif
00423 
00424 #if defined(_MAGICKMOD_)
00425 # undef MAGICKCORE_BUILD_MODULES
00426 # define MAGICKCORE_BUILD_MODULES
00427 #endif
00428 
00429 /*
00430   I/O defines.
00431 */
00432 #if defined(__WINDOWS__) && !defined(Windows95) && !defined(__BORLANDC__)
00433 #define MagickSeek(file,offset,whence)  _lseeki64(file,offset,whence)
00434 #define MagickTell(file)  _telli64(file)
00435 #else
00436 #define MagickSeek(file,offset,whence)  lseek(file,offset,whence)
00437 #define MagickTell(file) tell(file)
00438 #endif
00439 
00440 /*
00441   Magick defines.
00442 */
00443 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
00444 
00445 #if defined(__cplusplus) || defined(c_plusplus)
00446 }
00447 #endif
00448 
00449 #endif

Generated on Thu Jul 2 12:03:22 2009 for MagickCore by  doxygen 1.5.8