Skip to content

Commit c0a49ca

Browse files
committed
fixed:example build error
1 parent fb8176b commit c0a49ca

File tree

8 files changed

+39
-49
lines changed

8 files changed

+39
-49
lines changed

XEngine_APPClient/APPClient_BTorrent/APPClient_BTorrent.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int BTorrent_Parse(LPCXSTR lpszFile)
4040
{
4141
printf("BTorrent_Parse_GetNode:%d = %s\n", ppSt_ParseNode[i]->nValue, ppSt_ParseNode[i]->tszValue);
4242
}
43-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ParseNode, nListCount);
43+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ParseNode, nListCount);
4444
nListCount = 0;
4545

4646
if (!BTorrent_Parse_GetTracker(xhToken, &ppSt_ParseNode, &nListCount))
@@ -52,7 +52,7 @@ int BTorrent_Parse(LPCXSTR lpszFile)
5252
{
5353
printf("BTorrent_Parse_GetTracker:%d = %s\n", ppSt_ParseNode[i]->nValue, ppSt_ParseNode[i]->tszValue);
5454
}
55-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ParseNode, nListCount);
55+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ParseNode, nListCount);
5656
nListCount = 0;
5757

5858
if (!BTorrent_Parse_GetSeeds(xhToken, &ppSt_ParseNode, &nListCount))
@@ -64,7 +64,7 @@ int BTorrent_Parse(LPCXSTR lpszFile)
6464
{
6565
printf("BTorrent_Parse_GetSeeds:%d = %s\n", ppSt_ParseNode[i]->nValue, ppSt_ParseNode[i]->tszValue);
6666
}
67-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ParseNode, nListCount);
67+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ParseNode, nListCount);
6868
nListCount = 0;
6969

7070
int nPieceLen = 0;
@@ -103,7 +103,7 @@ int BTorrent_Parse(LPCXSTR lpszFile)
103103
{
104104
printf("BTorrent_Parse_GetFile:%s %s %s %s %lld %lld %lld %d %d\n", ppSt_FileList[i]->tszFileHash, ppSt_FileList[i]->tszFilePath, ppSt_FileList[i]->tszFileName, ppSt_FileList[i]->tszFileLink, ppSt_FileList[i]->nFileOffset, ppSt_FileList[i]->nFileSize, ppSt_FileList[i]->nFileTime, ppSt_FileList[i]->nFileStart, ppSt_FileList[i]->nFileEnd);
105105
}
106-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_FileList, nListCount);
106+
BaseLib_Memory_Free((XPPPMEM)&ppSt_FileList, nListCount);
107107

108108
BTorrent_Parse_Destory(xhToken);
109109
return 0;
@@ -178,7 +178,7 @@ int BTorrent_Download()
178178
break;
179179
}
180180
std::this_thread::sleep_for(std::chrono::seconds(1));
181-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppenEventList, nListCount);
181+
BaseLib_Memory_Free((XPPPMEM)&ppenEventList, nListCount);
182182
}
183183

184184
BTorrent_DLoader_Close(xhToken);

XEngine_APPClient/APPClient_Download/APPClient_Download.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int main()
193193
}
194194
P2PFile_Create(&stl_ListFile, lpszFile);
195195

196-
BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszMsgBody);
196+
BaseLib_Memory_FreeCStyle((VOID**)&ptszMsgBody);
197197

198198
#ifdef _MSC_BUILD
199199
WSACleanup();

XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <windows.h>
33
#include <tchar.h>
44
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
5-
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
5+
#pragma comment(lib,"XEngine_Core/XEngine_Cryption")
66
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
77
#pragma comment(lib,"Ws2_32")
88
#ifdef _WIN64
@@ -21,8 +21,8 @@
2121
#include <XEngine_Include/XEngine_ProtocolHdr.h>
2222
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2323
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
24-
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
25-
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
24+
#include <XEngine_Include/XEngine_Core/Cryption_Define.h>
25+
#include <XEngine_Include/XEngine_Core/Cryption_Error.h>
2626
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
2727
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
2828
using namespace std;
@@ -53,7 +53,7 @@ void API_Manage_Query()
5353
return;
5454
}
5555
_xtprintf("API_Manage_Query:%d,%s\n", nCode, ptszMsgBuffer);
56-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
56+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
5757
}
5858
//插入
5959
void API_Manage_Insert()
@@ -81,7 +81,7 @@ void API_Manage_Insert()
8181
return;
8282
}
8383
_xtprintf("API_Manage_Insert:%d,%s\n", nCode, ptszMsgBuffer);
84-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
84+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
8585
}
8686
//删除
8787
void API_Manage_Delete()
@@ -106,7 +106,7 @@ void API_Manage_Delete()
106106
return;
107107
}
108108
_xtprintf("API_Manage_Delete:%d,%s\n", nCode, ptszMsgBuffer);
109-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
109+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
110110
}
111111
//文件夹
112112
void API_Manage_Dir()
@@ -126,7 +126,7 @@ void API_Manage_Dir()
126126
return;
127127
}
128128
_xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
129-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
129+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
130130
//查询
131131
st_JsonRoot.clear();
132132
st_JsonRoot["lpszBuckKey"] = "storagekey1";
@@ -138,7 +138,7 @@ void API_Manage_Dir()
138138
return;
139139
}
140140
_xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
141-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
141+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
142142
//删除
143143
st_JsonRoot.clear();
144144
st_JsonRoot["lpszBuckKey"] = "storagekey1";
@@ -150,7 +150,7 @@ void API_Manage_Dir()
150150
return;
151151
}
152152
_xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
153-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
153+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
154154
}
155155
//任务管理
156156
void API_Manage_Task()
@@ -165,7 +165,7 @@ void API_Manage_Task()
165165
return;
166166
}
167167
_xtprintf("API_Manage_Task:%d,%s\n", nCode, ptszMsgBuffer);
168-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
168+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
169169
}
170170

171171
int main()
@@ -174,10 +174,6 @@ int main()
174174
WSADATA st_WSAData;
175175
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
176176
#endif
177-
memset(tszBaseBuffer, '\0', MAX_PATH);
178-
memset(tszHdrBuffer, '\0', MAX_PATH);
179-
OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer);
180-
_xstprintf(tszHdrBuffer, _X("Authorization: %s\r\n"), tszBaseBuffer);
181177

182178
API_Manage_Query();
183179
API_Manage_Insert();

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ int main(int argc, char** argv)
4747
_xtprintf("FileParser_ReadVer_GetLocal error\n");
4848
return 0;
4949
}
50-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_LocalList, nLocalCount);
51-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_RemoteList, nRemoteCount);
50+
BaseLib_Memory_Free((XPPPMEM)&ppSt_LocalList, nLocalCount);
51+
BaseLib_Memory_Free((XPPPMEM)&ppSt_RemoteList, nRemoteCount);
5252

5353
if (stl_ListUPDate.empty())
5454
{

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPInstall.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool FileParser_ReadVer_GetRemote(LPCXSTR lpszJsonMsg, int nMsgLen, FILEPARSER_V
6969
return FALSE;
7070
}
7171
*pInt_Count = st_JsonArray.size();
72-
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO));
72+
BaseLib_Memory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO));
7373

7474
for (unsigned int i = 0; i < st_JsonArray.size(); i++)
7575
{
@@ -169,7 +169,7 @@ bool FileParser_ReadVer_GetLocal(LPCXSTR lpszFileList, FILEPARSER_VERSIONINFO***
169169
return FALSE;
170170
}
171171
*pInt_Count = st_JsonArray.size();
172-
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO));
172+
BaseLib_Memory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO));
173173
for (unsigned int i = 0; i < st_JsonArray.size(); i++)
174174
{
175175
(*pppSt_FileList)[i]->st_LocalVersion.nModuleVersion = st_JsonArray[i]["ModuleVersion"].asInt64();

XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in
8484
HELPMODULE_FILELIST st_FileList;
8585
memset(&st_FileList, '\0', sizeof(HELPMODULE_FILELIST));
8686

87-
if (!BaseLib_OperatorString_GetFileAndPath(ppszListDir[i], st_FileList.tszFilePath, st_FileList.tszFileName))
87+
if (!BaseLib_String_GetFileAndPath(ppszListDir[i], st_FileList.tszFilePath, st_FileList.tszFileName))
8888
{
8989
return FALSE;
9090
}
9191
stl_ListFile.push_back(st_FileList);
9292
}
93-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListDir, nListCount);
93+
BaseLib_Memory_Free((XPPPMEM)&ppszListDir, nListCount);
9494

9595
Json::Value st_JsonLocalRoot;
9696
Json::Value st_JsonLocalArray;
@@ -108,7 +108,7 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in
108108
memset(tszTimer, '\0', sizeof(tszTimer));
109109
memset(&st_Timer, '\0', sizeof(XENGINE_LIBTIMER));
110110

111-
BaseLib_OperatorTime_GetSysTime(&st_Timer);
111+
BaseLib_Time_GetSysTime(&st_Timer);
112112
_xstprintf(tszTimer, _X("%04d%02d%02d%02d%02d%02d"), st_Timer.wYear, st_Timer.wMonth, st_Timer.wDay, st_Timer.wHour, st_Timer.wMinute, st_Timer.wSecond);
113113
__int64x m_nFileVer = _ttxoll(tszTimer);
114114

@@ -135,7 +135,7 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in
135135
memset(tszDlPath, '\0', sizeof(tszDlPath));
136136
//删除指定字符串
137137
int nPathType = 0;
138-
BaseLib_OperatorString_GetPath(stl_ListIterator->tszFilePath, &nPathType);
138+
BaseLib_String_GetPath(stl_ListIterator->tszFilePath, &nPathType);
139139
if (1 == nPathType)
140140
{
141141
XCHAR tszDelPath[MAX_PATH];
@@ -149,8 +149,8 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in
149149

150150
tszDelPath[_tcsxlen(tszDelPath) - 1] = '\0';
151151

152-
BaseLib_OperatorString_DelSub(tszSubPath, tszDelPath);
153-
BaseLib_OperatorString_FixPath(tszSubPath, 2);
152+
BaseLib_String_DelSub(tszSubPath, tszDelPath);
153+
BaseLib_String_FixPath(tszSubPath, 2);
154154
_xstprintf(tszDlPath, _X("%s%s%s"), lpszDlUrl, tszSubPath, stl_ListIterator->tszFileName);
155155
}
156156
else

XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <windows.h>
33
#include <tchar.h>
44
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
5-
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
5+
#pragma comment(lib,"XEngine_Core/XEngine_Cryption")
66
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
77
#pragma comment(lib,"Ws2_32")
88
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
@@ -22,15 +22,15 @@
2222
#include <XEngine_Include/XEngine_ProtocolHdr.h>
2323
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2424
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
25-
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
26-
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
25+
#include <XEngine_Include/XEngine_Core/Cryption_Define.h>
26+
#include <XEngine_Include/XEngine_Core/Cryption_Error.h>
2727
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
2828
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
2929
using namespace std;
3030

3131
//需要优先配置XEngine
3232
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
33-
//linux macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_APIHelp -ljsoncpp -Wl,-rpath=../../XEngine_Release
33+
//linux macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXEngine_Cryption -lXClient_APIHelp -ljsoncpp -Wl,-rpath=../../XEngine_Release
3434

3535

3636
//上传文件
@@ -40,18 +40,15 @@ void File_UPLoad()
4040
int nLen = 0;
4141
int nCode = 0;
4242
XCHAR* ptszMsgBuffer = NULL;
43-
XCHAR tszBaseBuffer[128];
4443
XCHAR tszHdrBuffer[MAX_PATH];
4544
XCHAR tszKeyBuffer[MAX_PATH];
4645
LPCXSTR lpszMsgBuffer = _X("01234");
4746
LPCXSTR lpszMsgBuffer2 = _X("56789");
4847

49-
memset(tszBaseBuffer, '\0', sizeof(tszBaseBuffer));
5048
memset(tszHdrBuffer, '\0', MAX_PATH);
5149
memset(tszKeyBuffer, '\0', MAX_PATH);
52-
OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer);
5350

54-
_xstprintf(tszHdrBuffer, _X("Range: bytes=0-5/10\r\nAuthorization: %s\r\n"), tszBaseBuffer);
51+
_xstprintf(tszHdrBuffer, _X("Range: bytes=0-5/10\r\n"));
5552
if (!APIClient_Http_Request(_X("POST"), lpszUrl, lpszMsgBuffer, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
5653
{
5754
_xtprintf("upload failed:%lX\n", APIClient_GetLastError());
@@ -68,18 +65,18 @@ void File_UPLoad()
6865
_tcsxcpy(tszKeyBuffer, st_JsonRoot["lpszBuckKey"].asCString());
6966

7067
_xtprintf("upload:%d\n", nCode);
71-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
68+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
7269
//断点续传必须指定storagekey
7370
nLen = 0;
7471
memset(tszHdrBuffer, '\0', MAX_PATH);
75-
_xstprintf(tszHdrBuffer, _X("Range: bytes=5-10/10\r\nAuthorization: %s\r\nStorageKey: %s\r\n"), tszBaseBuffer, tszKeyBuffer);
72+
_xstprintf(tszHdrBuffer, _X("Range: bytes=5-10/10\r\nStorageKey: %s\r\n"), tszKeyBuffer);
7673
if (!APIClient_Http_Request(_X("POST"), lpszUrl, lpszMsgBuffer2, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
7774
{
7875
_xtprintf("upload failed:%lX\n", APIClient_GetLastError());
7976
return;
8077
}
8178
_xtprintf("upload:%d\n%s\n", nCode, ptszMsgBuffer);
82-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
79+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
8380
}
8481
//下载文件
8582
void File_Download()
@@ -88,31 +85,28 @@ void File_Download()
8885

8986
int nLen = 0;
9087
XCHAR* ptszMsgBuffer = NULL;
91-
XCHAR tszBaseBuffer[128];
9288
XCHAR tszHdrBuffer[MAX_PATH];
9389

94-
memset(tszBaseBuffer, '\0', sizeof(tszBaseBuffer));
9590
memset(tszHdrBuffer, '\0', MAX_PATH);
96-
OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer);
9791

98-
_xstprintf(tszHdrBuffer, _X("Range: bytes=0-5\r\nAuthorization: %s\r\n"), tszBaseBuffer);
92+
_xstprintf(tszHdrBuffer, _X("Range: bytes=0-5\r\n"));
9993
if (!APIClient_Http_Request(_X("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer))
10094
{
10195
_xtprintf("download failed:%lX\n", APIClient_GetLastError());
10296
return;
10397
}
10498
_xtprintf("download:%d,%s\n", nLen, ptszMsgBuffer);
105-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
99+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
106100

107101
memset(tszHdrBuffer, '\0', MAX_PATH);
108-
_xstprintf(tszHdrBuffer, _X("Range: bytes=5-10\r\nAuthorization: %s\r\n"), tszBaseBuffer);
102+
_xstprintf(tszHdrBuffer, _X("Range: bytes=5-10\r\n"));
109103
if (!APIClient_Http_Request(_X("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer))
110104
{
111105
_xtprintf("download failed:%lX\n", APIClient_GetLastError());
112106
return;
113107
}
114108
_xtprintf("download:%d,%s\n", nLen, ptszMsgBuffer);
115-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
109+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
116110
}
117111

118112
int main()

XEngine_APPClient/VSCopy_x86.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseLib.dll" "./"
22
copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
3-
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./"
3+
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./"
44
copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"
55
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./"

0 commit comments

Comments
 (0)