From 4d013571090402f5f8e759ecaff31b60d5724720 Mon Sep 17 00:00:00 2001 From: ExMix Date: Thu, 2 May 2013 11:39:16 +0300 Subject: [PATCH] Fixed line endings --- .../builds/win32/visualc/freetype.dsp | 800 ++-- .../builds/win32/visualc/freetype.dsw | 58 +- 3party/tomcrypt/libtomcrypt.dsp | 3268 ++++++++--------- 3party/utfcpp/source/utf8.h | 68 +- 3party/zlib/contrib/dotzlib/DotZLib.build | 64 +- .../contrib/dotzlib/DotZLib/AssemblyInfo.cs | 116 +- .../contrib/dotzlib/DotZLib/ChecksumImpl.cs | 402 +- .../contrib/dotzlib/DotZLib/CircularBuffer.cs | 166 +- .../zlib/contrib/dotzlib/DotZLib/CodecBase.cs | 396 +- .../zlib/contrib/dotzlib/DotZLib/Deflater.cs | 212 +- .../zlib/contrib/dotzlib/DotZLib/DotZLib.cs | 576 +-- .../zlib/contrib/dotzlib/DotZLib/Inflater.cs | 210 +- .../zlib/contrib/dotzlib/DotZLib/UnitTests.cs | 548 +-- 3party/zlib/contrib/dotzlib/LICENSE_1_0.txt | 44 +- 3party/zlib/contrib/masmx64/gvmat64.asm | 1106 +++--- 3party/zlib/contrib/masmx64/inffasx64.asm | 792 ++-- 3party/zlib/contrib/masmx64/readme.txt | 62 +- 3party/zlib/contrib/masmx86/bld_ml32.bat | 4 +- 3party/zlib/contrib/masmx86/inffas32.asm | 2166 +++++------ 3party/zlib/contrib/masmx86/match686.asm | 956 ++--- 3party/zlib/contrib/masmx86/readme.txt | 54 +- 3party/zlib/contrib/testzlib/testzlib.txt | 18 +- 3party/zlib/contrib/vstudio/vc10/zlibvc.def | 260 +- 3party/zlib/old/visualc6/README.txt | 146 +- 3party/zlib/old/visualc6/zlib.dsp | 1242 +++---- 3party/zlib/old/visualc6/zlib.dsw | 118 +- android/jni/MapsWithMe.cpp | 2 +- android/jni/nv_debug/nv_debug.hpp | 154 +- android/jni/nv_event/nv_event.hpp | 1078 +++--- android/jni/nv_event/nv_event_queue.cpp | 554 +-- android/jni/nv_event/nv_keycode_mapping.hpp | 294 +- android/jni/nv_event/scoped_profiler.hpp | 164 +- android/jni/nv_thread/nv_thread.cpp | 334 +- android/jni/nv_thread/nv_thread.hpp | 194 +- android/jni/nv_time/nv_time.cpp | 328 +- data/styles/symbols/arrow.svg | 16 +- data/styles/symbols/placemark-blue.svg | 50 +- data/styles/symbols/placemark-brown.svg | 50 +- data/styles/symbols/placemark-green.svg | 52 +- data/styles/symbols/placemark-orange.svg | 52 +- data/styles/symbols/placemark-pink.svg | 50 +- data/styles/symbols/placemark-purple.svg | 48 +- 42 files changed, 8636 insertions(+), 8636 deletions(-) diff --git a/3party/freetype/builds/win32/visualc/freetype.dsp b/3party/freetype/builds/win32/visualc/freetype.dsp index b8e05ae09a..2544dc83c1 100644 --- a/3party/freetype/builds/win32/visualc/freetype.dsp +++ b/3party/freetype/builds/win32/visualc/freetype.dsp @@ -1,400 +1,400 @@ -# Microsoft Developer Studio Project File - Name="freetype" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=freetype - Win32 Debug Singlethreaded -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "freetype.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library") -!MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library") -!MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library") -!MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "freetype - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\objs\release" -# PROP Intermediate_Dir "..\..\..\objs\release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /MD /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c -# SUBTRACT CPP /nologo /Z /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411.lib" - -!ELSEIF "$(CFG)" == "freetype - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\objs\debug" -# PROP Intermediate_Dir "..\..\..\objs\debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /MDd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c -# SUBTRACT CPP /nologo /X /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411_D.lib" - -!ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "freetype___Win32_Debug_Multithreaded" -# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Multithreaded" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\objs\debug_mt" -# PROP Intermediate_Dir "..\..\..\objs\debug_mt" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c -# SUBTRACT BASE CPP /X -# ADD CPP /MTd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c -# SUBTRACT CPP /nologo /X /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype2411_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411MT_D.lib" - -!ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "freetype___Win32_Release_Multithreaded" -# PROP BASE Intermediate_Dir "freetype___Win32_Release_Multithreaded" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\objs\release_mt" -# PROP Intermediate_Dir "..\..\..\objs\release_mt" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c -# ADD CPP /MT /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c -# SUBTRACT CPP /nologo /Z /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype2411.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411MT.lib" - -!ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "freetype___Win32_Release_Singlethreaded" -# PROP BASE Intermediate_Dir "freetype___Win32_Release_Singlethreaded" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\objs\release_st" -# PROP Intermediate_Dir "..\..\..\objs\release_st" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c -# SUBTRACT CPP /nologo /Z /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype2411.lib" -# ADD LIB32 /out:"..\..\..\objs\freetype2411ST.lib" -# SUBTRACT LIB32 /nologo - -!ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "freetype___Win32_Debug_Singlethreaded" -# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Singlethreaded" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\objs\debug_st" -# PROP Intermediate_Dir "..\..\..\objs\debug_st" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /Za /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c -# SUBTRACT BASE CPP /X /YX -# ADD CPP /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c -# SUBTRACT CPP /nologo /X /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype2411_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411ST_D.lib" - -!ENDIF - -# Begin Target - -# Name "freetype - Win32 Release" -# Name "freetype - Win32 Debug" -# Name "freetype - Win32 Debug Multithreaded" -# Name "freetype - Win32 Release Multithreaded" -# Name "freetype - Win32 Release Singlethreaded" -# Name "freetype - Win32 Debug Singlethreaded" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\src\autofit\autofit.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\bdf\bdf.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\cff\cff.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftbase.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftbbox.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftbdf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftbitmap.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftfstype.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftgasp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\cache\ftcache.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\ftdebug.c -# ADD CPP /Ze -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftglyph.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftgxval.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\gzip\ftgzip.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftinit.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\lzw\ftlzw.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftmm.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftotval.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftpfr.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftstroke.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftsynth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftsystem.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\fttype1.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftwinfnt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\base\ftxf86.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\pcf\pcf.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\pfr\pfr.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\psaux\psaux.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\pshinter\pshinter.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\psnames\psmodule.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\raster\raster.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\sfnt\sfnt.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\smooth\smooth.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\truetype\truetype.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\type1\type1.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\cid\type1cid.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\type42\type42.c -# SUBTRACT CPP /Fr -# End Source File -# Begin Source File - -SOURCE=..\..\..\src\winfonts\winfnt.c -# SUBTRACT CPP /Fr -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\include\ft2build.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\freetype\config\ftconfig.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\freetype\config\ftheader.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\freetype\config\ftmodule.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\freetype\config\ftoption.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\freetype\config\ftstdlib.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="freetype" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=freetype - Win32 Debug Singlethreaded +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library") +!MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "freetype - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\release" +# PROP Intermediate_Dir "..\..\..\objs\release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /MD /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /nologo /Z /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\debug" +# PROP Intermediate_Dir "..\..\..\objs\debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /MDd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c +# SUBTRACT CPP /nologo /X /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411_D.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "freetype___Win32_Debug_Multithreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Multithreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\debug_mt" +# PROP Intermediate_Dir "..\..\..\objs\debug_mt" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c +# SUBTRACT BASE CPP /X +# ADD CPP /MTd /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c +# SUBTRACT CPP /nologo /X /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"lib\freetype2411_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411MT_D.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "freetype___Win32_Release_Multithreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Release_Multithreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\release_mt" +# PROP Intermediate_Dir "..\..\..\objs\release_mt" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c +# ADD CPP /MT /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /nologo /Z /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"lib\freetype2411.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411MT.lib" + +!ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "freetype___Win32_Release_Singlethreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Release_Singlethreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\objs\release_st" +# PROP Intermediate_Dir "..\..\..\objs\release_st" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /c +# SUBTRACT CPP /nologo /Z /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype2411.lib" +# ADD LIB32 /out:"..\..\..\objs\freetype2411ST.lib" +# SUBTRACT LIB32 /nologo + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "freetype___Win32_Debug_Singlethreaded" +# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Singlethreaded" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\objs\debug_st" +# PROP Intermediate_Dir "..\..\..\objs\debug_st" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /Za /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c +# SUBTRACT BASE CPP /X /YX +# ADD CPP /Za /W4 /GX /Z7 /Od /I "..\..\..\include" /D "_DEBUG" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT2_BUILD_LIBRARY" /FD /GZ /c +# SUBTRACT CPP /nologo /X /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype2411_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2411ST_D.lib" + +!ENDIF + +# Begin Target + +# Name "freetype - Win32 Release" +# Name "freetype - Win32 Debug" +# Name "freetype - Win32 Debug Multithreaded" +# Name "freetype - Win32 Release Multithreaded" +# Name "freetype - Win32 Release Singlethreaded" +# Name "freetype - Win32 Debug Singlethreaded" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\src\autofit\autofit.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\bdf\bdf.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cff\cff.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbase.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbbox.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbdf.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftbitmap.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftfstype.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftgasp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cache\ftcache.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\ftdebug.c +# ADD CPP /Ze +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftglyph.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftgxval.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\gzip\ftgzip.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftinit.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\lzw\ftlzw.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftmm.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftotval.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftpfr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftstroke.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftsynth.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftsystem.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\fttype1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftwinfnt.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\base\ftxf86.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pcf\pcf.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pfr\pfr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\psaux\psaux.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\pshinter\pshinter.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\psnames\psmodule.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\raster\raster.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\sfnt\sfnt.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\smooth\smooth.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\truetype\truetype.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\type1\type1.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cid\type1cid.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\type42\type42.c +# SUBTRACT CPP /Fr +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\winfonts\winfnt.c +# SUBTRACT CPP /Fr +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\include\ft2build.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftconfig.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftheader.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftmodule.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftoption.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\include\freetype\config\ftstdlib.h +# End Source File +# End Group +# End Target +# End Project diff --git a/3party/freetype/builds/win32/visualc/freetype.dsw b/3party/freetype/builds/win32/visualc/freetype.dsw index b149e769b5..b1b375dbbc 100644 --- a/3party/freetype/builds/win32/visualc/freetype.dsw +++ b/3party/freetype/builds/win32/visualc/freetype.dsw @@ -1,29 +1,29 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "freetype"=.\freetype.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "freetype"=.\freetype.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/3party/tomcrypt/libtomcrypt.dsp b/3party/tomcrypt/libtomcrypt.dsp index a6dbe7a351..e18176450a 100644 --- a/3party/tomcrypt/libtomcrypt.dsp +++ b/3party/tomcrypt/libtomcrypt.dsp @@ -1,1634 +1,1634 @@ -# Microsoft Developer Studio Project File - Name="libtomcrypt" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libtomcrypt - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libtomcrypt.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libtomcrypt.mak" CFG="libtomcrypt - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libtomcrypt - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libtomcrypt - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "libtomcrypt" -# PROP Scc_LocalPath "." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libtomcrypt - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "src\headers" /I "..\libtommath" /D "NDEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Release\tomcrypt.lib" - -!ELSEIF "$(CFG)" == "libtomcrypt - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Debug\tomcrypt.lib" - -!ENDIF - -# Begin Target - -# Name "libtomcrypt - Win32 Release" -# Name "libtomcrypt - Win32 Debug" -# Begin Group "ciphers" - -# PROP Default_Filter "" -# Begin Group "aes" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\ciphers\aes\aes.c - -!IF "$(CFG)" == "libtomcrypt - Win32 Release" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build -InputPath=.\src\ciphers\aes\aes.c - -BuildCmds= \ - cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath) \ - cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath) \ - - -"Release/aes.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"Release/aes_enc.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "libtomcrypt - Win32 Debug" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build -InputPath=.\src\ciphers\aes\aes.c - -BuildCmds= \ - cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath) \ - cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath) \ - - -"Debug/aes.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"Debug/aes_enc.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\aes\aes_tab.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "safer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\ciphers\safer\safer.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\safer\safer_tab.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\safer\saferp.c -# End Source File -# End Group -# Begin Group "twofish" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\ciphers\twofish\twofish.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\twofish\twofish_tab.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\ciphers\anubis.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\blowfish.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\cast5.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\des.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\kasumi.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\khazad.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\kseed.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\multi2.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\noekeon.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\rc2.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\rc5.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\rc6.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\skipjack.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\xtea.c -# End Source File -# End Group -# Begin Group "encauth" - -# PROP Default_Filter "" -# Begin Group "ccm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\ccm\ccm_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ccm\ccm_test.c -# End Source File -# End Group -# Begin Group "eax" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_addheader.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_decrypt_verify_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_encrypt_authenticate_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_test.c -# End Source File -# End Group -# Begin Group "gcm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_add_aad.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_add_iv.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_gf_mult.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_mult_h.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_reset.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_test.c -# End Source File -# End Group -# Begin Group "ocb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_decrypt_verify_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_done_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_done_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_encrypt_authenticate_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_ntz.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_shift_xor.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_test.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\s_ocb_done.c -# End Source File -# End Group -# End Group -# Begin Group "hashes" - -# PROP Default_Filter "" -# Begin Group "helper" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_filehandle.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_memory_multi.c -# End Source File -# End Group -# Begin Group "sha2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha224.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha256.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha384.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha512.c -# End Source File -# End Group -# Begin Group "whirl" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\hashes\whirl\whirl.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\whirl\whirltab.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\hashes\chc\chc.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\md2.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\md4.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\md5.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd128.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd160.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd256.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd320.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha1.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\tiger.c -# End Source File -# End Group -# Begin Group "mac" - -# PROP Default_Filter "" -# Begin Group "f9" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\f9\f9_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_test.c -# End Source File -# End Group -# Begin Group "hmac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_test.c -# End Source File -# End Group -# Begin Group "omac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\omac\omac_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_test.c -# End Source File -# End Group -# Begin Group "pelican" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\pelican\pelican.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pelican\pelican_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pelican\pelican_test.c -# End Source File -# End Group -# Begin Group "pmac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_ntz.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_shift_xor.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_test.c -# End Source File -# End Group -# Begin Group "xcbc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_test.c -# End Source File -# End Group -# End Group -# Begin Group "math" - -# PROP Default_Filter "" -# Begin Group "fp" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\math\fp\ltc_ecc_fp_mulmod.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\math\gmp_desc.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\ltm_desc.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\rand_prime.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\tfm_desc.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Group "base64" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\misc\base64\base64_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\base64\base64_encode.c -# End Source File -# End Group -# Begin Group "crypt" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_argchk.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_cipher_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_cipher_is_valid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_cipher.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_cipher_any.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_cipher_id.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash_any.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash_id.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash_oid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_prng.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_fsa.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_hash_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_hash_is_valid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_ltc_mp_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_prng_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_prng_is_valid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_register_cipher.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_register_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_register_prng.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_unregister_cipher.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_unregister_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_unregister_prng.c -# End Source File -# End Group -# Begin Group "pkcs" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\misc\pkcs5\pkcs_5_1.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\pkcs5\pkcs_5_2.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\misc\burn_stack.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\error_to_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\zeromem.c -# End Source File -# End Group -# Begin Group "modes" - -# PROP Default_Filter "" -# Begin Group "cbc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_start.c -# End Source File -# End Group -# Begin Group "cfb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_start.c -# End Source File -# End Group -# Begin Group "ctr" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_start.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_test.c -# End Source File -# End Group -# Begin Group "ecb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_start.c -# End Source File -# End Group -# Begin Group "f8" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\f8\f8_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_start.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_test_mode.c -# End Source File -# End Group -# Begin Group "lrw" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_start.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_test.c -# End Source File -# End Group -# Begin Group "ofb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_start.c -# End Source File -# End Group -# Begin Group "xts" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\xts\xts_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_mult_x.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_test.c -# End Source File -# End Group -# End Group -# Begin Group "pk" - -# PROP Default_Filter "" -# Begin Group "asn1" - -# PROP Default_Filter "" -# Begin Group "der" - -# PROP Default_Filter "" -# Begin Group "bit" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\bit\der_decode_bit_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\bit\der_encode_bit_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\bit\der_length_bit_string.c -# End Source File -# End Group -# Begin Group "boolean" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\boolean\der_decode_boolean.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\boolean\der_encode_boolean.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\boolean\der_length_boolean.c -# End Source File -# End Group -# Begin Group "choice" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\choice\der_decode_choice.c -# End Source File -# End Group -# Begin Group "ia5" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\ia5\der_decode_ia5_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\ia5\der_encode_ia5_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\ia5\der_length_ia5_string.c -# End Source File -# End Group -# Begin Group "integer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\integer\der_decode_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\integer\der_encode_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\integer\der_length_integer.c -# End Source File -# End Group -# Begin Group "object_identifier" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\object_identifier\der_decode_object_identifier.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\object_identifier\der_encode_object_identifier.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\object_identifier\der_length_object_identifier.c -# End Source File -# End Group -# Begin Group "octet" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\octet\der_decode_octet_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\octet\der_encode_octet_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\octet\der_length_octet_string.c -# End Source File -# End Group -# Begin Group "printable_string" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\printable_string\der_decode_printable_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\printable_string\der_encode_printable_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\printable_string\der_length_printable_string.c -# End Source File -# End Group -# Begin Group "sequence" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_ex.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_flexi.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_encode_sequence_ex.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_encode_sequence_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_length_sequence.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_sequence_free.c -# End Source File -# End Group -# Begin Group "set" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\set\der_encode_set.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\set\der_encode_setof.c -# End Source File -# End Group -# Begin Group "short_integer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\short_integer\der_decode_short_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\short_integer\der_encode_short_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\short_integer\der_length_short_integer.c -# End Source File -# End Group -# Begin Group "utctime" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utctime\der_decode_utctime.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utctime\der_encode_utctime.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utctime\der_length_utctime.c -# End Source File -# End Group -# Begin Group "utf8" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utf8\der_decode_utf8_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utf8\der_encode_utf8_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utf8\der_length_utf8_string.c -# End Source File -# End Group -# End Group -# End Group -# Begin Group "dsa" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_make_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_shared_secret.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_sign_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_verify_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_verify_key.c -# End Source File -# End Group -# Begin Group "ecc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_ansi_x963_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_ansi_x963_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_get_size.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_make_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_shared_secret.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_sign_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_sizes.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_test.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_verify_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_is_valid_idx.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_map.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_mul2add.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_mulmod.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_mulmod_timing.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_points.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_projective_add_point.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_projective_dbl_point.c -# End Source File -# End Group -# Begin Group "katja" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\katja\katja_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_exptmod.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_make_key.c -# End Source File -# End Group -# Begin Group "pkcs1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_i2osp.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_mgf1.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_oaep_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_oaep_encode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_os2ip.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_pss_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_pss_encode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_v1_5_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_v1_5_encode.c -# End Source File -# End Group -# Begin Group "rsa" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_exptmod.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_make_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_sign_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_verify_hash.c -# End Source File -# End Group -# End Group -# Begin Group "prngs" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\prngs\fortuna.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\rc4.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\rng_get_bytes.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\rng_make_prng.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\sober128.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\sober128tab.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\sprng.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\yarrow.c -# End Source File -# End Group -# Begin Group "headers" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\headers\tomcrypt.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_argchk.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_cfg.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_cipher.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_custom.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_hash.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_mac.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_macros.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_math.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_misc.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_pk.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_pkcs.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_prng.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="libtomcrypt" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libtomcrypt - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libtomcrypt.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libtomcrypt.mak" CFG="libtomcrypt - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libtomcrypt - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libtomcrypt - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "libtomcrypt" +# PROP Scc_LocalPath "." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libtomcrypt - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "src\headers" /I "..\libtommath" /D "NDEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Release\tomcrypt.lib" + +!ELSEIF "$(CFG)" == "libtomcrypt - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug\tomcrypt.lib" + +!ENDIF + +# Begin Target + +# Name "libtomcrypt - Win32 Release" +# Name "libtomcrypt - Win32 Debug" +# Begin Group "ciphers" + +# PROP Default_Filter "" +# Begin Group "aes" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\ciphers\aes\aes.c + +!IF "$(CFG)" == "libtomcrypt - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputPath=.\src\ciphers\aes\aes.c + +BuildCmds= \ + cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath) \ + cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath) \ + + +"Release/aes.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"Release/aes_enc.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ELSEIF "$(CFG)" == "libtomcrypt - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputPath=.\src\ciphers\aes\aes.c + +BuildCmds= \ + cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath) \ + cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath) \ + + +"Debug/aes.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"Debug/aes_enc.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\aes\aes_tab.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Group "safer" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\ciphers\safer\safer.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\safer\safer_tab.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\safer\saferp.c +# End Source File +# End Group +# Begin Group "twofish" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\ciphers\twofish\twofish.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\twofish\twofish_tab.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Source File + +SOURCE=.\src\ciphers\anubis.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\blowfish.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\cast5.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\des.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\kasumi.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\khazad.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\kseed.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\multi2.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\noekeon.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\rc2.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\rc5.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\rc6.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\skipjack.c +# End Source File +# Begin Source File + +SOURCE=.\src\ciphers\xtea.c +# End Source File +# End Group +# Begin Group "encauth" + +# PROP Default_Filter "" +# Begin Group "ccm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\encauth\ccm\ccm_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ccm\ccm_test.c +# End Source File +# End Group +# Begin Group "eax" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_addheader.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_decrypt_verify_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_encrypt_authenticate_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\eax\eax_test.c +# End Source File +# End Group +# Begin Group "gcm" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_add_aad.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_add_iv.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_gf_mult.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_mult_h.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_reset.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\gcm\gcm_test.c +# End Source File +# End Group +# Begin Group "ocb" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_decrypt_verify_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_done_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_done_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_encrypt_authenticate_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_ntz.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_shift_xor.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\ocb_test.c +# End Source File +# Begin Source File + +SOURCE=.\src\encauth\ocb\s_ocb_done.c +# End Source File +# End Group +# End Group +# Begin Group "hashes" + +# PROP Default_Filter "" +# Begin Group "helper" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\hashes\helper\hash_file.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\helper\hash_filehandle.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\helper\hash_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\helper\hash_memory_multi.c +# End Source File +# End Group +# Begin Group "sha2" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\hashes\sha2\sha224.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\sha2\sha256.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\sha2\sha384.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\sha2\sha512.c +# End Source File +# End Group +# Begin Group "whirl" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\hashes\whirl\whirl.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\whirl\whirltab.c +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# Begin Source File + +SOURCE=.\src\hashes\chc\chc.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\md2.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\md4.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\md5.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\rmd128.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\rmd160.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\rmd256.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\rmd320.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\sha1.c +# End Source File +# Begin Source File + +SOURCE=.\src\hashes\tiger.c +# End Source File +# End Group +# Begin Group "mac" + +# PROP Default_Filter "" +# Begin Group "f9" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\mac\f9\f9_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\f9\f9_file.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\f9\f9_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\f9\f9_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\f9\f9_memory_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\f9\f9_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\f9\f9_test.c +# End Source File +# End Group +# Begin Group "hmac" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_file.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_memory_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\hmac\hmac_test.c +# End Source File +# End Group +# Begin Group "omac" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\mac\omac\omac_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\omac\omac_file.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\omac\omac_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\omac\omac_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\omac\omac_memory_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\omac\omac_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\omac\omac_test.c +# End Source File +# End Group +# Begin Group "pelican" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\mac\pelican\pelican.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pelican\pelican_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pelican\pelican_test.c +# End Source File +# End Group +# Begin Group "pmac" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_file.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_memory_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_ntz.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_shift_xor.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\pmac\pmac_test.c +# End Source File +# End Group +# Begin Group "xcbc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_file.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_memory.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_memory_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\mac\xcbc\xcbc_test.c +# End Source File +# End Group +# End Group +# Begin Group "math" + +# PROP Default_Filter "" +# Begin Group "fp" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\math\fp\ltc_ecc_fp_mulmod.c +# End Source File +# End Group +# Begin Source File + +SOURCE=.\src\math\gmp_desc.c +# End Source File +# Begin Source File + +SOURCE=.\src\math\ltm_desc.c +# End Source File +# Begin Source File + +SOURCE=.\src\math\multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\math\rand_prime.c +# End Source File +# Begin Source File + +SOURCE=.\src\math\tfm_desc.c +# End Source File +# End Group +# Begin Group "misc" + +# PROP Default_Filter "" +# Begin Group "base64" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\misc\base64\base64_decode.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\base64\base64_encode.c +# End Source File +# End Group +# Begin Group "crypt" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_argchk.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_cipher_descriptor.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_cipher_is_valid.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_cipher.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_cipher_any.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_cipher_id.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_hash_any.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_hash_id.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_hash_oid.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_find_prng.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_fsa.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_hash_descriptor.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_hash_is_valid.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_ltc_mp_descriptor.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_prng_descriptor.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_prng_is_valid.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_register_cipher.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_register_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_register_prng.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_unregister_cipher.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_unregister_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\crypt\crypt_unregister_prng.c +# End Source File +# End Group +# Begin Group "pkcs" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\misc\pkcs5\pkcs_5_1.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\pkcs5\pkcs_5_2.c +# End Source File +# End Group +# Begin Source File + +SOURCE=.\src\misc\burn_stack.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\error_to_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\misc\zeromem.c +# End Source File +# End Group +# Begin Group "modes" + +# PROP Default_Filter "" +# Begin Group "cbc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\cbc\cbc_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cbc\cbc_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cbc\cbc_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cbc\cbc_getiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cbc\cbc_setiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cbc\cbc_start.c +# End Source File +# End Group +# Begin Group "cfb" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\cfb\cfb_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cfb\cfb_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cfb\cfb_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cfb\cfb_getiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cfb\cfb_setiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\cfb\cfb_start.c +# End Source File +# End Group +# Begin Group "ctr" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_getiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_setiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_start.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ctr\ctr_test.c +# End Source File +# End Group +# Begin Group "ecb" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\ecb\ecb_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ecb\ecb_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ecb\ecb_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ecb\ecb_start.c +# End Source File +# End Group +# Begin Group "f8" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\f8\f8_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\f8\f8_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\f8\f8_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\f8\f8_getiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\f8\f8_setiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\f8\f8_start.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\f8\f8_test_mode.c +# End Source File +# End Group +# Begin Group "lrw" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_getiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_process.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_setiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_start.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\lrw\lrw_test.c +# End Source File +# End Group +# Begin Group "ofb" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\ofb\ofb_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ofb\ofb_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ofb\ofb_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ofb\ofb_getiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ofb\ofb_setiv.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\ofb\ofb_start.c +# End Source File +# End Group +# Begin Group "xts" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\modes\xts\xts_decrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\xts\xts_done.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\xts\xts_encrypt.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\xts\xts_init.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\xts\xts_mult_x.c +# End Source File +# Begin Source File + +SOURCE=.\src\modes\xts\xts_test.c +# End Source File +# End Group +# End Group +# Begin Group "pk" + +# PROP Default_Filter "" +# Begin Group "asn1" + +# PROP Default_Filter "" +# Begin Group "der" + +# PROP Default_Filter "" +# Begin Group "bit" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\bit\der_decode_bit_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\bit\der_encode_bit_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\bit\der_length_bit_string.c +# End Source File +# End Group +# Begin Group "boolean" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\boolean\der_decode_boolean.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\boolean\der_encode_boolean.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\boolean\der_length_boolean.c +# End Source File +# End Group +# Begin Group "choice" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\choice\der_decode_choice.c +# End Source File +# End Group +# Begin Group "ia5" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\ia5\der_decode_ia5_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\ia5\der_encode_ia5_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\ia5\der_length_ia5_string.c +# End Source File +# End Group +# Begin Group "integer" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\integer\der_decode_integer.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\integer\der_encode_integer.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\integer\der_length_integer.c +# End Source File +# End Group +# Begin Group "object_identifier" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\object_identifier\der_decode_object_identifier.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\object_identifier\der_encode_object_identifier.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\object_identifier\der_length_object_identifier.c +# End Source File +# End Group +# Begin Group "octet" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\octet\der_decode_octet_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\octet\der_encode_octet_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\octet\der_length_octet_string.c +# End Source File +# End Group +# Begin Group "printable_string" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\printable_string\der_decode_printable_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\printable_string\der_encode_printable_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\printable_string\der_length_printable_string.c +# End Source File +# End Group +# Begin Group "sequence" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_ex.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_flexi.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_encode_sequence_ex.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_encode_sequence_multi.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_length_sequence.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\sequence\der_sequence_free.c +# End Source File +# End Group +# Begin Group "set" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\set\der_encode_set.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\set\der_encode_setof.c +# End Source File +# End Group +# Begin Group "short_integer" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\short_integer\der_decode_short_integer.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\short_integer\der_encode_short_integer.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\short_integer\der_length_short_integer.c +# End Source File +# End Group +# Begin Group "utctime" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\utctime\der_decode_utctime.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\utctime\der_encode_utctime.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\utctime\der_length_utctime.c +# End Source File +# End Group +# Begin Group "utf8" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\asn1\der\utf8\der_decode_utf8_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\utf8\der_encode_utf8_string.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\asn1\der\utf8\der_length_utf8_string.c +# End Source File +# End Group +# End Group +# End Group +# Begin Group "dsa" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_decrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_encrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_export.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_free.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_import.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_make_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_shared_secret.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_sign_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_verify_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\dsa\dsa_verify_key.c +# End Source File +# End Group +# Begin Group "ecc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_ansi_x963_export.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_ansi_x963_import.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_decrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_encrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_export.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_free.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_get_size.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_import.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_make_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_shared_secret.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_sign_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_sizes.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_test.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ecc_verify_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_is_valid_idx.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_map.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_mul2add.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_mulmod.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_mulmod_timing.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_points.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_projective_add_point.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\ecc\ltc_ecc_projective_dbl_point.c +# End Source File +# End Group +# Begin Group "katja" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\katja\katja_decrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\katja\katja_encrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\katja\katja_export.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\katja\katja_exptmod.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\katja\katja_free.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\katja\katja_import.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\katja\katja_make_key.c +# End Source File +# End Group +# Begin Group "pkcs1" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_i2osp.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_mgf1.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_oaep_decode.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_oaep_encode.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_os2ip.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_pss_decode.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_pss_encode.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_v1_5_decode.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\pkcs1\pkcs_1_v1_5_encode.c +# End Source File +# End Group +# Begin Group "rsa" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_decrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_encrypt_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_export.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_exptmod.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_free.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_import.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_make_key.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_sign_hash.c +# End Source File +# Begin Source File + +SOURCE=.\src\pk\rsa\rsa_verify_hash.c +# End Source File +# End Group +# End Group +# Begin Group "prngs" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\prngs\fortuna.c +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\rc4.c +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\rng_get_bytes.c +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\rng_make_prng.c +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\sober128.c +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\sober128tab.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\sprng.c +# End Source File +# Begin Source File + +SOURCE=.\src\prngs\yarrow.c +# End Source File +# End Group +# Begin Group "headers" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\src\headers\tomcrypt.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_argchk.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_cfg.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_cipher.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_custom.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_hash.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_mac.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_macros.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_math.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_misc.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_pk.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_pkcs.h +# End Source File +# Begin Source File + +SOURCE=.\src\headers\tomcrypt_prng.h +# End Source File +# End Group +# End Target +# End Project diff --git a/3party/utfcpp/source/utf8.h b/3party/utfcpp/source/utf8.h index 4e4451403f..82b13f59f9 100644 --- a/3party/utfcpp/source/utf8.h +++ b/3party/utfcpp/source/utf8.h @@ -1,34 +1,34 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "utf8/checked.h" -#include "utf8/unchecked.h" - -#endif // header guard +// Copyright 2006 Nemanja Trifunovic + +/* +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + + +#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 +#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 + +#include "utf8/checked.h" +#include "utf8/unchecked.h" + +#endif // header guard diff --git a/3party/zlib/contrib/dotzlib/DotZLib.build b/3party/zlib/contrib/dotzlib/DotZLib.build index 7f90d6bc7c..e69630cec2 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib.build +++ b/3party/zlib/contrib/dotzlib/DotZLib.build @@ -1,33 +1,33 @@ - - - A .Net wrapper library around ZLib1.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + A .Net wrapper library around ZLib1.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/3party/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs b/3party/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs index 0491bfc2b0..724c5347f3 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs @@ -1,58 +1,58 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("DotZLib")] -[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Henrik Ravn")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("DotZLib")] +[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Henrik Ravn")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/3party/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs b/3party/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs index 788b2fcece..b110dae6a1 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs @@ -1,202 +1,202 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.Runtime.InteropServices; -using System.Text; - - -namespace DotZLib -{ - #region ChecksumGeneratorBase - /// - /// Implements the common functionality needed for all s - /// - /// - public abstract class ChecksumGeneratorBase : ChecksumGenerator - { - /// - /// The value of the current checksum - /// - protected uint _current; - - /// - /// Initializes a new instance of the checksum generator base - the current checksum is - /// set to zero - /// - public ChecksumGeneratorBase() - { - _current = 0; - } - - /// - /// Initializes a new instance of the checksum generator basewith a specified value - /// - /// The value to set the current checksum to - public ChecksumGeneratorBase(uint initialValue) - { - _current = initialValue; - } - - /// - /// Resets the current checksum to zero - /// - public void Reset() { _current = 0; } - - /// - /// Gets the current checksum value - /// - public uint Value { get { return _current; } } - - /// - /// Updates the current checksum with part of an array of bytes - /// - /// The data to update the checksum with - /// Where in data to start updating - /// The number of bytes from data to use - /// The sum of offset and count is larger than the length of data - /// data is a null reference - /// Offset or count is negative. - /// All the other Update methods are implmeneted in terms of this one. - /// This is therefore the only method a derived class has to implement - public abstract void Update(byte[] data, int offset, int count); - - /// - /// Updates the current checksum with an array of bytes. - /// - /// The data to update the checksum with - public void Update(byte[] data) - { - Update(data, 0, data.Length); - } - - /// - /// Updates the current checksum with the data from a string - /// - /// The string to update the checksum with - /// The characters in the string are converted by the UTF-8 encoding - public void Update(string data) - { - Update(Encoding.UTF8.GetBytes(data)); - } - - /// - /// Updates the current checksum with the data from a string, using a specific encoding - /// - /// The string to update the checksum with - /// The encoding to use - public void Update(string data, Encoding encoding) - { - Update(encoding.GetBytes(data)); - } - - } - #endregion - - #region CRC32 - /// - /// Implements a CRC32 checksum generator - /// - public sealed class CRC32Checksum : ChecksumGeneratorBase - { - #region DLL imports - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern uint crc32(uint crc, int data, uint length); - - #endregion - - /// - /// Initializes a new instance of the CRC32 checksum generator - /// - public CRC32Checksum() : base() {} - - /// - /// Initializes a new instance of the CRC32 checksum generator with a specified value - /// - /// The value to set the current checksum to - public CRC32Checksum(uint initialValue) : base(initialValue) {} - - /// - /// Updates the current checksum with part of an array of bytes - /// - /// The data to update the checksum with - /// Where in data to start updating - /// The number of bytes from data to use - /// The sum of offset and count is larger than the length of data - /// data is a null reference - /// Offset or count is negative. - public override void Update(byte[] data, int offset, int count) - { - if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); - if ((offset+count) > data.Length) throw new ArgumentException(); - GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); - try - { - _current = crc32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); - } - finally - { - hData.Free(); - } - } - - } - #endregion - - #region Adler - /// - /// Implements a checksum generator that computes the Adler checksum on data - /// - public sealed class AdlerChecksum : ChecksumGeneratorBase - { - #region DLL imports - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern uint adler32(uint adler, int data, uint length); - - #endregion - - /// - /// Initializes a new instance of the Adler checksum generator - /// - public AdlerChecksum() : base() {} - - /// - /// Initializes a new instance of the Adler checksum generator with a specified value - /// - /// The value to set the current checksum to - public AdlerChecksum(uint initialValue) : base(initialValue) {} - - /// - /// Updates the current checksum with part of an array of bytes - /// - /// The data to update the checksum with - /// Where in data to start updating - /// The number of bytes from data to use - /// The sum of offset and count is larger than the length of data - /// data is a null reference - /// Offset or count is negative. - public override void Update(byte[] data, int offset, int count) - { - if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); - if ((offset+count) > data.Length) throw new ArgumentException(); - GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); - try - { - _current = adler32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); - } - finally - { - hData.Free(); - } - } - - } - #endregion - +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Runtime.InteropServices; +using System.Text; + + +namespace DotZLib +{ + #region ChecksumGeneratorBase + /// + /// Implements the common functionality needed for all s + /// + /// + public abstract class ChecksumGeneratorBase : ChecksumGenerator + { + /// + /// The value of the current checksum + /// + protected uint _current; + + /// + /// Initializes a new instance of the checksum generator base - the current checksum is + /// set to zero + /// + public ChecksumGeneratorBase() + { + _current = 0; + } + + /// + /// Initializes a new instance of the checksum generator basewith a specified value + /// + /// The value to set the current checksum to + public ChecksumGeneratorBase(uint initialValue) + { + _current = initialValue; + } + + /// + /// Resets the current checksum to zero + /// + public void Reset() { _current = 0; } + + /// + /// Gets the current checksum value + /// + public uint Value { get { return _current; } } + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + /// All the other Update methods are implmeneted in terms of this one. + /// This is therefore the only method a derived class has to implement + public abstract void Update(byte[] data, int offset, int count); + + /// + /// Updates the current checksum with an array of bytes. + /// + /// The data to update the checksum with + public void Update(byte[] data) + { + Update(data, 0, data.Length); + } + + /// + /// Updates the current checksum with the data from a string + /// + /// The string to update the checksum with + /// The characters in the string are converted by the UTF-8 encoding + public void Update(string data) + { + Update(Encoding.UTF8.GetBytes(data)); + } + + /// + /// Updates the current checksum with the data from a string, using a specific encoding + /// + /// The string to update the checksum with + /// The encoding to use + public void Update(string data, Encoding encoding) + { + Update(encoding.GetBytes(data)); + } + + } + #endregion + + #region CRC32 + /// + /// Implements a CRC32 checksum generator + /// + public sealed class CRC32Checksum : ChecksumGeneratorBase + { + #region DLL imports + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint crc32(uint crc, int data, uint length); + + #endregion + + /// + /// Initializes a new instance of the CRC32 checksum generator + /// + public CRC32Checksum() : base() {} + + /// + /// Initializes a new instance of the CRC32 checksum generator with a specified value + /// + /// The value to set the current checksum to + public CRC32Checksum(uint initialValue) : base(initialValue) {} + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + public override void Update(byte[] data, int offset, int count) + { + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); + try + { + _current = crc32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); + } + finally + { + hData.Free(); + } + } + + } + #endregion + + #region Adler + /// + /// Implements a checksum generator that computes the Adler checksum on data + /// + public sealed class AdlerChecksum : ChecksumGeneratorBase + { + #region DLL imports + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint adler32(uint adler, int data, uint length); + + #endregion + + /// + /// Initializes a new instance of the Adler checksum generator + /// + public AdlerChecksum() : base() {} + + /// + /// Initializes a new instance of the Adler checksum generator with a specified value + /// + /// The value to set the current checksum to + public AdlerChecksum(uint initialValue) : base(initialValue) {} + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + public override void Update(byte[] data, int offset, int count) + { + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); + try + { + _current = adler32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); + } + finally + { + hData.Free(); + } + } + + } + #endregion + } \ No newline at end of file diff --git a/3party/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs b/3party/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs index c1cab3a02c..9c8d601954 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs @@ -1,83 +1,83 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.Diagnostics; - -namespace DotZLib -{ - - /// - /// This class implements a circular buffer - /// - internal class CircularBuffer - { - #region Private data - private int _capacity; - private int _head; - private int _tail; - private int _size; - private byte[] _buffer; - #endregion - - public CircularBuffer(int capacity) - { - Debug.Assert( capacity > 0 ); - _buffer = new byte[capacity]; - _capacity = capacity; - _head = 0; - _tail = 0; - _size = 0; - } - - public int Size { get { return _size; } } - - public int Put(byte[] source, int offset, int count) - { - Debug.Assert( count > 0 ); - int trueCount = Math.Min(count, _capacity - Size); - for (int i = 0; i < trueCount; ++i) - _buffer[(_tail+i) % _capacity] = source[offset+i]; - _tail += trueCount; - _tail %= _capacity; - _size += trueCount; - return trueCount; - } - - public bool Put(byte b) - { - if (Size == _capacity) // no room - return false; - _buffer[_tail++] = b; - _tail %= _capacity; - ++_size; - return true; - } - - public int Get(byte[] destination, int offset, int count) - { - int trueCount = Math.Min(count,Size); - for (int i = 0; i < trueCount; ++i) - destination[offset + i] = _buffer[(_head+i) % _capacity]; - _head += trueCount; - _head %= _capacity; - _size -= trueCount; - return trueCount; - } - - public int Get() - { - if (Size == 0) - return -1; - - int result = (int)_buffer[_head++ % _capacity]; - --_size; - return result; - } - - } -} +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Diagnostics; + +namespace DotZLib +{ + + /// + /// This class implements a circular buffer + /// + internal class CircularBuffer + { + #region Private data + private int _capacity; + private int _head; + private int _tail; + private int _size; + private byte[] _buffer; + #endregion + + public CircularBuffer(int capacity) + { + Debug.Assert( capacity > 0 ); + _buffer = new byte[capacity]; + _capacity = capacity; + _head = 0; + _tail = 0; + _size = 0; + } + + public int Size { get { return _size; } } + + public int Put(byte[] source, int offset, int count) + { + Debug.Assert( count > 0 ); + int trueCount = Math.Min(count, _capacity - Size); + for (int i = 0; i < trueCount; ++i) + _buffer[(_tail+i) % _capacity] = source[offset+i]; + _tail += trueCount; + _tail %= _capacity; + _size += trueCount; + return trueCount; + } + + public bool Put(byte b) + { + if (Size == _capacity) // no room + return false; + _buffer[_tail++] = b; + _tail %= _capacity; + ++_size; + return true; + } + + public int Get(byte[] destination, int offset, int count) + { + int trueCount = Math.Min(count,Size); + for (int i = 0; i < trueCount; ++i) + destination[offset + i] = _buffer[(_head+i) % _capacity]; + _head += trueCount; + _head %= _capacity; + _size -= trueCount; + return trueCount; + } + + public int Get() + { + if (Size == 0) + return -1; + + int result = (int)_buffer[_head++ % _capacity]; + --_size; + return result; + } + + } +} diff --git a/3party/zlib/contrib/dotzlib/DotZLib/CodecBase.cs b/3party/zlib/contrib/dotzlib/DotZLib/CodecBase.cs index 42e6da3a56..b0eb78a022 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/CodecBase.cs @@ -1,198 +1,198 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.Runtime.InteropServices; - -namespace DotZLib -{ - /// - /// Implements the common functionality needed for all s - /// - public abstract class CodecBase : Codec, IDisposable - { - - #region Data members - - /// - /// Instance of the internal zlib buffer structure that is - /// passed to all functions in the zlib dll - /// - internal ZStream _ztream = new ZStream(); - - /// - /// True if the object instance has been disposed, false otherwise - /// - protected bool _isDisposed = false; - - /// - /// The size of the internal buffers - /// - protected const int kBufferSize = 16384; - - private byte[] _outBuffer = new byte[kBufferSize]; - private byte[] _inBuffer = new byte[kBufferSize]; - - private GCHandle _hInput; - private GCHandle _hOutput; - - private uint _checksum = 0; - - #endregion - - /// - /// Initializes a new instance of the CodeBase class. - /// - public CodecBase() - { - try - { - _hInput = GCHandle.Alloc(_inBuffer, GCHandleType.Pinned); - _hOutput = GCHandle.Alloc(_outBuffer, GCHandleType.Pinned); - } - catch (Exception) - { - CleanUp(false); - throw; - } - } - - - #region Codec Members - - /// - /// Occurs when more processed data are available. - /// - public event DataAvailableHandler DataAvailable; - - /// - /// Fires the event - /// - protected void OnDataAvailable() - { - if (_ztream.total_out > 0) - { - if (DataAvailable != null) - DataAvailable( _outBuffer, 0, (int)_ztream.total_out); - resetOutput(); - } - } - - /// - /// Adds more data to the codec to be processed. - /// - /// Byte array containing the data to be added to the codec - /// Adding data may, or may not, raise the DataAvailable event - public void Add(byte[] data) - { - Add(data,0,data.Length); - } - - /// - /// Adds more data to the codec to be processed. - /// - /// Byte array containing the data to be added to the codec - /// The index of the first byte to add from data - /// The number of bytes to add - /// Adding data may, or may not, raise the DataAvailable event - /// This must be implemented by a derived class - public abstract void Add(byte[] data, int offset, int count); - - /// - /// Finishes up any pending data that needs to be processed and handled. - /// - /// This must be implemented by a derived class - public abstract void Finish(); - - /// - /// Gets the checksum of the data that has been added so far - /// - public uint Checksum { get { return _checksum; } } - - #endregion - - #region Destructor & IDisposable stuff - - /// - /// Destroys this instance - /// - ~CodecBase() - { - CleanUp(false); - } - - /// - /// Releases any unmanaged resources and calls the method of the derived class - /// - public void Dispose() - { - CleanUp(true); - } - - /// - /// Performs any codec specific cleanup - /// - /// This must be implemented by a derived class - protected abstract void CleanUp(); - - // performs the release of the handles and calls the dereived CleanUp() - private void CleanUp(bool isDisposing) - { - if (!_isDisposed) - { - CleanUp(); - if (_hInput.IsAllocated) - _hInput.Free(); - if (_hOutput.IsAllocated) - _hOutput.Free(); - - _isDisposed = true; - } - } - - - #endregion - - #region Helper methods - - /// - /// Copies a number of bytes to the internal codec buffer - ready for proccesing - /// - /// The byte array that contains the data to copy - /// The index of the first byte to copy - /// The number of bytes to copy from data - protected void copyInput(byte[] data, int startIndex, int count) - { - Array.Copy(data, startIndex, _inBuffer,0, count); - _ztream.next_in = _hInput.AddrOfPinnedObject(); - _ztream.total_in = 0; - _ztream.avail_in = (uint)count; - - } - - /// - /// Resets the internal output buffers to a known state - ready for processing - /// - protected void resetOutput() - { - _ztream.total_out = 0; - _ztream.avail_out = kBufferSize; - _ztream.next_out = _hOutput.AddrOfPinnedObject(); - } - - /// - /// Updates the running checksum property - /// - /// The new checksum value - protected void setChecksum(uint newSum) - { - _checksum = newSum; - } - #endregion - - } -} +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + /// + /// Implements the common functionality needed for all s + /// + public abstract class CodecBase : Codec, IDisposable + { + + #region Data members + + /// + /// Instance of the internal zlib buffer structure that is + /// passed to all functions in the zlib dll + /// + internal ZStream _ztream = new ZStream(); + + /// + /// True if the object instance has been disposed, false otherwise + /// + protected bool _isDisposed = false; + + /// + /// The size of the internal buffers + /// + protected const int kBufferSize = 16384; + + private byte[] _outBuffer = new byte[kBufferSize]; + private byte[] _inBuffer = new byte[kBufferSize]; + + private GCHandle _hInput; + private GCHandle _hOutput; + + private uint _checksum = 0; + + #endregion + + /// + /// Initializes a new instance of the CodeBase class. + /// + public CodecBase() + { + try + { + _hInput = GCHandle.Alloc(_inBuffer, GCHandleType.Pinned); + _hOutput = GCHandle.Alloc(_outBuffer, GCHandleType.Pinned); + } + catch (Exception) + { + CleanUp(false); + throw; + } + } + + + #region Codec Members + + /// + /// Occurs when more processed data are available. + /// + public event DataAvailableHandler DataAvailable; + + /// + /// Fires the event + /// + protected void OnDataAvailable() + { + if (_ztream.total_out > 0) + { + if (DataAvailable != null) + DataAvailable( _outBuffer, 0, (int)_ztream.total_out); + resetOutput(); + } + } + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// Adding data may, or may not, raise the DataAvailable event + public void Add(byte[] data) + { + Add(data,0,data.Length); + } + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + /// This must be implemented by a derived class + public abstract void Add(byte[] data, int offset, int count); + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + /// This must be implemented by a derived class + public abstract void Finish(); + + /// + /// Gets the checksum of the data that has been added so far + /// + public uint Checksum { get { return _checksum; } } + + #endregion + + #region Destructor & IDisposable stuff + + /// + /// Destroys this instance + /// + ~CodecBase() + { + CleanUp(false); + } + + /// + /// Releases any unmanaged resources and calls the method of the derived class + /// + public void Dispose() + { + CleanUp(true); + } + + /// + /// Performs any codec specific cleanup + /// + /// This must be implemented by a derived class + protected abstract void CleanUp(); + + // performs the release of the handles and calls the dereived CleanUp() + private void CleanUp(bool isDisposing) + { + if (!_isDisposed) + { + CleanUp(); + if (_hInput.IsAllocated) + _hInput.Free(); + if (_hOutput.IsAllocated) + _hOutput.Free(); + + _isDisposed = true; + } + } + + + #endregion + + #region Helper methods + + /// + /// Copies a number of bytes to the internal codec buffer - ready for proccesing + /// + /// The byte array that contains the data to copy + /// The index of the first byte to copy + /// The number of bytes to copy from data + protected void copyInput(byte[] data, int startIndex, int count) + { + Array.Copy(data, startIndex, _inBuffer,0, count); + _ztream.next_in = _hInput.AddrOfPinnedObject(); + _ztream.total_in = 0; + _ztream.avail_in = (uint)count; + + } + + /// + /// Resets the internal output buffers to a known state - ready for processing + /// + protected void resetOutput() + { + _ztream.total_out = 0; + _ztream.avail_out = kBufferSize; + _ztream.next_out = _hOutput.AddrOfPinnedObject(); + } + + /// + /// Updates the running checksum property + /// + /// The new checksum value + protected void setChecksum(uint newSum) + { + _checksum = newSum; + } + #endregion + + } +} diff --git a/3party/zlib/contrib/dotzlib/DotZLib/Deflater.cs b/3party/zlib/contrib/dotzlib/DotZLib/Deflater.cs index c2477925b6..9039f41f66 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/Deflater.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/Deflater.cs @@ -1,106 +1,106 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace DotZLib -{ - - /// - /// Implements a data compressor, using the deflate algorithm in the ZLib dll - /// - public sealed class Deflater : CodecBase - { - #region Dll imports - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - private static extern int deflateInit_(ref ZStream sz, int level, string vs, int size); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern int deflate(ref ZStream sz, int flush); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern int deflateReset(ref ZStream sz); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern int deflateEnd(ref ZStream sz); - #endregion - - /// - /// Constructs an new instance of the Deflater - /// - /// The compression level to use for this Deflater - public Deflater(CompressLevel level) : base() - { - int retval = deflateInit_(ref _ztream, (int)level, Info.Version, Marshal.SizeOf(_ztream)); - if (retval != 0) - throw new ZLibException(retval, "Could not initialize deflater"); - - resetOutput(); - } - - /// - /// Adds more data to the codec to be processed. - /// - /// Byte array containing the data to be added to the codec - /// The index of the first byte to add from data - /// The number of bytes to add - /// Adding data may, or may not, raise the DataAvailable event - public override void Add(byte[] data, int offset, int count) - { - if (data == null) throw new ArgumentNullException(); - if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); - if ((offset+count) > data.Length) throw new ArgumentException(); - - int total = count; - int inputIndex = offset; - int err = 0; - - while (err >= 0 && inputIndex < total) - { - copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize)); - while (err >= 0 && _ztream.avail_in > 0) - { - err = deflate(ref _ztream, (int)FlushTypes.None); - if (err == 0) - while (_ztream.avail_out == 0) - { - OnDataAvailable(); - err = deflate(ref _ztream, (int)FlushTypes.None); - } - inputIndex += (int)_ztream.total_in; - } - } - setChecksum( _ztream.adler ); - } - - - /// - /// Finishes up any pending data that needs to be processed and handled. - /// - public override void Finish() - { - int err; - do - { - err = deflate(ref _ztream, (int)FlushTypes.Finish); - OnDataAvailable(); - } - while (err == 0); - setChecksum( _ztream.adler ); - deflateReset(ref _ztream); - resetOutput(); - } - - /// - /// Closes the internal zlib deflate stream - /// - protected override void CleanUp() { deflateEnd(ref _ztream); } - - } -} +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + + /// + /// Implements a data compressor, using the deflate algorithm in the ZLib dll + /// + public sealed class Deflater : CodecBase + { + #region Dll imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] + private static extern int deflateInit_(ref ZStream sz, int level, string vs, int size); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int deflate(ref ZStream sz, int flush); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int deflateReset(ref ZStream sz); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int deflateEnd(ref ZStream sz); + #endregion + + /// + /// Constructs an new instance of the Deflater + /// + /// The compression level to use for this Deflater + public Deflater(CompressLevel level) : base() + { + int retval = deflateInit_(ref _ztream, (int)level, Info.Version, Marshal.SizeOf(_ztream)); + if (retval != 0) + throw new ZLibException(retval, "Could not initialize deflater"); + + resetOutput(); + } + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + public override void Add(byte[] data, int offset, int count) + { + if (data == null) throw new ArgumentNullException(); + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + + int total = count; + int inputIndex = offset; + int err = 0; + + while (err >= 0 && inputIndex < total) + { + copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize)); + while (err >= 0 && _ztream.avail_in > 0) + { + err = deflate(ref _ztream, (int)FlushTypes.None); + if (err == 0) + while (_ztream.avail_out == 0) + { + OnDataAvailable(); + err = deflate(ref _ztream, (int)FlushTypes.None); + } + inputIndex += (int)_ztream.total_in; + } + } + setChecksum( _ztream.adler ); + } + + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + public override void Finish() + { + int err; + do + { + err = deflate(ref _ztream, (int)FlushTypes.Finish); + OnDataAvailable(); + } + while (err == 0); + setChecksum( _ztream.adler ); + deflateReset(ref _ztream); + resetOutput(); + } + + /// + /// Closes the internal zlib deflate stream + /// + protected override void CleanUp() { deflateEnd(ref _ztream); } + + } +} diff --git a/3party/zlib/contrib/dotzlib/DotZLib/DotZLib.cs b/3party/zlib/contrib/dotzlib/DotZLib/DotZLib.cs index be184b4c71..90c7c3b380 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/DotZLib.cs @@ -1,288 +1,288 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; - - -namespace DotZLib -{ - - #region Internal types - - /// - /// Defines constants for the various flush types used with zlib - /// - internal enum FlushTypes - { - None, Partial, Sync, Full, Finish, Block - } - - #region ZStream structure - // internal mapping of the zlib zstream structure for marshalling - [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0, CharSet=CharSet.Ansi)] - internal struct ZStream - { - public IntPtr next_in; - public uint avail_in; - public uint total_in; - - public IntPtr next_out; - public uint avail_out; - public uint total_out; - - [MarshalAs(UnmanagedType.LPStr)] - string msg; - uint state; - - uint zalloc; - uint zfree; - uint opaque; - - int data_type; - public uint adler; - uint reserved; - } - - #endregion - - #endregion - - #region Public enums - /// - /// Defines constants for the available compression levels in zlib - /// - public enum CompressLevel : int - { - /// - /// The default compression level with a reasonable compromise between compression and speed - /// - Default = -1, - /// - /// No compression at all. The data are passed straight through. - /// - None = 0, - /// - /// The maximum compression rate available. - /// - Best = 9, - /// - /// The fastest available compression level. - /// - Fastest = 1 - } - #endregion - - #region Exception classes - /// - /// The exception that is thrown when an error occurs on the zlib dll - /// - public class ZLibException : ApplicationException - { - /// - /// Initializes a new instance of the class with a specified - /// error message and error code - /// - /// The zlib error code that caused the exception - /// A message that (hopefully) describes the error - public ZLibException(int errorCode, string msg) : base(String.Format("ZLib error {0} {1}", errorCode, msg)) - { - } - - /// - /// Initializes a new instance of the class with a specified - /// error code - /// - /// The zlib error code that caused the exception - public ZLibException(int errorCode) : base(String.Format("ZLib error {0}", errorCode)) - { - } - } - #endregion - - #region Interfaces - - /// - /// Declares methods and properties that enables a running checksum to be calculated - /// - public interface ChecksumGenerator - { - /// - /// Gets the current value of the checksum - /// - uint Value { get; } - - /// - /// Clears the current checksum to 0 - /// - void Reset(); - - /// - /// Updates the current checksum with an array of bytes - /// - /// The data to update the checksum with - void Update(byte[] data); - - /// - /// Updates the current checksum with part of an array of bytes - /// - /// The data to update the checksum with - /// Where in data to start updating - /// The number of bytes from data to use - /// The sum of offset and count is larger than the length of data - /// data is a null reference - /// Offset or count is negative. - void Update(byte[] data, int offset, int count); - - /// - /// Updates the current checksum with the data from a string - /// - /// The string to update the checksum with - /// The characters in the string are converted by the UTF-8 encoding - void Update(string data); - - /// - /// Updates the current checksum with the data from a string, using a specific encoding - /// - /// The string to update the checksum with - /// The encoding to use - void Update(string data, Encoding encoding); - } - - - /// - /// Represents the method that will be called from a codec when new data - /// are available. - /// - /// The byte array containing the processed data - /// The index of the first processed byte in data - /// The number of processed bytes available - /// On return from this method, the data may be overwritten, so grab it while you can. - /// You cannot assume that startIndex will be zero. - /// - public delegate void DataAvailableHandler(byte[] data, int startIndex, int count); - - /// - /// Declares methods and events for implementing compressors/decompressors - /// - public interface Codec - { - /// - /// Occurs when more processed data are available. - /// - event DataAvailableHandler DataAvailable; - - /// - /// Adds more data to the codec to be processed. - /// - /// Byte array containing the data to be added to the codec - /// Adding data may, or may not, raise the DataAvailable event - void Add(byte[] data); - - /// - /// Adds more data to the codec to be processed. - /// - /// Byte array containing the data to be added to the codec - /// The index of the first byte to add from data - /// The number of bytes to add - /// Adding data may, or may not, raise the DataAvailable event - void Add(byte[] data, int offset, int count); - - /// - /// Finishes up any pending data that needs to be processed and handled. - /// - void Finish(); - - /// - /// Gets the checksum of the data that has been added so far - /// - uint Checksum { get; } - - - } - - #endregion - - #region Classes - /// - /// Encapsulates general information about the ZLib library - /// - public class Info - { - #region DLL imports - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern uint zlibCompileFlags(); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern string zlibVersion(); - #endregion - - #region Private stuff - private uint _flags; - - // helper function that unpacks a bitsize mask - private static int bitSize(uint bits) - { - switch (bits) - { - case 0: return 16; - case 1: return 32; - case 2: return 64; - } - return -1; - } - #endregion - - /// - /// Constructs an instance of the Info class. - /// - public Info() - { - _flags = zlibCompileFlags(); - } - - /// - /// True if the library is compiled with debug info - /// - public bool HasDebugInfo { get { return 0 != (_flags & 0x100); } } - - /// - /// True if the library is compiled with assembly optimizations - /// - public bool UsesAssemblyCode { get { return 0 != (_flags & 0x200); } } - - /// - /// Gets the size of the unsigned int that was compiled into Zlib - /// - public int SizeOfUInt { get { return bitSize(_flags & 3); } } - - /// - /// Gets the size of the unsigned long that was compiled into Zlib - /// - public int SizeOfULong { get { return bitSize((_flags >> 2) & 3); } } - - /// - /// Gets the size of the pointers that were compiled into Zlib - /// - public int SizeOfPointer { get { return bitSize((_flags >> 4) & 3); } } - - /// - /// Gets the size of the z_off_t type that was compiled into Zlib - /// - public int SizeOfOffset { get { return bitSize((_flags >> 6) & 3); } } - - /// - /// Gets the version of ZLib as a string, e.g. "1.2.1" - /// - public static string Version { get { return zlibVersion(); } } - } - - #endregion - -} +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; + + +namespace DotZLib +{ + + #region Internal types + + /// + /// Defines constants for the various flush types used with zlib + /// + internal enum FlushTypes + { + None, Partial, Sync, Full, Finish, Block + } + + #region ZStream structure + // internal mapping of the zlib zstream structure for marshalling + [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0, CharSet=CharSet.Ansi)] + internal struct ZStream + { + public IntPtr next_in; + public uint avail_in; + public uint total_in; + + public IntPtr next_out; + public uint avail_out; + public uint total_out; + + [MarshalAs(UnmanagedType.LPStr)] + string msg; + uint state; + + uint zalloc; + uint zfree; + uint opaque; + + int data_type; + public uint adler; + uint reserved; + } + + #endregion + + #endregion + + #region Public enums + /// + /// Defines constants for the available compression levels in zlib + /// + public enum CompressLevel : int + { + /// + /// The default compression level with a reasonable compromise between compression and speed + /// + Default = -1, + /// + /// No compression at all. The data are passed straight through. + /// + None = 0, + /// + /// The maximum compression rate available. + /// + Best = 9, + /// + /// The fastest available compression level. + /// + Fastest = 1 + } + #endregion + + #region Exception classes + /// + /// The exception that is thrown when an error occurs on the zlib dll + /// + public class ZLibException : ApplicationException + { + /// + /// Initializes a new instance of the class with a specified + /// error message and error code + /// + /// The zlib error code that caused the exception + /// A message that (hopefully) describes the error + public ZLibException(int errorCode, string msg) : base(String.Format("ZLib error {0} {1}", errorCode, msg)) + { + } + + /// + /// Initializes a new instance of the class with a specified + /// error code + /// + /// The zlib error code that caused the exception + public ZLibException(int errorCode) : base(String.Format("ZLib error {0}", errorCode)) + { + } + } + #endregion + + #region Interfaces + + /// + /// Declares methods and properties that enables a running checksum to be calculated + /// + public interface ChecksumGenerator + { + /// + /// Gets the current value of the checksum + /// + uint Value { get; } + + /// + /// Clears the current checksum to 0 + /// + void Reset(); + + /// + /// Updates the current checksum with an array of bytes + /// + /// The data to update the checksum with + void Update(byte[] data); + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + void Update(byte[] data, int offset, int count); + + /// + /// Updates the current checksum with the data from a string + /// + /// The string to update the checksum with + /// The characters in the string are converted by the UTF-8 encoding + void Update(string data); + + /// + /// Updates the current checksum with the data from a string, using a specific encoding + /// + /// The string to update the checksum with + /// The encoding to use + void Update(string data, Encoding encoding); + } + + + /// + /// Represents the method that will be called from a codec when new data + /// are available. + /// + /// The byte array containing the processed data + /// The index of the first processed byte in data + /// The number of processed bytes available + /// On return from this method, the data may be overwritten, so grab it while you can. + /// You cannot assume that startIndex will be zero. + /// + public delegate void DataAvailableHandler(byte[] data, int startIndex, int count); + + /// + /// Declares methods and events for implementing compressors/decompressors + /// + public interface Codec + { + /// + /// Occurs when more processed data are available. + /// + event DataAvailableHandler DataAvailable; + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// Adding data may, or may not, raise the DataAvailable event + void Add(byte[] data); + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + void Add(byte[] data, int offset, int count); + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + void Finish(); + + /// + /// Gets the checksum of the data that has been added so far + /// + uint Checksum { get; } + + + } + + #endregion + + #region Classes + /// + /// Encapsulates general information about the ZLib library + /// + public class Info + { + #region DLL imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint zlibCompileFlags(); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern string zlibVersion(); + #endregion + + #region Private stuff + private uint _flags; + + // helper function that unpacks a bitsize mask + private static int bitSize(uint bits) + { + switch (bits) + { + case 0: return 16; + case 1: return 32; + case 2: return 64; + } + return -1; + } + #endregion + + /// + /// Constructs an instance of the Info class. + /// + public Info() + { + _flags = zlibCompileFlags(); + } + + /// + /// True if the library is compiled with debug info + /// + public bool HasDebugInfo { get { return 0 != (_flags & 0x100); } } + + /// + /// True if the library is compiled with assembly optimizations + /// + public bool UsesAssemblyCode { get { return 0 != (_flags & 0x200); } } + + /// + /// Gets the size of the unsigned int that was compiled into Zlib + /// + public int SizeOfUInt { get { return bitSize(_flags & 3); } } + + /// + /// Gets the size of the unsigned long that was compiled into Zlib + /// + public int SizeOfULong { get { return bitSize((_flags >> 2) & 3); } } + + /// + /// Gets the size of the pointers that were compiled into Zlib + /// + public int SizeOfPointer { get { return bitSize((_flags >> 4) & 3); } } + + /// + /// Gets the size of the z_off_t type that was compiled into Zlib + /// + public int SizeOfOffset { get { return bitSize((_flags >> 6) & 3); } } + + /// + /// Gets the version of ZLib as a string, e.g. "1.2.1" + /// + public static string Version { get { return zlibVersion(); } } + } + + #endregion + +} diff --git a/3party/zlib/contrib/dotzlib/DotZLib/Inflater.cs b/3party/zlib/contrib/dotzlib/DotZLib/Inflater.cs index 8ed5451d66..d295f26804 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/Inflater.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/Inflater.cs @@ -1,105 +1,105 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace DotZLib -{ - - /// - /// Implements a data decompressor, using the inflate algorithm in the ZLib dll - /// - public class Inflater : CodecBase - { - #region Dll imports - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - private static extern int inflateInit_(ref ZStream sz, string vs, int size); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern int inflate(ref ZStream sz, int flush); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern int inflateReset(ref ZStream sz); - - [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] - private static extern int inflateEnd(ref ZStream sz); - #endregion - - /// - /// Constructs an new instance of the Inflater - /// - public Inflater() : base() - { - int retval = inflateInit_(ref _ztream, Info.Version, Marshal.SizeOf(_ztream)); - if (retval != 0) - throw new ZLibException(retval, "Could not initialize inflater"); - - resetOutput(); - } - - - /// - /// Adds more data to the codec to be processed. - /// - /// Byte array containing the data to be added to the codec - /// The index of the first byte to add from data - /// The number of bytes to add - /// Adding data may, or may not, raise the DataAvailable event - public override void Add(byte[] data, int offset, int count) - { - if (data == null) throw new ArgumentNullException(); - if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); - if ((offset+count) > data.Length) throw new ArgumentException(); - - int total = count; - int inputIndex = offset; - int err = 0; - - while (err >= 0 && inputIndex < total) - { - copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize)); - err = inflate(ref _ztream, (int)FlushTypes.None); - if (err == 0) - while (_ztream.avail_out == 0) - { - OnDataAvailable(); - err = inflate(ref _ztream, (int)FlushTypes.None); - } - - inputIndex += (int)_ztream.total_in; - } - setChecksum( _ztream.adler ); - } - - - /// - /// Finishes up any pending data that needs to be processed and handled. - /// - public override void Finish() - { - int err; - do - { - err = inflate(ref _ztream, (int)FlushTypes.Finish); - OnDataAvailable(); - } - while (err == 0); - setChecksum( _ztream.adler ); - inflateReset(ref _ztream); - resetOutput(); - } - - /// - /// Closes the internal zlib inflate stream - /// - protected override void CleanUp() { inflateEnd(ref _ztream); } - - - } -} +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + + /// + /// Implements a data decompressor, using the inflate algorithm in the ZLib dll + /// + public class Inflater : CodecBase + { + #region Dll imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] + private static extern int inflateInit_(ref ZStream sz, string vs, int size); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int inflate(ref ZStream sz, int flush); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int inflateReset(ref ZStream sz); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int inflateEnd(ref ZStream sz); + #endregion + + /// + /// Constructs an new instance of the Inflater + /// + public Inflater() : base() + { + int retval = inflateInit_(ref _ztream, Info.Version, Marshal.SizeOf(_ztream)); + if (retval != 0) + throw new ZLibException(retval, "Could not initialize inflater"); + + resetOutput(); + } + + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + public override void Add(byte[] data, int offset, int count) + { + if (data == null) throw new ArgumentNullException(); + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + + int total = count; + int inputIndex = offset; + int err = 0; + + while (err >= 0 && inputIndex < total) + { + copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize)); + err = inflate(ref _ztream, (int)FlushTypes.None); + if (err == 0) + while (_ztream.avail_out == 0) + { + OnDataAvailable(); + err = inflate(ref _ztream, (int)FlushTypes.None); + } + + inputIndex += (int)_ztream.total_in; + } + setChecksum( _ztream.adler ); + } + + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + public override void Finish() + { + int err; + do + { + err = inflate(ref _ztream, (int)FlushTypes.Finish); + OnDataAvailable(); + } + while (err == 0); + setChecksum( _ztream.adler ); + inflateReset(ref _ztream); + resetOutput(); + } + + /// + /// Closes the internal zlib inflate stream + /// + protected override void CleanUp() { inflateEnd(ref _ztream); } + + + } +} diff --git a/3party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs b/3party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs index 3bbcc8cee6..528a0398e0 100644 --- a/3party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +++ b/3party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs @@ -1,274 +1,274 @@ -// -// © Copyright Henrik Ravn 2004 -// -// Use, modification and distribution are subject to the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -using System; -using System.Collections; -using System.IO; - -// uncomment the define below to include unit tests -//#define nunit -#if nunit -using NUnit.Framework; - -// Unit tests for the DotZLib class library -// ---------------------------------------- -// -// Use this with NUnit 2 from http://www.nunit.org -// - -namespace DotZLibTests -{ - using DotZLib; - - // helper methods - internal class Utils - { - public static bool byteArrEqual( byte[] lhs, byte[] rhs ) - { - if (lhs.Length != rhs.Length) - return false; - for (int i = lhs.Length-1; i >= 0; --i) - if (lhs[i] != rhs[i]) - return false; - return true; - } - - } - - - [TestFixture] - public class CircBufferTests - { - #region Circular buffer tests - [Test] - public void SinglePutGet() - { - CircularBuffer buf = new CircularBuffer(10); - Assert.AreEqual( 0, buf.Size ); - Assert.AreEqual( -1, buf.Get() ); - - Assert.IsTrue(buf.Put( 1 )); - Assert.AreEqual( 1, buf.Size ); - Assert.AreEqual( 1, buf.Get() ); - Assert.AreEqual( 0, buf.Size ); - Assert.AreEqual( -1, buf.Get() ); - } - - [Test] - public void BlockPutGet() - { - CircularBuffer buf = new CircularBuffer(10); - byte[] arr = {1,2,3,4,5,6,7,8,9,10}; - Assert.AreEqual( 10, buf.Put(arr,0,10) ); - Assert.AreEqual( 10, buf.Size ); - Assert.IsFalse( buf.Put(11) ); - Assert.AreEqual( 1, buf.Get() ); - Assert.IsTrue( buf.Put(11) ); - - byte[] arr2 = (byte[])arr.Clone(); - Assert.AreEqual( 9, buf.Get(arr2,1,9) ); - Assert.IsTrue( Utils.byteArrEqual(arr,arr2) ); - } - - #endregion - } - - [TestFixture] - public class ChecksumTests - { - #region CRC32 Tests - [Test] - public void CRC32_Null() - { - CRC32Checksum crc32 = new CRC32Checksum(); - Assert.AreEqual( 0, crc32.Value ); - - crc32 = new CRC32Checksum(1); - Assert.AreEqual( 1, crc32.Value ); - - crc32 = new CRC32Checksum(556); - Assert.AreEqual( 556, crc32.Value ); - } - - [Test] - public void CRC32_Data() - { - CRC32Checksum crc32 = new CRC32Checksum(); - byte[] data = { 1,2,3,4,5,6,7 }; - crc32.Update(data); - Assert.AreEqual( 0x70e46888, crc32.Value ); - - crc32 = new CRC32Checksum(); - crc32.Update("penguin"); - Assert.AreEqual( 0x0e5c1a120, crc32.Value ); - - crc32 = new CRC32Checksum(1); - crc32.Update("penguin"); - Assert.AreEqual(0x43b6aa94, crc32.Value); - - } - #endregion - - #region Adler tests - - [Test] - public void Adler_Null() - { - AdlerChecksum adler = new AdlerChecksum(); - Assert.AreEqual(0, adler.Value); - - adler = new AdlerChecksum(1); - Assert.AreEqual( 1, adler.Value ); - - adler = new AdlerChecksum(556); - Assert.AreEqual( 556, adler.Value ); - } - - [Test] - public void Adler_Data() - { - AdlerChecksum adler = new AdlerChecksum(1); - byte[] data = { 1,2,3,4,5,6,7 }; - adler.Update(data); - Assert.AreEqual( 0x5b001d, adler.Value ); - - adler = new AdlerChecksum(); - adler.Update("penguin"); - Assert.AreEqual(0x0bcf02f6, adler.Value ); - - adler = new AdlerChecksum(1); - adler.Update("penguin"); - Assert.AreEqual(0x0bd602f7, adler.Value); - - } - #endregion - } - - [TestFixture] - public class InfoTests - { - #region Info tests - [Test] - public void Info_Version() - { - Info info = new Info(); - Assert.AreEqual("1.2.5", Info.Version); - Assert.AreEqual(32, info.SizeOfUInt); - Assert.AreEqual(32, info.SizeOfULong); - Assert.AreEqual(32, info.SizeOfPointer); - Assert.AreEqual(32, info.SizeOfOffset); - } - #endregion - } - - [TestFixture] - public class DeflateInflateTests - { - #region Deflate tests - [Test] - public void Deflate_Init() - { - using (Deflater def = new Deflater(CompressLevel.Default)) - { - } - } - - private ArrayList compressedData = new ArrayList(); - private uint adler1; - - private ArrayList uncompressedData = new ArrayList(); - private uint adler2; - - public void CDataAvail(byte[] data, int startIndex, int count) - { - for (int i = 0; i < count; ++i) - compressedData.Add(data[i+startIndex]); - } - - [Test] - public void Deflate_Compress() - { - compressedData.Clear(); - - byte[] testData = new byte[35000]; - for (int i = 0; i < testData.Length; ++i) - testData[i] = 5; - - using (Deflater def = new Deflater((CompressLevel)5)) - { - def.DataAvailable += new DataAvailableHandler(CDataAvail); - def.Add(testData); - def.Finish(); - adler1 = def.Checksum; - } - } - #endregion - - #region Inflate tests - [Test] - public void Inflate_Init() - { - using (Inflater inf = new Inflater()) - { - } - } - - private void DDataAvail(byte[] data, int startIndex, int count) - { - for (int i = 0; i < count; ++i) - uncompressedData.Add(data[i+startIndex]); - } - - [Test] - public void Inflate_Expand() - { - uncompressedData.Clear(); - - using (Inflater inf = new Inflater()) - { - inf.DataAvailable += new DataAvailableHandler(DDataAvail); - inf.Add((byte[])compressedData.ToArray(typeof(byte))); - inf.Finish(); - adler2 = inf.Checksum; - } - Assert.AreEqual( adler1, adler2 ); - } - #endregion - } - - [TestFixture] - public class GZipStreamTests - { - #region GZipStream test - [Test] - public void GZipStream_WriteRead() - { - using (GZipStream gzOut = new GZipStream("gzstream.gz", CompressLevel.Best)) - { - BinaryWriter writer = new BinaryWriter(gzOut); - writer.Write("hi there"); - writer.Write(Math.PI); - writer.Write(42); - } - - using (GZipStream gzIn = new GZipStream("gzstream.gz")) - { - BinaryReader reader = new BinaryReader(gzIn); - string s = reader.ReadString(); - Assert.AreEqual("hi there",s); - double d = reader.ReadDouble(); - Assert.AreEqual(Math.PI, d); - int i = reader.ReadInt32(); - Assert.AreEqual(42,i); - } - - } - #endregion - } -} - -#endif +// +// © Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Collections; +using System.IO; + +// uncomment the define below to include unit tests +//#define nunit +#if nunit +using NUnit.Framework; + +// Unit tests for the DotZLib class library +// ---------------------------------------- +// +// Use this with NUnit 2 from http://www.nunit.org +// + +namespace DotZLibTests +{ + using DotZLib; + + // helper methods + internal class Utils + { + public static bool byteArrEqual( byte[] lhs, byte[] rhs ) + { + if (lhs.Length != rhs.Length) + return false; + for (int i = lhs.Length-1; i >= 0; --i) + if (lhs[i] != rhs[i]) + return false; + return true; + } + + } + + + [TestFixture] + public class CircBufferTests + { + #region Circular buffer tests + [Test] + public void SinglePutGet() + { + CircularBuffer buf = new CircularBuffer(10); + Assert.AreEqual( 0, buf.Size ); + Assert.AreEqual( -1, buf.Get() ); + + Assert.IsTrue(buf.Put( 1 )); + Assert.AreEqual( 1, buf.Size ); + Assert.AreEqual( 1, buf.Get() ); + Assert.AreEqual( 0, buf.Size ); + Assert.AreEqual( -1, buf.Get() ); + } + + [Test] + public void BlockPutGet() + { + CircularBuffer buf = new CircularBuffer(10); + byte[] arr = {1,2,3,4,5,6,7,8,9,10}; + Assert.AreEqual( 10, buf.Put(arr,0,10) ); + Assert.AreEqual( 10, buf.Size ); + Assert.IsFalse( buf.Put(11) ); + Assert.AreEqual( 1, buf.Get() ); + Assert.IsTrue( buf.Put(11) ); + + byte[] arr2 = (byte[])arr.Clone(); + Assert.AreEqual( 9, buf.Get(arr2,1,9) ); + Assert.IsTrue( Utils.byteArrEqual(arr,arr2) ); + } + + #endregion + } + + [TestFixture] + public class ChecksumTests + { + #region CRC32 Tests + [Test] + public void CRC32_Null() + { + CRC32Checksum crc32 = new CRC32Checksum(); + Assert.AreEqual( 0, crc32.Value ); + + crc32 = new CRC32Checksum(1); + Assert.AreEqual( 1, crc32.Value ); + + crc32 = new CRC32Checksum(556); + Assert.AreEqual( 556, crc32.Value ); + } + + [Test] + public void CRC32_Data() + { + CRC32Checksum crc32 = new CRC32Checksum(); + byte[] data = { 1,2,3,4,5,6,7 }; + crc32.Update(data); + Assert.AreEqual( 0x70e46888, crc32.Value ); + + crc32 = new CRC32Checksum(); + crc32.Update("penguin"); + Assert.AreEqual( 0x0e5c1a120, crc32.Value ); + + crc32 = new CRC32Checksum(1); + crc32.Update("penguin"); + Assert.AreEqual(0x43b6aa94, crc32.Value); + + } + #endregion + + #region Adler tests + + [Test] + public void Adler_Null() + { + AdlerChecksum adler = new AdlerChecksum(); + Assert.AreEqual(0, adler.Value); + + adler = new AdlerChecksum(1); + Assert.AreEqual( 1, adler.Value ); + + adler = new AdlerChecksum(556); + Assert.AreEqual( 556, adler.Value ); + } + + [Test] + public void Adler_Data() + { + AdlerChecksum adler = new AdlerChecksum(1); + byte[] data = { 1,2,3,4,5,6,7 }; + adler.Update(data); + Assert.AreEqual( 0x5b001d, adler.Value ); + + adler = new AdlerChecksum(); + adler.Update("penguin"); + Assert.AreEqual(0x0bcf02f6, adler.Value ); + + adler = new AdlerChecksum(1); + adler.Update("penguin"); + Assert.AreEqual(0x0bd602f7, adler.Value); + + } + #endregion + } + + [TestFixture] + public class InfoTests + { + #region Info tests + [Test] + public void Info_Version() + { + Info info = new Info(); + Assert.AreEqual("1.2.5", Info.Version); + Assert.AreEqual(32, info.SizeOfUInt); + Assert.AreEqual(32, info.SizeOfULong); + Assert.AreEqual(32, info.SizeOfPointer); + Assert.AreEqual(32, info.SizeOfOffset); + } + #endregion + } + + [TestFixture] + public class DeflateInflateTests + { + #region Deflate tests + [Test] + public void Deflate_Init() + { + using (Deflater def = new Deflater(CompressLevel.Default)) + { + } + } + + private ArrayList compressedData = new ArrayList(); + private uint adler1; + + private ArrayList uncompressedData = new ArrayList(); + private uint adler2; + + public void CDataAvail(byte[] data, int startIndex, int count) + { + for (int i = 0; i < count; ++i) + compressedData.Add(data[i+startIndex]); + } + + [Test] + public void Deflate_Compress() + { + compressedData.Clear(); + + byte[] testData = new byte[35000]; + for (int i = 0; i < testData.Length; ++i) + testData[i] = 5; + + using (Deflater def = new Deflater((CompressLevel)5)) + { + def.DataAvailable += new DataAvailableHandler(CDataAvail); + def.Add(testData); + def.Finish(); + adler1 = def.Checksum; + } + } + #endregion + + #region Inflate tests + [Test] + public void Inflate_Init() + { + using (Inflater inf = new Inflater()) + { + } + } + + private void DDataAvail(byte[] data, int startIndex, int count) + { + for (int i = 0; i < count; ++i) + uncompressedData.Add(data[i+startIndex]); + } + + [Test] + public void Inflate_Expand() + { + uncompressedData.Clear(); + + using (Inflater inf = new Inflater()) + { + inf.DataAvailable += new DataAvailableHandler(DDataAvail); + inf.Add((byte[])compressedData.ToArray(typeof(byte))); + inf.Finish(); + adler2 = inf.Checksum; + } + Assert.AreEqual( adler1, adler2 ); + } + #endregion + } + + [TestFixture] + public class GZipStreamTests + { + #region GZipStream test + [Test] + public void GZipStream_WriteRead() + { + using (GZipStream gzOut = new GZipStream("gzstream.gz", CompressLevel.Best)) + { + BinaryWriter writer = new BinaryWriter(gzOut); + writer.Write("hi there"); + writer.Write(Math.PI); + writer.Write(42); + } + + using (GZipStream gzIn = new GZipStream("gzstream.gz")) + { + BinaryReader reader = new BinaryReader(gzIn); + string s = reader.ReadString(); + Assert.AreEqual("hi there",s); + double d = reader.ReadDouble(); + Assert.AreEqual(Math.PI, d); + int i = reader.ReadInt32(); + Assert.AreEqual(42,i); + } + + } + #endregion + } +} + +#endif diff --git a/3party/zlib/contrib/dotzlib/LICENSE_1_0.txt b/3party/zlib/contrib/dotzlib/LICENSE_1_0.txt index 30aac2cf47..127a5bc39b 100644 --- a/3party/zlib/contrib/dotzlib/LICENSE_1_0.txt +++ b/3party/zlib/contrib/dotzlib/LICENSE_1_0.txt @@ -1,23 +1,23 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/3party/zlib/contrib/masmx64/gvmat64.asm b/3party/zlib/contrib/masmx64/gvmat64.asm index 9879c28b90..c1817f1be9 100644 --- a/3party/zlib/contrib/masmx64/gvmat64.asm +++ b/3party/zlib/contrib/masmx64/gvmat64.asm @@ -1,553 +1,553 @@ -;uInt longest_match_x64( -; deflate_state *s, -; IPos cur_match); /* current match */ - -; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64 -; (AMD64 on Athlon 64, Opteron, Phenom -; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7) -; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant. -; -; File written by Gilles Vollant, by converting to assembly the longest_match -; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. -; -; and by taking inspiration on asm686 with masm, optimised assembly code -; from Brian Raiter, written 1998 -; -; This software is provided 'as-is', without any express or implied -; warranty. In no event will the authors be held liable for any damages -; arising from the use of this software. -; -; Permission is granted to anyone to use this software for any purpose, -; including commercial applications, and to alter it and redistribute it -; freely, subject to the following restrictions: -; -; 1. The origin of this software must not be misrepresented; you must not -; claim that you wrote the original software. If you use this software -; in a product, an acknowledgment in the product documentation would be -; appreciated but is not required. -; 2. Altered source versions must be plainly marked as such, and must not be -; misrepresented as being the original software -; 3. This notice may not be removed or altered from any source distribution. -; -; -; -; http://www.zlib.net -; http://www.winimage.com/zLibDll -; http://www.muppetlabs.com/~breadbox/software/assembly.html -; -; to compile this file for infozip Zip, I use option: -; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm -; -; to compile this file for zLib, I use option: -; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm -; Be carrefull to adapt zlib1222add below to your version of zLib -; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change -; value of zlib1222add later) -; -; This file compile with Microsoft Macro Assembler (x64) for AMD64 -; -; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK -; -; (you can get Windows WDK with ml64 for AMD64 from -; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) -; - - -;uInt longest_match(s, cur_match) -; deflate_state *s; -; IPos cur_match; /* current match */ -.code -longest_match PROC - - -;LocalVarsSize equ 88 - LocalVarsSize equ 72 - -; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12 -; free register : r14,r15 -; register can be saved : rsp - - chainlenwmask equ rsp + 8 - LocalVarsSize ; high word: current chain len - ; low word: s->wmask -;window equ rsp + xx - LocalVarsSize ; local copy of s->window ; stored in r10 -;windowbestlen equ rsp + xx - LocalVarsSize ; s->window + bestlen , use r10+r11 -;scanstart equ rsp + xx - LocalVarsSize ; first two bytes of string ; stored in r12w -;scanend equ rsp + xx - LocalVarsSize ; last two bytes of string use ebx -;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13 -;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d -;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9 -IFDEF INFOZIP -ELSE - nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size -ENDIF - -save_rdi equ rsp + 24 - LocalVarsSize -save_rsi equ rsp + 32 - LocalVarsSize -save_rbx equ rsp + 40 - LocalVarsSize -save_rbp equ rsp + 48 - LocalVarsSize -save_r12 equ rsp + 56 - LocalVarsSize -save_r13 equ rsp + 64 - LocalVarsSize -;save_r14 equ rsp + 72 - LocalVarsSize -;save_r15 equ rsp + 80 - LocalVarsSize - - -; summary of register usage -; scanend ebx -; scanendw bx -; chainlenwmask edx -; curmatch rsi -; curmatchd esi -; windowbestlen r8 -; scanalign r9 -; scanalignd r9d -; window r10 -; bestlen r11 -; bestlend r11d -; scanstart r12d -; scanstartw r12w -; scan r13 -; nicematch r14d -; limit r15 -; limitd r15d -; prev rcx - -; all the +4 offsets are due to the addition of pending_buf_size (in zlib -; in the deflate_state structure since the asm code was first written -; (if you compile with zlib 1.0.4 or older, remove the +4). -; Note : these value are good with a 8 bytes boundary pack structure - - - MAX_MATCH equ 258 - MIN_MATCH equ 3 - MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) - - -;;; Offsets for fields in the deflate_state structure. These numbers -;;; are calculated from the definition of deflate_state, with the -;;; assumption that the compiler will dword-align the fields. (Thus, -;;; changing the definition of deflate_state could easily cause this -;;; program to crash horribly, without so much as a warning at -;;; compile time. Sigh.) - -; all the +zlib1222add offsets are due to the addition of fields -; in zlib in the deflate_state structure since the asm code was first written -; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). -; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). -; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). - - -IFDEF INFOZIP - -_DATA SEGMENT -COMM window_size:DWORD -; WMask ; 7fff -COMM window:BYTE:010040H -COMM prev:WORD:08000H -; MatchLen : unused -; PrevMatch : unused -COMM strstart:DWORD -COMM match_start:DWORD -; Lookahead : ignore -COMM prev_length:DWORD ; PrevLen -COMM max_chain_length:DWORD -COMM good_match:DWORD -COMM nice_match:DWORD -prev_ad equ OFFSET prev -window_ad equ OFFSET window -nicematch equ nice_match -_DATA ENDS -WMask equ 07fffh - -ELSE - - IFNDEF zlib1222add - zlib1222add equ 8 - ENDIF -dsWSize equ 56+zlib1222add+(zlib1222add/2) -dsWMask equ 64+zlib1222add+(zlib1222add/2) -dsWindow equ 72+zlib1222add -dsPrev equ 88+zlib1222add -dsMatchLen equ 128+zlib1222add -dsPrevMatch equ 132+zlib1222add -dsStrStart equ 140+zlib1222add -dsMatchStart equ 144+zlib1222add -dsLookahead equ 148+zlib1222add -dsPrevLen equ 152+zlib1222add -dsMaxChainLen equ 156+zlib1222add -dsGoodMatch equ 172+zlib1222add -dsNiceMatch equ 176+zlib1222add - -window_size equ [ rcx + dsWSize] -WMask equ [ rcx + dsWMask] -window_ad equ [ rcx + dsWindow] -prev_ad equ [ rcx + dsPrev] -strstart equ [ rcx + dsStrStart] -match_start equ [ rcx + dsMatchStart] -Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip -prev_length equ [ rcx + dsPrevLen] -max_chain_length equ [ rcx + dsMaxChainLen] -good_match equ [ rcx + dsGoodMatch] -nice_match equ [ rcx + dsNiceMatch] -ENDIF - -; parameter 1 in r8(deflate state s), param 2 in rdx (cur match) - -; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and -; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp -; -; All registers must be preserved across the call, except for -; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch. - - - -;;; Save registers that the compiler may be using, and adjust esp to -;;; make room for our stack frame. - - -;;; Retrieve the function arguments. r8d will hold cur_match -;;; throughout the entire function. edx will hold the pointer to the -;;; deflate_state structure during the function's setup (before -;;; entering the main loop. - -; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match) - -; this clear high 32 bits of r8, which can be garbage in both r8 and rdx - - mov [save_rdi],rdi - mov [save_rsi],rsi - mov [save_rbx],rbx - mov [save_rbp],rbp -IFDEF INFOZIP - mov r8d,ecx -ELSE - mov r8d,edx -ENDIF - mov [save_r12],r12 - mov [save_r13],r13 -; mov [save_r14],r14 -; mov [save_r15],r15 - - -;;; uInt wmask = s->w_mask; -;;; unsigned chain_length = s->max_chain_length; -;;; if (s->prev_length >= s->good_match) { -;;; chain_length >>= 2; -;;; } - - mov edi, prev_length - mov esi, good_match - mov eax, WMask - mov ebx, max_chain_length - cmp edi, esi - jl LastMatchGood - shr ebx, 2 -LastMatchGood: - -;;; chainlen is decremented once beforehand so that the function can -;;; use the sign flag instead of the zero flag for the exit test. -;;; It is then shifted into the high word, to make room for the wmask -;;; value, which it will always accompany. - - dec ebx - shl ebx, 16 - or ebx, eax - -;;; on zlib only -;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - -IFDEF INFOZIP - mov [chainlenwmask], ebx -; on infozip nice_match = [nice_match] -ELSE - mov eax, nice_match - mov [chainlenwmask], ebx - mov r10d, Lookahead - cmp r10d, eax - cmovnl r10d, eax - mov [nicematch],r10d -ENDIF - -;;; register Bytef *scan = s->window + s->strstart; - mov r10, window_ad - mov ebp, strstart - lea r13, [r10 + rbp] - -;;; Determine how many bytes the scan ptr is off from being -;;; dword-aligned. - - mov r9,r13 - neg r13 - and r13,3 - -;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? -;;; s->strstart - (IPos)MAX_DIST(s) : NIL; -IFDEF INFOZIP - mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1)) -ELSE - mov eax, window_size - sub eax, MIN_LOOKAHEAD -ENDIF - xor edi,edi - sub ebp, eax - - mov r11d, prev_length - - cmovng ebp,edi - -;;; int best_len = s->prev_length; - - -;;; Store the sum of s->window + best_len in esi locally, and in esi. - - lea rsi,[r10+r11] - -;;; register ush scan_start = *(ushf*)scan; -;;; register ush scan_end = *(ushf*)(scan+best_len-1); -;;; Posf *prev = s->prev; - - movzx r12d,word ptr [r9] - movzx ebx, word ptr [r9 + r11 - 1] - - mov rdi, prev_ad - -;;; Jump into the main loop. - - mov edx, [chainlenwmask] - - cmp bx,word ptr [rsi + r8 - 1] - jz LookupLoopIsZero - -LookupLoop1: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry1: - cmp bx,word ptr [rsi + r8 - 1] - jz LookupLoopIsZero - -LookupLoop2: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry2: - cmp bx,word ptr [rsi + r8 - 1] - jz LookupLoopIsZero - -LookupLoop4: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry4: - - cmp bx,word ptr [rsi + r8 - 1] - jnz LookupLoop1 - jmp LookupLoopIsZero - - -;;; do { -;;; match = s->window + cur_match; -;;; if (*(ushf*)(match+best_len-1) != scan_end || -;;; *(ushf*)match != scan_start) continue; -;;; [...] -;;; } while ((cur_match = prev[cur_match & wmask]) > limit -;;; && --chain_length != 0); -;;; -;;; Here is the inner loop of the function. The function will spend the -;;; majority of its time in this loop, and majority of that time will -;;; be spent in the first ten instructions. -;;; -;;; Within this loop: -;;; ebx = scanend -;;; r8d = curmatch -;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) -;;; esi = windowbestlen - i.e., (window + bestlen) -;;; edi = prev -;;; ebp = limit - -LookupLoop: - and r8d, edx - - movzx r8d, word ptr [rdi + r8*2] - cmp r8d, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow - -LoopEntry: - - cmp bx,word ptr [rsi + r8 - 1] - jnz LookupLoop1 -LookupLoopIsZero: - cmp r12w, word ptr [r10 + r8] - jnz LookupLoop1 - - -;;; Store the current value of chainlen. - mov [chainlenwmask], edx - -;;; Point edi to the string under scrutiny, and esi to the string we -;;; are hoping to match it up with. In actuality, esi and edi are -;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is -;;; initialized to -(MAX_MATCH_8 - scanalign). - - lea rsi,[r8+r10] - mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8) - lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8] - lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8] - - prefetcht1 [rsi+rdx] - prefetcht1 [rdi+rdx] - - -;;; Test the strings for equality, 8 bytes at a time. At the end, -;;; adjust rdx so that it is offset to the exact byte that mismatched. -;;; -;;; We already know at this point that the first three bytes of the -;;; strings match each other, and they can be safely passed over before -;;; starting the compare loop. So what this code does is skip over 0-3 -;;; bytes, as much as necessary in order to dword-align the edi -;;; pointer. (rsi will still be misaligned three times out of four.) -;;; -;;; It should be confessed that this loop usually does not represent -;;; much of the total running time. Replacing it with a more -;;; straightforward "rep cmpsb" would not drastically degrade -;;; performance. - - -LoopCmps: - mov rax, [rsi + rdx] - xor rax, [rdi + rdx] - jnz LeaveLoopCmps - - mov rax, [rsi + rdx + 8] - xor rax, [rdi + rdx + 8] - jnz LeaveLoopCmps8 - - - mov rax, [rsi + rdx + 8+8] - xor rax, [rdi + rdx + 8+8] - jnz LeaveLoopCmps16 - - add rdx,8+8+8 - - jnz short LoopCmps - jmp short LenMaximum -LeaveLoopCmps16: add rdx,8 -LeaveLoopCmps8: add rdx,8 -LeaveLoopCmps: - - test eax, 0000FFFFh - jnz LenLower - - test eax,0ffffffffh - - jnz LenLower32 - - add rdx,4 - shr rax,32 - or ax,ax - jnz LenLower - -LenLower32: - shr eax,16 - add rdx,2 -LenLower: sub al, 1 - adc rdx, 0 -;;; Calculate the length of the match. If it is longer than MAX_MATCH, -;;; then automatically accept it as the best possible match and leave. - - lea rax, [rdi + rdx] - sub rax, r9 - cmp eax, MAX_MATCH - jge LenMaximum - -;;; If the length of the match is not longer than the best match we -;;; have so far, then forget it and return to the lookup loop. -;/////////////////////////////////// - - cmp eax, r11d - jg LongerMatch - - lea rsi,[r10+r11] - - mov rdi, prev_ad - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; s->match_start = cur_match; -;;; best_len = len; -;;; if (len >= nice_match) break; -;;; scan_end = *(ushf*)(scan+best_len-1); - -LongerMatch: - mov r11d, eax - mov match_start, r8d - cmp eax, [nicematch] - jge LeaveNow - - lea rsi,[r10+rax] - - movzx ebx, word ptr [r9 + rax - 1] - mov rdi, prev_ad - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; Accept the current string, with the maximum possible length. - -LenMaximum: - mov r11d,MAX_MATCH - mov match_start, r8d - -;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; -;;; return s->lookahead; - -LeaveNow: -IFDEF INFOZIP - mov eax,r11d -ELSE - mov eax, Lookahead - cmp r11d, eax - cmovng eax, r11d -ENDIF - -;;; Restore the stack and return from whence we came. - - - mov rsi,[save_rsi] - mov rdi,[save_rdi] - mov rbx,[save_rbx] - mov rbp,[save_rbp] - mov r12,[save_r12] - mov r13,[save_r13] -; mov r14,[save_r14] -; mov r15,[save_r15] - - - ret 0 -; please don't remove this string ! -; Your can freely use gvmat64 in any free or commercial app -; but it is far better don't remove the string in the binary! - db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 -longest_match ENDP - -match_init PROC - ret 0 -match_init ENDP - - -END +;uInt longest_match_x64( +; deflate_state *s, +; IPos cur_match); /* current match */ + +; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64 +; (AMD64 on Athlon 64, Opteron, Phenom +; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7) +; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant. +; +; File written by Gilles Vollant, by converting to assembly the longest_match +; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. +; +; and by taking inspiration on asm686 with masm, optimised assembly code +; from Brian Raiter, written 1998 +; +; This software is provided 'as-is', without any express or implied +; warranty. In no event will the authors be held liable for any damages +; arising from the use of this software. +; +; Permission is granted to anyone to use this software for any purpose, +; including commercial applications, and to alter it and redistribute it +; freely, subject to the following restrictions: +; +; 1. The origin of this software must not be misrepresented; you must not +; claim that you wrote the original software. If you use this software +; in a product, an acknowledgment in the product documentation would be +; appreciated but is not required. +; 2. Altered source versions must be plainly marked as such, and must not be +; misrepresented as being the original software +; 3. This notice may not be removed or altered from any source distribution. +; +; +; +; http://www.zlib.net +; http://www.winimage.com/zLibDll +; http://www.muppetlabs.com/~breadbox/software/assembly.html +; +; to compile this file for infozip Zip, I use option: +; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm +; +; to compile this file for zLib, I use option: +; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm +; Be carrefull to adapt zlib1222add below to your version of zLib +; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change +; value of zlib1222add later) +; +; This file compile with Microsoft Macro Assembler (x64) for AMD64 +; +; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK +; +; (you can get Windows WDK with ml64 for AMD64 from +; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) +; + + +;uInt longest_match(s, cur_match) +; deflate_state *s; +; IPos cur_match; /* current match */ +.code +longest_match PROC + + +;LocalVarsSize equ 88 + LocalVarsSize equ 72 + +; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12 +; free register : r14,r15 +; register can be saved : rsp + + chainlenwmask equ rsp + 8 - LocalVarsSize ; high word: current chain len + ; low word: s->wmask +;window equ rsp + xx - LocalVarsSize ; local copy of s->window ; stored in r10 +;windowbestlen equ rsp + xx - LocalVarsSize ; s->window + bestlen , use r10+r11 +;scanstart equ rsp + xx - LocalVarsSize ; first two bytes of string ; stored in r12w +;scanend equ rsp + xx - LocalVarsSize ; last two bytes of string use ebx +;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13 +;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d +;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9 +IFDEF INFOZIP +ELSE + nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size +ENDIF + +save_rdi equ rsp + 24 - LocalVarsSize +save_rsi equ rsp + 32 - LocalVarsSize +save_rbx equ rsp + 40 - LocalVarsSize +save_rbp equ rsp + 48 - LocalVarsSize +save_r12 equ rsp + 56 - LocalVarsSize +save_r13 equ rsp + 64 - LocalVarsSize +;save_r14 equ rsp + 72 - LocalVarsSize +;save_r15 equ rsp + 80 - LocalVarsSize + + +; summary of register usage +; scanend ebx +; scanendw bx +; chainlenwmask edx +; curmatch rsi +; curmatchd esi +; windowbestlen r8 +; scanalign r9 +; scanalignd r9d +; window r10 +; bestlen r11 +; bestlend r11d +; scanstart r12d +; scanstartw r12w +; scan r13 +; nicematch r14d +; limit r15 +; limitd r15d +; prev rcx + +; all the +4 offsets are due to the addition of pending_buf_size (in zlib +; in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, remove the +4). +; Note : these value are good with a 8 bytes boundary pack structure + + + MAX_MATCH equ 258 + MIN_MATCH equ 3 + MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) + + +;;; Offsets for fields in the deflate_state structure. These numbers +;;; are calculated from the definition of deflate_state, with the +;;; assumption that the compiler will dword-align the fields. (Thus, +;;; changing the definition of deflate_state could easily cause this +;;; program to crash horribly, without so much as a warning at +;;; compile time. Sigh.) + +; all the +zlib1222add offsets are due to the addition of fields +; in zlib in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). +; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). +; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). + + +IFDEF INFOZIP + +_DATA SEGMENT +COMM window_size:DWORD +; WMask ; 7fff +COMM window:BYTE:010040H +COMM prev:WORD:08000H +; MatchLen : unused +; PrevMatch : unused +COMM strstart:DWORD +COMM match_start:DWORD +; Lookahead : ignore +COMM prev_length:DWORD ; PrevLen +COMM max_chain_length:DWORD +COMM good_match:DWORD +COMM nice_match:DWORD +prev_ad equ OFFSET prev +window_ad equ OFFSET window +nicematch equ nice_match +_DATA ENDS +WMask equ 07fffh + +ELSE + + IFNDEF zlib1222add + zlib1222add equ 8 + ENDIF +dsWSize equ 56+zlib1222add+(zlib1222add/2) +dsWMask equ 64+zlib1222add+(zlib1222add/2) +dsWindow equ 72+zlib1222add +dsPrev equ 88+zlib1222add +dsMatchLen equ 128+zlib1222add +dsPrevMatch equ 132+zlib1222add +dsStrStart equ 140+zlib1222add +dsMatchStart equ 144+zlib1222add +dsLookahead equ 148+zlib1222add +dsPrevLen equ 152+zlib1222add +dsMaxChainLen equ 156+zlib1222add +dsGoodMatch equ 172+zlib1222add +dsNiceMatch equ 176+zlib1222add + +window_size equ [ rcx + dsWSize] +WMask equ [ rcx + dsWMask] +window_ad equ [ rcx + dsWindow] +prev_ad equ [ rcx + dsPrev] +strstart equ [ rcx + dsStrStart] +match_start equ [ rcx + dsMatchStart] +Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip +prev_length equ [ rcx + dsPrevLen] +max_chain_length equ [ rcx + dsMaxChainLen] +good_match equ [ rcx + dsGoodMatch] +nice_match equ [ rcx + dsNiceMatch] +ENDIF + +; parameter 1 in r8(deflate state s), param 2 in rdx (cur match) + +; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and +; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp +; +; All registers must be preserved across the call, except for +; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch. + + + +;;; Save registers that the compiler may be using, and adjust esp to +;;; make room for our stack frame. + + +;;; Retrieve the function arguments. r8d will hold cur_match +;;; throughout the entire function. edx will hold the pointer to the +;;; deflate_state structure during the function's setup (before +;;; entering the main loop. + +; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match) + +; this clear high 32 bits of r8, which can be garbage in both r8 and rdx + + mov [save_rdi],rdi + mov [save_rsi],rsi + mov [save_rbx],rbx + mov [save_rbp],rbp +IFDEF INFOZIP + mov r8d,ecx +ELSE + mov r8d,edx +ENDIF + mov [save_r12],r12 + mov [save_r13],r13 +; mov [save_r14],r14 +; mov [save_r15],r15 + + +;;; uInt wmask = s->w_mask; +;;; unsigned chain_length = s->max_chain_length; +;;; if (s->prev_length >= s->good_match) { +;;; chain_length >>= 2; +;;; } + + mov edi, prev_length + mov esi, good_match + mov eax, WMask + mov ebx, max_chain_length + cmp edi, esi + jl LastMatchGood + shr ebx, 2 +LastMatchGood: + +;;; chainlen is decremented once beforehand so that the function can +;;; use the sign flag instead of the zero flag for the exit test. +;;; It is then shifted into the high word, to make room for the wmask +;;; value, which it will always accompany. + + dec ebx + shl ebx, 16 + or ebx, eax + +;;; on zlib only +;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + +IFDEF INFOZIP + mov [chainlenwmask], ebx +; on infozip nice_match = [nice_match] +ELSE + mov eax, nice_match + mov [chainlenwmask], ebx + mov r10d, Lookahead + cmp r10d, eax + cmovnl r10d, eax + mov [nicematch],r10d +ENDIF + +;;; register Bytef *scan = s->window + s->strstart; + mov r10, window_ad + mov ebp, strstart + lea r13, [r10 + rbp] + +;;; Determine how many bytes the scan ptr is off from being +;;; dword-aligned. + + mov r9,r13 + neg r13 + and r13,3 + +;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? +;;; s->strstart - (IPos)MAX_DIST(s) : NIL; +IFDEF INFOZIP + mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1)) +ELSE + mov eax, window_size + sub eax, MIN_LOOKAHEAD +ENDIF + xor edi,edi + sub ebp, eax + + mov r11d, prev_length + + cmovng ebp,edi + +;;; int best_len = s->prev_length; + + +;;; Store the sum of s->window + best_len in esi locally, and in esi. + + lea rsi,[r10+r11] + +;;; register ush scan_start = *(ushf*)scan; +;;; register ush scan_end = *(ushf*)(scan+best_len-1); +;;; Posf *prev = s->prev; + + movzx r12d,word ptr [r9] + movzx ebx, word ptr [r9 + r11 - 1] + + mov rdi, prev_ad + +;;; Jump into the main loop. + + mov edx, [chainlenwmask] + + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + +LookupLoop1: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry1: + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + +LookupLoop2: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry2: + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + +LookupLoop4: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry4: + + cmp bx,word ptr [rsi + r8 - 1] + jnz LookupLoop1 + jmp LookupLoopIsZero + + +;;; do { +;;; match = s->window + cur_match; +;;; if (*(ushf*)(match+best_len-1) != scan_end || +;;; *(ushf*)match != scan_start) continue; +;;; [...] +;;; } while ((cur_match = prev[cur_match & wmask]) > limit +;;; && --chain_length != 0); +;;; +;;; Here is the inner loop of the function. The function will spend the +;;; majority of its time in this loop, and majority of that time will +;;; be spent in the first ten instructions. +;;; +;;; Within this loop: +;;; ebx = scanend +;;; r8d = curmatch +;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) +;;; esi = windowbestlen - i.e., (window + bestlen) +;;; edi = prev +;;; ebp = limit + +LookupLoop: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry: + + cmp bx,word ptr [rsi + r8 - 1] + jnz LookupLoop1 +LookupLoopIsZero: + cmp r12w, word ptr [r10 + r8] + jnz LookupLoop1 + + +;;; Store the current value of chainlen. + mov [chainlenwmask], edx + +;;; Point edi to the string under scrutiny, and esi to the string we +;;; are hoping to match it up with. In actuality, esi and edi are +;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is +;;; initialized to -(MAX_MATCH_8 - scanalign). + + lea rsi,[r8+r10] + mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8) + lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8] + lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8] + + prefetcht1 [rsi+rdx] + prefetcht1 [rdi+rdx] + + +;;; Test the strings for equality, 8 bytes at a time. At the end, +;;; adjust rdx so that it is offset to the exact byte that mismatched. +;;; +;;; We already know at this point that the first three bytes of the +;;; strings match each other, and they can be safely passed over before +;;; starting the compare loop. So what this code does is skip over 0-3 +;;; bytes, as much as necessary in order to dword-align the edi +;;; pointer. (rsi will still be misaligned three times out of four.) +;;; +;;; It should be confessed that this loop usually does not represent +;;; much of the total running time. Replacing it with a more +;;; straightforward "rep cmpsb" would not drastically degrade +;;; performance. + + +LoopCmps: + mov rax, [rsi + rdx] + xor rax, [rdi + rdx] + jnz LeaveLoopCmps + + mov rax, [rsi + rdx + 8] + xor rax, [rdi + rdx + 8] + jnz LeaveLoopCmps8 + + + mov rax, [rsi + rdx + 8+8] + xor rax, [rdi + rdx + 8+8] + jnz LeaveLoopCmps16 + + add rdx,8+8+8 + + jnz short LoopCmps + jmp short LenMaximum +LeaveLoopCmps16: add rdx,8 +LeaveLoopCmps8: add rdx,8 +LeaveLoopCmps: + + test eax, 0000FFFFh + jnz LenLower + + test eax,0ffffffffh + + jnz LenLower32 + + add rdx,4 + shr rax,32 + or ax,ax + jnz LenLower + +LenLower32: + shr eax,16 + add rdx,2 +LenLower: sub al, 1 + adc rdx, 0 +;;; Calculate the length of the match. If it is longer than MAX_MATCH, +;;; then automatically accept it as the best possible match and leave. + + lea rax, [rdi + rdx] + sub rax, r9 + cmp eax, MAX_MATCH + jge LenMaximum + +;;; If the length of the match is not longer than the best match we +;;; have so far, then forget it and return to the lookup loop. +;/////////////////////////////////// + + cmp eax, r11d + jg LongerMatch + + lea rsi,[r10+r11] + + mov rdi, prev_ad + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; s->match_start = cur_match; +;;; best_len = len; +;;; if (len >= nice_match) break; +;;; scan_end = *(ushf*)(scan+best_len-1); + +LongerMatch: + mov r11d, eax + mov match_start, r8d + cmp eax, [nicematch] + jge LeaveNow + + lea rsi,[r10+rax] + + movzx ebx, word ptr [r9 + rax - 1] + mov rdi, prev_ad + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; Accept the current string, with the maximum possible length. + +LenMaximum: + mov r11d,MAX_MATCH + mov match_start, r8d + +;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; +;;; return s->lookahead; + +LeaveNow: +IFDEF INFOZIP + mov eax,r11d +ELSE + mov eax, Lookahead + cmp r11d, eax + cmovng eax, r11d +ENDIF + +;;; Restore the stack and return from whence we came. + + + mov rsi,[save_rsi] + mov rdi,[save_rdi] + mov rbx,[save_rbx] + mov rbp,[save_rbp] + mov r12,[save_r12] + mov r13,[save_r13] +; mov r14,[save_r14] +; mov r15,[save_r15] + + + ret 0 +; please don't remove this string ! +; Your can freely use gvmat64 in any free or commercial app +; but it is far better don't remove the string in the binary! + db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 +longest_match ENDP + +match_init PROC + ret 0 +match_init ENDP + + +END diff --git a/3party/zlib/contrib/masmx64/inffasx64.asm b/3party/zlib/contrib/masmx64/inffasx64.asm index 60a8d89b71..41ec82392e 100644 --- a/3party/zlib/contrib/masmx64/inffasx64.asm +++ b/3party/zlib/contrib/masmx64/inffasx64.asm @@ -1,396 +1,396 @@ -; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding -; version for AMD64 on Windows using Microsoft C compiler -; -; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c -; inffasx64.asm is called by inffas8664.c, which contain more info. - - -; to compile this file, I use option -; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm -; with Microsoft Macro Assembler (x64) for AMD64 -; - -; This file compile with Microsoft Macro Assembler (x64) for AMD64 -; -; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK -; -; (you can get Windows WDK with ml64 for AMD64 from -; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) -; - - -.code -inffas8664fnc PROC - -; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and -; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp -; -; All registers must be preserved across the call, except for -; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch. - - - mov [rsp-8],rsi - mov [rsp-16],rdi - mov [rsp-24],r12 - mov [rsp-32],r13 - mov [rsp-40],r14 - mov [rsp-48],r15 - mov [rsp-56],rbx - - mov rax,rcx - - mov [rax+8], rbp ; /* save regs rbp and rsp */ - mov [rax], rsp - - mov rsp, rax ; /* make rsp point to &ar */ - - mov rsi, [rsp+16] ; /* rsi = in */ - mov rdi, [rsp+32] ; /* rdi = out */ - mov r9, [rsp+24] ; /* r9 = last */ - mov r10, [rsp+48] ; /* r10 = end */ - mov rbp, [rsp+64] ; /* rbp = lcode */ - mov r11, [rsp+72] ; /* r11 = dcode */ - mov rdx, [rsp+80] ; /* rdx = hold */ - mov ebx, [rsp+88] ; /* ebx = bits */ - mov r12d, [rsp+100] ; /* r12d = lmask */ - mov r13d, [rsp+104] ; /* r13d = dmask */ - ; /* r14d = len */ - ; /* r15d = dist */ - - - cld - cmp r10, rdi - je L_one_time ; /* if only one decode left */ - cmp r9, rsi - - jne L_do_loop - - -L_one_time: - mov r8, r12 ; /* r8 = lmask */ - cmp bl, 32 - ja L_get_length_code_one_time - - lodsd ; /* eax = *(uint *)in++ */ - mov cl, bl ; /* cl = bits, needs it for shifting */ - add bl, 32 ; /* bits += 32 */ - shl rax, cl - or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ - jmp L_get_length_code_one_time - -ALIGN 4 -L_while_test: - cmp r10, rdi - jbe L_break_loop - cmp r9, rsi - jbe L_break_loop - -L_do_loop: - mov r8, r12 ; /* r8 = lmask */ - cmp bl, 32 - ja L_get_length_code ; /* if (32 < bits) */ - - lodsd ; /* eax = *(uint *)in++ */ - mov cl, bl ; /* cl = bits, needs it for shifting */ - add bl, 32 ; /* bits += 32 */ - shl rax, cl - or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ - -L_get_length_code: - and r8, rdx ; /* r8 &= hold */ - mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ - - mov cl, ah ; /* cl = this.bits */ - sub bl, ah ; /* bits -= this.bits */ - shr rdx, cl ; /* hold >>= this.bits */ - - test al, al - jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ - - mov r8, r12 ; /* r8 = lmask */ - shr eax, 16 ; /* output this.val char */ - stosb - -L_get_length_code_one_time: - and r8, rdx ; /* r8 &= hold */ - mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ - -L_dolen: - mov cl, ah ; /* cl = this.bits */ - sub bl, ah ; /* bits -= this.bits */ - shr rdx, cl ; /* hold >>= this.bits */ - - test al, al - jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ - - shr eax, 16 ; /* output this.val char */ - stosb - jmp L_while_test - -ALIGN 4 -L_test_for_length_base: - mov r14d, eax ; /* len = this */ - shr r14d, 16 ; /* len = this.val */ - mov cl, al - - test al, 16 - jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */ - and cl, 15 ; /* op &= 15 */ - jz L_decode_distance ; /* if (!op) */ - -L_add_bits_to_len: - sub bl, cl - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx ; /* eax &= hold */ - shr rdx, cl - add r14d, eax ; /* len += hold & mask[op] */ - -L_decode_distance: - mov r8, r13 ; /* r8 = dmask */ - cmp bl, 32 - ja L_get_distance_code ; /* if (32 < bits) */ - - lodsd ; /* eax = *(uint *)in++ */ - mov cl, bl ; /* cl = bits, needs it for shifting */ - add bl, 32 ; /* bits += 32 */ - shl rax, cl - or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ - -L_get_distance_code: - and r8, rdx ; /* r8 &= hold */ - mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */ - -L_dodist: - mov r15d, eax ; /* dist = this */ - shr r15d, 16 ; /* dist = this.val */ - mov cl, ah - sub bl, ah ; /* bits -= this.bits */ - shr rdx, cl ; /* hold >>= this.bits */ - mov cl, al ; /* cl = this.op */ - - test al, 16 ; /* if ((op & 16) == 0) */ - jz L_test_for_second_level_dist - and cl, 15 ; /* op &= 15 */ - jz L_check_dist_one - -L_add_bits_to_dist: - sub bl, cl - xor eax, eax - inc eax - shl eax, cl - dec eax ; /* (1 << op) - 1 */ - and eax, edx ; /* eax &= hold */ - shr rdx, cl - add r15d, eax ; /* dist += hold & ((1 << op) - 1) */ - -L_check_window: - mov r8, rsi ; /* save in so from can use it's reg */ - mov rax, rdi - sub rax, [rsp+40] ; /* nbytes = out - beg */ - - cmp eax, r15d - jb L_clip_window ; /* if (dist > nbytes) 4.2% */ - - mov ecx, r14d ; /* ecx = len */ - mov rsi, rdi - sub rsi, r15 ; /* from = out - dist */ - - sar ecx, 1 - jnc L_copy_two ; /* if len % 2 == 0 */ - - rep movsw - mov al, [rsi] - mov [rdi], al - inc rdi - - mov rsi, r8 ; /* move in back to %rsi, toss from */ - jmp L_while_test - -L_copy_two: - rep movsw - mov rsi, r8 ; /* move in back to %rsi, toss from */ - jmp L_while_test - -ALIGN 4 -L_check_dist_one: - cmp r15d, 1 ; /* if dist 1, is a memset */ - jne L_check_window - cmp [rsp+40], rdi ; /* if out == beg, outside window */ - je L_check_window - - mov ecx, r14d ; /* ecx = len */ - mov al, [rdi-1] - mov ah, al - - sar ecx, 1 - jnc L_set_two - mov [rdi], al - inc rdi - -L_set_two: - rep stosw - jmp L_while_test - -ALIGN 4 -L_test_for_second_level_length: - test al, 64 - jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */ - - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx ; /* eax &= hold */ - add eax, r14d ; /* eax += len */ - mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/ - jmp L_dolen - -ALIGN 4 -L_test_for_second_level_dist: - test al, 64 - jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */ - - xor eax, eax - inc eax - shl eax, cl - dec eax - and eax, edx ; /* eax &= hold */ - add eax, r15d ; /* eax += dist */ - mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/ - jmp L_dodist - -ALIGN 4 -L_clip_window: - mov ecx, eax ; /* ecx = nbytes */ - mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */ - neg ecx ; /* nbytes = -nbytes */ - - cmp eax, r15d - jb L_invalid_distance_too_far ; /* if (dist > wsize) */ - - add ecx, r15d ; /* nbytes = dist - nbytes */ - cmp dword ptr [rsp+96], 0 - jne L_wrap_around_window ; /* if (write != 0) */ - - mov rsi, [rsp+56] ; /* from = window */ - sub eax, ecx ; /* eax -= nbytes */ - add rsi, rax ; /* from += wsize - nbytes */ - - mov eax, r14d ; /* eax = len */ - cmp r14d, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* eax -= nbytes */ - rep movsb - mov rsi, rdi - sub rsi, r15 ; /* from = &out[ -dist ] */ - jmp L_do_copy - -ALIGN 4 -L_wrap_around_window: - mov eax, [rsp+96] ; /* eax = write */ - cmp ecx, eax - jbe L_contiguous_in_window ; /* if (write >= nbytes) */ - - mov esi, [rsp+92] ; /* from = wsize */ - add rsi, [rsp+56] ; /* from += window */ - add rsi, rax ; /* from += write */ - sub rsi, rcx ; /* from -= nbytes */ - sub ecx, eax ; /* nbytes -= write */ - - mov eax, r14d ; /* eax = len */ - cmp eax, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* len -= nbytes */ - rep movsb - mov rsi, [rsp+56] ; /* from = window */ - mov ecx, [rsp+96] ; /* nbytes = write */ - cmp eax, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* len -= nbytes */ - rep movsb - mov rsi, rdi - sub rsi, r15 ; /* from = out - dist */ - jmp L_do_copy - -ALIGN 4 -L_contiguous_in_window: - mov rsi, [rsp+56] ; /* rsi = window */ - add rsi, rax - sub rsi, rcx ; /* from += write - nbytes */ - - mov eax, r14d ; /* eax = len */ - cmp eax, ecx - jbe L_do_copy ; /* if (nbytes >= len) */ - - sub eax, ecx ; /* len -= nbytes */ - rep movsb - mov rsi, rdi - sub rsi, r15 ; /* from = out - dist */ - jmp L_do_copy ; /* if (nbytes >= len) */ - -ALIGN 4 -L_do_copy: - mov ecx, eax ; /* ecx = len */ - rep movsb - - mov rsi, r8 ; /* move in back to %esi, toss from */ - jmp L_while_test - -L_test_for_end_of_block: - test al, 32 - jz L_invalid_literal_length_code - mov dword ptr [rsp+116], 1 - jmp L_break_loop_with_status - -L_invalid_literal_length_code: - mov dword ptr [rsp+116], 2 - jmp L_break_loop_with_status - -L_invalid_distance_code: - mov dword ptr [rsp+116], 3 - jmp L_break_loop_with_status - -L_invalid_distance_too_far: - mov dword ptr [rsp+116], 4 - jmp L_break_loop_with_status - -L_break_loop: - mov dword ptr [rsp+116], 0 - -L_break_loop_with_status: -; /* put in, out, bits, and hold back into ar and pop esp */ - mov [rsp+16], rsi ; /* in */ - mov [rsp+32], rdi ; /* out */ - mov [rsp+88], ebx ; /* bits */ - mov [rsp+80], rdx ; /* hold */ - - mov rax, [rsp] ; /* restore rbp and rsp */ - mov rbp, [rsp+8] - mov rsp, rax - - - - mov rsi,[rsp-8] - mov rdi,[rsp-16] - mov r12,[rsp-24] - mov r13,[rsp-32] - mov r14,[rsp-40] - mov r15,[rsp-48] - mov rbx,[rsp-56] - - ret 0 -; : -; : "m" (ar) -; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", -; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" -; ); - -inffas8664fnc ENDP -;_TEXT ENDS -END +; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding +; version for AMD64 on Windows using Microsoft C compiler +; +; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c +; inffasx64.asm is called by inffas8664.c, which contain more info. + + +; to compile this file, I use option +; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm +; with Microsoft Macro Assembler (x64) for AMD64 +; + +; This file compile with Microsoft Macro Assembler (x64) for AMD64 +; +; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK +; +; (you can get Windows WDK with ml64 for AMD64 from +; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) +; + + +.code +inffas8664fnc PROC + +; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and +; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp +; +; All registers must be preserved across the call, except for +; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch. + + + mov [rsp-8],rsi + mov [rsp-16],rdi + mov [rsp-24],r12 + mov [rsp-32],r13 + mov [rsp-40],r14 + mov [rsp-48],r15 + mov [rsp-56],rbx + + mov rax,rcx + + mov [rax+8], rbp ; /* save regs rbp and rsp */ + mov [rax], rsp + + mov rsp, rax ; /* make rsp point to &ar */ + + mov rsi, [rsp+16] ; /* rsi = in */ + mov rdi, [rsp+32] ; /* rdi = out */ + mov r9, [rsp+24] ; /* r9 = last */ + mov r10, [rsp+48] ; /* r10 = end */ + mov rbp, [rsp+64] ; /* rbp = lcode */ + mov r11, [rsp+72] ; /* r11 = dcode */ + mov rdx, [rsp+80] ; /* rdx = hold */ + mov ebx, [rsp+88] ; /* ebx = bits */ + mov r12d, [rsp+100] ; /* r12d = lmask */ + mov r13d, [rsp+104] ; /* r13d = dmask */ + ; /* r14d = len */ + ; /* r15d = dist */ + + + cld + cmp r10, rdi + je L_one_time ; /* if only one decode left */ + cmp r9, rsi + + jne L_do_loop + + +L_one_time: + mov r8, r12 ; /* r8 = lmask */ + cmp bl, 32 + ja L_get_length_code_one_time + + lodsd ; /* eax = *(uint *)in++ */ + mov cl, bl ; /* cl = bits, needs it for shifting */ + add bl, 32 ; /* bits += 32 */ + shl rax, cl + or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ + jmp L_get_length_code_one_time + +ALIGN 4 +L_while_test: + cmp r10, rdi + jbe L_break_loop + cmp r9, rsi + jbe L_break_loop + +L_do_loop: + mov r8, r12 ; /* r8 = lmask */ + cmp bl, 32 + ja L_get_length_code ; /* if (32 < bits) */ + + lodsd ; /* eax = *(uint *)in++ */ + mov cl, bl ; /* cl = bits, needs it for shifting */ + add bl, 32 ; /* bits += 32 */ + shl rax, cl + or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ + +L_get_length_code: + and r8, rdx ; /* r8 &= hold */ + mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ + + mov cl, ah ; /* cl = this.bits */ + sub bl, ah ; /* bits -= this.bits */ + shr rdx, cl ; /* hold >>= this.bits */ + + test al, al + jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ + + mov r8, r12 ; /* r8 = lmask */ + shr eax, 16 ; /* output this.val char */ + stosb + +L_get_length_code_one_time: + and r8, rdx ; /* r8 &= hold */ + mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ + +L_dolen: + mov cl, ah ; /* cl = this.bits */ + sub bl, ah ; /* bits -= this.bits */ + shr rdx, cl ; /* hold >>= this.bits */ + + test al, al + jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ + + shr eax, 16 ; /* output this.val char */ + stosb + jmp L_while_test + +ALIGN 4 +L_test_for_length_base: + mov r14d, eax ; /* len = this */ + shr r14d, 16 ; /* len = this.val */ + mov cl, al + + test al, 16 + jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */ + and cl, 15 ; /* op &= 15 */ + jz L_decode_distance ; /* if (!op) */ + +L_add_bits_to_len: + sub bl, cl + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx ; /* eax &= hold */ + shr rdx, cl + add r14d, eax ; /* len += hold & mask[op] */ + +L_decode_distance: + mov r8, r13 ; /* r8 = dmask */ + cmp bl, 32 + ja L_get_distance_code ; /* if (32 < bits) */ + + lodsd ; /* eax = *(uint *)in++ */ + mov cl, bl ; /* cl = bits, needs it for shifting */ + add bl, 32 ; /* bits += 32 */ + shl rax, cl + or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ + +L_get_distance_code: + and r8, rdx ; /* r8 &= hold */ + mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */ + +L_dodist: + mov r15d, eax ; /* dist = this */ + shr r15d, 16 ; /* dist = this.val */ + mov cl, ah + sub bl, ah ; /* bits -= this.bits */ + shr rdx, cl ; /* hold >>= this.bits */ + mov cl, al ; /* cl = this.op */ + + test al, 16 ; /* if ((op & 16) == 0) */ + jz L_test_for_second_level_dist + and cl, 15 ; /* op &= 15 */ + jz L_check_dist_one + +L_add_bits_to_dist: + sub bl, cl + xor eax, eax + inc eax + shl eax, cl + dec eax ; /* (1 << op) - 1 */ + and eax, edx ; /* eax &= hold */ + shr rdx, cl + add r15d, eax ; /* dist += hold & ((1 << op) - 1) */ + +L_check_window: + mov r8, rsi ; /* save in so from can use it's reg */ + mov rax, rdi + sub rax, [rsp+40] ; /* nbytes = out - beg */ + + cmp eax, r15d + jb L_clip_window ; /* if (dist > nbytes) 4.2% */ + + mov ecx, r14d ; /* ecx = len */ + mov rsi, rdi + sub rsi, r15 ; /* from = out - dist */ + + sar ecx, 1 + jnc L_copy_two ; /* if len % 2 == 0 */ + + rep movsw + mov al, [rsi] + mov [rdi], al + inc rdi + + mov rsi, r8 ; /* move in back to %rsi, toss from */ + jmp L_while_test + +L_copy_two: + rep movsw + mov rsi, r8 ; /* move in back to %rsi, toss from */ + jmp L_while_test + +ALIGN 4 +L_check_dist_one: + cmp r15d, 1 ; /* if dist 1, is a memset */ + jne L_check_window + cmp [rsp+40], rdi ; /* if out == beg, outside window */ + je L_check_window + + mov ecx, r14d ; /* ecx = len */ + mov al, [rdi-1] + mov ah, al + + sar ecx, 1 + jnc L_set_two + mov [rdi], al + inc rdi + +L_set_two: + rep stosw + jmp L_while_test + +ALIGN 4 +L_test_for_second_level_length: + test al, 64 + jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */ + + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx ; /* eax &= hold */ + add eax, r14d ; /* eax += len */ + mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/ + jmp L_dolen + +ALIGN 4 +L_test_for_second_level_dist: + test al, 64 + jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */ + + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx ; /* eax &= hold */ + add eax, r15d ; /* eax += dist */ + mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/ + jmp L_dodist + +ALIGN 4 +L_clip_window: + mov ecx, eax ; /* ecx = nbytes */ + mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */ + neg ecx ; /* nbytes = -nbytes */ + + cmp eax, r15d + jb L_invalid_distance_too_far ; /* if (dist > wsize) */ + + add ecx, r15d ; /* nbytes = dist - nbytes */ + cmp dword ptr [rsp+96], 0 + jne L_wrap_around_window ; /* if (write != 0) */ + + mov rsi, [rsp+56] ; /* from = window */ + sub eax, ecx ; /* eax -= nbytes */ + add rsi, rax ; /* from += wsize - nbytes */ + + mov eax, r14d ; /* eax = len */ + cmp r14d, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* eax -= nbytes */ + rep movsb + mov rsi, rdi + sub rsi, r15 ; /* from = &out[ -dist ] */ + jmp L_do_copy + +ALIGN 4 +L_wrap_around_window: + mov eax, [rsp+96] ; /* eax = write */ + cmp ecx, eax + jbe L_contiguous_in_window ; /* if (write >= nbytes) */ + + mov esi, [rsp+92] ; /* from = wsize */ + add rsi, [rsp+56] ; /* from += window */ + add rsi, rax ; /* from += write */ + sub rsi, rcx ; /* from -= nbytes */ + sub ecx, eax ; /* nbytes -= write */ + + mov eax, r14d ; /* eax = len */ + cmp eax, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* len -= nbytes */ + rep movsb + mov rsi, [rsp+56] ; /* from = window */ + mov ecx, [rsp+96] ; /* nbytes = write */ + cmp eax, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* len -= nbytes */ + rep movsb + mov rsi, rdi + sub rsi, r15 ; /* from = out - dist */ + jmp L_do_copy + +ALIGN 4 +L_contiguous_in_window: + mov rsi, [rsp+56] ; /* rsi = window */ + add rsi, rax + sub rsi, rcx ; /* from += write - nbytes */ + + mov eax, r14d ; /* eax = len */ + cmp eax, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* len -= nbytes */ + rep movsb + mov rsi, rdi + sub rsi, r15 ; /* from = out - dist */ + jmp L_do_copy ; /* if (nbytes >= len) */ + +ALIGN 4 +L_do_copy: + mov ecx, eax ; /* ecx = len */ + rep movsb + + mov rsi, r8 ; /* move in back to %esi, toss from */ + jmp L_while_test + +L_test_for_end_of_block: + test al, 32 + jz L_invalid_literal_length_code + mov dword ptr [rsp+116], 1 + jmp L_break_loop_with_status + +L_invalid_literal_length_code: + mov dword ptr [rsp+116], 2 + jmp L_break_loop_with_status + +L_invalid_distance_code: + mov dword ptr [rsp+116], 3 + jmp L_break_loop_with_status + +L_invalid_distance_too_far: + mov dword ptr [rsp+116], 4 + jmp L_break_loop_with_status + +L_break_loop: + mov dword ptr [rsp+116], 0 + +L_break_loop_with_status: +; /* put in, out, bits, and hold back into ar and pop esp */ + mov [rsp+16], rsi ; /* in */ + mov [rsp+32], rdi ; /* out */ + mov [rsp+88], ebx ; /* bits */ + mov [rsp+80], rdx ; /* hold */ + + mov rax, [rsp] ; /* restore rbp and rsp */ + mov rbp, [rsp+8] + mov rsp, rax + + + + mov rsi,[rsp-8] + mov rdi,[rsp-16] + mov r12,[rsp-24] + mov r13,[rsp-32] + mov r14,[rsp-40] + mov r15,[rsp-48] + mov rbx,[rsp-56] + + ret 0 +; : +; : "m" (ar) +; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", +; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" +; ); + +inffas8664fnc ENDP +;_TEXT ENDS +END diff --git a/3party/zlib/contrib/masmx64/readme.txt b/3party/zlib/contrib/masmx64/readme.txt index 2da6733412..652571c7a5 100644 --- a/3party/zlib/contrib/masmx64/readme.txt +++ b/3party/zlib/contrib/masmx64/readme.txt @@ -1,31 +1,31 @@ -Summary -------- -This directory contains ASM implementations of the functions -longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), -for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. - -gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits - assembly optimized version from Jean-loup Gailly original longest_match function - -inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing - original function from Mark Adler - -Use instructions ----------------- -Assemble the .asm files using MASM and put the object files into the zlib source -directory. You can also get object files here: - - http://www.winimage.com/zLibDll/zlib124_masm_obj.zip - -define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, -and inffasx64.obj and gvmat64.obj as object to link. - - -Build instructions ------------------- -run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) - -ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK - -You can get Windows 2003 server DDK with ml64 and cl for AMD64 from - http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) +Summary +------- +This directory contains ASM implementations of the functions +longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), +for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. + +gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits + assembly optimized version from Jean-loup Gailly original longest_match function + +inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing + original function from Mark Adler + +Use instructions +---------------- +Assemble the .asm files using MASM and put the object files into the zlib source +directory. You can also get object files here: + + http://www.winimage.com/zLibDll/zlib124_masm_obj.zip + +define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, +and inffasx64.obj and gvmat64.obj as object to link. + + +Build instructions +------------------ +run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) + +ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK + +You can get Windows 2003 server DDK with ml64 and cl for AMD64 from + http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) diff --git a/3party/zlib/contrib/masmx86/bld_ml32.bat b/3party/zlib/contrib/masmx86/bld_ml32.bat index e1b86bf68a..fcf5755e46 100644 --- a/3party/zlib/contrib/masmx86/bld_ml32.bat +++ b/3party/zlib/contrib/masmx86/bld_ml32.bat @@ -1,2 +1,2 @@ -ml /coff /Zi /c /Flmatch686.lst match686.asm -ml /coff /Zi /c /Flinffas32.lst inffas32.asm +ml /coff /Zi /c /Flmatch686.lst match686.asm +ml /coff /Zi /c /Flinffas32.lst inffas32.asm diff --git a/3party/zlib/contrib/masmx86/inffas32.asm b/3party/zlib/contrib/masmx86/inffas32.asm index 92ac22ad9d..14f9d3514a 100644 --- a/3party/zlib/contrib/masmx86/inffas32.asm +++ b/3party/zlib/contrib/masmx86/inffas32.asm @@ -1,1083 +1,1083 @@ -;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding -; * -; * inffas32.asm is derivated from inffas86.c, with translation of assembly code -; * -; * Copyright (C) 1995-2003 Mark Adler -; * For conditions of distribution and use, see copyright notice in zlib.h -; * -; * Copyright (C) 2003 Chris Anderson -; * Please use the copyright conditions above. -; * -; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from -; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at -; * the moment. I have successfully compiled and tested this code with gcc2.96, -; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S -; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX -; * enabled. I will attempt to merge the MMX code into this version. Newer -; * versions of this and inffast.S can be found at -; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ -; * -; * 2005 : modification by Gilles Vollant -; */ -; For Visual C++ 4.x and higher and ML 6.x and higher -; ml.exe is in directory \MASM611C of Win95 DDK -; ml.exe is also distributed in http://www.masm32.com/masmdl.htm -; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/ -; -; -; compile with command line option -; ml /coff /Zi /c /Flinffas32.lst inffas32.asm - -; if you define NO_GZIP (see inflate.h), compile with -; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm - - -; zlib122sup is 0 fort zlib 1.2.2.1 and lower -; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head -; in inflate_state in inflate.h) -zlib1222sup equ 8 - - -IFDEF GUNZIP - INFLATE_MODE_TYPE equ 11 - INFLATE_MODE_BAD equ 26 -ELSE - IFNDEF NO_GUNZIP - INFLATE_MODE_TYPE equ 11 - INFLATE_MODE_BAD equ 26 - ELSE - INFLATE_MODE_TYPE equ 3 - INFLATE_MODE_BAD equ 17 - ENDIF -ENDIF - - -; 75 "inffast.S" -;FILE "inffast.S" - -;;;GLOBAL _inflate_fast - -;;;SECTION .text - - - - .586p - .mmx - - name inflate_fast_x86 - .MODEL FLAT - -_DATA segment -inflate_fast_use_mmx: - dd 1 - - -_TEXT segment -PUBLIC _inflate_fast - -ALIGN 4 -_inflate_fast: - jmp inflate_fast_entry - - - -ALIGN 4 - db 'Fast decoding Code from Chris Anderson' - db 0 - -ALIGN 4 -invalid_literal_length_code_msg: - db 'invalid literal/length code' - db 0 - -ALIGN 4 -invalid_distance_code_msg: - db 'invalid distance code' - db 0 - -ALIGN 4 -invalid_distance_too_far_msg: - db 'invalid distance too far back' - db 0 - - -ALIGN 4 -inflate_fast_mask: -dd 0 -dd 1 -dd 3 -dd 7 -dd 15 -dd 31 -dd 63 -dd 127 -dd 255 -dd 511 -dd 1023 -dd 2047 -dd 4095 -dd 8191 -dd 16383 -dd 32767 -dd 65535 -dd 131071 -dd 262143 -dd 524287 -dd 1048575 -dd 2097151 -dd 4194303 -dd 8388607 -dd 16777215 -dd 33554431 -dd 67108863 -dd 134217727 -dd 268435455 -dd 536870911 -dd 1073741823 -dd 2147483647 -dd 4294967295 - - -mode_state equ 0 ;/* state->mode */ -wsize_state equ (32+zlib1222sup) ;/* state->wsize */ -write_state equ (36+4+zlib1222sup) ;/* state->write */ -window_state equ (40+4+zlib1222sup) ;/* state->window */ -hold_state equ (44+4+zlib1222sup) ;/* state->hold */ -bits_state equ (48+4+zlib1222sup) ;/* state->bits */ -lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */ -distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */ -lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */ -distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */ - - -;;SECTION .text -; 205 "inffast.S" -;GLOBAL inflate_fast_use_mmx - -;SECTION .data - - -; GLOBAL inflate_fast_use_mmx:object -;.size inflate_fast_use_mmx, 4 -; 226 "inffast.S" -;SECTION .text - -ALIGN 4 -inflate_fast_entry: - push edi - push esi - push ebp - push ebx - pushfd - sub esp,64 - cld - - - - - mov esi, [esp+88] - mov edi, [esi+28] - - - - - - - - mov edx, [esi+4] - mov eax, [esi+0] - - add edx,eax - sub edx,11 - - mov [esp+44],eax - mov [esp+20],edx - - mov ebp, [esp+92] - mov ecx, [esi+16] - mov ebx, [esi+12] - - sub ebp,ecx - neg ebp - add ebp,ebx - - sub ecx,257 - add ecx,ebx - - mov [esp+60],ebx - mov [esp+40],ebp - mov [esp+16],ecx -; 285 "inffast.S" - mov eax, [edi+lencode_state] - mov ecx, [edi+distcode_state] - - mov [esp+8],eax - mov [esp+12],ecx - - mov eax,1 - mov ecx, [edi+lenbits_state] - shl eax,cl - dec eax - mov [esp+0],eax - - mov eax,1 - mov ecx, [edi+distbits_state] - shl eax,cl - dec eax - mov [esp+4],eax - - mov eax, [edi+wsize_state] - mov ecx, [edi+write_state] - mov edx, [edi+window_state] - - mov [esp+52],eax - mov [esp+48],ecx - mov [esp+56],edx - - mov ebp, [edi+hold_state] - mov ebx, [edi+bits_state] -; 321 "inffast.S" - mov esi, [esp+44] - mov ecx, [esp+20] - cmp ecx,esi - ja L_align_long - - add ecx,11 - sub ecx,esi - mov eax,12 - sub eax,ecx - lea edi, [esp+28] - rep movsb - mov ecx,eax - xor eax,eax - rep stosb - lea esi, [esp+28] - mov [esp+20],esi - jmp L_is_aligned - - -L_align_long: - test esi,3 - jz L_is_aligned - xor eax,eax - mov al, [esi] - inc esi - mov ecx,ebx - add ebx,8 - shl eax,cl - or ebp,eax - jmp L_align_long - -L_is_aligned: - mov edi, [esp+60] -; 366 "inffast.S" -L_check_mmx: - cmp dword ptr [inflate_fast_use_mmx],2 - je L_init_mmx - ja L_do_loop - - push eax - push ebx - push ecx - push edx - pushfd - mov eax, [esp] - xor dword ptr [esp],0200000h - - - - - popfd - pushfd - pop edx - xor edx,eax - jz L_dont_use_mmx - xor eax,eax - cpuid - cmp ebx,0756e6547h - jne L_dont_use_mmx - cmp ecx,06c65746eh - jne L_dont_use_mmx - cmp edx,049656e69h - jne L_dont_use_mmx - mov eax,1 - cpuid - shr eax,8 - and eax,15 - cmp eax,6 - jne L_dont_use_mmx - test edx,0800000h - jnz L_use_mmx - jmp L_dont_use_mmx -L_use_mmx: - mov dword ptr [inflate_fast_use_mmx],2 - jmp L_check_mmx_pop -L_dont_use_mmx: - mov dword ptr [inflate_fast_use_mmx],3 -L_check_mmx_pop: - pop edx - pop ecx - pop ebx - pop eax - jmp L_check_mmx -; 426 "inffast.S" -ALIGN 4 -L_do_loop: -; 437 "inffast.S" - cmp bl,15 - ja L_get_length_code - - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - -L_get_length_code: - mov edx, [esp+0] - mov ecx, [esp+8] - and edx,ebp - mov eax, [ecx+edx*4] - -L_dolen: - - - - - - - mov cl,ah - sub bl,ah - shr ebp,cl - - - - - - - test al,al - jnz L_test_for_length_base - - shr eax,16 - stosb - -L_while_test: - - - cmp [esp+16],edi - jbe L_break_loop - - cmp [esp+20],esi - ja L_do_loop - jmp L_break_loop - -L_test_for_length_base: -; 502 "inffast.S" - mov edx,eax - shr edx,16 - mov cl,al - - test al,16 - jz L_test_for_second_level_length - and cl,15 - jz L_save_len - cmp bl,cl - jae L_add_bits_to_len - - mov ch,cl - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - mov cl,ch - -L_add_bits_to_len: - mov eax,1 - shl eax,cl - dec eax - sub bl,cl - and eax,ebp - shr ebp,cl - add edx,eax - -L_save_len: - mov [esp+24],edx - - -L_decode_distance: -; 549 "inffast.S" - cmp bl,15 - ja L_get_distance_code - - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - -L_get_distance_code: - mov edx, [esp+4] - mov ecx, [esp+12] - and edx,ebp - mov eax, [ecx+edx*4] - - -L_dodist: - mov edx,eax - shr edx,16 - mov cl,ah - sub bl,ah - shr ebp,cl -; 584 "inffast.S" - mov cl,al - - test al,16 - jz L_test_for_second_level_dist - and cl,15 - jz L_check_dist_one - cmp bl,cl - jae L_add_bits_to_dist - - mov ch,cl - xor eax,eax - lodsw - mov cl,bl - add bl,16 - shl eax,cl - or ebp,eax - mov cl,ch - -L_add_bits_to_dist: - mov eax,1 - shl eax,cl - dec eax - sub bl,cl - and eax,ebp - shr ebp,cl - add edx,eax - jmp L_check_window - -L_check_window: -; 625 "inffast.S" - mov [esp+44],esi - mov eax,edi - sub eax, [esp+40] - - cmp eax,edx - jb L_clip_window - - mov ecx, [esp+24] - mov esi,edi - sub esi,edx - - sub ecx,3 - mov al, [esi] - mov [edi],al - mov al, [esi+1] - mov dl, [esi+2] - add esi,3 - mov [edi+1],al - mov [edi+2],dl - add edi,3 - rep movsb - - mov esi, [esp+44] - jmp L_while_test - -ALIGN 4 -L_check_dist_one: - cmp edx,1 - jne L_check_window - cmp [esp+40],edi - je L_check_window - - dec edi - mov ecx, [esp+24] - mov al, [edi] - sub ecx,3 - - mov [edi+1],al - mov [edi+2],al - mov [edi+3],al - add edi,4 - rep stosb - - jmp L_while_test - -ALIGN 4 -L_test_for_second_level_length: - - - - - test al,64 - jnz L_test_for_end_of_block - - mov eax,1 - shl eax,cl - dec eax - and eax,ebp - add eax,edx - mov edx, [esp+8] - mov eax, [edx+eax*4] - jmp L_dolen - -ALIGN 4 -L_test_for_second_level_dist: - - - - - test al,64 - jnz L_invalid_distance_code - - mov eax,1 - shl eax,cl - dec eax - and eax,ebp - add eax,edx - mov edx, [esp+12] - mov eax, [edx+eax*4] - jmp L_dodist - -ALIGN 4 -L_clip_window: -; 721 "inffast.S" - mov ecx,eax - mov eax, [esp+52] - neg ecx - mov esi, [esp+56] - - cmp eax,edx - jb L_invalid_distance_too_far - - add ecx,edx - cmp dword ptr [esp+48],0 - jne L_wrap_around_window - - sub eax,ecx - add esi,eax -; 749 "inffast.S" - mov eax, [esp+24] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - jmp L_do_copy1 - - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - jmp L_do_copy1 - -L_wrap_around_window: -; 793 "inffast.S" - mov eax, [esp+48] - cmp ecx,eax - jbe L_contiguous_in_window - - add esi, [esp+52] - add esi,eax - sub esi,ecx - sub ecx,eax - - - mov eax, [esp+24] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi, [esp+56] - mov ecx, [esp+48] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - jmp L_do_copy1 - -L_contiguous_in_window: -; 836 "inffast.S" - add esi,eax - sub esi,ecx - - - mov eax, [esp+24] - cmp eax,ecx - jbe L_do_copy1 - - sub eax,ecx - rep movsb - mov esi,edi - sub esi,edx - -L_do_copy1: -; 862 "inffast.S" - mov ecx,eax - rep movsb - - mov esi, [esp+44] - jmp L_while_test -; 878 "inffast.S" -ALIGN 4 -L_init_mmx: - emms - - - - - - movd mm0,ebp - mov ebp,ebx -; 896 "inffast.S" - movd mm4,dword ptr [esp+0] - movq mm3,mm4 - movd mm5,dword ptr [esp+4] - movq mm2,mm5 - pxor mm1,mm1 - mov ebx, [esp+8] - jmp L_do_loop_mmx - -ALIGN 4 -L_do_loop_mmx: - psrlq mm0,mm1 - - cmp ebp,32 - ja L_get_length_code_mmx - - movd mm6,ebp - movd mm7,dword ptr [esi] - add esi,4 - psllq mm7,mm6 - add ebp,32 - por mm0,mm7 - -L_get_length_code_mmx: - pand mm4,mm0 - movd eax,mm4 - movq mm4,mm3 - mov eax, [ebx+eax*4] - -L_dolen_mmx: - movzx ecx,ah - movd mm1,ecx - sub ebp,ecx - - test al,al - jnz L_test_for_length_base_mmx - - shr eax,16 - stosb - -L_while_test_mmx: - - - cmp [esp+16],edi - jbe L_break_loop - - cmp [esp+20],esi - ja L_do_loop_mmx - jmp L_break_loop - -L_test_for_length_base_mmx: - - mov edx,eax - shr edx,16 - - test al,16 - jz L_test_for_second_level_length_mmx - and eax,15 - jz L_decode_distance_mmx - - psrlq mm0,mm1 - movd mm1,eax - movd ecx,mm0 - sub ebp,eax - and ecx, [inflate_fast_mask+eax*4] - add edx,ecx - -L_decode_distance_mmx: - psrlq mm0,mm1 - - cmp ebp,32 - ja L_get_dist_code_mmx - - movd mm6,ebp - movd mm7,dword ptr [esi] - add esi,4 - psllq mm7,mm6 - add ebp,32 - por mm0,mm7 - -L_get_dist_code_mmx: - mov ebx, [esp+12] - pand mm5,mm0 - movd eax,mm5 - movq mm5,mm2 - mov eax, [ebx+eax*4] - -L_dodist_mmx: - - movzx ecx,ah - mov ebx,eax - shr ebx,16 - sub ebp,ecx - movd mm1,ecx - - test al,16 - jz L_test_for_second_level_dist_mmx - and eax,15 - jz L_check_dist_one_mmx - -L_add_bits_to_dist_mmx: - psrlq mm0,mm1 - movd mm1,eax - movd ecx,mm0 - sub ebp,eax - and ecx, [inflate_fast_mask+eax*4] - add ebx,ecx - -L_check_window_mmx: - mov [esp+44],esi - mov eax,edi - sub eax, [esp+40] - - cmp eax,ebx - jb L_clip_window_mmx - - mov ecx,edx - mov esi,edi - sub esi,ebx - - sub ecx,3 - mov al, [esi] - mov [edi],al - mov al, [esi+1] - mov dl, [esi+2] - add esi,3 - mov [edi+1],al - mov [edi+2],dl - add edi,3 - rep movsb - - mov esi, [esp+44] - mov ebx, [esp+8] - jmp L_while_test_mmx - -ALIGN 4 -L_check_dist_one_mmx: - cmp ebx,1 - jne L_check_window_mmx - cmp [esp+40],edi - je L_check_window_mmx - - dec edi - mov ecx,edx - mov al, [edi] - sub ecx,3 - - mov [edi+1],al - mov [edi+2],al - mov [edi+3],al - add edi,4 - rep stosb - - mov ebx, [esp+8] - jmp L_while_test_mmx - -ALIGN 4 -L_test_for_second_level_length_mmx: - test al,64 - jnz L_test_for_end_of_block - - and eax,15 - psrlq mm0,mm1 - movd ecx,mm0 - and ecx, [inflate_fast_mask+eax*4] - add ecx,edx - mov eax, [ebx+ecx*4] - jmp L_dolen_mmx - -ALIGN 4 -L_test_for_second_level_dist_mmx: - test al,64 - jnz L_invalid_distance_code - - and eax,15 - psrlq mm0,mm1 - movd ecx,mm0 - and ecx, [inflate_fast_mask+eax*4] - mov eax, [esp+12] - add ecx,ebx - mov eax, [eax+ecx*4] - jmp L_dodist_mmx - -ALIGN 4 -L_clip_window_mmx: - - mov ecx,eax - mov eax, [esp+52] - neg ecx - mov esi, [esp+56] - - cmp eax,ebx - jb L_invalid_distance_too_far - - add ecx,ebx - cmp dword ptr [esp+48],0 - jne L_wrap_around_window_mmx - - sub eax,ecx - add esi,eax - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - jmp L_do_copy1_mmx - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - jmp L_do_copy1_mmx - -L_wrap_around_window_mmx: - - mov eax, [esp+48] - cmp ecx,eax - jbe L_contiguous_in_window_mmx - - add esi, [esp+52] - add esi,eax - sub esi,ecx - sub ecx,eax - - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi, [esp+56] - mov ecx, [esp+48] - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - jmp L_do_copy1_mmx - -L_contiguous_in_window_mmx: - - add esi,eax - sub esi,ecx - - - cmp edx,ecx - jbe L_do_copy1_mmx - - sub edx,ecx - rep movsb - mov esi,edi - sub esi,ebx - -L_do_copy1_mmx: - - - mov ecx,edx - rep movsb - - mov esi, [esp+44] - mov ebx, [esp+8] - jmp L_while_test_mmx -; 1174 "inffast.S" -L_invalid_distance_code: - - - - - - mov ecx, invalid_distance_code_msg - mov edx,INFLATE_MODE_BAD - jmp L_update_stream_state - -L_test_for_end_of_block: - - - - - - test al,32 - jz L_invalid_literal_length_code - - mov ecx,0 - mov edx,INFLATE_MODE_TYPE - jmp L_update_stream_state - -L_invalid_literal_length_code: - - - - - - mov ecx, invalid_literal_length_code_msg - mov edx,INFLATE_MODE_BAD - jmp L_update_stream_state - -L_invalid_distance_too_far: - - - - mov esi, [esp+44] - mov ecx, invalid_distance_too_far_msg - mov edx,INFLATE_MODE_BAD - jmp L_update_stream_state - -L_update_stream_state: - - mov eax, [esp+88] - test ecx,ecx - jz L_skip_msg - mov [eax+24],ecx -L_skip_msg: - mov eax, [eax+28] - mov [eax+mode_state],edx - jmp L_break_loop - -ALIGN 4 -L_break_loop: -; 1243 "inffast.S" - cmp dword ptr [inflate_fast_use_mmx],2 - jne L_update_next_in - - - - mov ebx,ebp - -L_update_next_in: -; 1266 "inffast.S" - mov eax, [esp+88] - mov ecx,ebx - mov edx, [eax+28] - shr ecx,3 - sub esi,ecx - shl ecx,3 - sub ebx,ecx - mov [eax+12],edi - mov [edx+bits_state],ebx - mov ecx,ebx - - lea ebx, [esp+28] - cmp [esp+20],ebx - jne L_buf_not_used - - sub esi,ebx - mov ebx, [eax+0] - mov [esp+20],ebx - add esi,ebx - mov ebx, [eax+4] - sub ebx,11 - add [esp+20],ebx - -L_buf_not_used: - mov [eax+0],esi - - mov ebx,1 - shl ebx,cl - dec ebx - - - - - - cmp dword ptr [inflate_fast_use_mmx],2 - jne L_update_hold - - - - psrlq mm0,mm1 - movd ebp,mm0 - - emms - -L_update_hold: - - - - and ebp,ebx - mov [edx+hold_state],ebp - - - - - mov ebx, [esp+20] - cmp ebx,esi - jbe L_last_is_smaller - - sub ebx,esi - add ebx,11 - mov [eax+4],ebx - jmp L_fixup_out -L_last_is_smaller: - sub esi,ebx - neg esi - add esi,11 - mov [eax+4],esi - - - - -L_fixup_out: - - mov ebx, [esp+16] - cmp ebx,edi - jbe L_end_is_smaller - - sub ebx,edi - add ebx,257 - mov [eax+16],ebx - jmp L_done -L_end_is_smaller: - sub edi,ebx - neg edi - add edi,257 - mov [eax+16],edi - - - - - -L_done: - add esp,64 - popfd - pop ebx - pop ebp - pop esi - pop edi - ret - -_TEXT ends -end +;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding +; * +; * inffas32.asm is derivated from inffas86.c, with translation of assembly code +; * +; * Copyright (C) 1995-2003 Mark Adler +; * For conditions of distribution and use, see copyright notice in zlib.h +; * +; * Copyright (C) 2003 Chris Anderson +; * Please use the copyright conditions above. +; * +; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from +; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at +; * the moment. I have successfully compiled and tested this code with gcc2.96, +; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S +; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX +; * enabled. I will attempt to merge the MMX code into this version. Newer +; * versions of this and inffast.S can be found at +; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ +; * +; * 2005 : modification by Gilles Vollant +; */ +; For Visual C++ 4.x and higher and ML 6.x and higher +; ml.exe is in directory \MASM611C of Win95 DDK +; ml.exe is also distributed in http://www.masm32.com/masmdl.htm +; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/ +; +; +; compile with command line option +; ml /coff /Zi /c /Flinffas32.lst inffas32.asm + +; if you define NO_GZIP (see inflate.h), compile with +; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm + + +; zlib122sup is 0 fort zlib 1.2.2.1 and lower +; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head +; in inflate_state in inflate.h) +zlib1222sup equ 8 + + +IFDEF GUNZIP + INFLATE_MODE_TYPE equ 11 + INFLATE_MODE_BAD equ 26 +ELSE + IFNDEF NO_GUNZIP + INFLATE_MODE_TYPE equ 11 + INFLATE_MODE_BAD equ 26 + ELSE + INFLATE_MODE_TYPE equ 3 + INFLATE_MODE_BAD equ 17 + ENDIF +ENDIF + + +; 75 "inffast.S" +;FILE "inffast.S" + +;;;GLOBAL _inflate_fast + +;;;SECTION .text + + + + .586p + .mmx + + name inflate_fast_x86 + .MODEL FLAT + +_DATA segment +inflate_fast_use_mmx: + dd 1 + + +_TEXT segment +PUBLIC _inflate_fast + +ALIGN 4 +_inflate_fast: + jmp inflate_fast_entry + + + +ALIGN 4 + db 'Fast decoding Code from Chris Anderson' + db 0 + +ALIGN 4 +invalid_literal_length_code_msg: + db 'invalid literal/length code' + db 0 + +ALIGN 4 +invalid_distance_code_msg: + db 'invalid distance code' + db 0 + +ALIGN 4 +invalid_distance_too_far_msg: + db 'invalid distance too far back' + db 0 + + +ALIGN 4 +inflate_fast_mask: +dd 0 +dd 1 +dd 3 +dd 7 +dd 15 +dd 31 +dd 63 +dd 127 +dd 255 +dd 511 +dd 1023 +dd 2047 +dd 4095 +dd 8191 +dd 16383 +dd 32767 +dd 65535 +dd 131071 +dd 262143 +dd 524287 +dd 1048575 +dd 2097151 +dd 4194303 +dd 8388607 +dd 16777215 +dd 33554431 +dd 67108863 +dd 134217727 +dd 268435455 +dd 536870911 +dd 1073741823 +dd 2147483647 +dd 4294967295 + + +mode_state equ 0 ;/* state->mode */ +wsize_state equ (32+zlib1222sup) ;/* state->wsize */ +write_state equ (36+4+zlib1222sup) ;/* state->write */ +window_state equ (40+4+zlib1222sup) ;/* state->window */ +hold_state equ (44+4+zlib1222sup) ;/* state->hold */ +bits_state equ (48+4+zlib1222sup) ;/* state->bits */ +lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */ +distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */ +lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */ +distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */ + + +;;SECTION .text +; 205 "inffast.S" +;GLOBAL inflate_fast_use_mmx + +;SECTION .data + + +; GLOBAL inflate_fast_use_mmx:object +;.size inflate_fast_use_mmx, 4 +; 226 "inffast.S" +;SECTION .text + +ALIGN 4 +inflate_fast_entry: + push edi + push esi + push ebp + push ebx + pushfd + sub esp,64 + cld + + + + + mov esi, [esp+88] + mov edi, [esi+28] + + + + + + + + mov edx, [esi+4] + mov eax, [esi+0] + + add edx,eax + sub edx,11 + + mov [esp+44],eax + mov [esp+20],edx + + mov ebp, [esp+92] + mov ecx, [esi+16] + mov ebx, [esi+12] + + sub ebp,ecx + neg ebp + add ebp,ebx + + sub ecx,257 + add ecx,ebx + + mov [esp+60],ebx + mov [esp+40],ebp + mov [esp+16],ecx +; 285 "inffast.S" + mov eax, [edi+lencode_state] + mov ecx, [edi+distcode_state] + + mov [esp+8],eax + mov [esp+12],ecx + + mov eax,1 + mov ecx, [edi+lenbits_state] + shl eax,cl + dec eax + mov [esp+0],eax + + mov eax,1 + mov ecx, [edi+distbits_state] + shl eax,cl + dec eax + mov [esp+4],eax + + mov eax, [edi+wsize_state] + mov ecx, [edi+write_state] + mov edx, [edi+window_state] + + mov [esp+52],eax + mov [esp+48],ecx + mov [esp+56],edx + + mov ebp, [edi+hold_state] + mov ebx, [edi+bits_state] +; 321 "inffast.S" + mov esi, [esp+44] + mov ecx, [esp+20] + cmp ecx,esi + ja L_align_long + + add ecx,11 + sub ecx,esi + mov eax,12 + sub eax,ecx + lea edi, [esp+28] + rep movsb + mov ecx,eax + xor eax,eax + rep stosb + lea esi, [esp+28] + mov [esp+20],esi + jmp L_is_aligned + + +L_align_long: + test esi,3 + jz L_is_aligned + xor eax,eax + mov al, [esi] + inc esi + mov ecx,ebx + add ebx,8 + shl eax,cl + or ebp,eax + jmp L_align_long + +L_is_aligned: + mov edi, [esp+60] +; 366 "inffast.S" +L_check_mmx: + cmp dword ptr [inflate_fast_use_mmx],2 + je L_init_mmx + ja L_do_loop + + push eax + push ebx + push ecx + push edx + pushfd + mov eax, [esp] + xor dword ptr [esp],0200000h + + + + + popfd + pushfd + pop edx + xor edx,eax + jz L_dont_use_mmx + xor eax,eax + cpuid + cmp ebx,0756e6547h + jne L_dont_use_mmx + cmp ecx,06c65746eh + jne L_dont_use_mmx + cmp edx,049656e69h + jne L_dont_use_mmx + mov eax,1 + cpuid + shr eax,8 + and eax,15 + cmp eax,6 + jne L_dont_use_mmx + test edx,0800000h + jnz L_use_mmx + jmp L_dont_use_mmx +L_use_mmx: + mov dword ptr [inflate_fast_use_mmx],2 + jmp L_check_mmx_pop +L_dont_use_mmx: + mov dword ptr [inflate_fast_use_mmx],3 +L_check_mmx_pop: + pop edx + pop ecx + pop ebx + pop eax + jmp L_check_mmx +; 426 "inffast.S" +ALIGN 4 +L_do_loop: +; 437 "inffast.S" + cmp bl,15 + ja L_get_length_code + + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + +L_get_length_code: + mov edx, [esp+0] + mov ecx, [esp+8] + and edx,ebp + mov eax, [ecx+edx*4] + +L_dolen: + + + + + + + mov cl,ah + sub bl,ah + shr ebp,cl + + + + + + + test al,al + jnz L_test_for_length_base + + shr eax,16 + stosb + +L_while_test: + + + cmp [esp+16],edi + jbe L_break_loop + + cmp [esp+20],esi + ja L_do_loop + jmp L_break_loop + +L_test_for_length_base: +; 502 "inffast.S" + mov edx,eax + shr edx,16 + mov cl,al + + test al,16 + jz L_test_for_second_level_length + and cl,15 + jz L_save_len + cmp bl,cl + jae L_add_bits_to_len + + mov ch,cl + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + mov cl,ch + +L_add_bits_to_len: + mov eax,1 + shl eax,cl + dec eax + sub bl,cl + and eax,ebp + shr ebp,cl + add edx,eax + +L_save_len: + mov [esp+24],edx + + +L_decode_distance: +; 549 "inffast.S" + cmp bl,15 + ja L_get_distance_code + + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + +L_get_distance_code: + mov edx, [esp+4] + mov ecx, [esp+12] + and edx,ebp + mov eax, [ecx+edx*4] + + +L_dodist: + mov edx,eax + shr edx,16 + mov cl,ah + sub bl,ah + shr ebp,cl +; 584 "inffast.S" + mov cl,al + + test al,16 + jz L_test_for_second_level_dist + and cl,15 + jz L_check_dist_one + cmp bl,cl + jae L_add_bits_to_dist + + mov ch,cl + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + mov cl,ch + +L_add_bits_to_dist: + mov eax,1 + shl eax,cl + dec eax + sub bl,cl + and eax,ebp + shr ebp,cl + add edx,eax + jmp L_check_window + +L_check_window: +; 625 "inffast.S" + mov [esp+44],esi + mov eax,edi + sub eax, [esp+40] + + cmp eax,edx + jb L_clip_window + + mov ecx, [esp+24] + mov esi,edi + sub esi,edx + + sub ecx,3 + mov al, [esi] + mov [edi],al + mov al, [esi+1] + mov dl, [esi+2] + add esi,3 + mov [edi+1],al + mov [edi+2],dl + add edi,3 + rep movsb + + mov esi, [esp+44] + jmp L_while_test + +ALIGN 4 +L_check_dist_one: + cmp edx,1 + jne L_check_window + cmp [esp+40],edi + je L_check_window + + dec edi + mov ecx, [esp+24] + mov al, [edi] + sub ecx,3 + + mov [edi+1],al + mov [edi+2],al + mov [edi+3],al + add edi,4 + rep stosb + + jmp L_while_test + +ALIGN 4 +L_test_for_second_level_length: + + + + + test al,64 + jnz L_test_for_end_of_block + + mov eax,1 + shl eax,cl + dec eax + and eax,ebp + add eax,edx + mov edx, [esp+8] + mov eax, [edx+eax*4] + jmp L_dolen + +ALIGN 4 +L_test_for_second_level_dist: + + + + + test al,64 + jnz L_invalid_distance_code + + mov eax,1 + shl eax,cl + dec eax + and eax,ebp + add eax,edx + mov edx, [esp+12] + mov eax, [edx+eax*4] + jmp L_dodist + +ALIGN 4 +L_clip_window: +; 721 "inffast.S" + mov ecx,eax + mov eax, [esp+52] + neg ecx + mov esi, [esp+56] + + cmp eax,edx + jb L_invalid_distance_too_far + + add ecx,edx + cmp dword ptr [esp+48],0 + jne L_wrap_around_window + + sub eax,ecx + add esi,eax +; 749 "inffast.S" + mov eax, [esp+24] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + jmp L_do_copy1 + + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + jmp L_do_copy1 + +L_wrap_around_window: +; 793 "inffast.S" + mov eax, [esp+48] + cmp ecx,eax + jbe L_contiguous_in_window + + add esi, [esp+52] + add esi,eax + sub esi,ecx + sub ecx,eax + + + mov eax, [esp+24] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi, [esp+56] + mov ecx, [esp+48] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + jmp L_do_copy1 + +L_contiguous_in_window: +; 836 "inffast.S" + add esi,eax + sub esi,ecx + + + mov eax, [esp+24] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + +L_do_copy1: +; 862 "inffast.S" + mov ecx,eax + rep movsb + + mov esi, [esp+44] + jmp L_while_test +; 878 "inffast.S" +ALIGN 4 +L_init_mmx: + emms + + + + + + movd mm0,ebp + mov ebp,ebx +; 896 "inffast.S" + movd mm4,dword ptr [esp+0] + movq mm3,mm4 + movd mm5,dword ptr [esp+4] + movq mm2,mm5 + pxor mm1,mm1 + mov ebx, [esp+8] + jmp L_do_loop_mmx + +ALIGN 4 +L_do_loop_mmx: + psrlq mm0,mm1 + + cmp ebp,32 + ja L_get_length_code_mmx + + movd mm6,ebp + movd mm7,dword ptr [esi] + add esi,4 + psllq mm7,mm6 + add ebp,32 + por mm0,mm7 + +L_get_length_code_mmx: + pand mm4,mm0 + movd eax,mm4 + movq mm4,mm3 + mov eax, [ebx+eax*4] + +L_dolen_mmx: + movzx ecx,ah + movd mm1,ecx + sub ebp,ecx + + test al,al + jnz L_test_for_length_base_mmx + + shr eax,16 + stosb + +L_while_test_mmx: + + + cmp [esp+16],edi + jbe L_break_loop + + cmp [esp+20],esi + ja L_do_loop_mmx + jmp L_break_loop + +L_test_for_length_base_mmx: + + mov edx,eax + shr edx,16 + + test al,16 + jz L_test_for_second_level_length_mmx + and eax,15 + jz L_decode_distance_mmx + + psrlq mm0,mm1 + movd mm1,eax + movd ecx,mm0 + sub ebp,eax + and ecx, [inflate_fast_mask+eax*4] + add edx,ecx + +L_decode_distance_mmx: + psrlq mm0,mm1 + + cmp ebp,32 + ja L_get_dist_code_mmx + + movd mm6,ebp + movd mm7,dword ptr [esi] + add esi,4 + psllq mm7,mm6 + add ebp,32 + por mm0,mm7 + +L_get_dist_code_mmx: + mov ebx, [esp+12] + pand mm5,mm0 + movd eax,mm5 + movq mm5,mm2 + mov eax, [ebx+eax*4] + +L_dodist_mmx: + + movzx ecx,ah + mov ebx,eax + shr ebx,16 + sub ebp,ecx + movd mm1,ecx + + test al,16 + jz L_test_for_second_level_dist_mmx + and eax,15 + jz L_check_dist_one_mmx + +L_add_bits_to_dist_mmx: + psrlq mm0,mm1 + movd mm1,eax + movd ecx,mm0 + sub ebp,eax + and ecx, [inflate_fast_mask+eax*4] + add ebx,ecx + +L_check_window_mmx: + mov [esp+44],esi + mov eax,edi + sub eax, [esp+40] + + cmp eax,ebx + jb L_clip_window_mmx + + mov ecx,edx + mov esi,edi + sub esi,ebx + + sub ecx,3 + mov al, [esi] + mov [edi],al + mov al, [esi+1] + mov dl, [esi+2] + add esi,3 + mov [edi+1],al + mov [edi+2],dl + add edi,3 + rep movsb + + mov esi, [esp+44] + mov ebx, [esp+8] + jmp L_while_test_mmx + +ALIGN 4 +L_check_dist_one_mmx: + cmp ebx,1 + jne L_check_window_mmx + cmp [esp+40],edi + je L_check_window_mmx + + dec edi + mov ecx,edx + mov al, [edi] + sub ecx,3 + + mov [edi+1],al + mov [edi+2],al + mov [edi+3],al + add edi,4 + rep stosb + + mov ebx, [esp+8] + jmp L_while_test_mmx + +ALIGN 4 +L_test_for_second_level_length_mmx: + test al,64 + jnz L_test_for_end_of_block + + and eax,15 + psrlq mm0,mm1 + movd ecx,mm0 + and ecx, [inflate_fast_mask+eax*4] + add ecx,edx + mov eax, [ebx+ecx*4] + jmp L_dolen_mmx + +ALIGN 4 +L_test_for_second_level_dist_mmx: + test al,64 + jnz L_invalid_distance_code + + and eax,15 + psrlq mm0,mm1 + movd ecx,mm0 + and ecx, [inflate_fast_mask+eax*4] + mov eax, [esp+12] + add ecx,ebx + mov eax, [eax+ecx*4] + jmp L_dodist_mmx + +ALIGN 4 +L_clip_window_mmx: + + mov ecx,eax + mov eax, [esp+52] + neg ecx + mov esi, [esp+56] + + cmp eax,ebx + jb L_invalid_distance_too_far + + add ecx,ebx + cmp dword ptr [esp+48],0 + jne L_wrap_around_window_mmx + + sub eax,ecx + add esi,eax + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + jmp L_do_copy1_mmx + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + jmp L_do_copy1_mmx + +L_wrap_around_window_mmx: + + mov eax, [esp+48] + cmp ecx,eax + jbe L_contiguous_in_window_mmx + + add esi, [esp+52] + add esi,eax + sub esi,ecx + sub ecx,eax + + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi, [esp+56] + mov ecx, [esp+48] + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + jmp L_do_copy1_mmx + +L_contiguous_in_window_mmx: + + add esi,eax + sub esi,ecx + + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + +L_do_copy1_mmx: + + + mov ecx,edx + rep movsb + + mov esi, [esp+44] + mov ebx, [esp+8] + jmp L_while_test_mmx +; 1174 "inffast.S" +L_invalid_distance_code: + + + + + + mov ecx, invalid_distance_code_msg + mov edx,INFLATE_MODE_BAD + jmp L_update_stream_state + +L_test_for_end_of_block: + + + + + + test al,32 + jz L_invalid_literal_length_code + + mov ecx,0 + mov edx,INFLATE_MODE_TYPE + jmp L_update_stream_state + +L_invalid_literal_length_code: + + + + + + mov ecx, invalid_literal_length_code_msg + mov edx,INFLATE_MODE_BAD + jmp L_update_stream_state + +L_invalid_distance_too_far: + + + + mov esi, [esp+44] + mov ecx, invalid_distance_too_far_msg + mov edx,INFLATE_MODE_BAD + jmp L_update_stream_state + +L_update_stream_state: + + mov eax, [esp+88] + test ecx,ecx + jz L_skip_msg + mov [eax+24],ecx +L_skip_msg: + mov eax, [eax+28] + mov [eax+mode_state],edx + jmp L_break_loop + +ALIGN 4 +L_break_loop: +; 1243 "inffast.S" + cmp dword ptr [inflate_fast_use_mmx],2 + jne L_update_next_in + + + + mov ebx,ebp + +L_update_next_in: +; 1266 "inffast.S" + mov eax, [esp+88] + mov ecx,ebx + mov edx, [eax+28] + shr ecx,3 + sub esi,ecx + shl ecx,3 + sub ebx,ecx + mov [eax+12],edi + mov [edx+bits_state],ebx + mov ecx,ebx + + lea ebx, [esp+28] + cmp [esp+20],ebx + jne L_buf_not_used + + sub esi,ebx + mov ebx, [eax+0] + mov [esp+20],ebx + add esi,ebx + mov ebx, [eax+4] + sub ebx,11 + add [esp+20],ebx + +L_buf_not_used: + mov [eax+0],esi + + mov ebx,1 + shl ebx,cl + dec ebx + + + + + + cmp dword ptr [inflate_fast_use_mmx],2 + jne L_update_hold + + + + psrlq mm0,mm1 + movd ebp,mm0 + + emms + +L_update_hold: + + + + and ebp,ebx + mov [edx+hold_state],ebp + + + + + mov ebx, [esp+20] + cmp ebx,esi + jbe L_last_is_smaller + + sub ebx,esi + add ebx,11 + mov [eax+4],ebx + jmp L_fixup_out +L_last_is_smaller: + sub esi,ebx + neg esi + add esi,11 + mov [eax+4],esi + + + + +L_fixup_out: + + mov ebx, [esp+16] + cmp ebx,edi + jbe L_end_is_smaller + + sub ebx,edi + add ebx,257 + mov [eax+16],ebx + jmp L_done +L_end_is_smaller: + sub edi,ebx + neg edi + add edi,257 + mov [eax+16],edi + + + + + +L_done: + add esp,64 + popfd + pop ebx + pop ebp + pop esi + pop edi + ret + +_TEXT ends +end diff --git a/3party/zlib/contrib/masmx86/match686.asm b/3party/zlib/contrib/masmx86/match686.asm index 1eaf555026..21ae7041b2 100644 --- a/3party/zlib/contrib/masmx86/match686.asm +++ b/3party/zlib/contrib/masmx86/match686.asm @@ -1,478 +1,478 @@ -; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86 -; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant. -; File written by Gilles Vollant, by converting match686.S from Brian Raiter -; for MASM. This is as assembly version of longest_match -; from Jean-loup Gailly in deflate.c -; -; http://www.zlib.net -; http://www.winimage.com/zLibDll -; http://www.muppetlabs.com/~breadbox/software/assembly.html -; -; For Visual C++ 4.x and higher and ML 6.x and higher -; ml.exe is distributed in -; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 -; -; this file contain two implementation of longest_match -; -; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro -; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom) -; -; for using an assembly version of longest_match, you need define ASMV in project -; -; compile the asm file running -; ml /coff /Zi /c /Flmatch686.lst match686.asm -; and do not include match686.obj in your project -; -; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for -; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor -; with autoselect (with cpu detection code) -; if you want support the old pentium optimization, you can still use these version -; -; this file is not optimized for old pentium, but it compatible with all x86 32 bits -; processor (starting 80386) -; -; -; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2 - -;uInt longest_match(s, cur_match) -; deflate_state *s; -; IPos cur_match; /* current match */ - - NbStack equ 76 - cur_match equ dword ptr[esp+NbStack-0] - str_s equ dword ptr[esp+NbStack-4] -; 5 dword on top (ret,ebp,esi,edi,ebx) - adrret equ dword ptr[esp+NbStack-8] - pushebp equ dword ptr[esp+NbStack-12] - pushedi equ dword ptr[esp+NbStack-16] - pushesi equ dword ptr[esp+NbStack-20] - pushebx equ dword ptr[esp+NbStack-24] - - chain_length equ dword ptr [esp+NbStack-28] - limit equ dword ptr [esp+NbStack-32] - best_len equ dword ptr [esp+NbStack-36] - window equ dword ptr [esp+NbStack-40] - prev equ dword ptr [esp+NbStack-44] - scan_start equ word ptr [esp+NbStack-48] - wmask equ dword ptr [esp+NbStack-52] - match_start_ptr equ dword ptr [esp+NbStack-56] - nice_match equ dword ptr [esp+NbStack-60] - scan equ dword ptr [esp+NbStack-64] - - windowlen equ dword ptr [esp+NbStack-68] - match_start equ dword ptr [esp+NbStack-72] - strend equ dword ptr [esp+NbStack-76] - NbStackAdd equ (NbStack-24) - - .386p - - name gvmatch - .MODEL FLAT - - - -; all the +zlib1222add offsets are due to the addition of fields -; in zlib in the deflate_state structure since the asm code was first written -; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). -; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). -; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). - - zlib1222add equ 8 - -; Note : these value are good with a 8 bytes boundary pack structure - dep_chain_length equ 74h+zlib1222add - dep_window equ 30h+zlib1222add - dep_strstart equ 64h+zlib1222add - dep_prev_length equ 70h+zlib1222add - dep_nice_match equ 88h+zlib1222add - dep_w_size equ 24h+zlib1222add - dep_prev equ 38h+zlib1222add - dep_w_mask equ 2ch+zlib1222add - dep_good_match equ 84h+zlib1222add - dep_match_start equ 68h+zlib1222add - dep_lookahead equ 6ch+zlib1222add - - -_TEXT segment - -IFDEF NOUNDERLINE - public longest_match - public match_init -ELSE - public _longest_match - public _match_init -ENDIF - - MAX_MATCH equ 258 - MIN_MATCH equ 3 - MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) - - - -MAX_MATCH equ 258 -MIN_MATCH equ 3 -MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1) -MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h) - - -;;; stack frame offsets - -chainlenwmask equ esp + 0 ; high word: current chain len - ; low word: s->wmask -window equ esp + 4 ; local copy of s->window -windowbestlen equ esp + 8 ; s->window + bestlen -scanstart equ esp + 16 ; first two bytes of string -scanend equ esp + 12 ; last two bytes of string -scanalign equ esp + 20 ; dword-misalignment of string -nicematch equ esp + 24 ; a good enough match size -bestlen equ esp + 28 ; size of best match so far -scan equ esp + 32 ; ptr to string wanting match - -LocalVarsSize equ 36 -; saved ebx byte esp + 36 -; saved edi byte esp + 40 -; saved esi byte esp + 44 -; saved ebp byte esp + 48 -; return address byte esp + 52 -deflatestate equ esp + 56 ; the function arguments -curmatch equ esp + 60 - -;;; Offsets for fields in the deflate_state structure. These numbers -;;; are calculated from the definition of deflate_state, with the -;;; assumption that the compiler will dword-align the fields. (Thus, -;;; changing the definition of deflate_state could easily cause this -;;; program to crash horribly, without so much as a warning at -;;; compile time. Sigh.) - -dsWSize equ 36+zlib1222add -dsWMask equ 44+zlib1222add -dsWindow equ 48+zlib1222add -dsPrev equ 56+zlib1222add -dsMatchLen equ 88+zlib1222add -dsPrevMatch equ 92+zlib1222add -dsStrStart equ 100+zlib1222add -dsMatchStart equ 104+zlib1222add -dsLookahead equ 108+zlib1222add -dsPrevLen equ 112+zlib1222add -dsMaxChainLen equ 116+zlib1222add -dsGoodMatch equ 132+zlib1222add -dsNiceMatch equ 136+zlib1222add - - -;;; match686.asm -- Pentium-Pro-optimized version of longest_match() -;;; Written for zlib 1.1.2 -;;; Copyright (C) 1998 Brian Raiter -;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html -;;; -;; -;; This software is provided 'as-is', without any express or implied -;; warranty. In no event will the authors be held liable for any damages -;; arising from the use of this software. -;; -;; Permission is granted to anyone to use this software for any purpose, -;; including commercial applications, and to alter it and redistribute it -;; freely, subject to the following restrictions: -;; -;; 1. The origin of this software must not be misrepresented; you must not -;; claim that you wrote the original software. If you use this software -;; in a product, an acknowledgment in the product documentation would be -;; appreciated but is not required. -;; 2. Altered source versions must be plainly marked as such, and must not be -;; misrepresented as being the original software -;; 3. This notice may not be removed or altered from any source distribution. -;; - -;GLOBAL _longest_match, _match_init - - -;SECTION .text - -;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch) - -;_longest_match: - IFDEF NOUNDERLINE - longest_match proc near - ELSE - _longest_match proc near - ENDIF - -;;; Save registers that the compiler may be using, and adjust esp to -;;; make room for our stack frame. - - push ebp - push edi - push esi - push ebx - sub esp, LocalVarsSize - -;;; Retrieve the function arguments. ecx will hold cur_match -;;; throughout the entire function. edx will hold the pointer to the -;;; deflate_state structure during the function's setup (before -;;; entering the main loop. - - mov edx, [deflatestate] - mov ecx, [curmatch] - -;;; uInt wmask = s->w_mask; -;;; unsigned chain_length = s->max_chain_length; -;;; if (s->prev_length >= s->good_match) { -;;; chain_length >>= 2; -;;; } - - mov eax, [edx + dsPrevLen] - mov ebx, [edx + dsGoodMatch] - cmp eax, ebx - mov eax, [edx + dsWMask] - mov ebx, [edx + dsMaxChainLen] - jl LastMatchGood - shr ebx, 2 -LastMatchGood: - -;;; chainlen is decremented once beforehand so that the function can -;;; use the sign flag instead of the zero flag for the exit test. -;;; It is then shifted into the high word, to make room for the wmask -;;; value, which it will always accompany. - - dec ebx - shl ebx, 16 - or ebx, eax - mov [chainlenwmask], ebx - -;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - - mov eax, [edx + dsNiceMatch] - mov ebx, [edx + dsLookahead] - cmp ebx, eax - jl LookaheadLess - mov ebx, eax -LookaheadLess: mov [nicematch], ebx - -;;; register Bytef *scan = s->window + s->strstart; - - mov esi, [edx + dsWindow] - mov [window], esi - mov ebp, [edx + dsStrStart] - lea edi, [esi + ebp] - mov [scan], edi - -;;; Determine how many bytes the scan ptr is off from being -;;; dword-aligned. - - mov eax, edi - neg eax - and eax, 3 - mov [scanalign], eax - -;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? -;;; s->strstart - (IPos)MAX_DIST(s) : NIL; - - mov eax, [edx + dsWSize] - sub eax, MIN_LOOKAHEAD - sub ebp, eax - jg LimitPositive - xor ebp, ebp -LimitPositive: - -;;; int best_len = s->prev_length; - - mov eax, [edx + dsPrevLen] - mov [bestlen], eax - -;;; Store the sum of s->window + best_len in esi locally, and in esi. - - add esi, eax - mov [windowbestlen], esi - -;;; register ush scan_start = *(ushf*)scan; -;;; register ush scan_end = *(ushf*)(scan+best_len-1); -;;; Posf *prev = s->prev; - - movzx ebx, word ptr [edi] - mov [scanstart], ebx - movzx ebx, word ptr [edi + eax - 1] - mov [scanend], ebx - mov edi, [edx + dsPrev] - -;;; Jump into the main loop. - - mov edx, [chainlenwmask] - jmp short LoopEntry - -align 4 - -;;; do { -;;; match = s->window + cur_match; -;;; if (*(ushf*)(match+best_len-1) != scan_end || -;;; *(ushf*)match != scan_start) continue; -;;; [...] -;;; } while ((cur_match = prev[cur_match & wmask]) > limit -;;; && --chain_length != 0); -;;; -;;; Here is the inner loop of the function. The function will spend the -;;; majority of its time in this loop, and majority of that time will -;;; be spent in the first ten instructions. -;;; -;;; Within this loop: -;;; ebx = scanend -;;; ecx = curmatch -;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) -;;; esi = windowbestlen - i.e., (window + bestlen) -;;; edi = prev -;;; ebp = limit - -LookupLoop: - and ecx, edx - movzx ecx, word ptr [edi + ecx*2] - cmp ecx, ebp - jbe LeaveNow - sub edx, 00010000h - js LeaveNow -LoopEntry: movzx eax, word ptr [esi + ecx - 1] - cmp eax, ebx - jnz LookupLoop - mov eax, [window] - movzx eax, word ptr [eax + ecx] - cmp eax, [scanstart] - jnz LookupLoop - -;;; Store the current value of chainlen. - - mov [chainlenwmask], edx - -;;; Point edi to the string under scrutiny, and esi to the string we -;;; are hoping to match it up with. In actuality, esi and edi are -;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is -;;; initialized to -(MAX_MATCH_8 - scanalign). - - mov esi, [window] - mov edi, [scan] - add esi, ecx - mov eax, [scanalign] - mov edx, 0fffffef8h; -(MAX_MATCH_8) - lea edi, [edi + eax + 0108h] ;MAX_MATCH_8] - lea esi, [esi + eax + 0108h] ;MAX_MATCH_8] - -;;; Test the strings for equality, 8 bytes at a time. At the end, -;;; adjust edx so that it is offset to the exact byte that mismatched. -;;; -;;; We already know at this point that the first three bytes of the -;;; strings match each other, and they can be safely passed over before -;;; starting the compare loop. So what this code does is skip over 0-3 -;;; bytes, as much as necessary in order to dword-align the edi -;;; pointer. (esi will still be misaligned three times out of four.) -;;; -;;; It should be confessed that this loop usually does not represent -;;; much of the total running time. Replacing it with a more -;;; straightforward "rep cmpsb" would not drastically degrade -;;; performance. - -LoopCmps: - mov eax, [esi + edx] - xor eax, [edi + edx] - jnz LeaveLoopCmps - mov eax, [esi + edx + 4] - xor eax, [edi + edx + 4] - jnz LeaveLoopCmps4 - add edx, 8 - jnz LoopCmps - jmp short LenMaximum -LeaveLoopCmps4: add edx, 4 -LeaveLoopCmps: test eax, 0000FFFFh - jnz LenLower - add edx, 2 - shr eax, 16 -LenLower: sub al, 1 - adc edx, 0 - -;;; Calculate the length of the match. If it is longer than MAX_MATCH, -;;; then automatically accept it as the best possible match and leave. - - lea eax, [edi + edx] - mov edi, [scan] - sub eax, edi - cmp eax, MAX_MATCH - jge LenMaximum - -;;; If the length of the match is not longer than the best match we -;;; have so far, then forget it and return to the lookup loop. - - mov edx, [deflatestate] - mov ebx, [bestlen] - cmp eax, ebx - jg LongerMatch - mov esi, [windowbestlen] - mov edi, [edx + dsPrev] - mov ebx, [scanend] - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; s->match_start = cur_match; -;;; best_len = len; -;;; if (len >= nice_match) break; -;;; scan_end = *(ushf*)(scan+best_len-1); - -LongerMatch: mov ebx, [nicematch] - mov [bestlen], eax - mov [edx + dsMatchStart], ecx - cmp eax, ebx - jge LeaveNow - mov esi, [window] - add esi, eax - mov [windowbestlen], esi - movzx ebx, word ptr [edi + eax - 1] - mov edi, [edx + dsPrev] - mov [scanend], ebx - mov edx, [chainlenwmask] - jmp LookupLoop - -;;; Accept the current string, with the maximum possible length. - -LenMaximum: mov edx, [deflatestate] - mov dword ptr [bestlen], MAX_MATCH - mov [edx + dsMatchStart], ecx - -;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; -;;; return s->lookahead; - -LeaveNow: - mov edx, [deflatestate] - mov ebx, [bestlen] - mov eax, [edx + dsLookahead] - cmp ebx, eax - jg LookaheadRet - mov eax, ebx -LookaheadRet: - -;;; Restore the stack and return from whence we came. - - add esp, LocalVarsSize - pop ebx - pop esi - pop edi - pop ebp - - ret -; please don't remove this string ! -; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary! - db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah - - - IFDEF NOUNDERLINE - longest_match endp - ELSE - _longest_match endp - ENDIF - - IFDEF NOUNDERLINE - match_init proc near - ret - match_init endp - ELSE - _match_init proc near - ret - _match_init endp - ENDIF - - -_TEXT ends -end +; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86 +; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant. +; File written by Gilles Vollant, by converting match686.S from Brian Raiter +; for MASM. This is as assembly version of longest_match +; from Jean-loup Gailly in deflate.c +; +; http://www.zlib.net +; http://www.winimage.com/zLibDll +; http://www.muppetlabs.com/~breadbox/software/assembly.html +; +; For Visual C++ 4.x and higher and ML 6.x and higher +; ml.exe is distributed in +; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 +; +; this file contain two implementation of longest_match +; +; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro +; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom) +; +; for using an assembly version of longest_match, you need define ASMV in project +; +; compile the asm file running +; ml /coff /Zi /c /Flmatch686.lst match686.asm +; and do not include match686.obj in your project +; +; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for +; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor +; with autoselect (with cpu detection code) +; if you want support the old pentium optimization, you can still use these version +; +; this file is not optimized for old pentium, but it compatible with all x86 32 bits +; processor (starting 80386) +; +; +; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2 + +;uInt longest_match(s, cur_match) +; deflate_state *s; +; IPos cur_match; /* current match */ + + NbStack equ 76 + cur_match equ dword ptr[esp+NbStack-0] + str_s equ dword ptr[esp+NbStack-4] +; 5 dword on top (ret,ebp,esi,edi,ebx) + adrret equ dword ptr[esp+NbStack-8] + pushebp equ dword ptr[esp+NbStack-12] + pushedi equ dword ptr[esp+NbStack-16] + pushesi equ dword ptr[esp+NbStack-20] + pushebx equ dword ptr[esp+NbStack-24] + + chain_length equ dword ptr [esp+NbStack-28] + limit equ dword ptr [esp+NbStack-32] + best_len equ dword ptr [esp+NbStack-36] + window equ dword ptr [esp+NbStack-40] + prev equ dword ptr [esp+NbStack-44] + scan_start equ word ptr [esp+NbStack-48] + wmask equ dword ptr [esp+NbStack-52] + match_start_ptr equ dword ptr [esp+NbStack-56] + nice_match equ dword ptr [esp+NbStack-60] + scan equ dword ptr [esp+NbStack-64] + + windowlen equ dword ptr [esp+NbStack-68] + match_start equ dword ptr [esp+NbStack-72] + strend equ dword ptr [esp+NbStack-76] + NbStackAdd equ (NbStack-24) + + .386p + + name gvmatch + .MODEL FLAT + + + +; all the +zlib1222add offsets are due to the addition of fields +; in zlib in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). +; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). +; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). + + zlib1222add equ 8 + +; Note : these value are good with a 8 bytes boundary pack structure + dep_chain_length equ 74h+zlib1222add + dep_window equ 30h+zlib1222add + dep_strstart equ 64h+zlib1222add + dep_prev_length equ 70h+zlib1222add + dep_nice_match equ 88h+zlib1222add + dep_w_size equ 24h+zlib1222add + dep_prev equ 38h+zlib1222add + dep_w_mask equ 2ch+zlib1222add + dep_good_match equ 84h+zlib1222add + dep_match_start equ 68h+zlib1222add + dep_lookahead equ 6ch+zlib1222add + + +_TEXT segment + +IFDEF NOUNDERLINE + public longest_match + public match_init +ELSE + public _longest_match + public _match_init +ENDIF + + MAX_MATCH equ 258 + MIN_MATCH equ 3 + MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) + + + +MAX_MATCH equ 258 +MIN_MATCH equ 3 +MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1) +MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h) + + +;;; stack frame offsets + +chainlenwmask equ esp + 0 ; high word: current chain len + ; low word: s->wmask +window equ esp + 4 ; local copy of s->window +windowbestlen equ esp + 8 ; s->window + bestlen +scanstart equ esp + 16 ; first two bytes of string +scanend equ esp + 12 ; last two bytes of string +scanalign equ esp + 20 ; dword-misalignment of string +nicematch equ esp + 24 ; a good enough match size +bestlen equ esp + 28 ; size of best match so far +scan equ esp + 32 ; ptr to string wanting match + +LocalVarsSize equ 36 +; saved ebx byte esp + 36 +; saved edi byte esp + 40 +; saved esi byte esp + 44 +; saved ebp byte esp + 48 +; return address byte esp + 52 +deflatestate equ esp + 56 ; the function arguments +curmatch equ esp + 60 + +;;; Offsets for fields in the deflate_state structure. These numbers +;;; are calculated from the definition of deflate_state, with the +;;; assumption that the compiler will dword-align the fields. (Thus, +;;; changing the definition of deflate_state could easily cause this +;;; program to crash horribly, without so much as a warning at +;;; compile time. Sigh.) + +dsWSize equ 36+zlib1222add +dsWMask equ 44+zlib1222add +dsWindow equ 48+zlib1222add +dsPrev equ 56+zlib1222add +dsMatchLen equ 88+zlib1222add +dsPrevMatch equ 92+zlib1222add +dsStrStart equ 100+zlib1222add +dsMatchStart equ 104+zlib1222add +dsLookahead equ 108+zlib1222add +dsPrevLen equ 112+zlib1222add +dsMaxChainLen equ 116+zlib1222add +dsGoodMatch equ 132+zlib1222add +dsNiceMatch equ 136+zlib1222add + + +;;; match686.asm -- Pentium-Pro-optimized version of longest_match() +;;; Written for zlib 1.1.2 +;;; Copyright (C) 1998 Brian Raiter +;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html +;;; +;; +;; This software is provided 'as-is', without any express or implied +;; warranty. In no event will the authors be held liable for any damages +;; arising from the use of this software. +;; +;; Permission is granted to anyone to use this software for any purpose, +;; including commercial applications, and to alter it and redistribute it +;; freely, subject to the following restrictions: +;; +;; 1. The origin of this software must not be misrepresented; you must not +;; claim that you wrote the original software. If you use this software +;; in a product, an acknowledgment in the product documentation would be +;; appreciated but is not required. +;; 2. Altered source versions must be plainly marked as such, and must not be +;; misrepresented as being the original software +;; 3. This notice may not be removed or altered from any source distribution. +;; + +;GLOBAL _longest_match, _match_init + + +;SECTION .text + +;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch) + +;_longest_match: + IFDEF NOUNDERLINE + longest_match proc near + ELSE + _longest_match proc near + ENDIF + +;;; Save registers that the compiler may be using, and adjust esp to +;;; make room for our stack frame. + + push ebp + push edi + push esi + push ebx + sub esp, LocalVarsSize + +;;; Retrieve the function arguments. ecx will hold cur_match +;;; throughout the entire function. edx will hold the pointer to the +;;; deflate_state structure during the function's setup (before +;;; entering the main loop. + + mov edx, [deflatestate] + mov ecx, [curmatch] + +;;; uInt wmask = s->w_mask; +;;; unsigned chain_length = s->max_chain_length; +;;; if (s->prev_length >= s->good_match) { +;;; chain_length >>= 2; +;;; } + + mov eax, [edx + dsPrevLen] + mov ebx, [edx + dsGoodMatch] + cmp eax, ebx + mov eax, [edx + dsWMask] + mov ebx, [edx + dsMaxChainLen] + jl LastMatchGood + shr ebx, 2 +LastMatchGood: + +;;; chainlen is decremented once beforehand so that the function can +;;; use the sign flag instead of the zero flag for the exit test. +;;; It is then shifted into the high word, to make room for the wmask +;;; value, which it will always accompany. + + dec ebx + shl ebx, 16 + or ebx, eax + mov [chainlenwmask], ebx + +;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + mov eax, [edx + dsNiceMatch] + mov ebx, [edx + dsLookahead] + cmp ebx, eax + jl LookaheadLess + mov ebx, eax +LookaheadLess: mov [nicematch], ebx + +;;; register Bytef *scan = s->window + s->strstart; + + mov esi, [edx + dsWindow] + mov [window], esi + mov ebp, [edx + dsStrStart] + lea edi, [esi + ebp] + mov [scan], edi + +;;; Determine how many bytes the scan ptr is off from being +;;; dword-aligned. + + mov eax, edi + neg eax + and eax, 3 + mov [scanalign], eax + +;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? +;;; s->strstart - (IPos)MAX_DIST(s) : NIL; + + mov eax, [edx + dsWSize] + sub eax, MIN_LOOKAHEAD + sub ebp, eax + jg LimitPositive + xor ebp, ebp +LimitPositive: + +;;; int best_len = s->prev_length; + + mov eax, [edx + dsPrevLen] + mov [bestlen], eax + +;;; Store the sum of s->window + best_len in esi locally, and in esi. + + add esi, eax + mov [windowbestlen], esi + +;;; register ush scan_start = *(ushf*)scan; +;;; register ush scan_end = *(ushf*)(scan+best_len-1); +;;; Posf *prev = s->prev; + + movzx ebx, word ptr [edi] + mov [scanstart], ebx + movzx ebx, word ptr [edi + eax - 1] + mov [scanend], ebx + mov edi, [edx + dsPrev] + +;;; Jump into the main loop. + + mov edx, [chainlenwmask] + jmp short LoopEntry + +align 4 + +;;; do { +;;; match = s->window + cur_match; +;;; if (*(ushf*)(match+best_len-1) != scan_end || +;;; *(ushf*)match != scan_start) continue; +;;; [...] +;;; } while ((cur_match = prev[cur_match & wmask]) > limit +;;; && --chain_length != 0); +;;; +;;; Here is the inner loop of the function. The function will spend the +;;; majority of its time in this loop, and majority of that time will +;;; be spent in the first ten instructions. +;;; +;;; Within this loop: +;;; ebx = scanend +;;; ecx = curmatch +;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) +;;; esi = windowbestlen - i.e., (window + bestlen) +;;; edi = prev +;;; ebp = limit + +LookupLoop: + and ecx, edx + movzx ecx, word ptr [edi + ecx*2] + cmp ecx, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow +LoopEntry: movzx eax, word ptr [esi + ecx - 1] + cmp eax, ebx + jnz LookupLoop + mov eax, [window] + movzx eax, word ptr [eax + ecx] + cmp eax, [scanstart] + jnz LookupLoop + +;;; Store the current value of chainlen. + + mov [chainlenwmask], edx + +;;; Point edi to the string under scrutiny, and esi to the string we +;;; are hoping to match it up with. In actuality, esi and edi are +;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is +;;; initialized to -(MAX_MATCH_8 - scanalign). + + mov esi, [window] + mov edi, [scan] + add esi, ecx + mov eax, [scanalign] + mov edx, 0fffffef8h; -(MAX_MATCH_8) + lea edi, [edi + eax + 0108h] ;MAX_MATCH_8] + lea esi, [esi + eax + 0108h] ;MAX_MATCH_8] + +;;; Test the strings for equality, 8 bytes at a time. At the end, +;;; adjust edx so that it is offset to the exact byte that mismatched. +;;; +;;; We already know at this point that the first three bytes of the +;;; strings match each other, and they can be safely passed over before +;;; starting the compare loop. So what this code does is skip over 0-3 +;;; bytes, as much as necessary in order to dword-align the edi +;;; pointer. (esi will still be misaligned three times out of four.) +;;; +;;; It should be confessed that this loop usually does not represent +;;; much of the total running time. Replacing it with a more +;;; straightforward "rep cmpsb" would not drastically degrade +;;; performance. + +LoopCmps: + mov eax, [esi + edx] + xor eax, [edi + edx] + jnz LeaveLoopCmps + mov eax, [esi + edx + 4] + xor eax, [edi + edx + 4] + jnz LeaveLoopCmps4 + add edx, 8 + jnz LoopCmps + jmp short LenMaximum +LeaveLoopCmps4: add edx, 4 +LeaveLoopCmps: test eax, 0000FFFFh + jnz LenLower + add edx, 2 + shr eax, 16 +LenLower: sub al, 1 + adc edx, 0 + +;;; Calculate the length of the match. If it is longer than MAX_MATCH, +;;; then automatically accept it as the best possible match and leave. + + lea eax, [edi + edx] + mov edi, [scan] + sub eax, edi + cmp eax, MAX_MATCH + jge LenMaximum + +;;; If the length of the match is not longer than the best match we +;;; have so far, then forget it and return to the lookup loop. + + mov edx, [deflatestate] + mov ebx, [bestlen] + cmp eax, ebx + jg LongerMatch + mov esi, [windowbestlen] + mov edi, [edx + dsPrev] + mov ebx, [scanend] + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; s->match_start = cur_match; +;;; best_len = len; +;;; if (len >= nice_match) break; +;;; scan_end = *(ushf*)(scan+best_len-1); + +LongerMatch: mov ebx, [nicematch] + mov [bestlen], eax + mov [edx + dsMatchStart], ecx + cmp eax, ebx + jge LeaveNow + mov esi, [window] + add esi, eax + mov [windowbestlen], esi + movzx ebx, word ptr [edi + eax - 1] + mov edi, [edx + dsPrev] + mov [scanend], ebx + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; Accept the current string, with the maximum possible length. + +LenMaximum: mov edx, [deflatestate] + mov dword ptr [bestlen], MAX_MATCH + mov [edx + dsMatchStart], ecx + +;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; +;;; return s->lookahead; + +LeaveNow: + mov edx, [deflatestate] + mov ebx, [bestlen] + mov eax, [edx + dsLookahead] + cmp ebx, eax + jg LookaheadRet + mov eax, ebx +LookaheadRet: + +;;; Restore the stack and return from whence we came. + + add esp, LocalVarsSize + pop ebx + pop esi + pop edi + pop ebp + + ret +; please don't remove this string ! +; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary! + db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah + + + IFDEF NOUNDERLINE + longest_match endp + ELSE + _longest_match endp + ENDIF + + IFDEF NOUNDERLINE + match_init proc near + ret + match_init endp + ELSE + _match_init proc near + ret + _match_init endp + ENDIF + + +_TEXT ends +end diff --git a/3party/zlib/contrib/masmx86/readme.txt b/3party/zlib/contrib/masmx86/readme.txt index 3271f720a1..3f8888679f 100644 --- a/3party/zlib/contrib/masmx86/readme.txt +++ b/3party/zlib/contrib/masmx86/readme.txt @@ -1,27 +1,27 @@ - -Summary -------- -This directory contains ASM implementations of the functions -longest_match() and inflate_fast(). - - -Use instructions ----------------- -Assemble using MASM, and copy the object files into the zlib source -directory, then run the appropriate makefile, as suggested below. You can -donwload MASM from here: - - http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 - -You can also get objects files here: - - http://www.winimage.com/zLibDll/zlib124_masm_obj.zip - -Build instructions ------------------- -* With Microsoft C and MASM: -nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" - -* With Borland C and TASM: -make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" - + +Summary +------- +This directory contains ASM implementations of the functions +longest_match() and inflate_fast(). + + +Use instructions +---------------- +Assemble using MASM, and copy the object files into the zlib source +directory, then run the appropriate makefile, as suggested below. You can +donwload MASM from here: + + http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 + +You can also get objects files here: + + http://www.winimage.com/zLibDll/zlib124_masm_obj.zip + +Build instructions +------------------ +* With Microsoft C and MASM: +nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" + +* With Borland C and TASM: +make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" + diff --git a/3party/zlib/contrib/testzlib/testzlib.txt b/3party/zlib/contrib/testzlib/testzlib.txt index 62258f1495..e508bb22ff 100644 --- a/3party/zlib/contrib/testzlib/testzlib.txt +++ b/3party/zlib/contrib/testzlib/testzlib.txt @@ -1,10 +1,10 @@ -To build testzLib with Visual Studio 2005: - -copy to a directory file from : -- root of zLib tree -- contrib/testzlib -- contrib/masmx86 -- contrib/masmx64 -- contrib/vstudio/vc7 - +To build testzLib with Visual Studio 2005: + +copy to a directory file from : +- root of zLib tree +- contrib/testzlib +- contrib/masmx86 +- contrib/masmx64 +- contrib/vstudio/vc7 + and open testzlib8.sln \ No newline at end of file diff --git a/3party/zlib/contrib/vstudio/vc10/zlibvc.def b/3party/zlib/contrib/vstudio/vc10/zlibvc.def index 0269ef722c..fa171ae925 100644 --- a/3party/zlib/contrib/vstudio/vc10/zlibvc.def +++ b/3party/zlib/contrib/vstudio/vc10/zlibvc.def @@ -1,130 +1,130 @@ -LIBRARY -; zlib data compression and ZIP file I/O library - -VERSION 1.24 - -EXPORTS - adler32 @1 - compress @2 - crc32 @3 - deflate @4 - deflateCopy @5 - deflateEnd @6 - deflateInit2_ @7 - deflateInit_ @8 - deflateParams @9 - deflateReset @10 - deflateSetDictionary @11 - gzclose @12 - gzdopen @13 - gzerror @14 - gzflush @15 - gzopen @16 - gzread @17 - gzwrite @18 - inflate @19 - inflateEnd @20 - inflateInit2_ @21 - inflateInit_ @22 - inflateReset @23 - inflateSetDictionary @24 - inflateSync @25 - uncompress @26 - zlibVersion @27 - gzprintf @28 - gzputc @29 - gzgetc @30 - gzseek @31 - gzrewind @32 - gztell @33 - gzeof @34 - gzsetparams @35 - zError @36 - inflateSyncPoint @37 - get_crc_table @38 - compress2 @39 - gzputs @40 - gzgets @41 - inflateCopy @42 - inflateBackInit_ @43 - inflateBack @44 - inflateBackEnd @45 - compressBound @46 - deflateBound @47 - gzclearerr @48 - gzungetc @49 - zlibCompileFlags @50 - deflatePrime @51 - - unzOpen @61 - unzClose @62 - unzGetGlobalInfo @63 - unzGetCurrentFileInfo @64 - unzGoToFirstFile @65 - unzGoToNextFile @66 - unzOpenCurrentFile @67 - unzReadCurrentFile @68 - unzOpenCurrentFile3 @69 - unztell @70 - unzeof @71 - unzCloseCurrentFile @72 - unzGetGlobalComment @73 - unzStringFileNameCompare @74 - unzLocateFile @75 - unzGetLocalExtrafield @76 - unzOpen2 @77 - unzOpenCurrentFile2 @78 - unzOpenCurrentFilePassword @79 - - zipOpen @80 - zipOpenNewFileInZip @81 - zipWriteInFileInZip @82 - zipCloseFileInZip @83 - zipClose @84 - zipOpenNewFileInZip2 @86 - zipCloseFileInZipRaw @87 - zipOpen2 @88 - zipOpenNewFileInZip3 @89 - - unzGetFilePos @100 - unzGoToFilePos @101 - - fill_win32_filefunc @110 - -; zlibwapi v1.2.4 added: - fill_win32_filefunc64 @111 - fill_win32_filefunc64A @112 - fill_win32_filefunc64W @113 - - unzOpen64 @120 - unzOpen2_64 @121 - unzGetGlobalInfo64 @122 - unzGetCurrentFileInfo64 @124 - unzGetCurrentFileZStreamPos64 @125 - unztell64 @126 - unzGetFilePos64 @127 - unzGoToFilePos64 @128 - - zipOpen64 @130 - zipOpen2_64 @131 - zipOpenNewFileInZip64 @132 - zipOpenNewFileInZip2_64 @133 - zipOpenNewFileInZip3_64 @134 - zipOpenNewFileInZip4_64 @135 - zipCloseFileInZipRaw64 @136 - -; zlib1 v1.2.4 added: - adler32_combine @140 - crc32_combine @142 - deflateSetHeader @144 - deflateTune @145 - gzbuffer @146 - gzclose_r @147 - gzclose_w @148 - gzdirect @149 - gzoffset @150 - inflateGetHeader @156 - inflateMark @157 - inflatePrime @158 - inflateReset2 @159 - inflateUndermine @160 +LIBRARY +; zlib data compression and ZIP file I/O library + +VERSION 1.24 + +EXPORTS + adler32 @1 + compress @2 + crc32 @3 + deflate @4 + deflateCopy @5 + deflateEnd @6 + deflateInit2_ @7 + deflateInit_ @8 + deflateParams @9 + deflateReset @10 + deflateSetDictionary @11 + gzclose @12 + gzdopen @13 + gzerror @14 + gzflush @15 + gzopen @16 + gzread @17 + gzwrite @18 + inflate @19 + inflateEnd @20 + inflateInit2_ @21 + inflateInit_ @22 + inflateReset @23 + inflateSetDictionary @24 + inflateSync @25 + uncompress @26 + zlibVersion @27 + gzprintf @28 + gzputc @29 + gzgetc @30 + gzseek @31 + gzrewind @32 + gztell @33 + gzeof @34 + gzsetparams @35 + zError @36 + inflateSyncPoint @37 + get_crc_table @38 + compress2 @39 + gzputs @40 + gzgets @41 + inflateCopy @42 + inflateBackInit_ @43 + inflateBack @44 + inflateBackEnd @45 + compressBound @46 + deflateBound @47 + gzclearerr @48 + gzungetc @49 + zlibCompileFlags @50 + deflatePrime @51 + + unzOpen @61 + unzClose @62 + unzGetGlobalInfo @63 + unzGetCurrentFileInfo @64 + unzGoToFirstFile @65 + unzGoToNextFile @66 + unzOpenCurrentFile @67 + unzReadCurrentFile @68 + unzOpenCurrentFile3 @69 + unztell @70 + unzeof @71 + unzCloseCurrentFile @72 + unzGetGlobalComment @73 + unzStringFileNameCompare @74 + unzLocateFile @75 + unzGetLocalExtrafield @76 + unzOpen2 @77 + unzOpenCurrentFile2 @78 + unzOpenCurrentFilePassword @79 + + zipOpen @80 + zipOpenNewFileInZip @81 + zipWriteInFileInZip @82 + zipCloseFileInZip @83 + zipClose @84 + zipOpenNewFileInZip2 @86 + zipCloseFileInZipRaw @87 + zipOpen2 @88 + zipOpenNewFileInZip3 @89 + + unzGetFilePos @100 + unzGoToFilePos @101 + + fill_win32_filefunc @110 + +; zlibwapi v1.2.4 added: + fill_win32_filefunc64 @111 + fill_win32_filefunc64A @112 + fill_win32_filefunc64W @113 + + unzOpen64 @120 + unzOpen2_64 @121 + unzGetGlobalInfo64 @122 + unzGetCurrentFileInfo64 @124 + unzGetCurrentFileZStreamPos64 @125 + unztell64 @126 + unzGetFilePos64 @127 + unzGoToFilePos64 @128 + + zipOpen64 @130 + zipOpen2_64 @131 + zipOpenNewFileInZip64 @132 + zipOpenNewFileInZip2_64 @133 + zipOpenNewFileInZip3_64 @134 + zipOpenNewFileInZip4_64 @135 + zipCloseFileInZipRaw64 @136 + +; zlib1 v1.2.4 added: + adler32_combine @140 + crc32_combine @142 + deflateSetHeader @144 + deflateTune @145 + gzbuffer @146 + gzclose_r @147 + gzclose_w @148 + gzdirect @149 + gzoffset @150 + inflateGetHeader @156 + inflateMark @157 + inflatePrime @158 + inflateReset2 @159 + inflateUndermine @160 diff --git a/3party/zlib/old/visualc6/README.txt b/3party/zlib/old/visualc6/README.txt index d0296c272c..3d0aef0a12 100644 --- a/3party/zlib/old/visualc6/README.txt +++ b/3party/zlib/old/visualc6/README.txt @@ -1,73 +1,73 @@ -Microsoft Developer Studio Project Files, Format Version 6.00 for zlib. - -Copyright (C) 2000-2004 Simon-Pierre Cadieux. -Copyright (C) 2004 Cosmin Truta. -For conditions of distribution and use, see copyright notice in zlib.h. - - -This project builds the zlib binaries as follows: - -* Win32_DLL_Release\zlib1.dll DLL build -* Win32_DLL_Debug\zlib1d.dll DLL build (debug version) -* Win32_DLL_ASM_Release\zlib1.dll DLL build using ASM code -* Win32_DLL_ASM_Debug\zlib1d.dll DLL build using ASM code (debug version) -* Win32_LIB_Release\zlib.lib static build -* Win32_LIB_Debug\zlibd.lib static build (debug version) -* Win32_LIB_ASM_Release\zlib.lib static build using ASM code -* Win32_LIB_ASM_Debug\zlibd.lib static build using ASM code (debug version) - - -For more information regarding the DLL builds, please see the DLL FAQ -in ..\..\win32\DLL_FAQ.txt. - - -To build and test: - -1) On the main menu, select "File | Open Workspace". - Open "zlib.dsw". - -2) Select "Build | Set Active Configuration". - Choose the configuration you wish to build. - -3) Select "Build | Clean". - -4) Select "Build | Build ... (F7)". Ignore warning messages about - not being able to find certain include files (e.g. alloc.h). - -5) If you built one of the sample programs (example or minigzip), - select "Build | Execute ... (Ctrl+F5)". - - -To use: - -1) Select "Project | Settings (Alt+F7)". - Make note of the configuration names used in your project. - Usually, these names are "Win32 Release" and "Win32 Debug". - -2) In the Workspace window, select the "FileView" tab. - Right-click on the root item "Workspace '...'". - Select "Insert Project into Workspace". - Switch on the checkbox "Dependency of:", and select the name - of your project. Open "zlib.dsp". - -3) Select "Build | Configurations". - For each configuration of your project: - 3.1) Choose the zlib configuration you wish to use. - 3.2) Click on "Add". - 3.3) Set the new zlib configuration name to the name used by - the configuration from the current iteration. - -4) Select "Build | Set Active Configuration". - Choose the configuration you wish to build. - -5) Select "Build | Build ... (F7)". - -6) If you built an executable program, select - "Build | Execute ... (Ctrl+F5)". - - -Note: - -To build the ASM-enabled code, you need Microsoft Assembler -(ML.EXE). You can get it by downloading and installing the -latest Processor Pack for Visual C++ 6.0. +Microsoft Developer Studio Project Files, Format Version 6.00 for zlib. + +Copyright (C) 2000-2004 Simon-Pierre Cadieux. +Copyright (C) 2004 Cosmin Truta. +For conditions of distribution and use, see copyright notice in zlib.h. + + +This project builds the zlib binaries as follows: + +* Win32_DLL_Release\zlib1.dll DLL build +* Win32_DLL_Debug\zlib1d.dll DLL build (debug version) +* Win32_DLL_ASM_Release\zlib1.dll DLL build using ASM code +* Win32_DLL_ASM_Debug\zlib1d.dll DLL build using ASM code (debug version) +* Win32_LIB_Release\zlib.lib static build +* Win32_LIB_Debug\zlibd.lib static build (debug version) +* Win32_LIB_ASM_Release\zlib.lib static build using ASM code +* Win32_LIB_ASM_Debug\zlibd.lib static build using ASM code (debug version) + + +For more information regarding the DLL builds, please see the DLL FAQ +in ..\..\win32\DLL_FAQ.txt. + + +To build and test: + +1) On the main menu, select "File | Open Workspace". + Open "zlib.dsw". + +2) Select "Build | Set Active Configuration". + Choose the configuration you wish to build. + +3) Select "Build | Clean". + +4) Select "Build | Build ... (F7)". Ignore warning messages about + not being able to find certain include files (e.g. alloc.h). + +5) If you built one of the sample programs (example or minigzip), + select "Build | Execute ... (Ctrl+F5)". + + +To use: + +1) Select "Project | Settings (Alt+F7)". + Make note of the configuration names used in your project. + Usually, these names are "Win32 Release" and "Win32 Debug". + +2) In the Workspace window, select the "FileView" tab. + Right-click on the root item "Workspace '...'". + Select "Insert Project into Workspace". + Switch on the checkbox "Dependency of:", and select the name + of your project. Open "zlib.dsp". + +3) Select "Build | Configurations". + For each configuration of your project: + 3.1) Choose the zlib configuration you wish to use. + 3.2) Click on "Add". + 3.3) Set the new zlib configuration name to the name used by + the configuration from the current iteration. + +4) Select "Build | Set Active Configuration". + Choose the configuration you wish to build. + +5) Select "Build | Build ... (F7)". + +6) If you built an executable program, select + "Build | Execute ... (Ctrl+F5)". + + +Note: + +To build the ASM-enabled code, you need Microsoft Assembler +(ML.EXE). You can get it by downloading and installing the +latest Processor Pack for Visual C++ 6.0. diff --git a/3party/zlib/old/visualc6/zlib.dsp b/3party/zlib/old/visualc6/zlib.dsp index 00f54ea422..34f1f3000f 100644 --- a/3party/zlib/old/visualc6/zlib.dsp +++ b/3party/zlib/old/visualc6/zlib.dsp @@ -1,621 +1,621 @@ -# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=zlib - Win32 LIB Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 LIB Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "zlib - Win32 DLL ASM Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 DLL ASM Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 LIB ASM Release" (based on "Win32 (x86) Static Library") -!MESSAGE "zlib - Win32 LIB ASM Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "zlib - Win32 LIB Release" (based on "Win32 (x86) Static Library") -!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "zlib___Win32_DLL_ASM_Release" -# PROP BASE Intermediate_Dir "zlib___Win32_DLL_ASM_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_ASM_Release" -# PROP Intermediate_Dir "Win32_DLL_ASM_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /D "ASMV" /D "ASMINF" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\zlib1.dll" - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "zlib___Win32_DLL_ASM_Debug" -# PROP BASE Intermediate_Dir "zlib___Win32_DLL_ASM_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_ASM_Debug" -# PROP Intermediate_Dir "Win32_DLL_ASM_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /D "ASMV" /D "ASMINF" /FR /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\zlib1d.dll" /pdbtype:sept - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "zlib___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "zlib___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_Release" -# PROP Intermediate_Dir "Win32_DLL_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 /nologo /dll /machine:I386 /out:"Win32_DLL_Release\zlib1.dll" - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "zlib___Win32_DLL_Debug" -# PROP BASE Intermediate_Dir "zlib___Win32_DLL_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_Debug" -# PROP Intermediate_Dir "Win32_DLL_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /FR /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\zlib1d.dll" /pdbtype:sept - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "zlib___Win32_LIB_ASM_Release" -# PROP BASE Intermediate_Dir "zlib___Win32_LIB_ASM_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_LIB_ASM_Release" -# PROP Intermediate_Dir "Win32_LIB_ASM_Release" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /D "ASMV" /D "ASMINF" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "zlib___Win32_LIB_ASM_Debug" -# PROP BASE Intermediate_Dir "zlib___Win32_LIB_ASM_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_LIB_ASM_Debug" -# PROP Intermediate_Dir "Win32_LIB_ASM_Debug" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /D "ASMV" /D "ASMINF" /FR /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Win32_LIB_ASM_Debug\zlibd.lib" - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "zlib___Win32_LIB_Release" -# PROP BASE Intermediate_Dir "zlib___Win32_LIB_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_LIB_Release" -# PROP Intermediate_Dir "Win32_LIB_Release" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "zlib___Win32_LIB_Debug" -# PROP BASE Intermediate_Dir "zlib___Win32_LIB_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_LIB_Debug" -# PROP Intermediate_Dir "Win32_LIB_Debug" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /FR /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Win32_LIB_Debug\zlibd.lib" - -!ENDIF - -# Begin Target - -# Name "zlib - Win32 DLL ASM Release" -# Name "zlib - Win32 DLL ASM Debug" -# Name "zlib - Win32 DLL Release" -# Name "zlib - Win32 DLL Debug" -# Name "zlib - Win32 LIB ASM Release" -# Name "zlib - Win32 LIB ASM Debug" -# Name "zlib - Win32 LIB Release" -# Name "zlib - Win32 LIB Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\adler32.c -# End Source File -# Begin Source File - -SOURCE=..\..\compress.c -# End Source File -# Begin Source File - -SOURCE=..\..\crc32.c -# End Source File -# Begin Source File - -SOURCE=..\..\deflate.c -# End Source File -# Begin Source File - -SOURCE=..\..\gzclose.c -# End Source File -# Begin Source File - -SOURCE=..\..\gzlib.c -# End Source File -# Begin Source File - -SOURCE=..\..\gzread.c -# End Source File -# Begin Source File - -SOURCE=..\..\gzwrite.c -# End Source File -# Begin Source File - -SOURCE=..\..\infback.c -# End Source File -# Begin Source File - -SOURCE=..\..\inffast.c -# End Source File -# Begin Source File - -SOURCE=..\..\inflate.c -# End Source File -# Begin Source File - -SOURCE=..\..\inftrees.c -# End Source File -# Begin Source File - -SOURCE=..\..\trees.c -# End Source File -# Begin Source File - -SOURCE=..\..\uncompr.c -# End Source File -# Begin Source File - -SOURCE=..\..\win32\zlib.def - -!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\zutil.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\crc32.h -# End Source File -# Begin Source File - -SOURCE=..\..\deflate.h -# End Source File -# Begin Source File - -SOURCE=..\..\inffast.h -# End Source File -# Begin Source File - -SOURCE=..\..\inffixed.h -# End Source File -# Begin Source File - -SOURCE=..\..\inflate.h -# End Source File -# Begin Source File - -SOURCE=..\..\inftrees.h -# End Source File -# Begin Source File - -SOURCE=..\..\trees.h -# End Source File -# Begin Source File - -SOURCE=..\..\zconf.h -# End Source File -# Begin Source File - -SOURCE=..\..\zlib.h -# End Source File -# Begin Source File - -SOURCE=..\..\zutil.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\win32\zlib1.rc -# End Source File -# End Group -# Begin Group "Assembler Files (Unsupported)" - -# PROP Default_Filter "asm;obj;c;cpp;cxx;h;hpp;hxx" -# Begin Source File - -SOURCE=..\..\contrib\masmx86\gvmat32.asm - -!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_DLL_ASM_Release -InputPath=..\..\contrib\masmx86\gvmat32.asm -InputName=gvmat32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_DLL_ASM_Debug -InputPath=..\..\contrib\masmx86\gvmat32.asm -InputName=gvmat32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_LIB_ASM_Release -InputPath=..\..\contrib\masmx86\gvmat32.asm -InputName=gvmat32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_LIB_ASM_Debug -InputPath=..\..\contrib\masmx86\gvmat32.asm -InputName=gvmat32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\contrib\masmx86\gvmat32c.c - -!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" - -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" - -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" - -# PROP Exclude_From_Build 1 -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" - -# PROP Exclude_From_Build 1 -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" - -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" - -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" - -# PROP Exclude_From_Build 1 -# ADD CPP /I "..\.." - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 -# ADD CPP /I "..\.." - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\contrib\masmx86\inffas32.asm - -!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_DLL_ASM_Release -InputPath=..\..\contrib\masmx86\inffas32.asm -InputName=inffas32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_DLL_ASM_Debug -InputPath=..\..\contrib\masmx86\inffas32.asm -InputName=inffas32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_LIB_ASM_Release -InputPath=..\..\contrib\masmx86\inffas32.asm -InputName=inffas32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" - -# Begin Custom Build - Assembling... -IntDir=.\Win32_LIB_ASM_Debug -InputPath=..\..\contrib\masmx86\inffas32.asm -InputName=inffas32 - -"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" - -# End Custom Build - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# End Group -# Begin Source File - -SOURCE=.\README.txt -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=zlib - Win32 LIB Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "zlib.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 LIB Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "zlib - Win32 DLL ASM Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "zlib - Win32 DLL ASM Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "zlib - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "zlib - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "zlib - Win32 LIB ASM Release" (based on "Win32 (x86) Static Library") +!MESSAGE "zlib - Win32 LIB ASM Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "zlib - Win32 LIB Release" (based on "Win32 (x86) Static Library") +!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "zlib___Win32_DLL_ASM_Release" +# PROP BASE Intermediate_Dir "zlib___Win32_DLL_ASM_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Win32_DLL_ASM_Release" +# PROP Intermediate_Dir "Win32_DLL_ASM_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /D "ASMV" /D "ASMINF" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\zlib1.dll" + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "zlib___Win32_DLL_ASM_Debug" +# PROP BASE Intermediate_Dir "zlib___Win32_DLL_ASM_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Win32_DLL_ASM_Debug" +# PROP Intermediate_Dir "Win32_DLL_ASM_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /D "ASMV" /D "ASMINF" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\zlib1d.dll" /pdbtype:sept + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "zlib___Win32_DLL_Release" +# PROP BASE Intermediate_Dir "zlib___Win32_DLL_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Win32_DLL_Release" +# PROP Intermediate_Dir "Win32_DLL_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 /nologo /dll /machine:I386 /out:"Win32_DLL_Release\zlib1.dll" + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "zlib___Win32_DLL_Debug" +# PROP BASE Intermediate_Dir "zlib___Win32_DLL_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Win32_DLL_Debug" +# PROP Intermediate_Dir "Win32_DLL_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\zlib1d.dll" /pdbtype:sept + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "zlib___Win32_LIB_ASM_Release" +# PROP BASE Intermediate_Dir "zlib___Win32_LIB_ASM_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Win32_LIB_ASM_Release" +# PROP Intermediate_Dir "Win32_LIB_ASM_Release" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /D "ASMV" /D "ASMINF" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "zlib___Win32_LIB_ASM_Debug" +# PROP BASE Intermediate_Dir "zlib___Win32_LIB_ASM_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Win32_LIB_ASM_Debug" +# PROP Intermediate_Dir "Win32_LIB_ASM_Debug" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /D "ASMV" /D "ASMINF" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Win32_LIB_ASM_Debug\zlibd.lib" + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "zlib___Win32_LIB_Release" +# PROP BASE Intermediate_Dir "zlib___Win32_LIB_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Win32_LIB_Release" +# PROP Intermediate_Dir "Win32_LIB_Release" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "zlib___Win32_LIB_Debug" +# PROP BASE Intermediate_Dir "zlib___Win32_LIB_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Win32_LIB_Debug" +# PROP Intermediate_Dir "Win32_LIB_Debug" +# PROP Target_Dir "" +CPP=cl.exe +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_DEBUG" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +RSC=rc.exe +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Win32_LIB_Debug\zlibd.lib" + +!ENDIF + +# Begin Target + +# Name "zlib - Win32 DLL ASM Release" +# Name "zlib - Win32 DLL ASM Debug" +# Name "zlib - Win32 DLL Release" +# Name "zlib - Win32 DLL Debug" +# Name "zlib - Win32 LIB ASM Release" +# Name "zlib - Win32 LIB ASM Debug" +# Name "zlib - Win32 LIB Release" +# Name "zlib - Win32 LIB Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\adler32.c +# End Source File +# Begin Source File + +SOURCE=..\..\compress.c +# End Source File +# Begin Source File + +SOURCE=..\..\crc32.c +# End Source File +# Begin Source File + +SOURCE=..\..\deflate.c +# End Source File +# Begin Source File + +SOURCE=..\..\gzclose.c +# End Source File +# Begin Source File + +SOURCE=..\..\gzlib.c +# End Source File +# Begin Source File + +SOURCE=..\..\gzread.c +# End Source File +# Begin Source File + +SOURCE=..\..\gzwrite.c +# End Source File +# Begin Source File + +SOURCE=..\..\infback.c +# End Source File +# Begin Source File + +SOURCE=..\..\inffast.c +# End Source File +# Begin Source File + +SOURCE=..\..\inflate.c +# End Source File +# Begin Source File + +SOURCE=..\..\inftrees.c +# End Source File +# Begin Source File + +SOURCE=..\..\trees.c +# End Source File +# Begin Source File + +SOURCE=..\..\uncompr.c +# End Source File +# Begin Source File + +SOURCE=..\..\win32\zlib.def + +!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\zutil.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\crc32.h +# End Source File +# Begin Source File + +SOURCE=..\..\deflate.h +# End Source File +# Begin Source File + +SOURCE=..\..\inffast.h +# End Source File +# Begin Source File + +SOURCE=..\..\inffixed.h +# End Source File +# Begin Source File + +SOURCE=..\..\inflate.h +# End Source File +# Begin Source File + +SOURCE=..\..\inftrees.h +# End Source File +# Begin Source File + +SOURCE=..\..\trees.h +# End Source File +# Begin Source File + +SOURCE=..\..\zconf.h +# End Source File +# Begin Source File + +SOURCE=..\..\zlib.h +# End Source File +# Begin Source File + +SOURCE=..\..\zutil.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=..\..\win32\zlib1.rc +# End Source File +# End Group +# Begin Group "Assembler Files (Unsupported)" + +# PROP Default_Filter "asm;obj;c;cpp;cxx;h;hpp;hxx" +# Begin Source File + +SOURCE=..\..\contrib\masmx86\gvmat32.asm + +!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_DLL_ASM_Release +InputPath=..\..\contrib\masmx86\gvmat32.asm +InputName=gvmat32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_DLL_ASM_Debug +InputPath=..\..\contrib\masmx86\gvmat32.asm +InputName=gvmat32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_LIB_ASM_Release +InputPath=..\..\contrib\masmx86\gvmat32.asm +InputName=gvmat32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_LIB_ASM_Debug +InputPath=..\..\contrib\masmx86\gvmat32.asm +InputName=gvmat32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\contrib\masmx86\gvmat32c.c + +!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" + +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" + +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" + +# PROP Exclude_From_Build 1 +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" + +# PROP Exclude_From_Build 1 +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" + +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" + +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" + +# PROP Exclude_From_Build 1 +# ADD CPP /I "..\.." + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" + +# PROP Exclude_From_Build 1 +# ADD CPP /I "..\.." + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\contrib\masmx86\inffas32.asm + +!IF "$(CFG)" == "zlib - Win32 DLL ASM Release" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_DLL_ASM_Release +InputPath=..\..\contrib\masmx86\inffas32.asm +InputName=inffas32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_DLL_ASM_Debug +InputPath=..\..\contrib\masmx86\inffas32.asm +InputName=inffas32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_LIB_ASM_Release +InputPath=..\..\contrib\masmx86\inffas32.asm +InputName=inffas32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug" + +# Begin Custom Build - Assembling... +IntDir=.\Win32_LIB_ASM_Debug +InputPath=..\..\contrib\masmx86\inffas32.asm +InputName=inffas32 + +"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ml.exe /nologo /c /coff /Cx /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)" + +# End Custom Build + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# End Group +# Begin Source File + +SOURCE=.\README.txt +# End Source File +# End Target +# End Project diff --git a/3party/zlib/old/visualc6/zlib.dsw b/3party/zlib/old/visualc6/zlib.dsw index 3a771fce07..2644856efa 100644 --- a/3party/zlib/old/visualc6/zlib.dsw +++ b/3party/zlib/old/visualc6/zlib.dsw @@ -1,59 +1,59 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "example"=.\example.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "minigzip"=.\minigzip.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "zlib"=.\zlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "example"=.\example.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name zlib + End Project Dependency +}}} + +############################################################################### + +Project: "minigzip"=.\minigzip.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name zlib + End Project Dependency +}}} + +############################################################################### + +Project: "zlib"=.\zlib.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/android/jni/MapsWithMe.cpp b/android/jni/MapsWithMe.cpp index 6434c66774..775edf1b39 100644 --- a/android/jni/MapsWithMe.cpp +++ b/android/jni/MapsWithMe.cpp @@ -1 +1 @@ -#include +#include diff --git a/android/jni/nv_debug/nv_debug.hpp b/android/jni/nv_debug/nv_debug.hpp index 501c53cfba..f404c212ca 100644 --- a/android/jni/nv_debug/nv_debug.hpp +++ b/android/jni/nv_debug/nv_debug.hpp @@ -1,77 +1,77 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_debug.h -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- -#ifndef __INCLUDED_NV_DEBUG_H -#define __INCLUDED_NV_DEBUG_H - -#define CT_ASSERT(tag,cond) \ -enum { COMPILE_TIME_ASSERT__ ## tag = 1/(cond) } - -#define dimof( x ) ( sizeof(x) / sizeof(x[0]) ) -#include - -#define DBG_DETAILED 0 - -#if 0 - - // the detailed prefix can be customised by setting DBG_DETAILED_PREFIX. See - // below as a reference. - // NOTE: fmt is the desired format string and must be in the prefix. - //#ifndef DBG_DETAILED_PREFIX - // #define DBG_DETAILED_PREFIX "%s, %s, line %d: " fmt, __FILE__, __FUNCTION__, __LINE__, - //#endif - //#define DEBUG_D_(fmt, args...) - //#define DEBUG_D(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, (DBG_DETAILED_PREFIX) ## args) - -#else - - #ifdef STRINGIFY - #pragma push_macro("STRINGIFY") - #undef STRINGIFY - #define STRINGIFYPUSHED_____ - #endif - #define STRINGIFY(x) #x - - // debug macro, includes file name function name and line number - #define TO(x) typeof(x) - #define DEBUG_D_(file, line, fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, file ", %s, line(" STRINGIFY(line) "): " fmt, __FUNCTION__, ## args) - #define DEBUG_D(fmt, args...) DEBUG_D_( __FILE__ , __LINE__ , fmt, ## args) - - #ifdef STRINGIFYPUSHED_____ - #undef STRINGIFYPUSHED_____ - #pragma pop_macro("STRINGIFY") - #endif - -#endif - -// basic debug macro -#define NVDEBUG_(fmt, args...) (__android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ## args)) - -// Debug macro that can be switched to spew a file name, -// function and line number using DEBUG_DETAILED -#if DBG_DETAILED == 1 - #define NVDEBUG(fmt, args...) NVDEBUG_D(fmt, ## args) -#else - #define NVDEBUG(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ## args) -#endif - - -#endif +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_debug.h +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- +#ifndef __INCLUDED_NV_DEBUG_H +#define __INCLUDED_NV_DEBUG_H + +#define CT_ASSERT(tag,cond) \ +enum { COMPILE_TIME_ASSERT__ ## tag = 1/(cond) } + +#define dimof( x ) ( sizeof(x) / sizeof(x[0]) ) +#include + +#define DBG_DETAILED 0 + +#if 0 + + // the detailed prefix can be customised by setting DBG_DETAILED_PREFIX. See + // below as a reference. + // NOTE: fmt is the desired format string and must be in the prefix. + //#ifndef DBG_DETAILED_PREFIX + // #define DBG_DETAILED_PREFIX "%s, %s, line %d: " fmt, __FILE__, __FUNCTION__, __LINE__, + //#endif + //#define DEBUG_D_(fmt, args...) + //#define DEBUG_D(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, (DBG_DETAILED_PREFIX) ## args) + +#else + + #ifdef STRINGIFY + #pragma push_macro("STRINGIFY") + #undef STRINGIFY + #define STRINGIFYPUSHED_____ + #endif + #define STRINGIFY(x) #x + + // debug macro, includes file name function name and line number + #define TO(x) typeof(x) + #define DEBUG_D_(file, line, fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, file ", %s, line(" STRINGIFY(line) "): " fmt, __FUNCTION__, ## args) + #define DEBUG_D(fmt, args...) DEBUG_D_( __FILE__ , __LINE__ , fmt, ## args) + + #ifdef STRINGIFYPUSHED_____ + #undef STRINGIFYPUSHED_____ + #pragma pop_macro("STRINGIFY") + #endif + +#endif + +// basic debug macro +#define NVDEBUG_(fmt, args...) (__android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ## args)) + +// Debug macro that can be switched to spew a file name, +// function and line number using DEBUG_DETAILED +#if DBG_DETAILED == 1 + #define NVDEBUG(fmt, args...) NVDEBUG_D(fmt, ## args) +#else + #define NVDEBUG(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, MODULE, fmt, ## args) +#endif + + +#endif diff --git a/android/jni/nv_event/nv_event.hpp b/android/jni/nv_event/nv_event.hpp index 7d0c953d5c..5111e7289c 100644 --- a/android/jni/nv_event/nv_event.hpp +++ b/android/jni/nv_event/nv_event.hpp @@ -1,540 +1,540 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_event\nv_event.h -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- -#ifndef _NV_EVENT_H -#define _NV_EVENT_H -#include -#include -//#include - -/** @file nv_event.h -Contains a framework for event loop-based applications. This library replaces -most or all of the normally-required JNI code for Android NDK applications, -presenting the application developer with two callbacks into which they can -write their application. The framework runs in a natively-created thread, -allowing the application to implement a classic "event loop and render" structure -without having to return to Java code to avoid ANR warnings. The library -includes support for input and system event passing as well as JNI initialization -and exposes basic EGL functionality to native as well. Put together, the library -can form the basis of a simple interactive 3D application. All applications that -are based on this library must also be subclassed on the Java side from the -provided NvEventQueueActivity. Additional external documentation on the use of -this library, the related Java code and the tool provided to create a template -application based on the library are provided with the SDK. -@see NvEventQueueActivity -*/ - -#ifdef ANDROID - -#include -typedef jobject NVEventPlatformAppHandle; - -#else // unknown platform - -typedef void* NVEventPlatformAppHandle; - -#endif - - -enum -{ - /** Timeout argument to NVEventGetNextEvent() that indicates the function should - block until there is an event pending or the app exits - @see NVEventGetNextEvent() - */ - NV_EVENT_WAIT_FOREVER = -1 -}; - -/** Event type values -*/ -typedef enum NVEventType -{ - /** Key up/down events */ - NV_EVENT_KEY = 1, - /** Translated character events */ - NV_EVENT_CHAR, - /** Single-touch pointer events */ - NV_EVENT_TOUCH, - /** Multi-touch events */ - NV_EVENT_MULTITOUCH, - /** Long Click Event */ - NV_EVENT_LONG_CLICK, - /** Accelerometer events */ - NV_EVENT_ACCEL, - /** onStart lifecycle events */ - NV_EVENT_START, - /** onRestart lifecycle events */ - NV_EVENT_RESTART, - /** onResume lifecycle events */ - NV_EVENT_RESUME, - /** onWindowFocusChanged(TRUE) lifecycle events */ - NV_EVENT_FOCUS_GAINED, - /** Surface created events */ - NV_EVENT_SURFACE_CREATED, - /** Surface size changed events */ - NV_EVENT_SURFACE_SIZE, - /** Surface destroyed events */ - NV_EVENT_SURFACE_DESTROYED, - /** onWindowFocusChanged(FALSE) lifecycle events */ - NV_EVENT_FOCUS_LOST, - /** onPause lifecycle events */ - NV_EVENT_PAUSE, - /** onStop lifecycle events */ - NV_EVENT_STOP, - /** (onDestroy) Quit request events */ - NV_EVENT_QUIT, - /** App-specific events */ - NV_EVENT_USER, - /* a dummy enum value used to compute num_events */ - NV_EVENT_NUM_EVENT_DUMMY_DONTUSEME, - /* total number of events */ - NV_EVENT_NUM_EVENTS = NV_EVENT_NUM_EVENT_DUMMY_DONTUSEME - 1, - NV_EVENT_FORCE_32BITS = 0x7fffffff -} NVEventType; - -/** Touch event actions -*/ -typedef enum NVTouchEventType -{ - /** Pointer has just left the screen */ - NV_TOUCHACTION_UP, - /** Pointer has just gone down onto the screen */ - NV_TOUCHACTION_DOWN, - /** Pointer is moving on the screen */ - NV_TOUCHACTION_MOVE, - NV_TOUCHACTION_FORCE_32BITS = 0x7fffffff -} NVTouchEventType; - -/** Multitouch event flags -*/ -typedef enum NVMultiTouchEventType -{ - /** Indicated pointers are leaving the screen */ - NV_MULTITOUCH_UP = 0x00000001, - /** Indicated pointers have just touched the screen */ - NV_MULTITOUCH_DOWN = 0x00000002, - /** Indicated pointers are moving on the screen */ - NV_MULTITOUCH_MOVE = 0x00000003, - /** Indicated pointers have halted the current gesture - app should cancel any actions implied by the gesture */ - NV_MULTITOUCH_CANCEL = 0x00000004, - /** Mask to be AND'ed with the flag value - to get the active pointer bits */ - NV_MULTITOUCH_POINTER_MASK = 0x0000ff00, - /** Number of bits to right-shift the masked value - to get the active pointer bits */ - NV_MULTITOUCH_POINTER_SHIFT = 0x00000008, - /** Mask to be AND'ed with the flag value - to get the event action */ - NV_MULTITOUCH_ACTION_MASK = 0x000000ff, - NV_MULTITOUCH_FORCE_32BITS = 0x7fffffff -} NVMultiTouchEventType; - -/** Key event types -*/ -typedef enum NVKeyEventType -{ - /** Key has just been pressed (no repeats) */ - NV_KEYACTION_UP, - /** Key has just been released */ - NV_KEYACTION_DOWN, - NV_KEYACTION_FORCE_32BITS = 0x7fffffff -} NVKeyEventType; - -/** Key event key codes -*/ -#define NV_MAX_KEYCODE 256 -typedef enum NVKeyCode -{ - NV_KEYCODE_NULL = 0, - NV_KEYCODE_BACK, - NV_KEYCODE_TAB, - NV_KEYCODE_ENTER, - NV_KEYCODE_DEL, - NV_KEYCODE_SPACE, - NV_KEYCODE_ENDCALL, - NV_KEYCODE_HOME, - - NV_KEYCODE_STAR, - NV_KEYCODE_PLUS, - NV_KEYCODE_MINUS, - NV_KEYCODE_NUM, - - NV_KEYCODE_DPAD_LEFT, - NV_KEYCODE_DPAD_UP, - NV_KEYCODE_DPAD_RIGHT, - NV_KEYCODE_DPAD_DOWN, - - NV_KEYCODE_0, - NV_KEYCODE_1, - NV_KEYCODE_2, - NV_KEYCODE_3, - NV_KEYCODE_4, - NV_KEYCODE_5, - NV_KEYCODE_6, - NV_KEYCODE_7, - NV_KEYCODE_8, - NV_KEYCODE_9, - - NV_KEYCODE_A, - NV_KEYCODE_B, - NV_KEYCODE_C, - NV_KEYCODE_D, - NV_KEYCODE_E, - NV_KEYCODE_F, - NV_KEYCODE_G, - NV_KEYCODE_H, - NV_KEYCODE_I, - NV_KEYCODE_J, - NV_KEYCODE_K, - NV_KEYCODE_L, - NV_KEYCODE_M, - NV_KEYCODE_N, - NV_KEYCODE_O, - NV_KEYCODE_P, - NV_KEYCODE_Q, - NV_KEYCODE_R, - NV_KEYCODE_S, - NV_KEYCODE_T, - NV_KEYCODE_U, - NV_KEYCODE_V, - NV_KEYCODE_W, - NV_KEYCODE_X, - NV_KEYCODE_Y, - NV_KEYCODE_Z, - - NV_KEYCODE_ALT_LEFT, - NV_KEYCODE_ALT_RIGHT, - - NV_KEYCODE_SHIFT_LEFT, - NV_KEYCODE_SHIFT_RIGHT, - - NV_KEYCODE_APOSTROPHE, - NV_KEYCODE_SEMICOLON, - NV_KEYCODE_EQUALS, - NV_KEYCODE_COMMA, - NV_KEYCODE_PERIOD, - NV_KEYCODE_SLASH, - NV_KEYCODE_GRAVE, - NV_KEYCODE_BACKSLASH, - - NV_KEYCODE_LEFT_BRACKET, - NV_KEYCODE_RIGHT_BRACKET, - - NV_KEYCODE_FORCE_32BIT = 0x7fffffff -} NVKeyCode; - -/** Single-touch event data -*/ -typedef struct NVEventTouch -{ - /** The action code */ - NVTouchEventType m_action; - /** The window-relative X position (in pixels) */ - float m_x; - /** The window-relative Y position (in pixels) */ - float m_y; -} NVEventTouch; - -/** Multi-touch event data -*/ -typedef struct NVEventMultiTouch -{ - /** The action flags */ - NVMultiTouchEventType m_action; - /** The window-relative X position of the first pointer (in pixels) - only valid if bit 0 of the pointer bits is set */ - float m_x1; - /** The window-relative Y position of the first pointer (in pixels) - only valid if bit 0 of the pointer bits is set */ - float m_y1; - /** The window-relative X position of the second pointer (in pixels) - only valid if bit 1 of the pointer bits is set */ - float m_x2; - /** The window-relative Y position of the second pointer (in pixels) - only valid if bit 1 of the pointer bits is set */ - float m_y2; -} NVEventMultiTouch; - -/** Key down/up event data -*/ -typedef struct NVEventKey -{ - /** The action flags */ - NVKeyEventType m_action; - /** The code of the key pressed or released */ - NVKeyCode m_code; -} NVEventKey; - -/** Translated character event data -*/ -typedef struct NVEventChar -{ - /** The UNICODE character represented */ - int32_t m_unichar; -} NVEventChar; - -/** Accelerometer event data -*/ -typedef struct NVEventAccel -{ - /** Signed X magnitude of the force vector */ - float m_x; - /** Signed Y magnitude of the force vector */ - float m_y; - /** Signed Z magnitude of the force vector */ - float m_z; -} NVEventAccel; - -/** Surface size change event data -*/ -typedef struct NVEventSurfaceSize -{ - /** New surface client area width (in pixels) */ - int32_t m_w; - /** New surface client area height (in pixels) */ - int32_t m_h; - /** Screen density for the screen at which this surface was created*/ - int32_t m_density; -} NVEventSurfaceSize; - -/** User/App-specific event data -*/ -typedef struct NVEventUser -{ - /** First 32-bit user data item */ - int32_t m_u0; - /** Second 32-bit user data item */ - int32_t m_u1; - /** Third 32-bit user data item */ - int32_t m_u2; - /** Fourth 32-bit user data item */ - int32_t m_u3; -} NVEventUser; - -/** All-encompassing event structure -*/ -typedef struct NVEvent -{ - /** The type of the event, which also indicates which m_data union holds the data */ - NVEventType m_type; - /** Union containing all possible event type data */ - union NVEventData - { - /** Data for single-touch events */ - NVEventTouch m_touch; - /** Data for multi-touch events */ - NVEventMultiTouch m_multi; - /** Data for key up/down events */ - NVEventKey m_key; - /** Data for charcter events */ - NVEventChar m_char; - /** Data for accelerometer events */ - NVEventAccel m_accel; - /** Data for surface size events */ - NVEventSurfaceSize m_size; - /** Data for user/app events */ - NVEventUser m_user; - } m_data; -} NVEvent; - -/** Returns a string describing the event -@param eventType The event type -@return Returns a string containing a description of the event. Do not free or delete this memory. -@see NVEvent */ -const char* NVEventGetEventStr(NVEventType eventType); - -/** Returns the next pending event for the application to process. Can return immediately if there -is no event, or can wait a fixed number of milisecs (or "forever") if desired. -The application should always pair calls to this function that return non-NULL events with calls -to NVEventDoneWithEvent() -@param waitMSecs The maximum time (in milisecs) to wait for an event before returning "no event". - Pass NV_EVENT_WAIT_FOREVER to wait indefinitely for an event. Note that NV_EVENT_WAIT_FOREVER - does not guarantee an event on return. The function can still return on error or if the - app is exiting. Default is to return immediately, event or not. -@return Non-NULL pointer to a constant event structure if an event was pending, NULL if no event was - pending in the requested timeout period -@see NVEvent -@see NVEventDoneWithEvent -*/ -const NVEvent* NVEventGetNextEvent(int waitMSecs = 0); - -/** Indicates that the application has finished handling the event returned from the last -call to NVEventGetNextEvent. This function should always be called prior to the next call -to NVEventGetNextEvent. If the current event is a blocking event, this call will unblock -the posting thread (normally in Java). This is particularly important for application -lifecycle events like onPause, as calling this function indicates that the native code has -completed the handling of the lifecycle callback. Failure to call this function promptly -for all events can lead to Application Not Responding errors. -@param handled The return value that should be passed back to Java for blocking events. For non-blocking -events, this parameter is discard. -@see NVEvent -@see NVEventGetNextEvent -*/ -void NVEventDoneWithEvent(bool handled); - -/** The app-supplied "callback" for initialization during JNI_OnLoad. -Declares the application's pre-main initialization function. Does not define the -function. The app must define this in its own code, even if the function is empty. -JNI init code can be safely called from here, as it WILL be called from -within a JNI function thread -@parm argc Passes the number of command line arguments. - This is currently unsupported and is always passed 0 -@parm argv Passes the array of command line arguments. - This is currently unsupported and is always passed NULL -@return The function should return 0 on success and nonzero on failure. -*/ -extern int32_t NVEventAppInit(int32_t argc, char** argv); - -/** The app-supplied "callback" for running the application's main loop. -Declares the application's main loop function. Does not define the -function. The app must define this in its own code -This function will be spawned in its own thread. -@parm argc Passes the number of command line arguments. - This is currently unsupported and is always passed 0 -@parm argv Passes the array of command line arguments. - This is currently unsupported and is always passed NULL -@return The function should return 0 on success and nonzero on failure. -*/ -extern int32_t NVEventAppMain(int32_t argc, char** argv); - - -/** Initializes EGL, queries a valid ES1 config and creates (but does not bind) - an ES1-compatible EGLContext -@return true on success, false on failure -*/ -bool NVEventInitEGL(); - -/** Releases any existing EGLSurface and EGLContext and terminates EGL -@return true on success, false on failure -*/ -bool NVEventCleanupEGL(); - -/** Creates an EGLSurface for the current Android surface. Will attempt to initialize - EGL and an EGLContext if not already done. Fails if there is no valid Android surface - or if there is an EGL error. -@return true on success, false on failure -*/ -bool NVEventCreateSurfaceEGL(); - -/** Unbinds (if needed) and releases the app's EGLSurface -@return true on success, false on failure -*/ -bool NVEventDestroySurfaceEGL(); - -/** Binds the app's EGLSurface and EGLContext to the calling thread. The EGLSurface and - EGLContext must both exist already, or else the function will fail. -@return true on success, false on failure -*/ -bool NVEventBindSurfaceAndContextEGL(); - -/** Un-binds the app's EGLSurface and EGLContext from the calling thread. -@return true on success, false on failure -*/ -bool NVEventUnbindSurfaceAndContextEGL(); - -/** Swaps the currently-bound EGLSurface -@return true on success, false on failure -*/ -bool NVEventSwapBuffersEGL(); - -/** Accessor for the last EGL error -@return the EGL error -*/ -int NVEventGetErrorEGL(); - -/** Utility function: checks if EGl is completely ready to render, including - initialization, surface creation and context/surface binding. -@parm allocateIfNeeded If the parameter is false, then the function immediately returns if any - part of the requirements have not already been satisfied. If the parameter is - true, then the function attempts to initialize any of the steps needed, failing - and returning false only if a step cannot be completed at this time. -@return The function returns true if EGL/GLES is ready to render/load content (i.e. - a context and surface are bound) and false it not -*/ -bool NVEventReadyToRenderEGL(bool allocateIfNeeded); - -/** Convenience conditional function to determine if the app is between onCreate - and onDestroy callbacks (i.e. the app is in a running state). -@return true if the application is between onCreate and onDestroy and false after - an onDestroy event has been delivered. -*/ -bool NVEventStatusIsRunning(); - -/** Convenience conditional function to determine if the app is between onResume and onPause - callbacks (i.e. the app is in a "resumed" state). -@return true if the application is between onResume and onPause and false if the application - has not yet been resumed, or is currently paused. -*/ -bool NVEventStatusIsActive(); - -/** Convenience conditional function to determine if the app's window is focused (between - calls to onWindowFocusChanged(true) and onWindowFocusChanged(false)) -@return true between onWindowFocusChanged(true) and onWindowFocusChanged(false) -*/ -bool NVEventStatusIsFocused(); - -/** Convenience conditional function to determine if the app has a surface and that surface - has non-zero area -@return true if the app is between surfaceCreated and surfaceDestroyed callbacks and - the surface has non-zero pixel area (not 0x0 pixels) -*/ -bool NVEventStatusHasRealSurface(); - -/** Convenience conditional function to determine if the app is in a fully-focused, visible - state. This is a logical "AND" of IsRunning, IsActive, IsFocused and HasRealSurface -@return true if IsRunning, IsActive, IsFocused and HasRealSurface are all currently true, -false otherwise -*/ -bool NVEventStatusIsInteractable(); - -/** Convenience conditional function to determine if the app has active EGL -@return true between successful calls to NVEventInitEGL and NVEventCleanupEGL, -false otherwise -*/ -bool NVEventStatusEGLInitialized(); - -/** Convenience conditional function to determine if the app has an EGLSurface (need not be bound) -@return true if the EGLSurface for the app is allocated, false otherwise -*/ -bool NVEventStatusEGLHasSurface(); - -/** Convenience conditional function to determine if the app has an EGLSurface and EGLContext - and they are bound -@return true if the EGLSurface and EGLContext for the app are allocated and bound, false otherwise -*/ -bool NVEventStatusEGLIsBound(); - -bool NVEventRepaint(); - -void NVEventReportUnsupported(); - -void NVEventOnRenderingInitialized(); - +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_event\nv_event.h +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- +#ifndef _NV_EVENT_H +#define _NV_EVENT_H +#include +#include +//#include -/** Returns the platform-specific handle to the application instance, if supported. This -function is, by definition platform-specific. -@return A platform-specific handle to the application. */ -NVEventPlatformAppHandle NVEventGetPlatformAppHandle(); - -void InitNVEvent(JavaVM * jvm); - -#endif +/** @file nv_event.h +Contains a framework for event loop-based applications. This library replaces +most or all of the normally-required JNI code for Android NDK applications, +presenting the application developer with two callbacks into which they can +write their application. The framework runs in a natively-created thread, +allowing the application to implement a classic "event loop and render" structure +without having to return to Java code to avoid ANR warnings. The library +includes support for input and system event passing as well as JNI initialization +and exposes basic EGL functionality to native as well. Put together, the library +can form the basis of a simple interactive 3D application. All applications that +are based on this library must also be subclassed on the Java side from the +provided NvEventQueueActivity. Additional external documentation on the use of +this library, the related Java code and the tool provided to create a template +application based on the library are provided with the SDK. +@see NvEventQueueActivity +*/ + +#ifdef ANDROID + +#include +typedef jobject NVEventPlatformAppHandle; + +#else // unknown platform + +typedef void* NVEventPlatformAppHandle; + +#endif + + +enum +{ + /** Timeout argument to NVEventGetNextEvent() that indicates the function should + block until there is an event pending or the app exits + @see NVEventGetNextEvent() + */ + NV_EVENT_WAIT_FOREVER = -1 +}; + +/** Event type values +*/ +typedef enum NVEventType +{ + /** Key up/down events */ + NV_EVENT_KEY = 1, + /** Translated character events */ + NV_EVENT_CHAR, + /** Single-touch pointer events */ + NV_EVENT_TOUCH, + /** Multi-touch events */ + NV_EVENT_MULTITOUCH, + /** Long Click Event */ + NV_EVENT_LONG_CLICK, + /** Accelerometer events */ + NV_EVENT_ACCEL, + /** onStart lifecycle events */ + NV_EVENT_START, + /** onRestart lifecycle events */ + NV_EVENT_RESTART, + /** onResume lifecycle events */ + NV_EVENT_RESUME, + /** onWindowFocusChanged(TRUE) lifecycle events */ + NV_EVENT_FOCUS_GAINED, + /** Surface created events */ + NV_EVENT_SURFACE_CREATED, + /** Surface size changed events */ + NV_EVENT_SURFACE_SIZE, + /** Surface destroyed events */ + NV_EVENT_SURFACE_DESTROYED, + /** onWindowFocusChanged(FALSE) lifecycle events */ + NV_EVENT_FOCUS_LOST, + /** onPause lifecycle events */ + NV_EVENT_PAUSE, + /** onStop lifecycle events */ + NV_EVENT_STOP, + /** (onDestroy) Quit request events */ + NV_EVENT_QUIT, + /** App-specific events */ + NV_EVENT_USER, + /* a dummy enum value used to compute num_events */ + NV_EVENT_NUM_EVENT_DUMMY_DONTUSEME, + /* total number of events */ + NV_EVENT_NUM_EVENTS = NV_EVENT_NUM_EVENT_DUMMY_DONTUSEME - 1, + NV_EVENT_FORCE_32BITS = 0x7fffffff +} NVEventType; + +/** Touch event actions +*/ +typedef enum NVTouchEventType +{ + /** Pointer has just left the screen */ + NV_TOUCHACTION_UP, + /** Pointer has just gone down onto the screen */ + NV_TOUCHACTION_DOWN, + /** Pointer is moving on the screen */ + NV_TOUCHACTION_MOVE, + NV_TOUCHACTION_FORCE_32BITS = 0x7fffffff +} NVTouchEventType; + +/** Multitouch event flags +*/ +typedef enum NVMultiTouchEventType +{ + /** Indicated pointers are leaving the screen */ + NV_MULTITOUCH_UP = 0x00000001, + /** Indicated pointers have just touched the screen */ + NV_MULTITOUCH_DOWN = 0x00000002, + /** Indicated pointers are moving on the screen */ + NV_MULTITOUCH_MOVE = 0x00000003, + /** Indicated pointers have halted the current gesture + app should cancel any actions implied by the gesture */ + NV_MULTITOUCH_CANCEL = 0x00000004, + /** Mask to be AND'ed with the flag value + to get the active pointer bits */ + NV_MULTITOUCH_POINTER_MASK = 0x0000ff00, + /** Number of bits to right-shift the masked value + to get the active pointer bits */ + NV_MULTITOUCH_POINTER_SHIFT = 0x00000008, + /** Mask to be AND'ed with the flag value + to get the event action */ + NV_MULTITOUCH_ACTION_MASK = 0x000000ff, + NV_MULTITOUCH_FORCE_32BITS = 0x7fffffff +} NVMultiTouchEventType; + +/** Key event types +*/ +typedef enum NVKeyEventType +{ + /** Key has just been pressed (no repeats) */ + NV_KEYACTION_UP, + /** Key has just been released */ + NV_KEYACTION_DOWN, + NV_KEYACTION_FORCE_32BITS = 0x7fffffff +} NVKeyEventType; + +/** Key event key codes +*/ +#define NV_MAX_KEYCODE 256 +typedef enum NVKeyCode +{ + NV_KEYCODE_NULL = 0, + NV_KEYCODE_BACK, + NV_KEYCODE_TAB, + NV_KEYCODE_ENTER, + NV_KEYCODE_DEL, + NV_KEYCODE_SPACE, + NV_KEYCODE_ENDCALL, + NV_KEYCODE_HOME, + + NV_KEYCODE_STAR, + NV_KEYCODE_PLUS, + NV_KEYCODE_MINUS, + NV_KEYCODE_NUM, + + NV_KEYCODE_DPAD_LEFT, + NV_KEYCODE_DPAD_UP, + NV_KEYCODE_DPAD_RIGHT, + NV_KEYCODE_DPAD_DOWN, + + NV_KEYCODE_0, + NV_KEYCODE_1, + NV_KEYCODE_2, + NV_KEYCODE_3, + NV_KEYCODE_4, + NV_KEYCODE_5, + NV_KEYCODE_6, + NV_KEYCODE_7, + NV_KEYCODE_8, + NV_KEYCODE_9, + + NV_KEYCODE_A, + NV_KEYCODE_B, + NV_KEYCODE_C, + NV_KEYCODE_D, + NV_KEYCODE_E, + NV_KEYCODE_F, + NV_KEYCODE_G, + NV_KEYCODE_H, + NV_KEYCODE_I, + NV_KEYCODE_J, + NV_KEYCODE_K, + NV_KEYCODE_L, + NV_KEYCODE_M, + NV_KEYCODE_N, + NV_KEYCODE_O, + NV_KEYCODE_P, + NV_KEYCODE_Q, + NV_KEYCODE_R, + NV_KEYCODE_S, + NV_KEYCODE_T, + NV_KEYCODE_U, + NV_KEYCODE_V, + NV_KEYCODE_W, + NV_KEYCODE_X, + NV_KEYCODE_Y, + NV_KEYCODE_Z, + + NV_KEYCODE_ALT_LEFT, + NV_KEYCODE_ALT_RIGHT, + + NV_KEYCODE_SHIFT_LEFT, + NV_KEYCODE_SHIFT_RIGHT, + + NV_KEYCODE_APOSTROPHE, + NV_KEYCODE_SEMICOLON, + NV_KEYCODE_EQUALS, + NV_KEYCODE_COMMA, + NV_KEYCODE_PERIOD, + NV_KEYCODE_SLASH, + NV_KEYCODE_GRAVE, + NV_KEYCODE_BACKSLASH, + + NV_KEYCODE_LEFT_BRACKET, + NV_KEYCODE_RIGHT_BRACKET, + + NV_KEYCODE_FORCE_32BIT = 0x7fffffff +} NVKeyCode; + +/** Single-touch event data +*/ +typedef struct NVEventTouch +{ + /** The action code */ + NVTouchEventType m_action; + /** The window-relative X position (in pixels) */ + float m_x; + /** The window-relative Y position (in pixels) */ + float m_y; +} NVEventTouch; + +/** Multi-touch event data +*/ +typedef struct NVEventMultiTouch +{ + /** The action flags */ + NVMultiTouchEventType m_action; + /** The window-relative X position of the first pointer (in pixels) + only valid if bit 0 of the pointer bits is set */ + float m_x1; + /** The window-relative Y position of the first pointer (in pixels) + only valid if bit 0 of the pointer bits is set */ + float m_y1; + /** The window-relative X position of the second pointer (in pixels) + only valid if bit 1 of the pointer bits is set */ + float m_x2; + /** The window-relative Y position of the second pointer (in pixels) + only valid if bit 1 of the pointer bits is set */ + float m_y2; +} NVEventMultiTouch; + +/** Key down/up event data +*/ +typedef struct NVEventKey +{ + /** The action flags */ + NVKeyEventType m_action; + /** The code of the key pressed or released */ + NVKeyCode m_code; +} NVEventKey; + +/** Translated character event data +*/ +typedef struct NVEventChar +{ + /** The UNICODE character represented */ + int32_t m_unichar; +} NVEventChar; + +/** Accelerometer event data +*/ +typedef struct NVEventAccel +{ + /** Signed X magnitude of the force vector */ + float m_x; + /** Signed Y magnitude of the force vector */ + float m_y; + /** Signed Z magnitude of the force vector */ + float m_z; +} NVEventAccel; + +/** Surface size change event data +*/ +typedef struct NVEventSurfaceSize +{ + /** New surface client area width (in pixels) */ + int32_t m_w; + /** New surface client area height (in pixels) */ + int32_t m_h; + /** Screen density for the screen at which this surface was created*/ + int32_t m_density; +} NVEventSurfaceSize; + +/** User/App-specific event data +*/ +typedef struct NVEventUser +{ + /** First 32-bit user data item */ + int32_t m_u0; + /** Second 32-bit user data item */ + int32_t m_u1; + /** Third 32-bit user data item */ + int32_t m_u2; + /** Fourth 32-bit user data item */ + int32_t m_u3; +} NVEventUser; + +/** All-encompassing event structure +*/ +typedef struct NVEvent +{ + /** The type of the event, which also indicates which m_data union holds the data */ + NVEventType m_type; + /** Union containing all possible event type data */ + union NVEventData + { + /** Data for single-touch events */ + NVEventTouch m_touch; + /** Data for multi-touch events */ + NVEventMultiTouch m_multi; + /** Data for key up/down events */ + NVEventKey m_key; + /** Data for charcter events */ + NVEventChar m_char; + /** Data for accelerometer events */ + NVEventAccel m_accel; + /** Data for surface size events */ + NVEventSurfaceSize m_size; + /** Data for user/app events */ + NVEventUser m_user; + } m_data; +} NVEvent; + +/** Returns a string describing the event +@param eventType The event type +@return Returns a string containing a description of the event. Do not free or delete this memory. +@see NVEvent */ +const char* NVEventGetEventStr(NVEventType eventType); + +/** Returns the next pending event for the application to process. Can return immediately if there +is no event, or can wait a fixed number of milisecs (or "forever") if desired. +The application should always pair calls to this function that return non-NULL events with calls +to NVEventDoneWithEvent() +@param waitMSecs The maximum time (in milisecs) to wait for an event before returning "no event". + Pass NV_EVENT_WAIT_FOREVER to wait indefinitely for an event. Note that NV_EVENT_WAIT_FOREVER + does not guarantee an event on return. The function can still return on error or if the + app is exiting. Default is to return immediately, event or not. +@return Non-NULL pointer to a constant event structure if an event was pending, NULL if no event was + pending in the requested timeout period +@see NVEvent +@see NVEventDoneWithEvent +*/ +const NVEvent* NVEventGetNextEvent(int waitMSecs = 0); + +/** Indicates that the application has finished handling the event returned from the last +call to NVEventGetNextEvent. This function should always be called prior to the next call +to NVEventGetNextEvent. If the current event is a blocking event, this call will unblock +the posting thread (normally in Java). This is particularly important for application +lifecycle events like onPause, as calling this function indicates that the native code has +completed the handling of the lifecycle callback. Failure to call this function promptly +for all events can lead to Application Not Responding errors. +@param handled The return value that should be passed back to Java for blocking events. For non-blocking +events, this parameter is discard. +@see NVEvent +@see NVEventGetNextEvent +*/ +void NVEventDoneWithEvent(bool handled); + +/** The app-supplied "callback" for initialization during JNI_OnLoad. +Declares the application's pre-main initialization function. Does not define the +function. The app must define this in its own code, even if the function is empty. +JNI init code can be safely called from here, as it WILL be called from +within a JNI function thread +@parm argc Passes the number of command line arguments. + This is currently unsupported and is always passed 0 +@parm argv Passes the array of command line arguments. + This is currently unsupported and is always passed NULL +@return The function should return 0 on success and nonzero on failure. +*/ +extern int32_t NVEventAppInit(int32_t argc, char** argv); + +/** The app-supplied "callback" for running the application's main loop. +Declares the application's main loop function. Does not define the +function. The app must define this in its own code +This function will be spawned in its own thread. +@parm argc Passes the number of command line arguments. + This is currently unsupported and is always passed 0 +@parm argv Passes the array of command line arguments. + This is currently unsupported and is always passed NULL +@return The function should return 0 on success and nonzero on failure. +*/ +extern int32_t NVEventAppMain(int32_t argc, char** argv); + + +/** Initializes EGL, queries a valid ES1 config and creates (but does not bind) + an ES1-compatible EGLContext +@return true on success, false on failure +*/ +bool NVEventInitEGL(); + +/** Releases any existing EGLSurface and EGLContext and terminates EGL +@return true on success, false on failure +*/ +bool NVEventCleanupEGL(); + +/** Creates an EGLSurface for the current Android surface. Will attempt to initialize + EGL and an EGLContext if not already done. Fails if there is no valid Android surface + or if there is an EGL error. +@return true on success, false on failure +*/ +bool NVEventCreateSurfaceEGL(); + +/** Unbinds (if needed) and releases the app's EGLSurface +@return true on success, false on failure +*/ +bool NVEventDestroySurfaceEGL(); + +/** Binds the app's EGLSurface and EGLContext to the calling thread. The EGLSurface and + EGLContext must both exist already, or else the function will fail. +@return true on success, false on failure +*/ +bool NVEventBindSurfaceAndContextEGL(); + +/** Un-binds the app's EGLSurface and EGLContext from the calling thread. +@return true on success, false on failure +*/ +bool NVEventUnbindSurfaceAndContextEGL(); + +/** Swaps the currently-bound EGLSurface +@return true on success, false on failure +*/ +bool NVEventSwapBuffersEGL(); + +/** Accessor for the last EGL error +@return the EGL error +*/ +int NVEventGetErrorEGL(); + +/** Utility function: checks if EGl is completely ready to render, including + initialization, surface creation and context/surface binding. +@parm allocateIfNeeded If the parameter is false, then the function immediately returns if any + part of the requirements have not already been satisfied. If the parameter is + true, then the function attempts to initialize any of the steps needed, failing + and returning false only if a step cannot be completed at this time. +@return The function returns true if EGL/GLES is ready to render/load content (i.e. + a context and surface are bound) and false it not +*/ +bool NVEventReadyToRenderEGL(bool allocateIfNeeded); + +/** Convenience conditional function to determine if the app is between onCreate + and onDestroy callbacks (i.e. the app is in a running state). +@return true if the application is between onCreate and onDestroy and false after + an onDestroy event has been delivered. +*/ +bool NVEventStatusIsRunning(); + +/** Convenience conditional function to determine if the app is between onResume and onPause + callbacks (i.e. the app is in a "resumed" state). +@return true if the application is between onResume and onPause and false if the application + has not yet been resumed, or is currently paused. +*/ +bool NVEventStatusIsActive(); + +/** Convenience conditional function to determine if the app's window is focused (between + calls to onWindowFocusChanged(true) and onWindowFocusChanged(false)) +@return true between onWindowFocusChanged(true) and onWindowFocusChanged(false) +*/ +bool NVEventStatusIsFocused(); + +/** Convenience conditional function to determine if the app has a surface and that surface + has non-zero area +@return true if the app is between surfaceCreated and surfaceDestroyed callbacks and + the surface has non-zero pixel area (not 0x0 pixels) +*/ +bool NVEventStatusHasRealSurface(); + +/** Convenience conditional function to determine if the app is in a fully-focused, visible + state. This is a logical "AND" of IsRunning, IsActive, IsFocused and HasRealSurface +@return true if IsRunning, IsActive, IsFocused and HasRealSurface are all currently true, +false otherwise +*/ +bool NVEventStatusIsInteractable(); + +/** Convenience conditional function to determine if the app has active EGL +@return true between successful calls to NVEventInitEGL and NVEventCleanupEGL, +false otherwise +*/ +bool NVEventStatusEGLInitialized(); + +/** Convenience conditional function to determine if the app has an EGLSurface (need not be bound) +@return true if the EGLSurface for the app is allocated, false otherwise +*/ +bool NVEventStatusEGLHasSurface(); + +/** Convenience conditional function to determine if the app has an EGLSurface and EGLContext + and they are bound +@return true if the EGLSurface and EGLContext for the app are allocated and bound, false otherwise +*/ +bool NVEventStatusEGLIsBound(); + +bool NVEventRepaint(); + +void NVEventReportUnsupported(); + +void NVEventOnRenderingInitialized(); + + +/** Returns the platform-specific handle to the application instance, if supported. This +function is, by definition platform-specific. +@return A platform-specific handle to the application. */ +NVEventPlatformAppHandle NVEventGetPlatformAppHandle(); + +void InitNVEvent(JavaVM * jvm); + +#endif diff --git a/android/jni/nv_event/nv_event_queue.cpp b/android/jni/nv_event/nv_event_queue.cpp index b16a089c10..a99615eb76 100644 --- a/android/jni/nv_event/nv_event_queue.cpp +++ b/android/jni/nv_event/nv_event_queue.cpp @@ -1,277 +1,277 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_event\nv_event_queue.cpp -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- -#define MODULE "NVEventQueue" -#define DBG_DETAILED 1 -#include "../nv_debug/nv_debug.hpp" - -#include "nv_event_queue.hpp" -#include -#include -#include -#include -#include - -#define NVNextWrapped(index) (((index) + 1) & QUEUE_MASK) -#define NVPrevWrapped(index) (((index) - 1) & QUEUE_MASK) - -/* you must be inside a m_accessLock lock to invoke this! */ -static void unlockAll(NVEventSync* sem) -{ - sem->m_block = false; - pthread_cond_broadcast(&(sem->m_cond)); -} - -/* you must be inside mutex lock to invoke this! */ -static int32_t wait(NVEventSync* sem, pthread_mutex_t* mutex, int waitMS) -{ - // TBD - spec is dodgy; do we definitely release the mutex even if - // wait fails? - if(sem->m_block) - { - if( waitMS < 0 ) - return pthread_cond_wait(&sem->m_cond, mutex); - else - return pthread_cond_timeout_np(&sem->m_cond, mutex, (unsigned)waitMS); - } - else - { - // must release this, as failure assumes no lock - pthread_mutex_unlock(mutex); - return 1; // do not return 0 - we do not own the lock! - } -} - -static void signal(NVEventSync* sem) -{ - pthread_cond_signal(&sem->m_cond); -} - -static void broadcast(NVEventSync* sem) -{ - pthread_cond_broadcast(&sem->m_cond); -} - -static void syncInit( NVEventSync* sync ) -{ - pthread_cond_init(&(sync->m_cond), NULL); - sync->m_block = true; -} - -static void syncDestroy( NVEventSync* sync ) -{ - pthread_cond_destroy( &sync->m_cond ); -} - -/* you must be inside a m_accessLock lock to invoke this! */ -bool NVEventQueue::insert(const NVEvent* ev) -{ - // Is the queue full? - int32_t nextNext = NVNextWrapped(m_nextInsertIndex); - if (nextNext == m_headIndex) - { - // TBD - what to do when we cannot insert (full queue) - return false; - } - - NVEvent* evDest = m_events + m_nextInsertIndex; - memcpy(evDest, ev, sizeof(NVEvent)); - - m_nextInsertIndex = nextNext; - return true; -} - -void NVEventQueue::Init() -{ - m_nextInsertIndex = 0; - m_headIndex = 0; - pthread_mutex_init(&(m_accessLock), NULL); - syncInit(&m_consumerSync); - syncInit(&m_blockerSync); - - m_blocker = NULL; - m_blockerState = NO_BLOCKER; - m_blockerReturnVal = false; -} - -void NVEventQueue::Shutdown() -{ - pthread_mutex_destroy(&(m_accessLock)); - - // free everyone... - unlockAll(&m_consumerSync); - unlockAll(&m_blockerSync); - syncDestroy(&(m_consumerSync)); - syncDestroy(&(m_blockerSync)); -} - -void NVEventQueue::Flush() -{ - // TBD: Lock the mutex???? - m_headIndex = m_nextInsertIndex; -} - -void NVEventQueue::UnblockConsumer() -{ - unlockAll(&(m_consumerSync)); -} - -void NVEventQueue::UnblockProducer() -{ - unlockAll(&(m_blockerSync)); -} - -void NVEventQueue::Insert(const NVEvent* ev) -{ - pthread_mutex_lock(&(m_accessLock)); - - // insert the event and unblock a waiter - insert(ev); - signal(&m_consumerSync); - pthread_mutex_unlock(&(m_accessLock)); -} - -bool NVEventQueue::InsertBlocking(const NVEvent* ev) -{ - // TBD - how to handle the destruction of these mutexes - - pthread_mutex_lock(&(m_accessLock)); - while (m_blocker) - { - if (wait(&(m_blockerSync), &(m_accessLock), NV_EVENT_WAIT_FOREVER)) - return false; - } - - assert(!m_blocker); - assert(m_blockerState == NO_BLOCKER); - - // we have the mutex _and_ the blocking event is NULL - // So now we can push a new one - m_blocker = ev; - m_blockerState = PENDING_BLOCKER; - - // Release the consumer, as we just posted a new event - signal(&(m_consumerSync)); - - // Loop on the condition variable until we find out that - // there is a return value waiting for us. Since only we - // will null the blocker pointer, we will not let anyone - // else start to post a blocking event - while (m_blockerState != RETURNED_BLOCKER) - { - if (wait(&(m_blockerSync), &(m_accessLock), NV_EVENT_WAIT_FOREVER)) - return false; - } - - bool handled = m_blockerReturnVal; - m_blocker = NULL; - m_blockerState = NO_BLOCKER; - - NVDEBUG("producer unblocking from consumer handling blocking event (%s)", handled ? "true" : "false"); - - // We've handled the event, so the producer can release the - // next thread to potentially post a blocking event - signal(&(m_blockerSync)); - pthread_mutex_unlock(&(m_accessLock)); - - return handled; -} - - -const NVEvent* NVEventQueue::RemoveOldest(int waitMSecs) -{ - pthread_mutex_lock(&(m_accessLock)); - - // Hmm - the last event we got from RemoveOldest was a - // blocker, and DoneWithEvent not called. - // Default to "false" as a return value - if (m_blockerState == PROCESSING_BLOCKER) - { - m_blockerReturnVal = false; - m_blockerState = RETURNED_BLOCKER; - broadcast(&(m_blockerSync)); - } - - // Blocker is waiting - return it - // And push the blocker pipeline forward - if(m_blockerState == PENDING_BLOCKER) - { - m_blockerState = PROCESSING_BLOCKER; - const NVEvent* ev = m_blocker; - pthread_mutex_unlock(&(m_accessLock)); - - return ev; - } - else if (m_nextInsertIndex == m_headIndex) - { - // We're empty - so what do we do? - if (waitMSecs == 0) - { - goto no_event; - } - else - { - // wait for the specified time - wait(&(m_consumerSync), &(m_accessLock), (unsigned)waitMSecs); - } - - // check again after exiting cond waits, either we had a timeout - if(m_blockerState == PENDING_BLOCKER) - { - m_blockerState = PROCESSING_BLOCKER; - const NVEvent* ev = m_blocker; - pthread_mutex_unlock(&(m_accessLock)); - - return ev; - } - else if (m_nextInsertIndex == m_headIndex) - { - goto no_event; - } - } - - { - // One way or another, we have an event... - const NVEvent* ev = m_events + m_headIndex; - m_headIndex = NVNextWrapped(m_headIndex); - - pthread_mutex_unlock(&(m_accessLock)); - return ev; - } - -no_event: - pthread_mutex_unlock(&(m_accessLock)); - return NULL; -} - -void NVEventQueue::DoneWithEvent(bool ret) -{ - // We only care about blockers for now. - // All other events just NOP - pthread_mutex_lock(&(m_accessLock)); - if (m_blockerState == PROCESSING_BLOCKER) - { - m_blockerReturnVal = ret; - m_blockerState = RETURNED_BLOCKER; - broadcast(&(m_blockerSync)); - } - pthread_mutex_unlock(&(m_accessLock)); -} +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_event\nv_event_queue.cpp +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- +#define MODULE "NVEventQueue" +#define DBG_DETAILED 1 +#include "../nv_debug/nv_debug.hpp" + +#include "nv_event_queue.hpp" +#include +#include +#include +#include +#include + +#define NVNextWrapped(index) (((index) + 1) & QUEUE_MASK) +#define NVPrevWrapped(index) (((index) - 1) & QUEUE_MASK) + +/* you must be inside a m_accessLock lock to invoke this! */ +static void unlockAll(NVEventSync* sem) +{ + sem->m_block = false; + pthread_cond_broadcast(&(sem->m_cond)); +} + +/* you must be inside mutex lock to invoke this! */ +static int32_t wait(NVEventSync* sem, pthread_mutex_t* mutex, int waitMS) +{ + // TBD - spec is dodgy; do we definitely release the mutex even if + // wait fails? + if(sem->m_block) + { + if( waitMS < 0 ) + return pthread_cond_wait(&sem->m_cond, mutex); + else + return pthread_cond_timeout_np(&sem->m_cond, mutex, (unsigned)waitMS); + } + else + { + // must release this, as failure assumes no lock + pthread_mutex_unlock(mutex); + return 1; // do not return 0 - we do not own the lock! + } +} + +static void signal(NVEventSync* sem) +{ + pthread_cond_signal(&sem->m_cond); +} + +static void broadcast(NVEventSync* sem) +{ + pthread_cond_broadcast(&sem->m_cond); +} + +static void syncInit( NVEventSync* sync ) +{ + pthread_cond_init(&(sync->m_cond), NULL); + sync->m_block = true; +} + +static void syncDestroy( NVEventSync* sync ) +{ + pthread_cond_destroy( &sync->m_cond ); +} + +/* you must be inside a m_accessLock lock to invoke this! */ +bool NVEventQueue::insert(const NVEvent* ev) +{ + // Is the queue full? + int32_t nextNext = NVNextWrapped(m_nextInsertIndex); + if (nextNext == m_headIndex) + { + // TBD - what to do when we cannot insert (full queue) + return false; + } + + NVEvent* evDest = m_events + m_nextInsertIndex; + memcpy(evDest, ev, sizeof(NVEvent)); + + m_nextInsertIndex = nextNext; + return true; +} + +void NVEventQueue::Init() +{ + m_nextInsertIndex = 0; + m_headIndex = 0; + pthread_mutex_init(&(m_accessLock), NULL); + syncInit(&m_consumerSync); + syncInit(&m_blockerSync); + + m_blocker = NULL; + m_blockerState = NO_BLOCKER; + m_blockerReturnVal = false; +} + +void NVEventQueue::Shutdown() +{ + pthread_mutex_destroy(&(m_accessLock)); + + // free everyone... + unlockAll(&m_consumerSync); + unlockAll(&m_blockerSync); + syncDestroy(&(m_consumerSync)); + syncDestroy(&(m_blockerSync)); +} + +void NVEventQueue::Flush() +{ + // TBD: Lock the mutex???? + m_headIndex = m_nextInsertIndex; +} + +void NVEventQueue::UnblockConsumer() +{ + unlockAll(&(m_consumerSync)); +} + +void NVEventQueue::UnblockProducer() +{ + unlockAll(&(m_blockerSync)); +} + +void NVEventQueue::Insert(const NVEvent* ev) +{ + pthread_mutex_lock(&(m_accessLock)); + + // insert the event and unblock a waiter + insert(ev); + signal(&m_consumerSync); + pthread_mutex_unlock(&(m_accessLock)); +} + +bool NVEventQueue::InsertBlocking(const NVEvent* ev) +{ + // TBD - how to handle the destruction of these mutexes + + pthread_mutex_lock(&(m_accessLock)); + while (m_blocker) + { + if (wait(&(m_blockerSync), &(m_accessLock), NV_EVENT_WAIT_FOREVER)) + return false; + } + + assert(!m_blocker); + assert(m_blockerState == NO_BLOCKER); + + // we have the mutex _and_ the blocking event is NULL + // So now we can push a new one + m_blocker = ev; + m_blockerState = PENDING_BLOCKER; + + // Release the consumer, as we just posted a new event + signal(&(m_consumerSync)); + + // Loop on the condition variable until we find out that + // there is a return value waiting for us. Since only we + // will null the blocker pointer, we will not let anyone + // else start to post a blocking event + while (m_blockerState != RETURNED_BLOCKER) + { + if (wait(&(m_blockerSync), &(m_accessLock), NV_EVENT_WAIT_FOREVER)) + return false; + } + + bool handled = m_blockerReturnVal; + m_blocker = NULL; + m_blockerState = NO_BLOCKER; + + NVDEBUG("producer unblocking from consumer handling blocking event (%s)", handled ? "true" : "false"); + + // We've handled the event, so the producer can release the + // next thread to potentially post a blocking event + signal(&(m_blockerSync)); + pthread_mutex_unlock(&(m_accessLock)); + + return handled; +} + + +const NVEvent* NVEventQueue::RemoveOldest(int waitMSecs) +{ + pthread_mutex_lock(&(m_accessLock)); + + // Hmm - the last event we got from RemoveOldest was a + // blocker, and DoneWithEvent not called. + // Default to "false" as a return value + if (m_blockerState == PROCESSING_BLOCKER) + { + m_blockerReturnVal = false; + m_blockerState = RETURNED_BLOCKER; + broadcast(&(m_blockerSync)); + } + + // Blocker is waiting - return it + // And push the blocker pipeline forward + if(m_blockerState == PENDING_BLOCKER) + { + m_blockerState = PROCESSING_BLOCKER; + const NVEvent* ev = m_blocker; + pthread_mutex_unlock(&(m_accessLock)); + + return ev; + } + else if (m_nextInsertIndex == m_headIndex) + { + // We're empty - so what do we do? + if (waitMSecs == 0) + { + goto no_event; + } + else + { + // wait for the specified time + wait(&(m_consumerSync), &(m_accessLock), (unsigned)waitMSecs); + } + + // check again after exiting cond waits, either we had a timeout + if(m_blockerState == PENDING_BLOCKER) + { + m_blockerState = PROCESSING_BLOCKER; + const NVEvent* ev = m_blocker; + pthread_mutex_unlock(&(m_accessLock)); + + return ev; + } + else if (m_nextInsertIndex == m_headIndex) + { + goto no_event; + } + } + + { + // One way or another, we have an event... + const NVEvent* ev = m_events + m_headIndex; + m_headIndex = NVNextWrapped(m_headIndex); + + pthread_mutex_unlock(&(m_accessLock)); + return ev; + } + +no_event: + pthread_mutex_unlock(&(m_accessLock)); + return NULL; +} + +void NVEventQueue::DoneWithEvent(bool ret) +{ + // We only care about blockers for now. + // All other events just NOP + pthread_mutex_lock(&(m_accessLock)); + if (m_blockerState == PROCESSING_BLOCKER) + { + m_blockerReturnVal = ret; + m_blockerState = RETURNED_BLOCKER; + broadcast(&(m_blockerSync)); + } + pthread_mutex_unlock(&(m_accessLock)); +} diff --git a/android/jni/nv_event/nv_keycode_mapping.hpp b/android/jni/nv_event/nv_keycode_mapping.hpp index d33c28d75c..0434240c39 100644 --- a/android/jni/nv_event/nv_keycode_mapping.hpp +++ b/android/jni/nv_event/nv_keycode_mapping.hpp @@ -1,147 +1,147 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_event\nv_keycode_mapping.h -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- - -class NVKeyCodeMapping -{ -public: - NVKeyCodeMapping() - { - memset(m_keyMapping, 0, sizeof(NVKeyCode) * NV_MAX_KEYCODE); - } - - void Init(JNIEnv* env, jobject thiz); - - bool MapKey(int key, NVKeyCode& code); - -protected: - void AddKeyMapping(JNIEnv* env, jobject thiz, jclass KeyCode_class, const char* name, NVKeyCode value); - NVKeyCode m_keyMapping[NV_MAX_KEYCODE]; -}; - -/* Init the mapping array, set up the event queue */ -void NVKeyCodeMapping::AddKeyMapping(JNIEnv* env, jobject thiz, jclass KeyCode_class, const char* name, NVKeyCode value) -{ - // Add a new mapping... - jfieldID id = env->GetStaticFieldID(KeyCode_class, name, "I"); - int keyID = env->GetStaticIntField(KeyCode_class, id); - - if (keyID < NV_MAX_KEYCODE) - { - /* TODO TBD Should check for collision */ - m_keyMapping[keyID] = value; - } -} - -#define AddKeymappingMacro(name, value) \ - AddKeyMapping(env, thiz, KeyCode_class, name, value) - -void NVKeyCodeMapping::Init(JNIEnv* env, jobject thiz) -{ - jclass KeyCode_class = env->FindClass("android/view/KeyEvent"); - - AddKeymappingMacro("KEYCODE_BACK",NV_KEYCODE_BACK); - AddKeymappingMacro("KEYCODE_TAB",NV_KEYCODE_TAB); - AddKeymappingMacro("KEYCODE_ENTER",NV_KEYCODE_ENTER); - - AddKeymappingMacro("KEYCODE_SPACE",NV_KEYCODE_SPACE); - AddKeymappingMacro("KEYCODE_ENDCALL",NV_KEYCODE_ENDCALL); - AddKeymappingMacro("KEYCODE_HOME",NV_KEYCODE_HOME); - - AddKeymappingMacro("KEYCODE_DPAD_LEFT",NV_KEYCODE_DPAD_LEFT); - AddKeymappingMacro("KEYCODE_DPAD_UP",NV_KEYCODE_DPAD_UP); - AddKeymappingMacro("KEYCODE_DPAD_RIGHT",NV_KEYCODE_DPAD_RIGHT); - AddKeymappingMacro("KEYCODE_DPAD_DOWN",NV_KEYCODE_DPAD_DOWN); - - AddKeymappingMacro("KEYCODE_DEL",NV_KEYCODE_DEL); - - AddKeymappingMacro("KEYCODE_0",NV_KEYCODE_0); - AddKeymappingMacro("KEYCODE_1",NV_KEYCODE_1); - AddKeymappingMacro("KEYCODE_2",NV_KEYCODE_2); - AddKeymappingMacro("KEYCODE_3",NV_KEYCODE_3); - AddKeymappingMacro("KEYCODE_4",NV_KEYCODE_4); - AddKeymappingMacro("KEYCODE_5",NV_KEYCODE_5); - AddKeymappingMacro("KEYCODE_6",NV_KEYCODE_6); - AddKeymappingMacro("KEYCODE_7",NV_KEYCODE_7); - AddKeymappingMacro("KEYCODE_8",NV_KEYCODE_8); - AddKeymappingMacro("KEYCODE_9",NV_KEYCODE_9); - - AddKeymappingMacro("KEYCODE_A",NV_KEYCODE_A); - AddKeymappingMacro("KEYCODE_B",NV_KEYCODE_B); - AddKeymappingMacro("KEYCODE_C",NV_KEYCODE_C); - AddKeymappingMacro("KEYCODE_D",NV_KEYCODE_D); - AddKeymappingMacro("KEYCODE_E",NV_KEYCODE_E); - AddKeymappingMacro("KEYCODE_F",NV_KEYCODE_F); - AddKeymappingMacro("KEYCODE_G",NV_KEYCODE_G); - AddKeymappingMacro("KEYCODE_H",NV_KEYCODE_H); - AddKeymappingMacro("KEYCODE_I",NV_KEYCODE_I); - AddKeymappingMacro("KEYCODE_J",NV_KEYCODE_J); - AddKeymappingMacro("KEYCODE_K",NV_KEYCODE_K); - AddKeymappingMacro("KEYCODE_L",NV_KEYCODE_L); - AddKeymappingMacro("KEYCODE_M",NV_KEYCODE_M); - AddKeymappingMacro("KEYCODE_N",NV_KEYCODE_N); - AddKeymappingMacro("KEYCODE_O",NV_KEYCODE_O); - AddKeymappingMacro("KEYCODE_P",NV_KEYCODE_P); - AddKeymappingMacro("KEYCODE_Q",NV_KEYCODE_Q); - AddKeymappingMacro("KEYCODE_R",NV_KEYCODE_R); - AddKeymappingMacro("KEYCODE_S",NV_KEYCODE_S); - AddKeymappingMacro("KEYCODE_T",NV_KEYCODE_T); - AddKeymappingMacro("KEYCODE_U",NV_KEYCODE_U); - AddKeymappingMacro("KEYCODE_V",NV_KEYCODE_V); - AddKeymappingMacro("KEYCODE_W",NV_KEYCODE_W); - AddKeymappingMacro("KEYCODE_X",NV_KEYCODE_X); - AddKeymappingMacro("KEYCODE_Y",NV_KEYCODE_Y); - AddKeymappingMacro("KEYCODE_Z",NV_KEYCODE_Z); - - AddKeymappingMacro("KEYCODE_STAR",NV_KEYCODE_STAR); - AddKeymappingMacro("KEYCODE_PLUS",NV_KEYCODE_PLUS); - AddKeymappingMacro("KEYCODE_MINUS",NV_KEYCODE_MINUS); - - AddKeymappingMacro("KEYCODE_NUM",NV_KEYCODE_NUM); - - AddKeymappingMacro("KEYCODE_ALT_LEFT",NV_KEYCODE_ALT_LEFT); - AddKeymappingMacro("KEYCODE_ALT_RIGHT",NV_KEYCODE_ALT_RIGHT); - - AddKeymappingMacro("KEYCODE_SHIFT_LEFT",NV_KEYCODE_SHIFT_LEFT); - AddKeymappingMacro("KEYCODE_SHIFT_RIGHT",NV_KEYCODE_SHIFT_RIGHT); - - AddKeymappingMacro("KEYCODE_APOSTROPHE",NV_KEYCODE_APOSTROPHE); - AddKeymappingMacro("KEYCODE_SEMICOLON",NV_KEYCODE_SEMICOLON); - AddKeymappingMacro("KEYCODE_EQUALS",NV_KEYCODE_EQUALS); - AddKeymappingMacro("KEYCODE_COMMA",NV_KEYCODE_COMMA); - AddKeymappingMacro("KEYCODE_PERIOD",NV_KEYCODE_PERIOD); - AddKeymappingMacro("KEYCODE_SLASH",NV_KEYCODE_SLASH); - AddKeymappingMacro("KEYCODE_GRAVE",NV_KEYCODE_GRAVE); - AddKeymappingMacro("KEYCODE_LEFT_BRACKET",NV_KEYCODE_LEFT_BRACKET); - AddKeymappingMacro("KEYCODE_BACKSLASH",NV_KEYCODE_BACKSLASH); - AddKeymappingMacro("KEYCODE_RIGHT_BRACKET",NV_KEYCODE_RIGHT_BRACKET); -} - -bool NVKeyCodeMapping::MapKey(int key, NVKeyCode& code) -{ - if (key < NV_MAX_KEYCODE) - { - code = m_keyMapping[key]; - return true; - } - else - return false; -} +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_event\nv_keycode_mapping.h +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- + +class NVKeyCodeMapping +{ +public: + NVKeyCodeMapping() + { + memset(m_keyMapping, 0, sizeof(NVKeyCode) * NV_MAX_KEYCODE); + } + + void Init(JNIEnv* env, jobject thiz); + + bool MapKey(int key, NVKeyCode& code); + +protected: + void AddKeyMapping(JNIEnv* env, jobject thiz, jclass KeyCode_class, const char* name, NVKeyCode value); + NVKeyCode m_keyMapping[NV_MAX_KEYCODE]; +}; + +/* Init the mapping array, set up the event queue */ +void NVKeyCodeMapping::AddKeyMapping(JNIEnv* env, jobject thiz, jclass KeyCode_class, const char* name, NVKeyCode value) +{ + // Add a new mapping... + jfieldID id = env->GetStaticFieldID(KeyCode_class, name, "I"); + int keyID = env->GetStaticIntField(KeyCode_class, id); + + if (keyID < NV_MAX_KEYCODE) + { + /* TODO TBD Should check for collision */ + m_keyMapping[keyID] = value; + } +} + +#define AddKeymappingMacro(name, value) \ + AddKeyMapping(env, thiz, KeyCode_class, name, value) + +void NVKeyCodeMapping::Init(JNIEnv* env, jobject thiz) +{ + jclass KeyCode_class = env->FindClass("android/view/KeyEvent"); + + AddKeymappingMacro("KEYCODE_BACK",NV_KEYCODE_BACK); + AddKeymappingMacro("KEYCODE_TAB",NV_KEYCODE_TAB); + AddKeymappingMacro("KEYCODE_ENTER",NV_KEYCODE_ENTER); + + AddKeymappingMacro("KEYCODE_SPACE",NV_KEYCODE_SPACE); + AddKeymappingMacro("KEYCODE_ENDCALL",NV_KEYCODE_ENDCALL); + AddKeymappingMacro("KEYCODE_HOME",NV_KEYCODE_HOME); + + AddKeymappingMacro("KEYCODE_DPAD_LEFT",NV_KEYCODE_DPAD_LEFT); + AddKeymappingMacro("KEYCODE_DPAD_UP",NV_KEYCODE_DPAD_UP); + AddKeymappingMacro("KEYCODE_DPAD_RIGHT",NV_KEYCODE_DPAD_RIGHT); + AddKeymappingMacro("KEYCODE_DPAD_DOWN",NV_KEYCODE_DPAD_DOWN); + + AddKeymappingMacro("KEYCODE_DEL",NV_KEYCODE_DEL); + + AddKeymappingMacro("KEYCODE_0",NV_KEYCODE_0); + AddKeymappingMacro("KEYCODE_1",NV_KEYCODE_1); + AddKeymappingMacro("KEYCODE_2",NV_KEYCODE_2); + AddKeymappingMacro("KEYCODE_3",NV_KEYCODE_3); + AddKeymappingMacro("KEYCODE_4",NV_KEYCODE_4); + AddKeymappingMacro("KEYCODE_5",NV_KEYCODE_5); + AddKeymappingMacro("KEYCODE_6",NV_KEYCODE_6); + AddKeymappingMacro("KEYCODE_7",NV_KEYCODE_7); + AddKeymappingMacro("KEYCODE_8",NV_KEYCODE_8); + AddKeymappingMacro("KEYCODE_9",NV_KEYCODE_9); + + AddKeymappingMacro("KEYCODE_A",NV_KEYCODE_A); + AddKeymappingMacro("KEYCODE_B",NV_KEYCODE_B); + AddKeymappingMacro("KEYCODE_C",NV_KEYCODE_C); + AddKeymappingMacro("KEYCODE_D",NV_KEYCODE_D); + AddKeymappingMacro("KEYCODE_E",NV_KEYCODE_E); + AddKeymappingMacro("KEYCODE_F",NV_KEYCODE_F); + AddKeymappingMacro("KEYCODE_G",NV_KEYCODE_G); + AddKeymappingMacro("KEYCODE_H",NV_KEYCODE_H); + AddKeymappingMacro("KEYCODE_I",NV_KEYCODE_I); + AddKeymappingMacro("KEYCODE_J",NV_KEYCODE_J); + AddKeymappingMacro("KEYCODE_K",NV_KEYCODE_K); + AddKeymappingMacro("KEYCODE_L",NV_KEYCODE_L); + AddKeymappingMacro("KEYCODE_M",NV_KEYCODE_M); + AddKeymappingMacro("KEYCODE_N",NV_KEYCODE_N); + AddKeymappingMacro("KEYCODE_O",NV_KEYCODE_O); + AddKeymappingMacro("KEYCODE_P",NV_KEYCODE_P); + AddKeymappingMacro("KEYCODE_Q",NV_KEYCODE_Q); + AddKeymappingMacro("KEYCODE_R",NV_KEYCODE_R); + AddKeymappingMacro("KEYCODE_S",NV_KEYCODE_S); + AddKeymappingMacro("KEYCODE_T",NV_KEYCODE_T); + AddKeymappingMacro("KEYCODE_U",NV_KEYCODE_U); + AddKeymappingMacro("KEYCODE_V",NV_KEYCODE_V); + AddKeymappingMacro("KEYCODE_W",NV_KEYCODE_W); + AddKeymappingMacro("KEYCODE_X",NV_KEYCODE_X); + AddKeymappingMacro("KEYCODE_Y",NV_KEYCODE_Y); + AddKeymappingMacro("KEYCODE_Z",NV_KEYCODE_Z); + + AddKeymappingMacro("KEYCODE_STAR",NV_KEYCODE_STAR); + AddKeymappingMacro("KEYCODE_PLUS",NV_KEYCODE_PLUS); + AddKeymappingMacro("KEYCODE_MINUS",NV_KEYCODE_MINUS); + + AddKeymappingMacro("KEYCODE_NUM",NV_KEYCODE_NUM); + + AddKeymappingMacro("KEYCODE_ALT_LEFT",NV_KEYCODE_ALT_LEFT); + AddKeymappingMacro("KEYCODE_ALT_RIGHT",NV_KEYCODE_ALT_RIGHT); + + AddKeymappingMacro("KEYCODE_SHIFT_LEFT",NV_KEYCODE_SHIFT_LEFT); + AddKeymappingMacro("KEYCODE_SHIFT_RIGHT",NV_KEYCODE_SHIFT_RIGHT); + + AddKeymappingMacro("KEYCODE_APOSTROPHE",NV_KEYCODE_APOSTROPHE); + AddKeymappingMacro("KEYCODE_SEMICOLON",NV_KEYCODE_SEMICOLON); + AddKeymappingMacro("KEYCODE_EQUALS",NV_KEYCODE_EQUALS); + AddKeymappingMacro("KEYCODE_COMMA",NV_KEYCODE_COMMA); + AddKeymappingMacro("KEYCODE_PERIOD",NV_KEYCODE_PERIOD); + AddKeymappingMacro("KEYCODE_SLASH",NV_KEYCODE_SLASH); + AddKeymappingMacro("KEYCODE_GRAVE",NV_KEYCODE_GRAVE); + AddKeymappingMacro("KEYCODE_LEFT_BRACKET",NV_KEYCODE_LEFT_BRACKET); + AddKeymappingMacro("KEYCODE_BACKSLASH",NV_KEYCODE_BACKSLASH); + AddKeymappingMacro("KEYCODE_RIGHT_BRACKET",NV_KEYCODE_RIGHT_BRACKET); +} + +bool NVKeyCodeMapping::MapKey(int key, NVKeyCode& code) +{ + if (key < NV_MAX_KEYCODE) + { + code = m_keyMapping[key]; + return true; + } + else + return false; +} diff --git a/android/jni/nv_event/scoped_profiler.hpp b/android/jni/nv_event/scoped_profiler.hpp index 9e7d3a2952..1c3d2f2aae 100644 --- a/android/jni/nv_event/scoped_profiler.hpp +++ b/android/jni/nv_event/scoped_profiler.hpp @@ -1,82 +1,82 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_event\scoped_profiler.h -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- - -#ifndef SCOPED_PROFILER_H -#define SCOPED_PROFILER_H - -#define PERF_STMTS 0 -#if PERF_STMTS == 1 -#include "../nv_time/nv_time.hpp" -#include "stdio.h" -#include "stdlib.h" - -static char s_bigString[4096]; -static int s_bigStringSize; - -static char s_tmpBuf[1024]; - -class ScopedProfiler -{ -public: - ScopedProfiler(const char* text) - { - _text = text; - _startTime = nvGetSystemTime(); - __last = this; - } - ~ScopedProfiler() - { - stop(); - } - inline void stop() - { - if(_text) - { - int size = snprintf(s_tmpBuf, dimof(s_tmpBuf)-1, "%d ms spent in %s" , (int)(nvGetSystemTime() - _startTime), _text); - strcat(s_bigString + s_bigStringSize, s_tmpBuf); - s_bigStringSize += size; - _text = 0; - } - static void stopLast() - { - if(__last) - __last->stop(); - __last = 0; - } - const char* _text; - long _startTime; - static ScopedProfiler* __last; -}; -ScopedProfiler* ScopedProfiler::__last = 0; - -#define STRINGIFIER(s) #s -#define CONCAT_(a,b) a ## b -#define CONCAT(a,b) CONCAT_(a,b) -#define PERFBLURB(s) static const char CONCAT(___str,__LINE__)[] = s "\n"; ScopedProfiler CONCAT(SCOPED_PROFILER,__LINE__)(CONCAT(___str,__LINE__)); -#define RESET_PROFILING() { DEBUG_D("%s", s_bigString); s_bigString[0] = 0; s_bigStringSize = 0; } -#else -#define PERFBLURB(s) -#define RESET_PROFILING() -#endif - -#endif // SCOPED_PROFILER_H - +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_event\scoped_profiler.h +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- + +#ifndef SCOPED_PROFILER_H +#define SCOPED_PROFILER_H + +#define PERF_STMTS 0 +#if PERF_STMTS == 1 +#include "../nv_time/nv_time.hpp" +#include "stdio.h" +#include "stdlib.h" + +static char s_bigString[4096]; +static int s_bigStringSize; + +static char s_tmpBuf[1024]; + +class ScopedProfiler +{ +public: + ScopedProfiler(const char* text) + { + _text = text; + _startTime = nvGetSystemTime(); + __last = this; + } + ~ScopedProfiler() + { + stop(); + } + inline void stop() + { + if(_text) + { + int size = snprintf(s_tmpBuf, dimof(s_tmpBuf)-1, "%d ms spent in %s" , (int)(nvGetSystemTime() - _startTime), _text); + strcat(s_bigString + s_bigStringSize, s_tmpBuf); + s_bigStringSize += size; + _text = 0; + } + static void stopLast() + { + if(__last) + __last->stop(); + __last = 0; + } + const char* _text; + long _startTime; + static ScopedProfiler* __last; +}; +ScopedProfiler* ScopedProfiler::__last = 0; + +#define STRINGIFIER(s) #s +#define CONCAT_(a,b) a ## b +#define CONCAT(a,b) CONCAT_(a,b) +#define PERFBLURB(s) static const char CONCAT(___str,__LINE__)[] = s "\n"; ScopedProfiler CONCAT(SCOPED_PROFILER,__LINE__)(CONCAT(___str,__LINE__)); +#define RESET_PROFILING() { DEBUG_D("%s", s_bigString); s_bigString[0] = 0; s_bigStringSize = 0; } +#else +#define PERFBLURB(s) +#define RESET_PROFILING() +#endif + +#endif // SCOPED_PROFILER_H + diff --git a/android/jni/nv_thread/nv_thread.cpp b/android/jni/nv_thread/nv_thread.cpp index 6255fdf029..26a891d6ea 100644 --- a/android/jni/nv_thread/nv_thread.cpp +++ b/android/jni/nv_thread/nv_thread.cpp @@ -1,167 +1,167 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_thread\nv_thread.c -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA� Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- - -#include - -#include "nv_thread.hpp" -#include -#include - -static JavaVM* s_vm = NULL; -static pthread_key_t s_jniEnvKey = 0; - -#define MODULE "NVThread" - -#include "../nv_debug/nv_debug.hpp" -#include "../com/mapswithme/core/jni_helper.hpp" - -void NVThreadInit(JavaVM* vm) -{ - s_vm = vm; -} - -JNIEnv* NVThreadGetCurrentJNIEnv() -{ - return jni::GetEnv(); - -// JNIEnv* env = NULL; -// if (s_jniEnvKey) -// { -// env = (JNIEnv*)pthread_getspecific(s_jniEnvKey); -// } -// else -// { -// pthread_key_create(&s_jniEnvKey, NULL); -// } -// -// if (!env) -// { -// // do we have a VM cached? -// if (!s_vm) -// { -// __android_log_print(ANDROID_LOG_DEBUG, MODULE, "Error - could not find JVM!"); -// return NULL; -// } -// -// // Hmm - no env for this thread cached yet -// int error = s_vm->AttachCurrentThread(&env, NULL); -// __android_log_print(ANDROID_LOG_DEBUG, MODULE, "AttachCurrentThread: %d, 0x%p", error, env); -// if (error || !env) -// { -// __android_log_print(ANDROID_LOG_DEBUG, MODULE, "Error - could not attach thread to JVM!"); -// return NULL; -// } -// -// pthread_setspecific(s_jniEnvKey, env); -// } -// -// return env; -} - -typedef struct NVThreadInitStruct -{ - void* m_arg; - void *(*m_startRoutine)(void *); -} NVThreadInitStruct; - -// Implementations are in PThreadImpl.cpp -// They're used automatically if thread is created with base/thread.hpp -// @TODO: refactor and remove -void AndroidThreadAttachToJVM(); -void AndroidThreadDetachFromJVM(); - -static void* NVThreadSpawnProc(void* arg) -{ - NVThreadInitStruct* init = (NVThreadInitStruct*)arg; - void *(*start_routine)(void *) = init->m_startRoutine; - void* data = init->m_arg; - void* ret; - - free(arg); - - AndroidThreadAttachToJVM(); - - ret = start_routine(data); - - AndroidThreadDetachFromJVM(); - - return ret; -} - -int NVThreadSpawnJNIThread(pthread_t *thread, pthread_attr_t const * attr, - void *(*start_routine)(void *), void * arg) -{ - if (!start_routine) - return -1; - - NVThreadInitStruct * initData = new NVThreadInitStruct; - - initData->m_startRoutine = start_routine; - initData->m_arg = arg; - - int err = pthread_create(thread, attr, NVThreadSpawnProc, initData); - - // If the thread was not started, then we need to delete the init data ourselves - if (err) - free(initData); - - return err; -} - -// on linuces, signals can interrupt sleep functions, so you might need to -// retry to get the full sleep going. I'm not entirely sure this is necessary -// *here* clients could retry themselves when the exposed function returns -// nonzero -inline int __sleep(const struct timespec *req, struct timespec *rem) -{ - int ret = 1; - int i; - static const int sleepTries = 2; - - struct timespec req_tmp={0}, rem_tmp={0}; - - rem_tmp = *req; - for(i = 0; i < sleepTries; ++i) - { - req_tmp = rem_tmp; - int ret = nanosleep(&req_tmp, &rem_tmp); - if(ret == 0) - { - ret = 0; - break; - } - } - if(rem) - *rem = rem_tmp; - return ret; -} - -int NVThreadSleep(unsigned long millisec) -{ - struct timespec req={0},rem={0}; - time_t sec =(int)(millisec/1000); - - millisec = millisec-(sec*1000); - req.tv_sec = sec; - req.tv_nsec = millisec*1000000L; - return __sleep(&req,&rem); -} +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_thread\nv_thread.c +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA� Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- + +#include + +#include "nv_thread.hpp" +#include +#include + +static JavaVM* s_vm = NULL; +static pthread_key_t s_jniEnvKey = 0; + +#define MODULE "NVThread" + +#include "../nv_debug/nv_debug.hpp" +#include "../com/mapswithme/core/jni_helper.hpp" + +void NVThreadInit(JavaVM* vm) +{ + s_vm = vm; +} + +JNIEnv* NVThreadGetCurrentJNIEnv() +{ + return jni::GetEnv(); + +// JNIEnv* env = NULL; +// if (s_jniEnvKey) +// { +// env = (JNIEnv*)pthread_getspecific(s_jniEnvKey); +// } +// else +// { +// pthread_key_create(&s_jniEnvKey, NULL); +// } +// +// if (!env) +// { +// // do we have a VM cached? +// if (!s_vm) +// { +// __android_log_print(ANDROID_LOG_DEBUG, MODULE, "Error - could not find JVM!"); +// return NULL; +// } +// +// // Hmm - no env for this thread cached yet +// int error = s_vm->AttachCurrentThread(&env, NULL); +// __android_log_print(ANDROID_LOG_DEBUG, MODULE, "AttachCurrentThread: %d, 0x%p", error, env); +// if (error || !env) +// { +// __android_log_print(ANDROID_LOG_DEBUG, MODULE, "Error - could not attach thread to JVM!"); +// return NULL; +// } +// +// pthread_setspecific(s_jniEnvKey, env); +// } +// +// return env; +} + +typedef struct NVThreadInitStruct +{ + void* m_arg; + void *(*m_startRoutine)(void *); +} NVThreadInitStruct; + +// Implementations are in PThreadImpl.cpp +// They're used automatically if thread is created with base/thread.hpp +// @TODO: refactor and remove +void AndroidThreadAttachToJVM(); +void AndroidThreadDetachFromJVM(); + +static void* NVThreadSpawnProc(void* arg) +{ + NVThreadInitStruct* init = (NVThreadInitStruct*)arg; + void *(*start_routine)(void *) = init->m_startRoutine; + void* data = init->m_arg; + void* ret; + + free(arg); + + AndroidThreadAttachToJVM(); + + ret = start_routine(data); + + AndroidThreadDetachFromJVM(); + + return ret; +} + +int NVThreadSpawnJNIThread(pthread_t *thread, pthread_attr_t const * attr, + void *(*start_routine)(void *), void * arg) +{ + if (!start_routine) + return -1; + + NVThreadInitStruct * initData = new NVThreadInitStruct; + + initData->m_startRoutine = start_routine; + initData->m_arg = arg; + + int err = pthread_create(thread, attr, NVThreadSpawnProc, initData); + + // If the thread was not started, then we need to delete the init data ourselves + if (err) + free(initData); + + return err; +} + +// on linuces, signals can interrupt sleep functions, so you might need to +// retry to get the full sleep going. I'm not entirely sure this is necessary +// *here* clients could retry themselves when the exposed function returns +// nonzero +inline int __sleep(const struct timespec *req, struct timespec *rem) +{ + int ret = 1; + int i; + static const int sleepTries = 2; + + struct timespec req_tmp={0}, rem_tmp={0}; + + rem_tmp = *req; + for(i = 0; i < sleepTries; ++i) + { + req_tmp = rem_tmp; + int ret = nanosleep(&req_tmp, &rem_tmp); + if(ret == 0) + { + ret = 0; + break; + } + } + if(rem) + *rem = rem_tmp; + return ret; +} + +int NVThreadSleep(unsigned long millisec) +{ + struct timespec req={0},rem={0}; + time_t sec =(int)(millisec/1000); + + millisec = millisec-(sec*1000); + req.tv_sec = sec; + req.tv_nsec = millisec*1000000L; + return __sleep(&req,&rem); +} diff --git a/android/jni/nv_thread/nv_thread.hpp b/android/jni/nv_thread/nv_thread.hpp index 680ea1d223..20e03f5a4a 100644 --- a/android/jni/nv_thread/nv_thread.hpp +++ b/android/jni/nv_thread/nv_thread.hpp @@ -1,97 +1,97 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_thread\nv_thread.h -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- - -#ifndef __INCLUDED_NV_THREAD_H -#define __INCLUDED_NV_THREAD_H - -#include -#include -#include - -#if defined(__cplusplus) -extern "C" -{ -#endif - -/** @file nv_thread.h - The NVThread library makes it easy to create native threads that can acess - JNI objects. By default, pthreads created in the Android NDK are NOT connected - to the JVM and JNI calls will fail. This library wraps thread creation in - such a way that pthreads created using it will connect to and disconnect from - the JVM as appropriate. Applications creating all of their threads with these - interfaces can use the provided NVThreadGetCurrentJNIEnv() function to - get the current thread's JNI context at any time. - - Note that native-created threads still have JNI limitations over threads - that are calls down to native from Java. The JNI function FindClass will - NOT find application-specific classes when called from native threads. - Native code that needs to call FindClass and record the indices of Java - class members for later access must call FindClass and Get*FieldID/Get*MethodID - in threads calling from Java, such as JNI_OnLoad - */ - -/** - Initializes the nv_thread system by connecting it to the JVM. This - function must be called as early as possible in the native code's - JNI_OnLoad function, so that the thread system is prepared for any - JNI-dependent library initialization calls. - @param vm The VM pointer - should be the JavaVM pointer sent to JNI_OnLoad. - */ -void NVThreadInit(JavaVM* vm); - -/** - Retrieves the JNIEnv object associated with the current thread, allowing - any thread that was creating with NVThreadSpawnJNIThread() to access the - JNI at will. This JNIEnv is NOT usable across multiple calls or threads - The function should be called in each function that requires a JNIEnv - @return The current thread's JNIEnv, or NULL if the thread was not created - by NVThreadSpawnJNIThread - @see NVThreadSpawnJNIThread - */ -JNIEnv* NVThreadGetCurrentJNIEnv(); - -/** - Spwans a new native thread that is registered for use with JNI. Threads - created with this function will have access to JNI data via the JNIEnv - available from NVThreadGetCurrentJNIEnv(). - @param thread is the same as in pthread_create - @param attr is the same as in pthread_create - @param start_routine is the same as in pthread_create - @param arg is the same as in pthread_create - @return 0 on success, -1 on failure - @see NVThreadGetCurrentJNIEnv -*/ -int NVThreadSpawnJNIThread(pthread_t *thread, pthread_attr_t const * attr, - void *(*start_routine)(void *), void * arg); - -/** - Sleeps the current thread for the specified number of milliseconds - @param millisec Sleep time in ms - @return 0 on success, -1 on failure -*/ -int NVThreadSleep(unsigned long millisec); - -#if defined(__cplusplus) -} -#endif - -#endif +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_thread\nv_thread.h +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- + +#ifndef __INCLUDED_NV_THREAD_H +#define __INCLUDED_NV_THREAD_H + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" +{ +#endif + +/** @file nv_thread.h + The NVThread library makes it easy to create native threads that can acess + JNI objects. By default, pthreads created in the Android NDK are NOT connected + to the JVM and JNI calls will fail. This library wraps thread creation in + such a way that pthreads created using it will connect to and disconnect from + the JVM as appropriate. Applications creating all of their threads with these + interfaces can use the provided NVThreadGetCurrentJNIEnv() function to + get the current thread's JNI context at any time. + + Note that native-created threads still have JNI limitations over threads + that are calls down to native from Java. The JNI function FindClass will + NOT find application-specific classes when called from native threads. + Native code that needs to call FindClass and record the indices of Java + class members for later access must call FindClass and Get*FieldID/Get*MethodID + in threads calling from Java, such as JNI_OnLoad + */ + +/** + Initializes the nv_thread system by connecting it to the JVM. This + function must be called as early as possible in the native code's + JNI_OnLoad function, so that the thread system is prepared for any + JNI-dependent library initialization calls. + @param vm The VM pointer - should be the JavaVM pointer sent to JNI_OnLoad. + */ +void NVThreadInit(JavaVM* vm); + +/** + Retrieves the JNIEnv object associated with the current thread, allowing + any thread that was creating with NVThreadSpawnJNIThread() to access the + JNI at will. This JNIEnv is NOT usable across multiple calls or threads + The function should be called in each function that requires a JNIEnv + @return The current thread's JNIEnv, or NULL if the thread was not created + by NVThreadSpawnJNIThread + @see NVThreadSpawnJNIThread + */ +JNIEnv* NVThreadGetCurrentJNIEnv(); + +/** + Spwans a new native thread that is registered for use with JNI. Threads + created with this function will have access to JNI data via the JNIEnv + available from NVThreadGetCurrentJNIEnv(). + @param thread is the same as in pthread_create + @param attr is the same as in pthread_create + @param start_routine is the same as in pthread_create + @param arg is the same as in pthread_create + @return 0 on success, -1 on failure + @see NVThreadGetCurrentJNIEnv +*/ +int NVThreadSpawnJNIThread(pthread_t *thread, pthread_attr_t const * attr, + void *(*start_routine)(void *), void * arg); + +/** + Sleeps the current thread for the specified number of milliseconds + @param millisec Sleep time in ms + @return 0 on success, -1 on failure +*/ +int NVThreadSleep(unsigned long millisec); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/android/jni/nv_time/nv_time.cpp b/android/jni/nv_time/nv_time.cpp index 2a47d82a5d..c833d74703 100644 --- a/android/jni/nv_time/nv_time.cpp +++ b/android/jni/nv_time/nv_time.cpp @@ -1,164 +1,164 @@ -//---------------------------------------------------------------------------------- -// File: libs\jni\nv_time\nv_time.cpp -// Samples Version: NVIDIA Android Lifecycle samples 1_0beta -// Email: tegradev@nvidia.com -// Web: http://developer.nvidia.com/category/zone/mobile-development -// -// Copyright 2009-2011 NVIDIA® Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//---------------------------------------------------------------------------------- - -#include "nv_time.hpp" -#include "../nv_thread/nv_thread.hpp" -/*#include -#include -#include */ -#include -#include -#include -#include -#include - -/*#ifndef EGL_NV_system_time -#define EGL_NV_system_time 1 -typedef khronos_uint64_t EGLuint64NV; -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); -EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); -#endif -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void); -typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void); -#endif -*/ - -void nvAcquireTimeExtensionJNI(JNIEnv*, jobject) -{ - nvAcquireTimeExtension(); -} - -jlong nvGetSystemTimeJNI(JNIEnv*, jobject) -{ - return (jlong)nvGetSystemTime(); -} - -/*static PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC eglGetSystemTimeFrequencyNVProc = NULL; -static PFNEGLGETSYSTEMTIMENVPROC eglGetSystemTimeNVProc = NULL; -static EGLuint64NV eglSystemTimeFrequency = 0; -static bool timeExtensionQueried = false;*/ - -void nvAcquireTimeExtension() -{ -/* if (timeExtensionQueried) - return; - timeExtensionQueried = true; - - eglGetSystemTimeFrequencyNVProc = (PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) eglGetProcAddress("eglGetSystemTimeFrequencyNV"); - eglGetSystemTimeNVProc = (PFNEGLGETSYSTEMTIMENVPROC) eglGetProcAddress("eglGetSystemTimeNV"); - - // now, we'll proceed through a series of sanity checking. - // if they all succeed, we'll return. - // if any fail, we fall out of conditional tests to end of function, null pointers, and return. - if (eglGetSystemTimeFrequencyNVProc && - eglGetSystemTimeNVProc) - { - eglSystemTimeFrequency = eglGetSystemTimeFrequencyNVProc(); - if (eglSystemTimeFrequency>0) // assume okay. quick-check it works. - { - EGLuint64NV time1, time2; - time1 = eglGetSystemTimeNVProc(); - usleep(2000); // 2ms should be MORE than sufficient, right? - time2 = eglGetSystemTimeNVProc(); - if (time1 != time2) // quick sanity only... - { - // we've sanity checked: - // - fn pointers non-null - // - freq non-zero - // - two calls to time sep'd by sleep non-equal - // safe to return now. - return; - } - } - } - - // fall back if we've not returned already. - eglGetSystemTimeFrequencyNVProc = (PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) NULL; - eglGetSystemTimeNVProc = (PFNEGLGETSYSTEMTIMENVPROC) NULL;*/ -} - -bool nvValidTimeExtension() -{ -/* if (NULL == eglGetSystemTimeFrequencyNVProc || - NULL == eglGetSystemTimeNVProc) - return false; - else - return true;*/ -} - -long nvGetSystemTime() -{ - static struct timeval start_time, end_time; - static int isinit = 0; - jlong curr_time = 0; - -/* if(eglGetSystemTimeNVProc) - { - EGLuint64NV egltime; - EGLuint64NV egltimequot; - EGLuint64NV egltimerem; - - egltime = eglGetSystemTimeNVProc(); - - egltimequot = egltime / eglSystemTimeFrequency; - egltimerem = egltime - (eglSystemTimeFrequency * egltimequot); - egltimequot *= 1000; - egltimerem *= 1000; - egltimerem /= eglSystemTimeFrequency; - egltimequot += egltimerem; - return (jlong) egltimequot; - } -*/ - if (!isinit) - { - gettimeofday(&start_time, 0); - isinit = 1; - } - gettimeofday(&end_time, 0); - curr_time = (end_time.tv_sec - start_time.tv_sec) * 1000; - curr_time += (end_time.tv_usec - start_time.tv_usec) / 1000; - - return curr_time; -} - -void NVTimeInit() -{ - JNIEnv* env = NVThreadGetCurrentJNIEnv(); - - JNINativeMethod methods_time[] = - { - { - "nvAcquireTimeExtension", - "()V", - (void *) nvAcquireTimeExtension - }, - { - "nvGetSystemTime", - "()J", - (void *) nvGetSystemTime - }, - }; - jclass k_time; - k_time = (env)->FindClass ("com/nvidia/devtech/NvActivity"); - (env)->RegisterNatives(k_time, methods_time, 2); -} +//---------------------------------------------------------------------------------- +// File: libs\jni\nv_time\nv_time.cpp +// Samples Version: NVIDIA Android Lifecycle samples 1_0beta +// Email: tegradev@nvidia.com +// Web: http://developer.nvidia.com/category/zone/mobile-development +// +// Copyright 2009-2011 NVIDIA® Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//---------------------------------------------------------------------------------- + +#include "nv_time.hpp" +#include "../nv_thread/nv_thread.hpp" +/*#include +#include +#include */ +#include +#include +#include +#include +#include + +/*#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 +typedef khronos_uint64_t EGLuint64NV; +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); +#endif +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void); +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void); +#endif +*/ + +void nvAcquireTimeExtensionJNI(JNIEnv*, jobject) +{ + nvAcquireTimeExtension(); +} + +jlong nvGetSystemTimeJNI(JNIEnv*, jobject) +{ + return (jlong)nvGetSystemTime(); +} + +/*static PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC eglGetSystemTimeFrequencyNVProc = NULL; +static PFNEGLGETSYSTEMTIMENVPROC eglGetSystemTimeNVProc = NULL; +static EGLuint64NV eglSystemTimeFrequency = 0; +static bool timeExtensionQueried = false;*/ + +void nvAcquireTimeExtension() +{ +/* if (timeExtensionQueried) + return; + timeExtensionQueried = true; + + eglGetSystemTimeFrequencyNVProc = (PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) eglGetProcAddress("eglGetSystemTimeFrequencyNV"); + eglGetSystemTimeNVProc = (PFNEGLGETSYSTEMTIMENVPROC) eglGetProcAddress("eglGetSystemTimeNV"); + + // now, we'll proceed through a series of sanity checking. + // if they all succeed, we'll return. + // if any fail, we fall out of conditional tests to end of function, null pointers, and return. + if (eglGetSystemTimeFrequencyNVProc && + eglGetSystemTimeNVProc) + { + eglSystemTimeFrequency = eglGetSystemTimeFrequencyNVProc(); + if (eglSystemTimeFrequency>0) // assume okay. quick-check it works. + { + EGLuint64NV time1, time2; + time1 = eglGetSystemTimeNVProc(); + usleep(2000); // 2ms should be MORE than sufficient, right? + time2 = eglGetSystemTimeNVProc(); + if (time1 != time2) // quick sanity only... + { + // we've sanity checked: + // - fn pointers non-null + // - freq non-zero + // - two calls to time sep'd by sleep non-equal + // safe to return now. + return; + } + } + } + + // fall back if we've not returned already. + eglGetSystemTimeFrequencyNVProc = (PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) NULL; + eglGetSystemTimeNVProc = (PFNEGLGETSYSTEMTIMENVPROC) NULL;*/ +} + +bool nvValidTimeExtension() +{ +/* if (NULL == eglGetSystemTimeFrequencyNVProc || + NULL == eglGetSystemTimeNVProc) + return false; + else + return true;*/ +} + +long nvGetSystemTime() +{ + static struct timeval start_time, end_time; + static int isinit = 0; + jlong curr_time = 0; + +/* if(eglGetSystemTimeNVProc) + { + EGLuint64NV egltime; + EGLuint64NV egltimequot; + EGLuint64NV egltimerem; + + egltime = eglGetSystemTimeNVProc(); + + egltimequot = egltime / eglSystemTimeFrequency; + egltimerem = egltime - (eglSystemTimeFrequency * egltimequot); + egltimequot *= 1000; + egltimerem *= 1000; + egltimerem /= eglSystemTimeFrequency; + egltimequot += egltimerem; + return (jlong) egltimequot; + } +*/ + if (!isinit) + { + gettimeofday(&start_time, 0); + isinit = 1; + } + gettimeofday(&end_time, 0); + curr_time = (end_time.tv_sec - start_time.tv_sec) * 1000; + curr_time += (end_time.tv_usec - start_time.tv_usec) / 1000; + + return curr_time; +} + +void NVTimeInit() +{ + JNIEnv* env = NVThreadGetCurrentJNIEnv(); + + JNINativeMethod methods_time[] = + { + { + "nvAcquireTimeExtension", + "()V", + (void *) nvAcquireTimeExtension + }, + { + "nvGetSystemTime", + "()J", + (void *) nvGetSystemTime + }, + }; + jclass k_time; + k_time = (env)->FindClass ("com/nvidia/devtech/NvActivity"); + (env)->RegisterNatives(k_time, methods_time, 2); +} diff --git a/data/styles/symbols/arrow.svg b/data/styles/symbols/arrow.svg index bba12e29f9..8f28bb91a4 100644 --- a/data/styles/symbols/arrow.svg +++ b/data/styles/symbols/arrow.svg @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/data/styles/symbols/placemark-blue.svg b/data/styles/symbols/placemark-blue.svg index 7b6c8f54e3..d4483f1fea 100644 --- a/data/styles/symbols/placemark-blue.svg +++ b/data/styles/symbols/placemark-blue.svg @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/styles/symbols/placemark-brown.svg b/data/styles/symbols/placemark-brown.svg index 348f71520b..fcb406172d 100644 --- a/data/styles/symbols/placemark-brown.svg +++ b/data/styles/symbols/placemark-brown.svg @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/styles/symbols/placemark-green.svg b/data/styles/symbols/placemark-green.svg index 8e2e781954..a951290c8a 100644 --- a/data/styles/symbols/placemark-green.svg +++ b/data/styles/symbols/placemark-green.svg @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/styles/symbols/placemark-orange.svg b/data/styles/symbols/placemark-orange.svg index b6d904b889..443c56664a 100644 --- a/data/styles/symbols/placemark-orange.svg +++ b/data/styles/symbols/placemark-orange.svg @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/styles/symbols/placemark-pink.svg b/data/styles/symbols/placemark-pink.svg index 5ef37cc4d6..70d81b5996 100644 --- a/data/styles/symbols/placemark-pink.svg +++ b/data/styles/symbols/placemark-pink.svg @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/styles/symbols/placemark-purple.svg b/data/styles/symbols/placemark-purple.svg index bee876f488..3c2624fcfb 100644 --- a/data/styles/symbols/placemark-purple.svg +++ b/data/styles/symbols/placemark-purple.svg @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +