MagickCore 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 MagickCore private application programming interface declarations.
17*/
18#ifndef MAGICKCORE_STUDIO_H
19#define MAGICKCORE_STUDIO_H
20
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25#if defined(WIN32) || defined(WIN64)
26# define MAGICKCORE_WINDOWS_SUPPORT
27#else
28# define MAGICKCORE_POSIX_SUPPORT
29#endif
30
31#define MAGICKCORE_IMPLEMENTATION 1
32
33#if !defined(MAGICKCORE_CONFIG_H)
34# define MAGICKCORE_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(MAGICKCORE_NAMESPACE_PREFIX)
51# include "MagickCore/methods.h"
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(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG)
102#define _CRTDBG_MAP_ALLOC
103#endif
104#if defined(MAGICKCORE_WINDOWS_SUPPORT)
105# include <io.h>
106#if !defined(__CYGWIN__)
107# include <direct.h>
108#endif
109# if !defined(MAGICKCORE_HAVE_STRERROR)
110# define HAVE_STRERROR
111# endif
112#endif
113
114#include <ctype.h>
115#include <locale.h>
116#include <errno.h>
117#include <fcntl.h>
118#include <math.h>
119#include <time.h>
120#include <limits.h>
121#include <signal.h>
122#include <assert.h>
123
124#if defined(MAGICKCORE_HAVE_XLOCALE_H)
125# include <xlocale.h>
126#endif
127#if defined(MAGICKCORE_THREAD_SUPPORT)
128# include <pthread.h>
129#endif
130#if defined(MAGICKCORE_WINDOWS_SUPPORT)
131# if !defined(__CYGWIN__)
132# if defined(MAGICKCORE_DPC_SUPPORT)
133# include <winsock2.h>
134# ifdef _MSC_VER
135# pragma comment (lib, "ws2_32.lib")
136# endif
137# endif
138# include <ws2tcpip.h>
139# endif
140#endif
141#if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H)
142# include <sys/syslimits.h>
143#endif
144#if defined(MAGICKCORE_HAVE_ARM_LIMITS_H)
145# include <arm/limits.h>
146#endif
147
148#if defined(MAGICKCORE_HAVE_CL_CL_H)
149# define MAGICKCORE_OPENCL_SUPPORT 1
150#endif
151#if defined(MAGICKCORE_HAVE_OPENCL_CL_H)
152# define MAGICKCORE_OPENCL_SUPPORT 1
153#endif
154
155#if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__))
156# include <omp.h>
157# define MAGICKCORE_OPENMP_SUPPORT 1
158#endif
159
160#if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD
161ssize_t pread(int,void *,size_t,off_t);
162#endif
163
164#if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE
165ssize_t pwrite(int,const void *,size_t,off_t);
166#endif
167
168#if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY
169extern size_t strlcpy(char *,const char *,size_t);
170#endif
171
172#if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF
173extern int vsnprintf(char *,size_t,const char *,va_list);
174#endif
175
176#include "MagickCore/method-attribute.h"
177
178#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
179# include <sys/types.h>
180# include <sys/stat.h>
181# if defined(MAGICKCORE_POSIX_SUPPORT)
182# if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H)
183# define dirent direct
184# define NAMLEN(dirent) (dirent)->d_namlen
185# if defined(MAGICKCORE_HAVE_SYS_NDIR_H)
186# include <sys/ndir.h>
187# endif
188# if defined(MAGICKCORE_HAVE_SYS_DIR_H)
189# include <sys/dir.h>
190# endif
191# if defined(MAGICKCORE_HAVE_NDIR_H)
192# include <ndir.h>
193# endif
194# else
195# include <dirent.h>
196# define NAMLEN(dirent) strlen((dirent)->d_name)
197# endif
198# include <sys/wait.h>
199# include <pwd.h>
200# endif
201# if !defined(S_ISDIR)
202# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
203# endif
204# if !defined(S_ISREG)
205# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
206# endif
207# include "MagickCore/magick-type.h"
208# if !defined(MAGICKCORE_WINDOWS_SUPPORT)
209# include <sys/time.h>
210# if defined(MAGICKCORE_HAVE_SYS_TIMES_H)
211# include <sys/times.h>
212# endif
213# if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H)
214# include <sys/resource.h>
215# endif
216# if defined(MAGICKCORE_HAVE_SYS_MMAN_H)
217# include <sys/mman.h>
218# endif
219# if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H)
220# include <sys/sendfile.h>
221# endif
222# if defined(MAGICKCORE_HAVE_SYS_SOCKET_H)
223# include <sys/socket.h>
224# endif
225# if defined(MAGICKCORE_HAVE_SYS_UIO_H)
226# include <sys/uio.h>
227# endif
228#endif
229#else
230# include <types.h>
231# include <stat.h>
232# include "MagickCore/magick-type.h"
233#endif
234
235#if defined(S_IRUSR) && defined(S_IWUSR)
236# define S_MODE (S_IRUSR | S_IWUSR)
237#elif defined (MAGICKCORE_WINDOWS_SUPPORT)
238# define S_MODE (_S_IREAD | _S_IWRITE)
239#else
240# define S_MODE 0600
241#endif
242
243#if defined(MAGICKCORE_WINDOWS_SUPPORT)
244# include "MagickCore/nt-base.h"
245#endif
246#ifdef __VMS
247# include "MagickCore/vms.h"
248#endif
249
250#undef HAVE_CONFIG_H
251#undef gamma
252#undef index
253#undef pipe
254#undef y1
255
256/*
257 Review these platform specific definitions.
258*/
259#if defined(MAGICKCORE_POSIX_SUPPORT) && !( defined(__OS2__) || defined( vms ) )
260# define DirectorySeparator "/"
261# define DirectoryListSeparator ':'
262# define EditorOptions " -title \"Edit Image Comment\" -e vi"
263# define Exit exit
264# define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse)
265# define X11_PREFERENCES_PATH "~/."
266# define ProcessPendingEvents(text)
267# define ReadCommandlLine(argc,argv)
268# define SetNotifyHandlers
269#else
270# ifdef __VMS
271# define X11_APPLICATION_PATH "decw$system_defaults:"
272# define DirectorySeparator ""
273# define DirectoryListSeparator ';'
274# define EditorOptions ""
275# define Exit exit
276# define IsBasenameSeparator(c) \
277 (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse)
278# define MAGICKCORE_LIBRARY_PATH "sys$login:"
279# define MAGICKCORE_SHARE_PATH "sys$login:"
280# define X11_PREFERENCES_PATH "decw$user_defaults:"
281# define ProcessPendingEvents(text)
282# define ReadCommandlLine(argc,argv)
283# define SetNotifyHandlers
284# endif
285# if defined(__OS2__)
286# define DirectorySeparator "\\"
287# define DirectoryListSeparator ';'
288# define EditorOptions " -title \"Edit Image Comment\" -e vi"
289# define Exit exit
290# define IsBasenameSeparator(c) \
291 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
292# define PreferencesDefaults "~\."
293# define ProcessPendingEvents(text)
294# define ReadCommandlLine(argc,argv)
295# define SetNotifyHandlers
296#endif
297# if defined(MAGICKCORE_WINDOWS_SUPPORT)
298# define DirectorySeparator "\\"
299# define DirectoryListSeparator ';'
300# define EditorOptions ""
301# define IsBasenameSeparator(c) \
302 (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse)
303# define ProcessPendingEvents(text)
304# if !defined(X11_PREFERENCES_PATH)
305# define X11_PREFERENCES_PATH "~\\."
306# endif
307# define ReadCommandlLine(argc,argv)
308# define SetNotifyHandlers \
309 SetErrorHandler(NTErrorHandler); \
310 SetWarningHandler(NTWarningHandler)
311# endif
312
313#endif
314
315/*
316 Define system symbols if not already defined.
317*/
318#if !defined(STDIN_FILENO)
319#define STDIN_FILENO 0x00
320#endif
321
322#if !defined(O_BINARY)
323#define O_BINARY 0x00
324#endif
325
326#if !defined(PATH_MAX)
327#define PATH_MAX 4096
328#endif
329
330#if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB))
331# define MAGICKCORE_MODULES_SUPPORT
332#endif
333
334#if defined(_MAGICKMOD_)
335# undef MAGICKCORE_BUILD_MODULES
336# define MAGICKCORE_BUILD_MODULES
337#endif
338
339/*
340 Magick defines.
341*/
342#define MagickMaxRecursionDepth 600
343#define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y))
344#if defined(_MSC_VER)
345# define DisableMSCWarning(nr) __pragma(warning(push)) \
346 __pragma(warning(disable:nr))
347# define RestoreMSCWarning __pragma(warning(pop))
348#else
349# define DisableMSCWarning(nr)
350# define RestoreMSCWarning
351#endif
352
353#if defined(__cplusplus) || defined(c_plusplus)
354}
355#endif
356
357#endif