2 Copyright 1999-2019 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. You may
6 obtain a copy of the License at
8 https://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 # include "MagickCore/magick-config.h"
36 #if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
37 # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
39 #if defined(_magickcore_const) && !defined(const)
40 # define const _magickcore_const
42 #if defined(_magickcore_inline) && !defined(inline)
43 # define inline _magickcore_inline
45 # if defined(__cplusplus) || defined(c_plusplus)
56 #if defined(MAGICKCORE_HAVE_SYS_STAT_H)
57 # include <sys/stat.h>
59 #if defined(MAGICKCORE_STDC_HEADERS)
63 # if defined(MAGICKCORE_HAVE_STDLIB_H)
67 #if !defined(magick_restrict)
68 # if !defined(_magickcore_restrict)
69 # define magick_restrict restrict
71 # define magick_restrict _magickcore_restrict
74 #if defined(MAGICKCORE_HAVE_STRING_H)
75 # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
80 #if defined(MAGICKCORE_HAVE_STRINGS_H)
83 #if defined(MAGICKCORE_HAVE_INTTYPES_H)
84 # include <inttypes.h>
86 #if defined(MAGICKCORE_HAVE_STDINT_H)
89 #if defined(MAGICKCORE_HAVE_UNISTD_H)
92 #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
93 #define _CRTDBG_MAP_ALLOC
96 #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
97 #define _CRTDBG_MAP_ALLOC
99 #if defined(MAGICKWAND_WINDOWS_SUPPORT)
101 #if !defined(__CYGWIN__)
104 # if !defined(MAGICKCORE_HAVE_STRERROR)
105 # define HAVE_STRERROR
119 #if defined(MAGICKCORE_HAVE_XLOCALE_H)
120 # include <xlocale.h>
122 #if defined(MAGICKCORE_THREAD_SUPPORT)
123 # include <pthread.h>
125 #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
126 # include <sys/syslimits.h>
128 #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
129 # include <arm/limits.h>
132 #if defined(MAGICKCORE__OPENCL)
133 #if defined(MAGICKCORE_HAVE_CL_CL_H)
136 #if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
137 # include <OpenCL/cl.h>
139 # define MAGICKCORE_OPENCL_SUPPORT 1
142 #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
144 # define MAGICKCORE_OPENMP_SUPPORT 1
147 #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
148 ssize_t pread(int,void *,size_t,off_t);
151 #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
152 ssize_t pwrite(int,const void *,size_t,off_t);
155 #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
156 extern size_t strlcpy(char *,const char *,size_t);
159 #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
160 extern int vsnprintf(char *,size_t,const char *,va_list);
163 #include "MagickWand/method-attribute.h"
165 #if defined(MAGICKWAND_WINDOWS_SUPPORT) || defined(MAGICKWAND_POSIX_SUPPORT)
166 # include <sys/types.h>
167 # include <sys/stat.h>
168 # if defined(MAGICKCORE_HAVE_SYS_TIMEB_H)
169 # include <sys/timeb.h>
171 # if defined(MAGICKWAND_POSIX_SUPPORT)
172 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
173 # define dirent direct
174 # define NAMLEN(dirent) (dirent)->d_namlen
175 # if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
176 # include <sys/ndir.h>
178 # if defined(MAGICKCORE_HAVE_SYS_DIR_H)
179 # include <sys/dir.h>
181 # if defined(MAGICKCORE_HAVE_NDIR_H)
186 # define NAMLEN(dirent) strlen((dirent)->d_name)
188 # include <sys/wait.h>
191 # if !defined(S_ISDIR)
192 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
194 # if !defined(S_ISREG)
195 # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
197 # include "MagickWand/MagickWand.h"
198 # if !defined(MAGICKWAND_WINDOWS_SUPPORT)
199 # include <sys/time.h>
200 # if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
201 # include <sys/times.h>
203 # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
204 # include <sys/resource.h>
206 # if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
207 # include <sys/mman.h>
209 # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
210 # include <sys/sendfile.h>
216 # if defined(macintosh)
217 # if !defined(DISABLE_SIOUX)
219 # include <console.h>
225 #if defined(S_IRUSR) && defined(S_IWUSR)
226 # define S_MODE (S_IRUSR | S_IWUSR)
227 #elif defined (MAGICKWAND_WINDOWS_SUPPORT)
228 # define S_MODE (_S_IREAD | _S_IWRITE)
233 #if defined(MAGICKWAND_WINDOWS_SUPPORT)
234 # include "MagickCore/nt-base.h"
244 Review these platform specific definitions.
246 #if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__)
247 # define DirectorySeparator "/"
248 # define DirectoryListSeparator ':'
249 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
251 # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
252 # define X11_PREFERENCES_PATH "~/."
253 # define ProcessPendingEvents(text)
254 # define ReadCommandlLine(argc,argv)
255 # define SetNotifyHandlers
257 # if defined(__OS2__)
258 # define DirectorySeparator "\\"
259 # define DirectoryListSeparator ';'
260 # define EditorOptions " -title \"Edit Image Comment\" -e vi"
262 # define IsBasenameSeparator(c) \
263 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
264 # define PreferencesDefaults "~\."
265 # define ProcessPendingEvents(text)
266 # define ReadCommandlLine(argc,argv)
267 # define SetNotifyHandlers
269 # if defined(MAGICKWAND_WINDOWS_SUPPORT)
270 # define DirectorySeparator "\\"
271 # define DirectoryListSeparator ';'
272 # define EditorOptions ""
273 # define IsBasenameSeparator(c) \
274 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
275 # define ProcessPendingEvents(text)
276 # if !defined(X11_PREFERENCES_PATH)
277 # define X11_PREFERENCES_PATH "~\\."
279 # define ReadCommandlLine(argc,argv)
280 # define SetNotifyHandlers \
281 SetErrorHandler(NTErrorHandler); \
282 SetWarningHandler(NTWarningHandler)
283 # if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
284 # define HAVE_TIFFCONF_H
291 Define system symbols if not already defined.
293 #if !defined(STDIN_FILENO)
294 #define STDIN_FILENO 0x00
297 #if !defined(O_BINARY)
298 #define O_BINARY 0x00
301 #if !defined(PATH_MAX)
302 #define PATH_MAX 4096
308 #if defined(_MSC_VER)
309 # define DisableMSCWarning(nr) __pragma(warning(push)) \
310 __pragma(warning(disable:nr))
311 # define RestoreMSCWarning __pragma(warning(pop))
313 # define DisableMSCWarning(nr)
314 # define RestoreMSCWarning
317 #if defined(__cplusplus) || defined(c_plusplus)