diff -urN F:\FGCVS\tidy\build\msvc\tidy.dsp tidycvs6\build\msvc\tidy.dsp --- F:\FGCVS\tidy\build\msvc\tidy.dsp Thu Apr 17 17:48:03 2003 +++ tidycvs6\build\msvc\tidy.dsp Sat Sep 16 13:45:00 2006 @@ -42,7 +42,8 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /Za /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 /D SUPPORT_ACCESSIBILITY_CHECKS=1 /D TIDYDLL_EXPORT=__declspec(dllimport) /YX /FD /c +# ADD CPP /nologo /MT /Za /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 /D SUPPORT_ACCESSIBILITY_CHECKS=1 /D TIDYDLL_EXPORT=__declspec(dllimport) /FD /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +67,8 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /Za /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 /D SUPPORT_ACCESSIBILITY_CHECKS=1 /D TIDYDLL_EXPORT=__declspec(dllimport) /YX /FD /GZ /c +# ADD CPP /nologo /MTd /Za /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 /D SUPPORT_ACCESSIBILITY_CHECKS=1 /D TIDYDLL_EXPORT=__declspec(dllimport) /FD /GZ /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff -urN F:\FGCVS\tidy\build\msvc\tidydll.dsp tidycvs6\build\msvc\tidydll.dsp --- F:\FGCVS\tidy\build\msvc\tidydll.dsp Thu Apr 17 16:33:57 2003 +++ tidycvs6\build\msvc\tidydll.dsp Sat Sep 16 13:47:24 2006 @@ -69,7 +69,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDYDLL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 /D SUPPORT_ACCESSIBILITY_CHECKS=1 /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 /D SUPPORT_ACCESSIBILITY_CHECKS=1 /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 @@ -149,6 +149,10 @@ # End Source File # Begin Source File +SOURCE=..\..\src\mappedio.c +# End Source File +# Begin Source File + SOURCE=..\..\src\parser.c # End Source File # Begin Source File @@ -179,6 +183,10 @@ SOURCE=..\..\src\utf8.c # End Source File +# Begin Source File + +SOURCE=..\..\src\win32tc.c +# End Source File # End Group # Begin Group "Header Files" @@ -217,11 +225,19 @@ # End Source File # Begin Source File +SOURCE=..\..\src\fileio.h +# End Source File +# Begin Source File + SOURCE=..\..\src\forward.h # End Source File # Begin Source File SOURCE=..\..\src\lexer.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\mappedio.h # End Source File # Begin Source File diff -urN F:\FGCVS\tidy\build\msvc\tidylib.dsp tidycvs6\build\msvc\tidylib.dsp --- F:\FGCVS\tidy\build\msvc\tidylib.dsp Thu Apr 17 17:48:04 2003 +++ tidycvs6\build\msvc\tidylib.dsp Sat Sep 16 13:47:24 2006 @@ -143,6 +143,19 @@ # End Source File # Begin Source File +SOURCE=..\..\src\mappedio.c + +!IF "$(CFG)" == "tidylib - Win32 Release" + +!ELSEIF "$(CFG)" == "tidylib - Win32 Debug" + +# ADD CPP /Ze + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=..\..\src\parser.c # End Source File # Begin Source File @@ -173,6 +186,10 @@ SOURCE=..\..\src\utf8.c # End Source File +# Begin Source File + +SOURCE=..\..\src\win32tc.c +# End Source File # End Group # Begin Group "Header Files" @@ -211,6 +228,10 @@ # End Source File # Begin Source File +SOURCE=..\..\src\fileio.h +# End Source File +# Begin Source File + SOURCE=..\..\src\forward.h # End Source File # Begin Source File @@ -219,6 +240,10 @@ # End Source File # Begin Source File +SOURCE=..\..\src\mappedio.h +# End Source File +# Begin Source File + SOURCE=..\..\src\message.h # End Source File # Begin Source File @@ -260,6 +285,10 @@ # Begin Source File SOURCE=..\..\src\utf8.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\win32tc.h # End Source File # End Group # End Target diff -urN F:\FGCVS\tidy\src\mappedio.c tidycvs6\src\mappedio.c --- F:\FGCVS\tidy\src\mappedio.c Fri Sep 15 17:45:19 2006 +++ tidycvs6\src\mappedio.c Sat Sep 16 13:40:35 2006 @@ -8,9 +8,21 @@ $Id: mappedio.c,v 1.1 2006/09/15 15:45:19 arnaud02 Exp $ */ +#ifdef WIN32 +#if _MSC_VER > 1000 +#pragma warning( disable : 4115 ) /* named type definition in parentheses */ +#endif +#endif /* #ifdef WIN32 */ + /* keep these here to keep file non-empty */ +#include + #include "forward.h" #include "mappedio.h" +#include "streamio.h" +#include "platform.h" +#include "tidy-int.h" +#include "message.h" #ifdef _POSIX_MAPPED_FILES @@ -176,12 +188,23 @@ fin = (MappedFileSource*) MemAlloc( sizeof(MappedFileSource) ); if ( !fin ) return -1; - +#if _MSC_VER < 1700 + { + LARGE_INTEGER * pli = (LARGE_INTEGER *)&fin->size; + (DWORD)pli->LowPart = GetFileSize( fp, (DWORD *)&pli->HighPart ); + if(( GetLastError() != NO_ERROR ) || (fin->size <= 0)) + { + MemFree(fin); + return -1; + } + } +#else /* !#if _MSC_VER < 1700 */ if ( !GetFileSizeEx( fp, (LARGE_INTEGER*)&fin->size ) || fin->size <= 0 ) { MemFree(fin); return -1; } +#endif /* #if _MSC_VER < 1700 y/n */ fin->map = CreateFileMapping( fp, NULL, PAGE_READONLY, 0, 0, NULL ); @@ -254,11 +277,20 @@ if ( fin != INVALID_HANDLE_VALUE && cfgBool(doc,TidyKeepFileTimes) && GetFileTime(fin, NULL, (FILETIME*)&actime, (FILETIME*)&modtime) ) { +#if _MSC_VER < 1700 + doc->filetimes.actime = + (time_t)( ( actime - 116444736000000000I64) / 10000000I64 ); + + doc->filetimes.modtime = + (time_t)( ( modtime - 116444736000000000I64) / 10000000I64 ); + +#else /* _MSC_VER >= 1700 */ doc->filetimes.actime = (time_t)( ( actime - 116444736000000000LL) / 10000000LL ); doc->filetimes.modtime = (time_t)( ( modtime - 116444736000000000LL) / 10000000LL ); +#endif /* _MSC_VER < 1700 y/n */ } #endif diff -urN F:\FGCVS\tidy\src\streamio.c tidycvs6\src\streamio.c --- F:\FGCVS\tidy\src\streamio.c Sat Sep 16 11:39:25 2006 +++ tidycvs6\src\streamio.c Sat Sep 16 13:18:13 2006 @@ -110,7 +110,7 @@ ** Source ************************/ -static StreamIn* initStreamIn( TidyDocImpl* doc, int encoding ) +StreamIn* TY_(initStreamIn)( TidyDocImpl* doc, int encoding ) { StreamIn *in = (StreamIn*) MemAlloc( sizeof(StreamIn) ); @@ -142,7 +142,7 @@ StreamIn* TY_(FileInput)( TidyDocImpl* doc, FILE *fp, int encoding ) { - StreamIn *in = initStreamIn( doc, encoding ); + StreamIn *in = TY_(initStreamIn)( doc, encoding ); if ( TY_(initFileSource)( &in->source, fp ) != 0 ) { TY_(freeStreamIn)( in ); @@ -154,7 +154,7 @@ StreamIn* TY_(BufferInput)( TidyDocImpl* doc, TidyBuffer* buf, int encoding ) { - StreamIn *in = initStreamIn( doc, encoding ); + StreamIn *in = TY_(initStreamIn)( doc, encoding ); tidyInitInputBuffer( &in->source, buf ); in->iotype = BufferIO; return in; @@ -162,7 +162,7 @@ StreamIn* TY_(UserInput)( TidyDocImpl* doc, TidyInputSource* source, int encoding ) { - StreamIn *in = initStreamIn( doc, encoding ); + StreamIn *in = TY_(initStreamIn)( doc, encoding ); memcpy( &in->source, source, sizeof(TidyInputSource) ); in->iotype = UserIO; return in; diff -urN F:\FGCVS\tidy\src\streamio.h tidycvs6\src\streamio.h --- F:\FGCVS\tidy\src\streamio.h Sat Sep 16 11:39:25 2006 +++ tidycvs6\src\streamio.h Sat Sep 16 13:09:47 2006 @@ -97,6 +97,7 @@ StreamIn* TY_(FileInput)( TidyDocImpl* doc, FILE* fp, int encoding ); StreamIn* TY_(BufferInput)( TidyDocImpl* doc, TidyBuffer* content, int encoding ); StreamIn* TY_(UserInput)( TidyDocImpl* doc, TidyInputSource* source, int encoding ); +StreamIn* TY_(initStreamIn)( TidyDocImpl* doc, int encoding ); int TY_(ReadBOMEncoding)(StreamIn *in); uint TY_(ReadChar)( StreamIn* in ); diff -urN F:\FGCVS\tidy\src\tidylib.c tidycvs6\src\tidylib.c --- F:\FGCVS\tidy\src\tidylib.c Sat Sep 16 11:39:26 2006 +++ tidycvs6\src\tidylib.c Sat Sep 16 12:56:57 2006 @@ -35,6 +35,7 @@ #include "entities.h" #include "tmbstr.h" #include "utf8.h" +#include "mappedio.h" #ifdef TIDY_WIN32_MLANG_SUPPORT #include "win32tc.h"