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