MagickCore 7.1.1-33
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 fstat _fstati64
68# define stat _stati64
69#endif
70
71#if !defined(XS_VERSION)
72struct dirent
73{
74 char
75 d_name[2048];
76
77 int
78 d_namlen;
79};
80
81typedef struct _DIR
82{
83 HANDLE
84 hSearch;
85
86 WIN32_FIND_DATAW
87 Win32FindData;
88
89 BOOL
90 firsttime;
91
92 struct dirent
93 file_info;
94} DIR;
95
96#if !defined(__MINGW32__)
97struct timeval;
98
99struct timezone
100{
101 int
102 tz_minuteswest,
103 tz_dsttime;
104};
105#endif
106
107#endif
108
109static inline void *NTAcquireQuantumMemory(const size_t count,
110 const size_t quantum)
111{
112 size_t
113 size;
114
115 if (HeapOverflowSanityCheckGetSize(count,quantum,&size) != MagickFalse)
116 {
117 errno=ENOMEM;
118 return(NULL);
119 }
120 return(AcquireMagickMemory(size));
121}
122
123extern MagickPrivate char
124 *NTGetEnvironmentValue(const char *);
125
126#if !defined(MAGICKCORE_LTDL_DELEGATE)
127extern MagickPrivate const char
128 *NTGetLibraryError(void);
129#endif
130
131#if !defined(XS_VERSION)
132extern MagickPrivate const char
133 *NTGetLibraryError(void);
134
135extern MagickPrivate DIR
136 *NTOpenDirectory(const char *);
137
138extern MagickPrivate double
139 NTElapsedTime(void),
140 NTErf(double);
141
142extern MagickPrivate int
143#if !defined(__MINGW32__)
144 gettimeofday(struct timeval *,struct timezone *),
145#endif
146 NTCloseDirectory(DIR *),
147 NTCloseLibrary(void *),
148 NTTruncateFile(int,off_t),
149 NTUnmapMemory(void *,size_t),
150 NTSystemCommand(const char *,char *);
151
152extern MagickPrivate ssize_t
153 NTSystemConfiguration(int);
154
155extern MagickPrivate MagickBooleanType
156 NTGatherRandomData(const size_t,unsigned char *),
157 NTGetExecutionPath(char *,const size_t),
158 NTGetModulePath(const char *,char *),
159 NTGhostscriptFonts(char *,int),
160 NTReportEvent(const char *,const MagickBooleanType);
161
162extern MagickExport MagickBooleanType
163 NTLongPathsEnabled(void);
164
165extern MagickPrivate struct dirent
166 *NTReadDirectory(DIR *);
167
168extern MagickPrivate unsigned char
169 *NTRegistryKeyLookup(const char *),
170 *NTResourceToBlob(const char *);
171
172extern MagickPrivate void
173 *NTGetLibrarySymbol(void *,const char *),
174 NTGhostscriptEXE(char *,int),
175 *NTMapMemory(char *,size_t,int,int,int,MagickOffsetType),
176 *NTOpenLibrary(const char *),
177 NTWindowsGenesis(void),
178 NTWindowsTerminus(void);
179
180#endif /* !XS_VERSION */
181
182#endif /* MAGICKCORE_WINDOWS_SUPPORT */
183
184#if defined(__cplusplus) || defined(c_plusplus)
185}
186#endif /* !C++ */
187
188#endif /* !MAGICKCORE_NT_BASE_H */