2 Copyright 1999-2014 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 MAGICKWAND_WINDOWS_SUPPORT
28 # define MAGICKWAND_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(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
99 #define _CRTDBG_MAP_ALLOC
102 #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
103 #define _CRTDBG_MAP_ALLOC
105 #if defined(MAGICKWAND_WINDOWS_SUPPORT)
108 # if !defined(MAGICKCORE_HAVE_STRERROR)
109 # define HAVE_STRERROR
123 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
124 # include <xlocale.h>
126 #if defined(MAGICKCORE_THREAD_SUPPORT)
127 # include <pthread.h>
128 #elif defined(MAGICKWAND_WINDOWS_SUPPORT)
129 # define MAGICKCORE_HAVE_WINTHREADS 1
132 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
133 # include <sys/syslimits.h>
135 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
136 # include <arm/limits.h>
139 #if defined(MAGICKCORE__OPENCL)
140 #if defined(MAGICKCORE_HAVE_CL_CL_H)
143 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
144 # include <OpenCL/cl.h>
146 # define MAGICKCORE_OPENCL_SUPPORT 1
149 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
151 # define MAGICKCORE_OPENMP_SUPPORT 1
154 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
155 ssize_t pread(int,void *,size_t,off_t);
158 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
159 ssize_t pwrite(int,const void *,size_t,off_t);
162 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
163 extern size_t strlcpy(char *,const char *,size_t);
166 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
167 extern int vsnprintf(char *,size_t,const char *,va_list);
170 #include "MagickWand/method-attribute.h"
172 #if defined(MAGICKWAND_WINDOWS_SUPPORT) || defined(MAGICKWAND_POSIX_SUPPORT)
173 # include <sys/types.h>
174 # include <sys/stat.h>
175 # if defined(MAGICKCORE_HAVE_FTIME)
176 # include <sys/timeb.h>
178 # if defined(MAGICKWAND_POSIX_SUPPORT)
179 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
180 # define dirent direct
181 # define NAMLEN(dirent) (dirent)->d_namlen
182 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
183 # include <sys/ndir.h>
185 # if defined(MAGICKCORE_HAVE_SYS_DIR_H)
186 # include <sys/dir.h>
188 # if defined(MAGICKCORE_HAVE_NDIR_H)
193 # define NAMLEN(dirent) strlen((dirent)->d_name)
195 # include <sys/wait.h>
198 # if !defined(S_ISDIR)
199 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
201 # if !defined(S_ISREG)
202 # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
204 # include "MagickWand/MagickWand.h"
205 # if !defined(MAGICKWAND_WINDOWS_SUPPORT)
206 # include <sys/time.h>
207 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
208 # include <sys/times.h>
210 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
211 # include <sys/resource.h>
213 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
214 # include <sys/mman.h>
220 # if defined(macintosh)
221 # if !defined(DISABLE_SIOUX)
223 # include <console.h>
229 #if defined(S_IRUSR) && defined(S_IWUSR)
230 # define S_MODE (S_IRUSR | S_IWUSR)
231 #elif defined (MAGICKWAND_WINDOWS_SUPPORT)
232 # define S_MODE (_S_IREAD | _S_IWRITE)
237 #if defined(MAGICKWAND_WINDOWS_SUPPORT)
238 # include "MagickCore/nt-base.h"
240 #if defined(macintosh)
241 # include "MagickCore/mac.h"
244 # include "MagickCore/vms.h"
254 Review these platform specific definitions.
256 #if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__)
257 # define DirectorySeparator "/"
258 # define DirectoryListSeparator ':'
259 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
261 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
262 # define X11_PREFERENCES_PATH "~/."
263 # define ProcessPendingEvents(text)
264 # define ReadCommandlLine(argc,argv)
265 # define SetNotifyHandlers
268 # define X11_APPLICATION_PATH "decw$system_defaults:"
269 # define DirectorySeparator ""
270 # define DirectoryListSeparator ';'
271 # define EditorOptions ""
273 # define IsBasenameSeparator(c) \
274 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
275 # define MAGICKCORE_LIBRARY_PATH "sys$login:"
276 # define MAGICKCORE_SHARE_PATH "sys$login:"
277 # define X11_PREFERENCES_PATH "decw$user_defaults:"
278 # define ProcessPendingEvents(text)
279 # define ReadCommandlLine(argc,argv)
280 # define SetNotifyHandlers
282 # if defined(__OS2__)
283 # define DirectorySeparator "\\"
284 # define DirectoryListSeparator ';'
285 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
287 # define IsBasenameSeparator(c) \
288 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
289 # define PreferencesDefaults "~\."
290 # define ProcessPendingEvents(text)
291 # define ReadCommandlLine(argc,argv)
292 # define SetNotifyHandlers
294 # if defined(macintosh)
295 # define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/"
296 # define DirectorySeparator ":"
297 # define DirectoryListSeparator ';'
298 # define EditorOptions ""
299 # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse)
300 # define MAGICKCORE_LIBRARY_PATH ""
301 # define MAGICKCORE_SHARE_PATH ""
302 # define X11_PREFERENCES_PATH "~/."
303 # if defined(DISABLE_SIOUX)
304 # define ReadCommandlLine(argc,argv)
305 # define SetNotifyHandlers \
306 SetFatalErrorHandler(MacFatalErrorHandler); \
307 SetErrorHandler(MACErrorHandler); \
308 SetWarningHandler(MACWarningHandler)
310 # define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
311 # define SetNotifyHandlers \
312 SetErrorHandler(MACErrorHandler); \
313 SetWarningHandler(MACWarningHandler)
316 # if defined(MAGICKWAND_WINDOWS_SUPPORT)
317 # define DirectorySeparator "\\"
318 # define DirectoryListSeparator ';'
319 # define EditorOptions ""
320 # define IsBasenameSeparator(c) \
321 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
322 # define ProcessPendingEvents(text)
323 # if !defined(X11_PREFERENCES_PATH)
324 # define X11_PREFERENCES_PATH "~\\."
326 # define ReadCommandlLine(argc,argv)
327 # define SetNotifyHandlers \
328 SetErrorHandler(NTErrorHandler); \
329 SetWarningHandler(NTWarningHandler)
331 # define sleep(seconds) Sleep(seconds*1000)
332 # if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
333 # define HAVE_TIFFCONF_H
340 Define system symbols if not already defined.
342 #if !defined(STDIN_FILENO)
343 #define STDIN_FILENO 0x00
346 #if !defined(O_BINARY)
347 #define O_BINARY 0x00
350 #if !defined(PATH_MAX)
351 #define PATH_MAX 4096
357 #if defined(_MSC_VER)
358 # define DisableMSCWarning(nr) __pragma(warning(push)) \
359 __pragma(warning(disable:nr))
360 # define RestoreMSCWarning __pragma(warning(pop))
362 # define DisableMSCWarning(nr)
363 # define RestoreMSCWarning
366 #if defined(__cplusplus) || defined(c_plusplus)