From 0aafc6c4b2e485f5ee9bb0bdf3e687525859cb03 Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Sat, 14 Jan 2012 19:18:42 +0000 Subject: HTTPServer (patch from FREAK_THEMIGHTY): code cleanup header reorganisation MM_INTERFACE support new langpacks support rather technical changes git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@258 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- HTTPServer/IndexHTML.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'HTTPServer/IndexHTML.cpp') diff --git a/HTTPServer/IndexHTML.cpp b/HTTPServer/IndexHTML.cpp index 27a2760..1adae53 100644 --- a/HTTPServer/IndexHTML.cpp +++ b/HTTPServer/IndexHTML.cpp @@ -15,16 +15,10 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#ifdef NDEBUG //release -#include "AggressiveOptimize.h" //create small code -#endif #include "HttpUser.h" #include "MimeHandling.h" #include "GuiElements.h" -#include "Glob.h" -#include -#include #include "IndexCreation.h" eIndexCreationMode indexCreationMode; @@ -78,7 +72,7 @@ bool LoadIndexHTMLTemplate() { HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { - MessageBox(NULL, "HTTPServerIndex.html not found in Plugin Path", MSG_BOX_TITEL, MB_OK); + MessageBox(NULL, _T("HTTPServerIndex.html not found in Plugin Path"), MSG_BOX_TITEL, MB_OK); return false; } @@ -300,7 +294,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, strcpy(szMask, pszRealPath); strcat(szMask, "*"); - WIN32_FIND_DATAA fdFindFileData; + WIN32_FIND_DATA fdFindFileData; HANDLE hFind = FindFirstFile(szMask, &fdFindFileData); if (hFind == INVALID_HANDLE_VALUE) @@ -369,9 +363,9 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, } } - while (!strcmp(fdFindFileData.cFileName, ".") || - !strncmp(fdFindFileData.cFileName, "@", 1) || - (!strcmp(fdFindFileData.cFileName, "..") && !strcmp(pszSrvPath, "/")) || // hide .. in root + while (!_tcscmp(fdFindFileData.cFileName, _T(".")) || + !_tcsncmp(fdFindFileData.cFileName, _T("@"), 1) || + (!_tcscmp(fdFindFileData.cFileName, _T("..")) && !strcmp(pszSrvPath, "/")) || // hide .. in root ((*pszPos == 19) == ((fdFindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0))) { if (!FindNextFile(hFind, &fdFindFileData)) { FindClose(hFind); @@ -424,13 +418,13 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, case SY_FILE_NAME: case SY_DIR_NAME: { - pszBuffer += _snprintf(pszBuffer, 250, "%s", szName); + pszBuffer += mir_snprintf(pszBuffer, 250, "%s", szName); break; } case SY_DIR_URL: { case SY_FILE_URL: - pszBuffer += _snprintf(pszBuffer, 250, "%s", szURL); + pszBuffer += mir_snprintf(pszBuffer, 250, "%s", szURL); break; } @@ -441,7 +435,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, (*pszPos == SY_FILE_CREATE_TIME) ? &ftFileCreateTime : &ftFileModifyTime, &systemTime); - pszBuffer += _snprintf(pszBuffer, 100, "%i/%02i/%02i %i:%02i:%02i", + pszBuffer += mir_snprintf(pszBuffer, 100, "%i/%02i/%02i %i:%02i:%02i", systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, systemTime.wSecond); break; @@ -449,11 +443,11 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, case SY_FILE_SIZE: { if ((iFileSize >> 10) == 0) - pszBuffer += _snprintf(pszBuffer, 100, "%i Byte", iFileSize); + pszBuffer += mir_snprintf(pszBuffer, 100, "%i Byte", iFileSize); else if ((iFileSize >> 20) == 0) - pszBuffer += _snprintf(pszBuffer, 100, "%.1f KB", (float)(iFileSize) / 1024.0f); + pszBuffer += mir_snprintf(pszBuffer, 100, "%.1f KB", (float)(iFileSize) / 1024.0f); else - pszBuffer += _snprintf(pszBuffer, 100, "%.1f MB", (float)(iFileSize) / (1024.0f * 1024.0f)); + pszBuffer += mir_snprintf(pszBuffer, 100, "%.1f MB", (float)(iFileSize) / (1024.0f * 1024.0f)); break; } -- cgit v1.2.3