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/script/license.php
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(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25#if defined(WIN32) || defined(WIN64)
26# define MAGICKWAND_WINDOWS_SUPPORT
27#else
28# define MAGICKWAND_POSIX_SUPPORT
29#endif
30
31#define MAGICKWAND_IMPLEMENTATION 1
32
33#if !defined(MAGICKWAND_CONFIG_H)
34# define MAGICKWAND_CONFIG_H
35# if !defined(vms) && !defined(macintosh)
36# include "magick/magick-config.h"
37# else
38# include "magick-config.h"
39# endif
40#if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
41# define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
42#endif
43#if defined(_magickcore_const) && !defined(const)
44# define const _magickcore_const
45#endif
46#if defined(_magickcore_inline) && !defined(inline)
47# define inline _magickcore_inline
48#endif
49# if defined(__cplusplus) || defined(c_plusplus)
50# undef inline
51# endif
52#endif
53
54#if !defined(const)
55# define STDC
56#endif
57
58/* Define to 1 if assertions should be disabled. */
59#if defined(MAGICKCORE_NDEBUG)
60#define NDEBUG 1
61#endif
62
63#include <stdarg.h>
64#include <stdio.h>
65#if defined(MAGICKCORE_HAVE_SYS_STAT_H)
66# include <sys/stat.h>
67#endif
68#if defined(MAGICKCORE_STDC_HEADERS)
69# include <stdlib.h>
70# include <stddef.h>
71#else
72# if defined(MAGICKCORE_HAVE_STDLIB_H)
73# include <stdlib.h>
74# endif
75#endif
76#if !defined(magick_restrict)
77# if !defined(_magickcore_restrict)
78# define magick_restrict restrict
79# else
80# define magick_restrict _magickcore_restrict
81# endif
82#endif
83#if defined(MAGICKCORE_HAVE_STRING_H)
84# if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
85# include <memory.h>
86# endif
87# include <string.h>
88#endif
89#if defined(MAGICKCORE_HAVE_STRINGS_H)
90# include <strings.h>
91#endif
92#if defined(MAGICKCORE_HAVE_INTTYPES_H)
93# include <inttypes.h>
94#endif
95#if defined(MAGICKCORE_HAVE_STDINT_H)
96# include <stdint.h>
97#endif
98#if defined(MAGICKCORE_HAVE_UNISTD_H)
99# include <unistd.h>
100#endif
101#if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
102#define _CRTDBG_MAP_ALLOC
103#endif
104
105#if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
106#define _CRTDBG_MAP_ALLOC
107#endif
108#if defined(MAGICKWAND_WINDOWS_SUPPORT)
109# include <io.h>
110#if !defined(__CYGWIN__)
111# include <direct.h>
112#endif
113# if !defined(MAGICKCORE_HAVE_STRERROR)
114# define HAVE_STRERROR
115# endif
116#endif
117
118#include <ctype.h>
119#include <locale.h>
120#include <errno.h>
121#include <fcntl.h>
122#include <math.h>
123#include <time.h>
124#include <limits.h>
125#include <signal.h>
126#include <assert.h>
127
128#if defined(MAGICKCORE_HAVE_XLOCALE_H)
129# include <xlocale.h>
130#endif
131#if defined(MAGICKCORE_THREAD_SUPPORT)
132# include <pthread.h>
133#endif
134#if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
135# include <sys/syslimits.h>
136#endif
137#if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
138# include <arm/limits.h>
139#endif
140
141#if defined(MAGICKCORE_HAVE_CL_CL_H) && !defined(MAGICK_PIXEL_RGBA)
142# define MAGICKCORE_OPENCL_SUPPORT 1
143#endif
144#if defined(MAGICKCORE_HAVE_OPENCL_CL_H) && !defined(MAGICK_PIXEL_RGBA)
145# define MAGICKCORE_OPENCL_SUPPORT 1
146#endif
147
148#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
149# include <omp.h>
150# define MAGICKCORE_OPENMP_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(S_IRUSR) && defined(S_IWUSR)
227# define S_MODE (S_IRUSR | S_IWUSR)
228#elif defined (MAGICKWAND_WINDOWS_SUPPORT)
229# define S_MODE (_S_IREAD | _S_IWRITE)
230#else
231# define S_MODE 0600
232#endif
233
234#if defined(MAGICKWAND_WINDOWS_SUPPORT)
235# include "magick/nt-base.h"
236#endif
237#if defined(macintosh)
238# include "magick/mac.h"
239#endif
240#if defined(vms)
241# include "magick/vms.h"
242#endif
243
244#include "wand/MagickWand.h"
245
246#undef HAVE_CONFIG_H
247#undef gamma
248#undef index
249#undef pipe
250#undef y1
251
252/*
253 Review these platform specific definitions.
254*/
255#if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__)
256# define DirectorySeparator "/"
257# define DirectoryListSeparator ':'
258# define EditorOptions " -title \"Edit Image Comment\" -e vi"
259# define Exit exit
260# define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
261# define X11_PREFERENCES_PATH "~/."
262# define ProcessPendingEvents(text)
263# define ReadCommandlLine(argc,argv)
264# define SetNotifyHandlers
265#else
266# if defined(vms)
267# define X11_APPLICATION_PATH "decw$system_defaults:"
268# define DirectorySeparator ""
269# define DirectoryListSeparator ';'
270# define EditorOptions ""
271# define Exit exit
272# define IsBasenameSeparator(c) \
273 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
274# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "sys$login:"
275# define MAGICKCORE_SHARE_PATH "sys$login:"
276# define X11_PREFERENCES_PATH "decw$user_defaults:"
277# define ProcessPendingEvents(text)
278# define ReadCommandlLine(argc,argv)
279# define SetNotifyHandlers
280# endif
281# if defined(__OS2__)
282# define DirectorySeparator "\\"
283# define DirectoryListSeparator ';'
284# define EditorOptions " -title \"Edit Image Comment\" -e vi"
285# define Exit exit
286# define IsBasenameSeparator(c) \
287 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
288# define PreferencesDefaults "~\."
289# define ProcessPendingEvents(text)
290# define ReadCommandlLine(argc,argv)
291# define SetNotifyHandlers
292#endif
293# if defined(macintosh)
294# define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/"
295# define DirectorySeparator ":"
296# define DirectoryListSeparator ';'
297# define EditorOptions ""
298# define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse)
299# define MAGICKCORE_LIBRARY_ABSOLUTE_PATH ""
300# define MAGICKCORE_SHARE_PATH ""
301# define X11_PREFERENCES_PATH "~/."
302# if defined(DISABLE_SIOUX)
303# define ReadCommandlLine(argc,argv)
304# define SetNotifyHandlers \
305 SetFatalErrorHandler(MacFatalErrorHandler); \
306 SetErrorHandler(MACErrorHandler); \
307 SetWarningHandler(MACWarningHandler)
308# else
309# define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion);
310# define SetNotifyHandlers \
311 SetErrorHandler(MACErrorHandler); \
312 SetWarningHandler(MACWarningHandler)
313# endif
314# endif
315# if defined(MAGICKWAND_WINDOWS_SUPPORT)
316# define DirectorySeparator "\\"
317# define DirectoryListSeparator ';'
318# define EditorOptions ""
319# define IsBasenameSeparator(c) \
320 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
321# define ProcessPendingEvents(text)
322# if !defined(X11_PREFERENCES_PATH)
323# define X11_PREFERENCES_PATH "~\\."
324# endif
325# define ReadCommandlLine(argc,argv)
326# define SetNotifyHandlers \
327 SetErrorHandler(NTErrorHandler); \
328 SetWarningHandler(NTWarningHandler)
329# if !defined(MAGICKCORE_HAVE_TIFFCONF_H)
330# define HAVE_TIFFCONF_H
331# endif
332# endif
333
334#endif
335
336/*
337 Define system symbols if not already defined.
338*/
339#if !defined(STDIN_FILENO)
340#define STDIN_FILENO 0x00
341#endif
342
343#if !defined(O_BINARY)
344#define O_BINARY 0x00
345#endif
346
347#if !defined(PATH_MAX)
348#define PATH_MAX 4096
349#endif
350
351/*
352 Magick defines.
353*/
354#if defined(_MSC_VER)
355# define DisableMSCWarning(nr) __pragma(warning(push)) \
356 __pragma(warning(disable:nr))
357# define RestoreMSCWarning __pragma(warning(pop))
358#else
359# define DisableMSCWarning(nr)
360# define RestoreMSCWarning
361#endif
362
363#if defined(__cplusplus) || defined(c_plusplus)
364}
365#endif
366
367#endif