| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../include/fxcrt/fx_ext.h" | 7 #include "../../include/fxcrt/fx_ext.h" |
| 8 #include "extension.h" | 8 #include "extension.h" |
| 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 10 #include <wincrypt.h> | 10 #include <wincrypt.h> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes) | 83 IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes) |
| 84 { | 84 { |
| 85 IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(); | 85 IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(); |
| 86 if (!pFA) { | 86 if (!pFA) { |
| 87 return NULL; | 87 return NULL; |
| 88 } | 88 } |
| 89 if (!pFA->Open(filename, dwModes)) { | 89 if (!pFA->Open(filename, dwModes)) { |
| 90 pFA->Release(); | 90 pFA->Release(); |
| 91 return NULL; | 91 return NULL; |
| 92 } | 92 } |
| 93 return FX_NEW CFX_CRTFileStream(pFA); | 93 return new CFX_CRTFileStream(pFA); |
| 94 } | 94 } |
| 95 IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes) | 95 IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes) |
| 96 { | 96 { |
| 97 IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(); | 97 IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(); |
| 98 if (!pFA) { | 98 if (!pFA) { |
| 99 return NULL; | 99 return NULL; |
| 100 } | 100 } |
| 101 if (!pFA->Open(filename, dwModes)) { | 101 if (!pFA->Open(filename, dwModes)) { |
| 102 pFA->Release(); | 102 pFA->Release(); |
| 103 return NULL; | 103 return NULL; |
| 104 } | 104 } |
| 105 return FX_NEW CFX_CRTFileStream(pFA); | 105 return new CFX_CRTFileStream(pFA); |
| 106 } | 106 } |
| 107 IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename) | 107 IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename) |
| 108 { | 108 { |
| 109 return FX_CreateFileStream(filename, FX_FILEMODE_Truncate); | 109 return FX_CreateFileStream(filename, FX_FILEMODE_Truncate); |
| 110 } | 110 } |
| 111 IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename) | 111 IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename) |
| 112 { | 112 { |
| 113 return FX_CreateFileStream(filename, FX_FILEMODE_Truncate); | 113 return FX_CreateFileStream(filename, FX_FILEMODE_Truncate); |
| 114 } | 114 } |
| 115 IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename) | 115 IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename) |
| 116 { | 116 { |
| 117 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); | 117 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); |
| 118 } | 118 } |
| 119 IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename) | 119 IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename) |
| 120 { | 120 { |
| 121 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); | 121 return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly); |
| 122 } | 122 } |
| 123 IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t dwSize, FX_BOO
L bTakeOver) | 123 IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t dwSize, FX_BOO
L bTakeOver) |
| 124 { | 124 { |
| 125 return FX_NEW CFX_MemoryStream(pBuffer, dwSize, bTakeOver); | 125 return new CFX_MemoryStream(pBuffer, dwSize, bTakeOver); |
| 126 } | 126 } |
| 127 IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive) | 127 IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive) |
| 128 { | 128 { |
| 129 return FX_NEW CFX_MemoryStream(bConsecutive); | 129 return new CFX_MemoryStream(bConsecutive); |
| 130 } | 130 } |
| 131 #ifdef __cplusplus | 131 #ifdef __cplusplus |
| 132 extern "C" { | 132 extern "C" { |
| 133 #endif | 133 #endif |
| 134 FX_FLOAT FXSYS_tan(FX_FLOAT a) | 134 FX_FLOAT FXSYS_tan(FX_FLOAT a) |
| 135 { | 135 { |
| 136 return (FX_FLOAT)tan(a); | 136 return (FX_FLOAT)tan(a); |
| 137 } | 137 } |
| 138 FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x) | 138 FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x) |
| 139 { | 139 { |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 { | 376 { |
| 377 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 377 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 378 FX_GenerateCryptoRandom(pBuffer, iCount); | 378 FX_GenerateCryptoRandom(pBuffer, iCount); |
| 379 #else | 379 #else |
| 380 FX_Random_GenerateBase(pBuffer, iCount); | 380 FX_Random_GenerateBase(pBuffer, iCount); |
| 381 #endif | 381 #endif |
| 382 } | 382 } |
| 383 #ifdef __cplusplus | 383 #ifdef __cplusplus |
| 384 } | 384 } |
| 385 #endif | 385 #endif |
| OLD | NEW |