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