MagickWand 6.9.6
Loading...
Searching...
No Matches
studio.h
1/*
2 Copyright 1999 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License. You may
6 obtain a copy of the License at
7
8 https://imagemagick.org/license/
9
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.
15
16 MagickWand private application programming interface declarations.
17*/
18#ifndef MAGICKWAND_STUDIO_H
19#define MAGICKWAND_STUDIO_H
20
21#if defined(WIN32) || defined(WIN64) || defined(_WIN32_WINNT)
22# define MAGICKWAND_WINDOWS_SUPPORT
23#else
24# define MAGICKWAND_POSIX_SUPPORT
25#endif
26
27#define MAGICKWAND_IMPLEMENTATION 1
28
29#if !defined(MAGICKWAND_CONFIG_H)
30# define MAGICKWAND_CONFIG_H
31# if !defined(vms) && !defined(macintosh)
32# include "magick/magick-config.h"
33# else
34# include "magick-config.h"
35# endif
36#if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
37# define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
38#endif
39#if defined(_magickcore_const) && !defined(const)
40# define const _magickcore_const
41#endif
42#if defined(_magickcore_inline) && !defined(inline)
43# define inline _magickcore_inline
44#endif
45# if defined(__cplusplus) || defined(c_plusplus)
46# undef inline
47# endif
48#endif
49
50#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
51# include <omp.h>
52# define MAGICKCORE_OPENMP_SUPPORT 1
53#endif
54
55#if defined(__cplusplus) || defined(c_plusplus)
56extern "C" {
57#endif
58
59#if !defined(const)
60# define STDC
61#endif
62
63/* Define to 1 if assertions should be disabled. */
64#if defined(MAGICKCORE_NDEBUG)
65#define NDEBUG 1
66#endif
67
68#include <stdarg.h>
69#include <stdio.h>
70#if defined(MAGICKCORE_HAVE_SYS_STAT_H)
71# include <sys/stat.h>
72#endif
73#if defined(MAGICKCORE_STDC_HEADERS)
74# include <stdlib.h>
75# include <stddef.h>
76#else
77# if defined(MAGICKCORE_HAVE_STDLIB_H)
78# include <stdlib.h>
79# endif
80#endif
81#if !defined(magick_restrict)
82# if !defined(_magickcore_restrict)
83# define magick_restrict restrict
84# else
85# define magick_restrict _magickcore_restrict
86# endif
87#endif
88#if defined(MAGICKCORE_HAVE_STRING_H)
89# if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
90# include <memory.h>
91# endif
92# include <string.h>
93#endif
94#if defined(MAGICKCORE_HAVE_STRINGS_H)
95# include <strings.h>
96#endif
97#if defined(MAGICKCORE_HAVE_INTTYPES_H)
98# include <inttypes.h>
99#endif
100#if defined(MAGICKCORE_HAVE_STDINT_H)
101# include <stdint.h>
102#endif
103#if defined(MAGICKCORE_HAVE_UNISTD_H)
104# include <unistd.h>
105#endif
106#if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
107#define _CRTDBG_MAP_ALLOC
108#endif
109
110#if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
111#define _CRTDBG_MAP_ALLOC
112#endif
113#if defined(MAGICKWAND_WINDOWS_SUPPORT)
114# include <io.h>
115#if !defined(__CYGWIN__)
116# include <direct.h>
117#endif
118# if !defined(MAGICKCORE_HAVE_STRERROR)
119# define HAVE_STRERROR
120# endif
121#endif
122
123#include <ctype.h>
124#include <locale.h>
125#include <errno.h>
126#include <fcntl.h>
127#include <math.h>
128#include <time.h>
129#include <limits.h>
130#include <signal.h>
131#include <assert.h>
132
133#if defined(MAGICKCORE_HAVE_XLOCALE_H)
134# include <xlocale.h>
135#endif
136#if defined(MAGICKCORE_THREAD_SUPPORT)
137# include <pthread.h>
138#endif
139#if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
140# include <sys/syslimits.h>
141#endif
142#if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
143# include <arm/limits.h>
144#endif
145
146#if defined(MAGICKCORE_HAVE_CL_CL_H) && !defined(MAGICK_PIXEL_RGBA)
147# define MAGICKCORE_OPENCL_SUPPORT 1
148#endif
149#if defined(MAGICKCORE_HAVE_OPENCL_CL_H) && !defined(MAGICK_PIXEL_RGBA)
150# define MAGICKCORE_OPENCL_SUPPORT 1
151#endif
152
153#if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
154ssize_t pread(int,void *,size_t,off_t);
155#endif
156
157#if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
158ssize_t pwrite(int,const void *,size_t,off_t);
159#endif
160
161#if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
162extern size_t strlcpy(char *,const char *,size_t);
163#endif
164
165#if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
166extern int vsnprintf(char *,size_t,const char *,va_list);
167#endif
168
169#if defined(MAGICKWAND_WINDOWS_SUPPORT) || defined(MAGICKWAND_POSIX_SUPPORT)
170# include <sys/types.h>
171# include <sys/stat.h>
172# if defined(MAGICKWAND_POSIX_SUPPORT)
173# if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
174# define dirent direct
175# define NAMLEN(dirent) (dirent)->d_namlen
176# if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
177# include <sys/ndir.h>
178# endif
179# if defined(MAGICKCORE_HAVE_SYS_DIR_H)
180# include <sys/dir.h>
181# endif
182# if defined(MAGICKCORE_HAVE_NDIR_H)
183# include <ndir.h>
184# endif
185# else
186# include <dirent.h>
187# define NAMLEN(dirent) strlen((dirent)->d_name)
188# endif
189# include <sys/wait.h>
190# include <pwd.h>
191# endif
192# if !defined(S_ISDIR)
193# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
194# endif
195# if !defined(S_ISREG)
196# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
197# endif
198# include "wand/MagickWand.h"
199# if !defined(MAGICKWAND_WINDOWS_SUPPORT)
200# include <sys/time.h>
201# if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
202# include <sys/times.h>
203# endif
204# if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
205# include <sys/resource.h>
206# endif
207# if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
208# include <sys/mman.h>
209# endif
210# if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
211# include <sys/sendfile.h>
212# endif
213#endif
214#else
215# include <types.h>
216# include <stat.h>
217# if defined(macintosh)
218# if !defined(DISABLE_SIOUX)
219# include <SIOUX.h>
220# include <console.h>
221# endif
222# include <unix.h>
223# endif
224#endif
225
226#if defined (MAGICKWAND_WINDOWS_SUPPORT) || defined(__MINGW32__)
227# define P_MODE (_S_IREAD | _S_IWRITE)
228# define S_MODE (_S_IREAD | _S_IWRITE)
229#elif defined(MAGICKWAND_POSIX_SUPPORT)
230# define P_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
231# define S_MODE (S_IRUSR | S_IWUSR)
232#else
233# define P_MODE 0666
234# define S_MODE 0600
235#endif
236
237#if defined(MAGICKWAND_WINDOWS_SUPPORT)
238# include "magick/nt-base.h"
239#endif
240#if defined(macintosh)
241# include "magick/mac.h"
242#endif
243#if defined(vms)
244# include "magick/vms.h"
245#endif
246
247#include "wand/MagickWand.h"
248
249#undef HAVE_CONFIG_H
250#undef gamma
251#undef index
252#undef pipe
253#undef y1
254
255/*
256 Review these platform specific definitions.
257*/
258#if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__)
259# define DirectorySeparator "/"
260# define DirectoryListSeparator ':'
261# define EditorOptions " -title \"Edit Image Comment\" -e vi"
262# define Exit exit
263# define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
264# define X11_PREFERENCES_PATH "~/."
265# define ProcessPendingEvents(text)
266# define ReadCommandlLine(argc,argv)
267# define SetNotifyHandlers
268#else
269# if defined(vms)
270# define X11_APPLICATION_PATH "decw$system_defaults:"
271# define DirectorySeparator ""
272# define DirectoryListSeparator ';'
273# define EditorOptions ""
274# define Exit exit
275# define IsBasenameSeparator(c) \
276 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
277# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "sys$login:"
278# define MAGICKCORE_SHARE_PATH "sys$login:"
279# define X11_PREFERENCES_PATH "decw$user_defaults:"
280# define ProcessPendingEvents(text)
281# define ReadCommandlLine(argc,argv)
282# define SetNotifyHandlers
283# endif
284# if defined(__OS2__)
285# define DirectorySeparator "\\"
286# define DirectoryListSeparator ';'
287# define EditorOptions " -title \"Edit Image Comment\" -e vi"
288# define Exit exit
289# define IsBasenameSeparator(c) \
290 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
291# define PreferencesDefaults "~\."
292# define ProcessPendingEvents(text)
293# define ReadCommandlLine(argc,argv)
294# define SetNotifyHandlers
295#endif
296# if defined(macintosh)
297# define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/"
298# define DirectorySeparator ":"
299# define DirectoryListSeparator ';'
300# define EditorOptions ""
301# define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse)
302# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH ""
303# define MAGICKCORE_SHARE_PATH ""
304# define X11_PREFERENCES_PATH "~/."
305# if defined(DISABLE_SIOUX)
306# define ReadCommandlLine(argc,argv)
307# define SetNotifyHandlers \
308 SetFatalErrorHandler(MacFatalErrorHandler); \
309 SetErrorHandler(MACErrorHandler); \
310 SetWarningHandler(MACWarningHandler)
311# else
312# define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
313# define SetNotifyHandlers \
314 SetErrorHandler(MACErrorHandler); \
315 SetWarningHandler(MACWarningHandler)
316# endif
317# endif
318# if defined(MAGICKWAND_WINDOWS_SUPPORT)
319# define DirectorySeparator "\\"
320# define DirectoryListSeparator ';'
321# define EditorOptions ""
322# define IsBasenameSeparator(c) \
323 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
324# define ProcessPendingEvents(text)
325# if !defined(X11_PREFERENCES_PATH)
326# define X11_PREFERENCES_PATH "~\\."
327# endif
328# define ReadCommandlLine(argc,argv)
329# define SetNotifyHandlers \
330 SetErrorHandler(NTErrorHandler); \
331 SetWarningHandler(NTWarningHandler)
332# if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
333# define HAVE_TIFFCONF_H
334# endif
335# endif
336
337#endif
338
339/*
340 Define system symbols if not already defined.
341*/
342#if !defined(STDIN_FILENO)
343#define STDIN_FILENO 0x00
344#endif
345
346#if !defined(O_BINARY)
347#define O_BINARY 0x00
348#endif
349
350#if !defined(PATH_MAX)
351#define PATH_MAX 4096
352#endif
353
354/*
355 Magick defines.
356*/
357#if defined(_MSC_VER)
358# define DisableMSCWarning(nr) __pragma(warning(push)) \
359 __pragma(warning(disable:nr))
360# define RestoreMSCWarning __pragma(warning(pop))
361#else
362# define DisableMSCWarning(nr)
363# define RestoreMSCWarning
364#endif
365
366#if defined(__cplusplus) || defined(c_plusplus)
367}
368#endif
369
370#endif