2 Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickWand private application programming interface declarations.
18 #ifndef _MAGICKWAND_STUDIO_H
19 #define _MAGICKWAND_STUDIO_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #if defined(WIN32) || defined(WIN64)
26 # define MAGICKCORE_WINDOWS_SUPPORT
28 # define MAGICKCORE_POSIX_SUPPORT
31 #define MAGICKWAND_IMPLEMENTATION 1
33 #if !defined(_MAGICKWAND_CONFIG_H)
34 # define _MAGICKWAND_CONFIG_H
35 # if !defined(vms) && !defined(macintosh)
36 # include "MagickCore/magick-config.h"
38 # include "magick-config.h"
40 #if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
41 # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
43 #if defined(_magickcore_const) && !defined(const)
44 # define const _magickcore_const
46 #if defined(_magickcore_inline) && !defined(inline)
47 # define inline _magickcore_inline
49 #if defined(_magickcore_restrict) && !defined(restrict)
50 # define restrict _magickcore_restrict
52 # if defined(__cplusplus) || defined(c_plusplus)
61 #if defined(__cplusplus) || defined(c_plusplus)
62 # define storage_class c_class
64 # define storage_class class
69 #if defined(MAGICKCORE_HAVE_SYS_STAT_H)
70 # include <sys/stat.h>
72 #if defined(MAGICKCORE_STDC_HEADERS)
76 # if defined(MAGICKCORE_HAVE_STDLIB_H)
80 #if defined(MAGICKCORE_HAVE_STRING_H)
81 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
86 #if defined(MAGICKCORE_HAVE_STRINGS_H)
89 #if defined(MAGICKCORE_HAVE_INTTYPES_H)
90 # include <inttypes.h>
92 #if defined(MAGICKCORE_HAVE_STDINT_H)
95 #if defined(MAGICKCORE_HAVE_UNISTD_H)
98 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
99 #define _CRTDBG_MAP_ALLOC
101 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
103 # if !defined(MAGICKCORE_HAVE_STRERROR)
104 # define HAVE_STRERROR
108 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
109 #define _CRTDBG_MAP_ALLOC
111 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
113 # if !defined(MAGICKCORE_HAVE_STRERROR)
114 # define HAVE_STRERROR
128 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
129 # include <xlocale.h>
131 #if defined(MAGICKCORE_THREAD_SUPPORT)
132 # include <pthread.h>
133 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
134 # define MAGICKCORE_HAVE_WINTHREADS 1
137 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
138 # include <sys/syslimits.h>
140 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
141 # include <arm/limits.h>
144 #if defined(MAGICKCORE__OPENCL)
145 #if defined(MAGICKCORE_HAVE_CL_CL_H)
148 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
149 # include <OpenCL/cl.h>
151 # define MAGICKCORE_OPENCL_SUPPORT 1
154 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
156 # define MAGICKCORE_OPENMP_SUPPORT 1
159 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
160 ssize_t pread(int,void *,size_t,off_t);
163 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
164 ssize_t pwrite(int,const void *,size_t,off_t);
167 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
168 extern size_t strlcpy(char *,const char *,size_t);
171 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
172 extern int vsnprintf(char *,size_t,const char *,va_list);
175 #include "MagickWand/method-attribute.h"
177 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
178 # include <sys/types.h>
179 # include <sys/stat.h>
180 # if defined(MAGICKCORE_HAVE_FTIME)
181 # include <sys/timeb.h>
183 # if defined(MAGICKCORE_POSIX_SUPPORT)
184 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
185 # define dirent direct
186 # define NAMLEN(dirent) (dirent)->d_namlen
187 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
188 # include <sys/ndir.h>
190 # if defined(MAGICKCORE_HAVE_SYS_DIR_H)
191 # include <sys/dir.h>
193 # if defined(MAGICKCORE_HAVE_NDIR_H)
198 # define NAMLEN(dirent) strlen((dirent)->d_name)
200 # include <sys/wait.h>
203 # if !defined(S_ISDIR)
204 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
206 # if !defined(S_ISREG)
207 # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
209 # include "MagickWand/MagickWand.h"
210 # if !defined(MAGICKCORE_WINDOWS_SUPPORT)
211 # include <sys/time.h>
212 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
213 # include <sys/times.h>
215 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
216 # include <sys/resource.h>
222 # if defined(macintosh)
223 # if !defined(DISABLE_SIOUX)
225 # include <console.h>
231 #if defined(S_IRUSR) && defined(S_IWUSR)
232 # define S_MODE (S_IRUSR | S_IWUSR)
233 #elif defined (MAGICKCORE_WINDOWS_SUPPORT)
234 # define S_MODE (_S_IREAD | _S_IWRITE)
239 #if defined(MAGICKCORE_WINDOWS_SUPPORT)
240 # include "MagickCore/nt-base.h"
242 #if defined(macintosh)
243 # include "MagickCore/mac.h"
246 # include "MagickCore/vms.h"
256 Review these platform specific definitions.
258 #if defined(MAGICKCORE_POSIX_SUPPORT) && !defined(__OS2__)
259 # define DirectorySeparator "/"
260 # define DirectoryListSeparator ':'
261 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
263 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
264 # define X11_PREFERENCES_PATH "~/."
265 # define ProcessPendingEvents(text)
266 # define ReadCommandlLine(argc,argv)
267 # define SetNotifyHandlers
270 # define X11_APPLICATION_PATH "decw$system_defaults:"
271 # define DirectorySeparator ""
272 # define DirectoryListSeparator ';'
273 # define EditorOptions ""
275 # define IsBasenameSeparator(c) \
276 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
277 # define MAGICKCORE_LIBRARY_PATH "sys$login:"
278 # define MAGICKCORE_CODER_PATH "sys$login:"
279 # define MAGICKCORE_FILTER_PATH "sys$login:"
280 # define MAGICKCORE_SHARE_PATH "sys$login:"
281 # define X11_PREFERENCES_PATH "decw$user_defaults:"
282 # define ProcessPendingEvents(text)
283 # define ReadCommandlLine(argc,argv)
284 # define SetNotifyHandlers
286 # if defined(__OS2__)
287 # define DirectorySeparator "\\"
288 # define DirectoryListSeparator ';'
289 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
291 # define IsBasenameSeparator(c) \
292 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
293 # define PreferencesDefaults "~\."
294 # define ProcessPendingEvents(text)
295 # define ReadCommandlLine(argc,argv)
296 # define SetNotifyHandlers
298 # if defined(macintosh)
299 # define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/"
300 # define DirectorySeparator ":"
301 # define DirectoryListSeparator ';'
302 # define EditorOptions ""
303 # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse)
304 # define MAGICKCORE_LIBRARY_PATH ""
305 # define MAGICKCORE_CODER_PATH ""
306 # define MAGICKCORE_FILTER_PATH ""
307 # define MAGICKCORE_SHARE_PATH ""
308 # define X11_PREFERENCES_PATH "~/."
309 # if defined(DISABLE_SIOUX)
310 # define ReadCommandlLine(argc,argv)
311 # define SetNotifyHandlers \
312 SetFatalErrorHandler(MacFatalErrorHandler); \
313 SetErrorHandler(MACErrorHandler); \
314 SetWarningHandler(MACWarningHandler)
316 # define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
317 # define SetNotifyHandlers \
318 SetErrorHandler(MACErrorHandler); \
319 SetWarningHandler(MACWarningHandler)
322 # if defined(MAGICKCORE_WINDOWS_SUPPORT)
323 # define DirectorySeparator "\\"
324 # define DirectoryListSeparator ';'
325 # define EditorOptions ""
326 # define IsBasenameSeparator(c) \
327 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
328 # define ProcessPendingEvents(text)
329 # if !defined(X11_PREFERENCES_PATH)
330 # define X11_PREFERENCES_PATH "~\\."
332 # define ReadCommandlLine(argc,argv)
333 # define SetNotifyHandlers \
334 SetErrorHandler(NTErrorHandler); \
335 SetWarningHandler(NTWarningHandler)
337 # define sleep(seconds) Sleep(seconds*1000)
338 # if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
339 # define HAVE_TIFFCONF_H
346 Define system symbols if not already defined.
348 #if !defined(STDIN_FILENO)
349 #define STDIN_FILENO 0x00
352 #if !defined(O_BINARY)
353 #define O_BINARY 0x00
356 #if !defined(PATH_MAX)
357 #define PATH_MAX 4096
363 #define ThrowWandFatalException(severity,tag,context) \
368 fatal_exception=AcquireExceptionInfo(); \
369 (void) ThrowMagickException(fatal_exception,GetMagickModule(),severity,tag, \
371 CatchException(fatal_exception); \
372 fatal_exception=DestroyExceptionInfo(fatal_exception); \
375 #if defined(__cplusplus) || defined(c_plusplus)