1 /* 2 Copyright 1999-2020 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/splay-tree.h" 25 26 #if defined(__cplusplus) || defined(c_plusplus) 27 extern "C" { 28 #endif 29 30 #if defined(MAGICKCORE_WINDOWS_SUPPORT) 31 32 #if !defined(XS_VERSION) 33 struct dirent 34 { 35 char 36 d_name[2048]; 37 38 int 39 d_namlen; 40 }; 41 42 typedef struct _DIR 43 { 44 HANDLE 45 hSearch; 46 47 WIN32_FIND_DATAW 48 Win32FindData; 49 50 BOOL 51 firsttime; 52 53 struct dirent 54 file_info; 55 } DIR; 56 57 typedef struct _NTMEMORYSTATUSEX 58 { 59 DWORD 60 dwLength, 61 dwMemoryLoad; 62 63 DWORDLONG 64 ullTotalPhys, 65 ullAvailPhys, 66 ullTotalPageFile, 67 ullAvailPageFile, 68 ullTotalVirtual, 69 ullAvailVirtual, 70 ullAvailExtendedVirtual; 71 } NTMEMORYSTATUSEX; 72 73 #if !defined(__MINGW32__) 74 struct timeval; 75 76 struct timezone 77 { 78 int 79 tz_minuteswest, 80 tz_dsttime; 81 }; 82 #endif 83 84 typedef UINT 85 (CALLBACK *LPFNDLLFUNC1)(DWORD,UINT); 86 87 typedef UINT 88 (CALLBACK *LPFNDLLFUNC2)(NTMEMORYSTATUSEX *); 89 90 #endif 91 92 #if defined(MAGICKCORE_BZLIB_DELEGATE) 93 # if defined(_WIN32) 94 # define BZ_IMPORT 1 95 # endif 96 #endif 97 98 extern MagickPrivate char 99 *NTGetLastError(void); 100 101 #if !defined(MAGICKCORE_LTDL_DELEGATE) 102 extern MagickPrivate const char 103 *NTGetLibraryError(void); 104 #endif 105 106 #if !defined(XS_VERSION) 107 extern MagickPrivate const char 108 *NTGetLibraryError(void); 109 110 extern MagickPrivate DIR 111 *NTOpenDirectory(const char *); 112 113 extern MagickPrivate double 114 NTElapsedTime(void), 115 NTErf(double), 116 NTUserTime(void); 117 118 extern MagickPrivate int 119 Exit(int), 120 #if !defined(__MINGW32__) 121 gettimeofday(struct timeval *,struct timezone *), 122 #endif 123 IsWindows95(void), 124 NTCloseDirectory(DIR *), 125 NTCloseLibrary(void *), 126 NTControlHandler(void), 127 NTExitLibrary(void), 128 NTTruncateFile(int,off_t), 129 NTGhostscriptDLL(char *,int), 130 NTGhostscriptEXE(char *,int), 131 NTGhostscriptFonts(char *,int), 132 NTGhostscriptLoadDLL(void), 133 NTInitializeLibrary(void), 134 NTSetSearchPath(const char *), 135 NTSyncMemory(void *,size_t,int), 136 NTUnmapMemory(void *,size_t), 137 NTSystemCommand(const char *,char *); 138 139 extern MagickPrivate ssize_t 140 NTGetPageSize(void), 141 NTSystemConfiguration(int), 142 NTTellDirectory(DIR *); 143 144 extern MagickPrivate MagickBooleanType 145 NTGatherRandomData(const size_t,unsigned char *), 146 NTGetExecutionPath(char *,const size_t), 147 NTGetModulePath(const char *,char *), 148 NTReportEvent(const char *,const MagickBooleanType); 149 150 extern MagickExport MagickBooleanType 151 NTLongPathsEnabled(); 152 153 extern MagickPrivate struct dirent 154 *NTReadDirectory(DIR *); 155 156 extern MagickPrivate unsigned char 157 *NTRegistryKeyLookup(const char *), 158 *NTResourceToBlob(const char *); 159 160 extern MagickPrivate void 161 *NTGetLibrarySymbol(void *,const char *), 162 NTInitializeWinsock(MagickBooleanType), 163 *NTMapMemory(char *,size_t,int,int,int,MagickOffsetType), 164 *NTOpenLibrary(const char *), 165 NTSeekDirectory(DIR *,ssize_t), 166 NTWindowsGenesis(void), 167 NTWindowsTerminus(void); 168 169 #endif /* !XS_VERSION */ 170 171 #endif /* MAGICKCORE_WINDOWS_SUPPORT */ 172 173 #if defined(__cplusplus) || defined(c_plusplus) 174 } 175 #endif /* !C++ */ 176 177 #endif /* !MAGICKCORE_NT_BASE_H */ 178