MagickCore 7.1.2
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
nt-base-private.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 Windows NT private methods.
17*/
18#ifndef MAGICKCORE_NT_BASE_PRIVATE_H
19#define MAGICKCORE_NT_BASE_PRIVATE_H
20
21#include "MagickCore/delegate.h"
22#include "MagickCore/delegate-private.h"
23#include "MagickCore/exception.h"
24#include "MagickCore/memory_.h"
25#include "MagickCore/splay-tree.h"
26
27#if defined(__cplusplus) || defined(c_plusplus)
28extern "C" {
29#endif
30
31#if defined(MAGICKCORE_WINDOWS_SUPPORT)
32
33#if !defined(closedir)
34# define closedir(directory) NTCloseDirectory(directory)
35#endif
36#if !defined(MAGICKCORE_LTDL_DELEGATE)
37#if !defined(lt_dlclose)
38# define lt_dlclose(handle) NTCloseLibrary(handle)
39#endif
40#if !defined(lt_dlerror)
41# define lt_dlerror() NTGetLibraryError()
42#endif
43#if !defined(lt_dlopen)
44# define lt_dlopen(filename) NTOpenLibrary(filename)
45#endif
46#if !defined(lt_dlsym)
47# define lt_dlsym(handle,name) NTGetLibrarySymbol(handle,name)
48#endif
49#endif
50#if !defined(opendir)
51# define opendir(directory) NTOpenDirectory(directory)
52#endif
53#if !defined(read)
54# define read(fd,buffer,count) _read(fd,buffer,(unsigned int) count)
55#endif
56#if !defined(readdir)
57# define readdir(directory) NTReadDirectory(directory)
58#endif
59#if !defined(sysconf)
60# define sysconf(name) NTSystemConfiguration(name)
61# define MAGICKCORE_HAVE_SYSCONF 1
62#endif
63#if !defined(write)
64# define write(fd,buffer,count) _write(fd,buffer,(unsigned int) count)
65#endif
66#if !defined(__MINGW32__)
67# define fdopen _fdopen
68# define fileno _fileno
69# define fseek _fseeki64
70# define ftell _ftelli64
71# define getpid _getpid
72#if !defined(getcwd)
73# define getcwd _getcwd
74#endif
75# define lseek _lseeki64
76# define fstat _fstat64
77# define setmode _setmode
78# define stat _stat64
79# define tell _telli64
80# define wstat _wstat64
81#endif
82
83#if !defined(XS_VERSION)
84struct dirent
85{
86 char
87 d_name[2048];
88
89 int
90 d_namlen;
91};
92
93typedef struct _DIR
94{
95 HANDLE
96 hSearch;
97
98 WIN32_FIND_DATAW
99 Win32FindData;
100
101 BOOL
102 firsttime;
103
104 struct dirent
105 file_info;
106} DIR;
107
108#if !defined(__MINGW32__)
109struct timeval;
110
111struct timezone
112{
113 int
114 tz_minuteswest,
115 tz_dsttime;
116};
117#endif
118
119#endif
120
121static inline void *NTAcquireQuantumMemory(const size_t count,
122 const size_t quantum)
123{
124 size_t
125 size;
126
127 if (HeapOverflowSanityCheckGetSize(count,quantum,&size) != MagickFalse)
128 {
129 errno=ENOMEM;
130 return(NULL);
131 }
132 return(AcquireMagickMemory(size));
133}
134
135extern MagickPrivate char
136 *NTGetEnvironmentValue(const char *);
137
138#if !defined(MAGICKCORE_LTDL_DELEGATE)
139extern MagickPrivate const char
140 *NTGetLibraryError(void);
141#endif
142
143#if !defined(XS_VERSION)
144extern MagickPrivate const char
145 *NTGetLibraryError(void);
146
147extern MagickPrivate DIR
148 *NTOpenDirectory(const char *);
149
150extern MagickPrivate double
151 NTElapsedTime(void),
152 NTErf(double);
153
154extern MagickPrivate int
155#if !defined(__MINGW32__)
156 gettimeofday(struct timeval *,struct timezone *),
157#endif
158 NTCloseDirectory(DIR *),
159 NTCloseLibrary(void *),
160 NTTruncateFile(int,off_t),
161 NTUnmapMemory(void *,size_t),
162 NTSystemCommand(const char *,char *);
163
164extern MagickPrivate ssize_t
165 NTSystemConfiguration(int);
166
167extern MagickPrivate MagickBooleanType
168 NTGatherRandomData(const size_t,unsigned char *),
169 NTGetExecutionPath(char *,const size_t),
170 NTGetModulePath(const char *,char *),
171 NTGhostscriptFonts(char *,int),
172 NTReportEvent(const char *,const MagickBooleanType);
173
174extern MagickExport MagickBooleanType
175 NTLongPathsEnabled(void);
176
177extern MagickPrivate struct dirent
178 *NTReadDirectory(DIR *);
179
180extern MagickPrivate unsigned char
181 *NTRegistryKeyLookup(const char *),
182 *NTResourceToBlob(const char *);
183
184extern MagickPrivate void
185 *NTGetLibrarySymbol(void *,const char *),
186 NTGhostscriptEXE(char *,int),
187 *NTMapMemory(char *,size_t,int,int,int,MagickOffsetType),
188 *NTOpenLibrary(const char *),
189 NTWindowsGenesis(void),
190 NTWindowsTerminus(void);
191
192#endif /* !XS_VERSION */
193
194#endif /* MAGICKCORE_WINDOWS_SUPPORT */
195
196#if defined(__cplusplus) || defined(c_plusplus)
197}
198#endif /* !C++ */
199
200#endif /* !MAGICKCORE_NT_BASE_H */
Definition vms.h:942