MagickWand 7.1.2
Convert, Edit, Or Compose Bitmap Images
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(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# include "MagickCore/magick-config.h"
32#if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS)
33# define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS
34#endif
35#if defined(_magickcore_const) && !defined(const)
36# define const _magickcore_const
37#endif
38#if defined(_magickcore_inline) && !defined(inline)
39# define inline _magickcore_inline
40#endif
41# if defined(__cplusplus) || defined(c_plusplus)
42# undef inline
43# endif
44#endif
45
46#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
47# include <omp.h>
48# define MAGICKCORE_OPENMP_SUPPORT 1
49#endif
50
51#if defined(__cplusplus) || defined(c_plusplus)
52extern "C" {
53#endif
54
55#if !defined(const)
56# define STDC
57#endif
58
59/* Define to 1 if assertions should be disabled. */
60#if defined(MAGICKCORE_NDEBUG)
61#define NDEBUG 1
62#endif
63
64#include <stdarg.h>
65#include <stdio.h>
66#if defined(MAGICKCORE_HAVE_SYS_STAT_H)
67# include <sys/stat.h>
68#endif
69#if defined(MAGICKCORE_STDC_HEADERS)
70# include <stdlib.h>
71# include <stddef.h>
72#else
73# if defined(MAGICKCORE_HAVE_STDLIB_H)
74# include <stdlib.h>
75# endif
76#endif
77#if !defined(magick_restrict)
78# if !defined(_magickcore_restrict)
79# define magick_restrict restrict
80# else
81# define magick_restrict _magickcore_restrict
82# endif
83#endif
84#if defined(MAGICKCORE_HAVE_STRING_H)
85# if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H)
86# include <memory.h>
87# endif
88# include <string.h>
89#endif
90#if defined(MAGICKCORE_HAVE_STRINGS_H)
91# include <strings.h>
92#endif
93#if defined(MAGICKCORE_HAVE_INTTYPES_H)
94# include <inttypes.h>
95#endif
96#if defined(MAGICKCORE_HAVE_STDINT_H)
97# include <stdint.h>
98#endif
99#if defined(MAGICKCORE_HAVE_UNISTD_H)
100# include <unistd.h>
101#endif
102#if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG)
103#define _CRTDBG_MAP_ALLOC
104#endif
105#if defined(MAGICKWAND_WINDOWS_SUPPORT)
106# include <io.h>
107#if !defined(__CYGWIN__)
108# include <direct.h>
109#endif
110# if !defined(MAGICKCORE_HAVE_STRERROR)
111# define HAVE_STRERROR
112# endif
113#endif
114
115#include <ctype.h>
116#include <locale.h>
117#include <errno.h>
118#include <fcntl.h>
119#include <math.h>
120#include <time.h>
121#include <limits.h>
122#include <signal.h>
123#include <assert.h>
124
125#if defined(MAGICKCORE_HAVE_XLOCALE_H)
126# include <xlocale.h>
127#endif
128#if defined(MAGICKCORE_THREAD_SUPPORT)
129# include <pthread.h>
130#endif
131#if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
132# include <sys/syslimits.h>
133#endif
134#if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
135# include <arm/limits.h>
136#endif
137
138#if defined(MAGICKCORE_HAVE_CL_CL_H)
139# define MAGICKCORE_OPENCL_SUPPORT 1
140#endif
141#if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
142# define MAGICKCORE_OPENCL_SUPPORT 1
143#endif
144
145#if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
146ssize_t pread(int,void *,size_t,off_t);
147#endif
148
149#if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
150ssize_t pwrite(int,const void *,size_t,off_t);
151#endif
152
153#if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
154extern size_t strlcpy(char *,const char *,size_t);
155#endif
156
157#if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
158extern int vsnprintf(char *,size_t,const char *,va_list);
159#endif
160
161#include "MagickWand/method-attribute.h"
162
163#if defined(MAGICKWAND_WINDOWS_SUPPORT) || defined(MAGICKWAND_POSIX_SUPPORT)
164# include <sys/types.h>
165# include <sys/stat.h>
166# if defined(MAGICKWAND_POSIX_SUPPORT)
167# if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
168# define dirent direct
169# define NAMLEN(dirent) (dirent)->d_namlen
170# if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
171# include <sys/ndir.h>
172# endif
173# if defined(MAGICKCORE_HAVE_SYS_DIR_H)
174# include <sys/dir.h>
175# endif
176# if defined(MAGICKCORE_HAVE_NDIR_H)
177# include <ndir.h>
178# endif
179# else
180# include <dirent.h>
181# define NAMLEN(dirent) strlen((dirent)->d_name)
182# endif
183# include <sys/wait.h>
184# include <pwd.h>
185# endif
186# if !defined(S_ISDIR)
187# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
188# endif
189# if !defined(S_ISREG)
190# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
191# endif
192# include "MagickWand/MagickWand.h"
193# if !defined(MAGICKWAND_WINDOWS_SUPPORT)
194# include <sys/time.h>
195# if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
196# include <sys/times.h>
197# endif
198# if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
199# include <sys/resource.h>
200# endif
201# if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
202# include <sys/mman.h>
203# endif
204# if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
205# include <sys/sendfile.h>
206# endif
207#endif
208#else
209# include <types.h>
210# include <stat.h>
211#endif
212
213#if defined(S_IRUSR) && defined(S_IWUSR)
214# define S_MODE (S_IRUSR | S_IWUSR)
215#elif defined (MAGICKWAND_WINDOWS_SUPPORT)
216# define S_MODE (_S_IREAD | _S_IWRITE)
217#else
218# define S_MODE 0600
219#endif
220
221#if defined(MAGICKWAND_WINDOWS_SUPPORT)
222# include "MagickCore/nt-base.h"
223#endif
224
225#undef HAVE_CONFIG_H
226#undef gamma
227#undef index
228#undef pipe
229#undef y1
230
231/*
232 Review these platform specific definitions.
233*/
234#if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__)
235# define DirectorySeparator "/"
236# define DirectoryListSeparator ':'
237# define EditorOptions " -title \"Edit Image Comment\" -e vi"
238# define Exit exit
239# define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
240# define X11_PREFERENCES_PATH "~/."
241# define ProcessPendingEvents(text)
242# define ReadCommandlLine(argc,argv)
243# define SetNotifyHandlers
244#else
245# if defined(__OS2__)
246# define DirectorySeparator "\\"
247# define DirectoryListSeparator ';'
248# define EditorOptions " -title \"Edit Image Comment\" -e vi"
249# define Exit exit
250# define IsBasenameSeparator(c) \
251 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
252# define PreferencesDefaults "~\."
253# define ProcessPendingEvents(text)
254# define ReadCommandlLine(argc,argv)
255# define SetNotifyHandlers
256#endif
257# if defined(MAGICKWAND_WINDOWS_SUPPORT)
258# define DirectorySeparator "\\"
259# define DirectoryListSeparator ';'
260# define EditorOptions ""
261# define IsBasenameSeparator(c) \
262 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
263# define ProcessPendingEvents(text)
264# if !defined(X11_PREFERENCES_PATH)
265# define X11_PREFERENCES_PATH "~\\."
266# endif
267# define ReadCommandlLine(argc,argv)
268# define SetNotifyHandlers \
269 SetErrorHandler(NTErrorHandler); \
270 SetWarningHandler(NTWarningHandler)
271# endif
272
273#endif
274
275/*
276 Define system symbols if not already defined.
277*/
278#if !defined(STDIN_FILENO)
279#define STDIN_FILENO 0x00
280#endif
281
282#if !defined(O_BINARY)
283#define O_BINARY 0x00
284#endif
285
286#if !defined(PATH_MAX)
287#define PATH_MAX 4096
288#endif
289
290/*
291 Magick defines.
292*/
293#if defined(_MSC_VER)
294# define DisableMSCWarning(nr) __pragma(warning(push)) \
295 __pragma(warning(disable:nr))
296# define RestoreMSCWarning __pragma(warning(pop))
297#else
298# define DisableMSCWarning(nr)
299# define RestoreMSCWarning
300#endif
301
302#if defined(__cplusplus) || defined(c_plusplus)
303}
304#endif
305
306#endif