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