studio.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2008 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   MagickWand private application programming interface declarations.
00017 */
00018 #ifndef _MAGICKWAND_STUDIO_H
00019 #define _MAGICKWAND_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 MAGICKWAND_IMPLEMENTATION  1
00060 
00061 #if !defined(_MAGICKWAND_CONFIG_H)
00062 # define _MAGICKWAND_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 #endif
00081 
00082 #if !defined(const)
00083 #  define STDC
00084 #endif
00085 
00086 #if defined(__BORLANDC__) && defined(_DLL)
00087 #  pragma message("BCBMagick lib DLL export interface")
00088 #  define _MAGICKDLL_
00089 #  define _MAGICKLIB_
00090 #endif
00091 
00092 #if defined(__WINDOWS__)
00093 # if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB)
00094 #  define _MAGICKDLL_
00095 # endif
00096 # if defined(_MAGICKDLL_)
00097 #  if defined(_VISUALC_)
00098 #   pragma warning( disable: 4273 )  /* Disable the dll linkage warnings */
00099 #  endif
00100 #  if !defined(_MAGICKLIB_)
00101 #   define WandExport  __declspec(dllimport)
00102 #   if defined(_VISUALC_)
00103 #    pragma message( "MagickWand lib DLL import interface" )
00104 #   endif
00105 #  else
00106 #   define WandExport  __declspec(dllexport)
00107 #   if defined(_VISUALC_)
00108 #    pragma message( "MagickWand lib DLL export interface" )
00109 #   endif
00110 #  endif
00111 # else
00112 #  define WandExport
00113 #  if defined(_VISUALC_)
00114 #   pragma message( "MagickWand lib static interface" )
00115 #  endif
00116 # endif
00117 
00118 # if defined(_DLL) && !defined(_LIB)
00119 #  define ModuleExport  __declspec(dllexport)
00120 #  if defined(_VISUALC_)
00121 #   pragma message( "MagickWand module DLL export interface" )
00122 #  endif
00123 # else
00124 #  define ModuleExport
00125 #  if defined(_VISUALC_)
00126 #   pragma message( "MagickWand module static interface" )
00127 #  endif
00128 
00129 # endif
00130 # define WandGlobal  __declspec(thread)
00131 # if defined(_VISUALC_)
00132 #  pragma warning(disable : 4018)
00133 #  pragma warning(disable : 4068)
00134 #  pragma warning(disable : 4244)
00135 #  pragma warning(disable : 4142)
00136 #  pragma warning(disable : 4800)
00137 #  pragma warning(disable : 4786)
00138 #  pragma warning(disable : 4996)
00139 # endif
00140 #else
00141 # define WandExport
00142 # define ModuleExport
00143 # define WandGlobal
00144 #endif
00145 
00146 #if defined(__cplusplus) || defined(c_plusplus)
00147 # define storage_class  c_class
00148 #else
00149 # define storage_class  class
00150 #endif
00151 
00152 #define WandSignature  0xabacadabUL
00153 #if !defined(MaxTextExtent)
00154 # define MaxTextExtent  4096
00155 #endif
00156 
00157 #include <stdarg.h>
00158 #include <stdio.h>
00159 #if defined(__WINDOWS__) && defined(_DEBUG)
00160 #define _CRTDBG_MAP_ALLOC
00161 #endif
00162 #include <stdlib.h>
00163 #if !defined(__WINDOWS__)
00164 # include <unistd.h>
00165 #else
00166 # include <direct.h>
00167 # if !defined(MAGICKCORE_HAVE_STRERROR)
00168 #  define HAVE_STRERROR
00169 # endif
00170 #endif
00171 
00172 #if defined(MAGICKCORE_HAVE_STRINGS_H)
00173 # include <strings.h>
00174 #endif
00175 #include <string.h>
00176 #include <ctype.h>
00177 #include <locale.h>
00178 #include <errno.h>
00179 #include <fcntl.h>
00180 #include <math.h>
00181 #include <time.h>
00182 #include <limits.h>
00183 #include <signal.h>
00184 #include <assert.h>
00185 
00186 #if defined(MAGICKCORE_HAVE_PTHREAD )
00187 # include <pthread.h>
00188 #endif
00189 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
00190 # include <sys/syslimits.h>
00191 #endif
00192 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
00193 # include <arm/limits.h>
00194 #endif
00195 
00196 #if defined(_OPENMP) && (_OPENMP >= 200203)
00197 #  include <omp.h>
00198 #  define MAGICKCORE_OPENMP_SUPPORT 1
00199 #endif
00200 
00201 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
00202 ssize_t pread(int,void *,size_t,off_t);
00203 #endif
00204 
00205 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
00206 ssize_t pwrite(int,const void *,size_t,off_t);
00207 #endif
00208 
00209 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
00210 extern size_t strlcpy(char *,const char *,size_t);
00211 #endif
00212 
00213 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
00214 extern int vsnprintf(char *,size_t,const char *,va_list);
00215 #endif
00216 
00217 #if !defined(wand_attribute)
00218 #  if !defined(__GNUC__)
00219 #    define wand_attribute(x)  /* nothing */
00220 #  else
00221 #    define wand_attribute  __attribute__
00222 #  endif
00223 #endif
00224 
00225 #if !defined(wand_unused)
00226 #  if defined(__GNUC__)
00227 #     define wand_unused(x)  wand_unused_ ## x __attribute__((unused))
00228 #  elif defined(__LCLINT__)
00229 #    define wand_unused(x) /*@unused@*/ x
00230 #  else
00231 #    define wand_unused(x) x
00232 #  endif
00233 #endif
00234 
00235 #if defined(__WINDOWS__) || defined(MAGICKCORE_POSIX_SUPPORT)
00236 # include <sys/types.h>
00237 # include <sys/stat.h>
00238 # if defined(MAGICKCORE_HAVE_FTIME)
00239 # include <sys/timeb.h>
00240 # endif
00241 # if defined(MAGICKCORE_POSIX_SUPPORT)
00242 #  if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
00243 #   define dirent direct
00244 #   define NAMLEN(dirent) (dirent)->d_namlen
00245 #   if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
00246 #    include <sys/ndir.h>
00247 #   endif
00248 #   if defined(MAGICKCORE_HAVE_SYS_DIR_H)
00249 #    include <sys/dir.h>
00250 #   endif
00251 #   if defined(MAGICKCORE_HAVE_NDIR_H)
00252 #    include <ndir.h>
00253 #   endif
00254 #  else
00255 #   include <dirent.h>
00256 #   define NAMLEN(dirent) strlen((dirent)->d_name)
00257 #  endif
00258 #  include <sys/wait.h>
00259 #  include <pwd.h>
00260 # endif
00261 # if !defined(S_ISDIR)
00262 #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
00263 # endif
00264 # if !defined(S_ISREG)
00265 #  define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
00266 # endif
00267 # include "wand/MagickWand.h"
00268 # if !defined(__WINDOWS__)
00269 #  include <sys/time.h>
00270 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
00271 #  include <sys/times.h>
00272 # endif
00273 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
00274 #  include <sys/resource.h>
00275 # endif
00276 #endif
00277 #else
00278 # include <types.h>
00279 # include <stat.h>
00280 # if defined(macintosh)
00281 #  if !defined(DISABLE_SIOUX)
00282 #   include <SIOUX.h>
00283 #   include <console.h>
00284 #  endif
00285 #  include <unix.h>
00286 # endif
00287 # include "wand/MagickWand.h"
00288 #endif
00289 
00290 #if defined(S_IRUSR) && defined(S_IWUSR)
00291 # define S_MODE (S_IRUSR | S_IWUSR)
00292 #elif defined (__WINDOWS__)
00293 # define S_MODE (_S_IREAD | _S_IWRITE)
00294 #else
00295 # define S_MODE  0600
00296 #endif
00297 
00298 #if defined(__WINDOWS__)
00299 # include "magick/nt-base.h"
00300 #endif
00301 #if defined(macintosh)
00302 # include "magick/mac.h"
00303 #endif
00304 #if defined(vms)
00305 # include "magick/vms.h"
00306 #endif
00307 
00308 #undef index
00309 #undef pipe
00310 
00311 /*
00312   Review these platform specific definitions.
00313 */
00314 #if defined(MAGICKCORE_POSIX_SUPPORT)
00315 # define DirectorySeparator  "/"
00316 # define DirectoryListSeparator  ':'
00317 # define EditorOptions  " -title \"Edit Image Comment\" -e vi"
00318 # define Exit  exit
00319 # define IsBasenameSeparator(c)  ((c) == '/' ? MagickTrue : MagickFalse)
00320 # define X11_PREFERENCES_PATH  "~/."
00321 # define ProcessPendingEvents(text)
00322 # define ReadCommandlLine(argc,argv)
00323 # define SetNotifyHandlers
00324 #else
00325 # if defined(vms)
00326 #  define X11_APPLICATION_PATH  "decw$system_defaults:"
00327 #  define DirectorySeparator  ""
00328 #  define DirectoryListSeparator  ';'
00329 #  define EditorOptions  ""
00330 #  define Exit  exit
00331 #  define IsBasenameSeparator(c) \
00332   (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
00333 #  define MAGICKCORE_LIBRARY_PATH  "sys$login:"
00334 #  define MAGICKCORE_CODER_PATH  "sys$login:"
00335 #  define MAGICKCORE_FILTER_PATH  "sys$login:"
00336 #  define MAGICKCORE_SHARE_PATH  "sys$login:"
00337 #  define X11_PREFERENCES_PATH  "decw$user_defaults:"
00338 #  define ProcessPendingEvents(text)
00339 #  define ReadCommandlLine(argc,argv)
00340 #  define SetNotifyHandlers
00341 # endif
00342 # if defined(macintosh)
00343 #  define X11_APPLICATION_PATH  "/usr/lib/X11/app-defaults/"
00344 #  define DirectorySeparator  ":"
00345 #  define DirectoryListSeparator  ';'
00346 #  define EditorOptions ""
00347 #  define IsBasenameSeparator(c)  ((c) == ':' ? MagickTrue : MagickFalse)
00348 #  define MAGICKCORE_LIBRARY_PATH  ""
00349 #  define MAGICKCORE_CODER_PATH  ""
00350 #  define MAGICKCORE_FILTER_PATH  ""
00351 #  define MAGICKCORE_SHARE_PATH  ""
00352 #  define X11_PREFERENCES_PATH  "~/."
00353 #  if defined(DISABLE_SIOUX)
00354 #   define ReadCommandlLine(argc,argv)
00355 #   define SetNotifyHandlers \
00356      SetFatalErrorHandler(MacFatalErrorHandler); \
00357      SetErrorHandler(MACErrorHandler); \
00358      SetWarningHandler(MACWarningHandler)
00359 #  else
00360 #   define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
00361 #   define SetNotifyHandlers \
00362      SetErrorHandler(MACErrorHandler); \
00363      SetWarningHandler(MACWarningHandler)
00364 #  endif
00365 # endif
00366 # if defined(__WINDOWS__)
00367 #  define DirectorySeparator  "\\"
00368 #  define DirectoryListSeparator  ';'
00369 #  define EditorOptions ""
00370 #  define IsBasenameSeparator(c) \
00371   (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
00372 #  define ProcessPendingEvents(text)
00373 #  if !defined(X11_PREFERENCES_PATH)
00374 #    define X11_PREFERENCES_PATH  "~\\."
00375 #  endif
00376 #  define ReadCommandlLine(argc,argv)
00377 #  define SetNotifyHandlers \
00378     SetErrorHandler(NTErrorHandler); \
00379     SetWarningHandler(NTWarningHandler)
00380 #  undef sleep
00381 #  define sleep(seconds)  Sleep(seconds*1000)
00382 #  if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
00383 #    define HAVE_TIFFCONF_H
00384 #  endif
00385 # endif
00386 
00387 #endif
00388 
00389 /*
00390   Define system symbols if not already defined.
00391 */
00392 #if !defined(STDIN_FILENO)
00393 #define STDIN_FILENO  0x00
00394 #endif
00395 
00396 #if !defined(O_BINARY)
00397 #define O_BINARY  0x00
00398 #endif
00399 
00400 /*
00401   I/O defines.
00402 */
00403 #if defined(__WINDOWS__) && !defined(Windows95) && !defined(__BORLANDC__)
00404 #define MagickSeek(file,offset,whence)  _lseeki64(file,offset,whence)
00405 #define MagickTell(file)  _telli64(file)
00406 #else
00407 #define MagickSeek(file,offset,whence)  lseek(file,offset,whence)
00408 #define MagickTell(file) tell(file)
00409 #endif
00410 
00411 #define ThrowWandFatalException(severity,tag,context) \
00412 { \
00413   ExceptionInfo \
00414     *exception; \
00415  \
00416   exception=AcquireExceptionInfo(); \
00417   (void) ThrowMagickException(exception,GetMagickModule(),severity,tag, \
00418     "`%s'",context); \
00419   CatchException(exception); \
00420   exception=DestroyExceptionInfo(exception); \
00421 }
00422 
00423 #if defined(__cplusplus) || defined(c_plusplus)
00424 }
00425 #endif
00426 
00427 #endif

Generated on Sat Nov 22 23:45:26 2008 for MagickWand by  doxygen 1.5.7.1