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