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