summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--3RDPARTY38
-rw-r--r--Changelog55
-rw-r--r--INSTALL69
-rw-r--r--LICENSE.FDL450
-rw-r--r--README87
-rw-r--r--dist/config/config.xml4
-rw-r--r--dist/packages/org.qtproject.ifw.binaries/meta/package.xml4
-rw-r--r--dist/packages/org.qtproject.ifw/meta/3RDPARTY26
-rw-r--r--dist/packages/org.qtproject.ifw/meta/package.xml5
-rw-r--r--doc/config/installerfw-project.qdocconf15
-rw-r--r--doc/examples/config.xml1
-rw-r--r--doc/installerfw-getting-started.qdoc2
-rw-r--r--doc/installerfw.qdoc96
-rw-r--r--doc/noninteractive.qdoc2
-rw-r--r--doc/operations.qdoc4
-rw-r--r--doc/scripting.qdoc37
-rw-r--r--doc/tutorial.qdoc4
-rw-r--r--examples/changeuserinterface/README7
-rw-r--r--examples/changeuserinterface/config/config.xml9
-rw-r--r--examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/installscript.qs52
-rw-r--r--examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/license.txt1
-rw-r--r--examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/package.xml11
-rw-r--r--examples/examples.pro22
-rw-r--r--examples/modifyextract/config/config.xml2
-rw-r--r--examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js41
-rw-r--r--examples/quit_installer/config/config.xml2
-rw-r--r--examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js41
-rw-r--r--examples/registerfileextension/config/config.xml2
-rw-r--r--examples/registerfileextension/packages/org.qtproject.ifw.example.registerfileextension/meta/installscript.qs41
-rw-r--r--examples/startmenu/config/config.xml2
-rw-r--r--examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs45
-rw-r--r--examples/testapp/components.xml13
-rw-r--r--examples/testapp/componentselectiondialog.cpp203
-rw-r--r--examples/testapp/componentselectiondialog.ui184
-rw-r--r--examples/testapp/config.xml16
-rw-r--r--examples/testapp/config/config.xml20
-rw-r--r--examples/testapp/config/license.txt84
-rw-r--r--examples/testapp/config/logo.pngbin1592 -> 0 bytes
-rw-r--r--examples/testapp/config/qticon.icnsbin162568 -> 0 bytes
-rw-r--r--examples/testapp/config/qticon.icobin355574 -> 0 bytes
-rw-r--r--examples/testapp/config/qticon.pngbin2109 -> 0 bytes
-rw-r--r--examples/testapp/config/watermark.pngbin14462 -> 0 bytes
-rw-r--r--examples/testapp/logo.pngbin5437 -> 0 bytes
-rw-r--r--examples/testapp/mainwindow.cpp182
-rw-r--r--examples/testapp/mainwindow.h68
-rw-r--r--examples/testapp/packages/com.nokia.testapp.subcomponent.alwaysvisible/meta/package.xml8
-rw-r--r--examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/installscript.qs4
-rw-r--r--examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/package.xml9
-rw-r--r--examples/testapp/packages/com.nokia.testapp.subcomponent/meta/package.xml7
-rw-r--r--examples/testapp/packages/com.nokia.testapp/meta/installscript.js18
-rw-r--r--examples/testapp/packages/com.nokia.testapp/meta/package.xml9
-rw-r--r--examples/testapp/testapp.pro49
-rw-r--r--examples/testapp/testapp.qrc8
-rw-r--r--examples/testapp/updateagent.cpp119
-rw-r--r--examples/testapp/updatesettingsdialog.ui39
-rw-r--r--examples/testapp/updatesettingswidget.cpp162
-rw-r--r--examples/testapp/updatesettingswidget.ui286
-rw-r--r--examples/tutorial/config/config.xml2
-rw-r--r--examples/tutorial/packages/com.vendor.product/meta/installscript.qs41
-rw-r--r--installerfw.pri16
-rw-r--r--installerfw.pro2
-rw-r--r--no_app_bundle.pri28
-rw-r--r--src/libs/7zip/7zip.pri12
-rw-r--r--src/libs/7zip/7zip.pro5
-rw-r--r--src/libs/7zip/installer_framework_changes.txt54
-rw-r--r--src/libs/7zip/unix/7zC.txt (renamed from src/libs/7zip/unix/DOCS/7zC.txt)0
-rw-r--r--src/libs/7zip/unix/7zFormat.txt (renamed from src/libs/7zip/win/DOC/7zFormat.txt)84
-rw-r--r--src/libs/7zip/unix/C/7zCrcT8.c43
-rw-r--r--src/libs/7zip/unix/C/Aes.c284
-rw-r--r--src/libs/7zip/unix/C/Aes.h38
-rw-r--r--src/libs/7zip/unix/C/BwtSort.c516
-rw-r--r--src/libs/7zip/unix/C/BwtSort.h30
-rw-r--r--src/libs/7zip/unix/C/CpuArch.c8
-rw-r--r--src/libs/7zip/unix/C/HuffEnc.c146
-rw-r--r--src/libs/7zip/unix/C/HuffEnc.h27
-rw-r--r--src/libs/7zip/unix/C/Lzma86Dec.c (renamed from src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.c)0
-rw-r--r--src/libs/7zip/unix/C/Lzma86Enc.c (renamed from src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.c)0
-rw-r--r--src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.h51
-rw-r--r--src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.h78
-rw-r--r--src/libs/7zip/unix/C/Ppmd.h85
-rw-r--r--src/libs/7zip/unix/C/Ppmd7.c708
-rw-r--r--src/libs/7zip/unix/C/Ppmd7.h140
-rw-r--r--src/libs/7zip/unix/C/Ppmd7Dec.c187
-rw-r--r--src/libs/7zip/unix/C/Ppmd7Enc.c185
-rw-r--r--src/libs/7zip/unix/C/Ppmd8.c1120
-rw-r--r--src/libs/7zip/unix/C/Ppmd8.h133
-rw-r--r--src/libs/7zip/unix/C/Ppmd8Dec.c155
-rw-r--r--src/libs/7zip/unix/C/Ppmd8Enc.c161
-rw-r--r--src/libs/7zip/unix/C/Sort.c93
-rw-r--r--src/libs/7zip/unix/C/Sort.h20
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/ApmHandler.cpp356
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/ArjHandler.cpp798
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Bz2Handler.cpp423
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabBlockInStream.cpp189
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabBlockInStream.h44
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabHandler.cpp929
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabHandler.h28
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabHeader.cpp15
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabHeader.h44
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabIn.cpp272
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabIn.h161
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabItem.h63
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Cab/CabRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmHandler.cpp721
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmHandler.h29
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmHeader.cpp24
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmHeader.h28
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmIn.cpp937
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmIn.h244
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Chm/ChmRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Com/ComHandler.cpp239
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Com/ComHandler.h28
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Com/ComIn.cpp389
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Com/ComIn.h119
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Com/ComRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2ST.cpp239
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Common/CoderMixer2ST.h88
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Common/FindSignature.cpp62
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Common/FindSignature.h12
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp18
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithSha1.h36
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/CpioHandler.cpp624
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/CramfsHandler.cpp644
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/DebHandler.cpp413
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/DeflateProps.cpp118
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/DeflateProps.h35
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/DmgHandler.cpp918
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/ElfHandler.cpp534
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/FatHandler.cpp996
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/FlvHandler.cpp544
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/GzHandler.cpp698
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Hfs/HfsHandler.cpp243
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Hfs/HfsHandler.h26
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Hfs/HfsIn.cpp480
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Hfs/HfsIn.h154
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Hfs/HfsRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoHandler.cpp326
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoHandler.h30
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoHeader.cpp21
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoHeader.h61
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoIn.cpp453
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoIn.h315
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoItem.h141
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Iso/IsoRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/LzhHandler.cpp775
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/MachoHandler.cpp500
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/MbrHandler.cpp507
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/MslzHandler.cpp257
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/MubHandler.cpp266
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisDecode.cpp130
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisDecode.h47
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisHandler.cpp510
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisHandler.h43
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisIn.cpp1461
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisIn.h181
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Nsis/NsisRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/NtfsHandler.cpp1764
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/PeHandler.cpp1752
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/PpmdHandler.cpp456
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarHandler.cpp869
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarHandler.h66
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarHeader.cpp21
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarHeader.h205
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarIn.cpp478
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarIn.h123
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarItem.cpp55
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarItem.h79
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarVolumeInStream.cpp78
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Rar/RarVolumeInStream.h49
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/RpmHandler.cpp292
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/SquashfsHandler.cpp2155
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/SwfHandler.cpp706
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarHandler.cpp386
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarHandler.h61
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarHandlerOut.cpp122
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarHeader.cpp25
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarHeader.h108
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarIn.cpp207
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarIn.h17
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarItem.h72
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarOut.cpp187
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarOut.h28
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarRegister.cpp18
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarUpdate.cpp139
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Tar/TarUpdate.h34
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Udf/UdfHandler.cpp451
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Udf/UdfHandler.h37
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Udf/UdfIn.cpp876
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Udf/UdfIn.h375
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Udf/UdfRegister.cpp13
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/VhdHandler.cpp734
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Wim/WimHandler.cpp660
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Wim/WimHandler.h77
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Wim/WimHandlerOut.cpp639
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Wim/WimIn.cpp855
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Wim/WimIn.h297
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Wim/WimRegister.cpp18
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/XarHandler.cpp588
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/ZHandler.cpp161
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipAddCommon.cpp379
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipAddCommon.h56
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipCompressionMode.h42
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipHandler.cpp822
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipHandler.h101
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp537
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipHeader.cpp36
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipHeader.h284
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipIn.cpp893
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipIn.h125
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipItem.cpp181
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipItem.h281
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipItemEx.h34
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipOut.cpp289
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipOut.h56
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipRegister.cpp18
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipUpdate.cpp1076
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Archive/Zip/ZipUpdate.h58
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/MemBlocks.cpp183
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/MemBlocks.h71
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/OutMemStream.cpp142
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/OutMemStream.h96
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/ProgressMt.cpp53
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/ProgressMt.h46
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Common/StreamObjects.h2
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ArjDecoder1.cpp309
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ArjDecoder1.h98
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ArjDecoder2.cpp90
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ArjDecoder2.h59
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Const.h54
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Crc.cpp26
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Crc.h31
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Decoder.cpp943
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Decoder.h205
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Encoder.cpp895
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Encoder.h245
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BZip2Register.cpp20
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BitlDecoder.cpp24
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BitlDecoder.h141
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BitlEncoder.h57
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BitmDecoder.h66
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/BitmEncoder.h50
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Deflate64Register.cpp20
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateConst.h134
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateDecoder.cpp353
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateDecoder.h157
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateEncoder.cpp986
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateEncoder.h211
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateNsisRegister.cpp14
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DeflateRegister.cpp21
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DllExports.cpp39
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/DllExports2.cpp28
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/HuffmanDecoder.h89
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ImplodeDecoder.cpp219
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ImplodeDecoder.h57
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp89
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ImplodeHuffmanDecoder.h34
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp531
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp1018
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LZMA_Alone/LzmaBench.h48
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.cpp311
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.h20
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LzOutWindow.cpp14
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LzOutWindow.h66
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LzhDecoder.cpp220
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LzhDecoder.h106
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Lzx.h61
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Lzx86Converter.cpp90
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Lzx86Converter.h46
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LzxDecoder.cpp387
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/LzxDecoder.h159
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Mtf8.h193
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PPMD_Alone/PpmdAlone.cpp348
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdContext.h490
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdDecode.h156
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdDecoder.cpp167
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdDecoder.h78
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdEncode.h142
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdEncoder.cpp119
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdEncoder.h48
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdRegister.cpp21
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdSubAlloc.h293
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdType.h14
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdZip.cpp223
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/PpmdZip.h72
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/QuantumDecoder.cpp175
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/QuantumDecoder.h264
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar1Decoder.cpp480
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar1Decoder.h88
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar2Decoder.cpp391
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar2Decoder.h174
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar3Decoder.cpp897
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar3Decoder.h267
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar3Vm.cpp1091
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/Rar3Vm.h179
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/RarCodecsRegister.cpp26
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ShrinkDecoder.cpp145
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ShrinkDecoder.h38
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ZDecoder.cpp159
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ZDecoder.h42
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ZlibDecoder.cpp89
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ZlibDecoder.h48
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ZlibEncoder.cpp61
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Compress/ZlibEncoder.h48
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/7zAes.cpp244
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/7zAes.h117
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/7zAesRegister.cpp18
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/HmacSha1.cpp109
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/HmacSha1.h39
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/MyAes.cpp48
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/MyAes.h38
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp83
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/Pbkdf2HmacSha1.h21
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/RandGen.cpp107
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/RandGen.h21
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/Rar20Crypto.cpp133
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/Rar20Crypto.h50
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/RarAes.cpp134
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/RarAes.h47
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/Sha1.cpp229
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/Sha1.h68
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/WzAes.cpp221
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/WzAes.h125
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/ZipCrypto.cpp88
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/ZipCrypto.h56
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/ZipStrong.cpp164
-rw-r--r--src/libs/7zip/unix/CPP/7zip/Crypto/ZipStrong.h47
-rw-r--r--src/libs/7zip/unix/CPP/7zip/UI/Common/CompressCall.cpp470
-rw-r--r--src/libs/7zip/unix/CPP/7zip/UI/Common/CompressCall.h24
-rw-r--r--src/libs/7zip/unix/CPP/7zip/UI/Common/HandlerLoader.h38
-rw-r--r--src/libs/7zip/unix/CPP/7zip/UI/Common/UpdatePair.cpp7
-rw-r--r--src/libs/7zip/unix/CPP/7zip/UI/Common/ZipRegistry.cpp293
-rw-r--r--src/libs/7zip/unix/CPP/Common/DynamicBuffer.h2
-rw-r--r--src/libs/7zip/unix/CPP/Common/Lang.cpp130
-rw-r--r--src/libs/7zip/unix/CPP/Common/Lang.h28
-rw-r--r--src/libs/7zip/unix/CPP/Common/MyMap.cpp140
-rw-r--r--src/libs/7zip/unix/CPP/Common/MyMap.h28
-rw-r--r--src/libs/7zip/unix/CPP/Common/MyXml.cpp209
-rw-r--r--src/libs/7zip/unix/CPP/Common/MyXml.h40
-rw-r--r--src/libs/7zip/unix/CPP/Common/TextConfig.cpp138
-rw-r--r--src/libs/7zip/unix/CPP/Common/TextConfig.h22
-rw-r--r--src/libs/7zip/unix/CPP/Windows/COM.cpp37
-rw-r--r--src/libs/7zip/unix/CPP/Windows/COM.h69
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Clipboard.cpp160
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Clipboard.h28
-rw-r--r--src/libs/7zip/unix/CPP/Windows/CommonDialog.h19
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/ComboBox.h82
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Controls.cpp515
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Dialog.cpp560
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Dialog.h179
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/DialogImpl.h73
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Edit.h24
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/ListView.h164
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/ProgressBar.h34
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Static.h23
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/StatusBar.h56
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Window2.cpp211
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Control/Window2.h111
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Menu.h4
-rw-r--r--src/libs/7zip/unix/CPP/Windows/PropVariantConversions.cpp7
-rw-r--r--src/libs/7zip/unix/CPP/Windows/PropVariantUtils.cpp78
-rw-r--r--src/libs/7zip/unix/CPP/Windows/PropVariantUtils.h28
-rw-r--r--src/libs/7zip/unix/CPP/Windows/ResourceString.h22
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Shell.h21
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Time.cpp20
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Window.cpp101
-rw-r--r--src/libs/7zip/unix/CPP/Windows/Window.h43
-rw-r--r--src/libs/7zip/unix/CPP/include_windows/windows.h4
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/myAddExeFlag.cpp20
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/myDateAndTime.cpp146
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/myGetTickCount.cpp8
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/mySplitCommandLine.cpp82
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/test_emul.cpp745
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/wine_GetXXXDefaultLangID.cpp741
-rw-r--r--src/libs/7zip/unix/CPP/myWindows/wine_date_and_time.cpp434
-rw-r--r--src/libs/7zip/unix/ChangeLog914
-rw-r--r--src/libs/7zip/unix/DOCS/License.txt52
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/add.htm87
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/bench.htm79
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/delete.htm59
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/extract.htm91
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/extract_full.htm68
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/index.htm33
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/list.htm77
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/style.css232
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/test.htm46
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/commands/update.htm66
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/exit_codes.htm27
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/index.htm29
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/style.css232
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/ar_exclude.htm56
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/ar_include.htm83
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/ar_no.htm52
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/charset.htm49
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/exclude.htm60
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/include.htm87
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/index.htm64
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/large_pages.htm50
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/list_tech.htm36
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/method.htm625
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/output_dir.htm53
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/overwrite.htm56
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/password.htm54
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/recurse.htm83
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/sfx.htm156
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/ssc.htm50
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/stdin.htm55
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/stdout.htm50
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/stop_switch.htm31
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/style.css232
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/type.htm83
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/update.htm176
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/volume.htm49
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/working_dir.htm55
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/switches/yes.htm48
-rw-r--r--src/libs/7zip/unix/DOCS/MANUAL/syntax.htm120
-rw-r--r--src/libs/7zip/unix/DOCS/copying.txt504
-rw-r--r--src/libs/7zip/unix/DOCS/history.txt456
-rw-r--r--src/libs/7zip/unix/DOCS/readme.txt181
-rw-r--r--src/libs/7zip/unix/DOCS/unRarLicense.txt41
-rw-r--r--src/libs/7zip/unix/Methods.txt (renamed from src/libs/7zip/unix/DOCS/Methods.txt)0
-rw-r--r--src/libs/7zip/unix/README358
-rw-r--r--src/libs/7zip/unix/TODO39
-rw-r--r--src/libs/7zip/unix/history.txt271
-rw-r--r--src/libs/7zip/unix/installer_framework_changes.txt511
-rw-r--r--src/libs/7zip/unix/lzma.txt (renamed from src/libs/7zip/unix/DOCS/lzma.txt)0
-rw-r--r--src/libs/7zip/unix/unix.pri350
-rw-r--r--src/libs/7zip/win/7zC.txt (renamed from src/libs/7zip/win/DOC/7zC.txt)0
-rw-r--r--src/libs/7zip/win/7zFormat.txt (renamed from src/libs/7zip/unix/DOCS/7zFormat.txt)84
-rw-r--r--src/libs/7zip/win/C/Aes.c282
-rw-r--r--src/libs/7zip/win/C/Aes.h38
-rw-r--r--src/libs/7zip/win/C/AesOpt.c182
-rw-r--r--src/libs/7zip/win/C/BwtSort.c516
-rw-r--r--src/libs/7zip/win/C/BwtSort.h30
-rw-r--r--src/libs/7zip/win/C/HuffEnc.c146
-rw-r--r--src/libs/7zip/win/C/HuffEnc.h27
-rw-r--r--src/libs/7zip/win/C/Ppmd.h81
-rw-r--r--src/libs/7zip/win/C/Ppmd7.c708
-rw-r--r--src/libs/7zip/win/C/Ppmd7.h140
-rw-r--r--src/libs/7zip/win/C/Ppmd7Dec.c187
-rw-r--r--src/libs/7zip/win/C/Ppmd7Enc.c185
-rw-r--r--src/libs/7zip/win/C/Ppmd8.c1120
-rw-r--r--src/libs/7zip/win/C/Ppmd8.h133
-rw-r--r--src/libs/7zip/win/C/Ppmd8Dec.c155
-rw-r--r--src/libs/7zip/win/C/Ppmd8Enc.c161
-rw-r--r--src/libs/7zip/win/C/Sort.c93
-rw-r--r--src/libs/7zip/win/C/Sort.h20
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/ApmHandler.cpp356
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Archive.def6
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Archive2.def9
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/ArjHandler.cpp798
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Bz2Handler.cpp423
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.cpp189
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabBlockInStream.h44
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.cpp929
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHandler.h28
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHeader.cpp15
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabHeader.h44
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabIn.cpp272
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabIn.h161
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabItem.h63
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/CabRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Cab/StdAfx.h8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmHandler.cpp721
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmHandler.h29
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmHeader.cpp24
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmHeader.h28
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmIn.cpp937
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmIn.h244
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/ChmRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Chm/StdAfx.h8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Com/ComHandler.cpp239
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Com/ComHandler.h28
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Com/ComIn.cpp389
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Com/ComIn.h119
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Com/ComRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/CoderMixer.cpp19
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/CoderMixer.h32
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/CoderMixer2ST.cpp239
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/CoderMixer2ST.h88
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/CoderMixerMT.cpp99
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/CoderMixerMT.h69
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/FindSignature.cpp62
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/FindSignature.h12
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp18
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Common/OutStreamWithSha1.h36
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/CpioHandler.cpp624
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/CramfsHandler.cpp644
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/DebHandler.cpp413
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/DeflateProps.cpp118
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/DeflateProps.h35
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/DllExports.cpp47
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/DmgHandler.cpp918
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/ElfHandler.cpp534
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/FatHandler.cpp996
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/FlvHandler.cpp544
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/GzHandler.cpp698
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Hfs/HfsHandler.cpp243
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Hfs/HfsHandler.h26
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Hfs/HfsIn.cpp480
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Hfs/HfsIn.h154
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Hfs/HfsRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoHandler.cpp326
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoHandler.h30
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoHeader.cpp21
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoHeader.h61
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoIn.cpp453
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoIn.h315
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoItem.h141
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/IsoRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Iso/StdAfx.h9
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/LzhHandler.cpp775
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/MachoHandler.cpp500
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/MbrHandler.cpp507
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/MslzHandler.cpp257
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/MubHandler.cpp266
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisDecode.cpp130
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisDecode.h47
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisHandler.cpp510
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisHandler.h43
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisIn.cpp1461
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisIn.h181
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/NsisRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Nsis/StdAfx.h9
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/NtfsHandler.cpp1764
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/PeHandler.cpp1752
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/PpmdHandler.cpp456
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarHandler.cpp869
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarHandler.h66
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarHeader.cpp21
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarHeader.h205
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarIn.cpp478
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarIn.h123
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarItem.cpp55
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarItem.h79
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarVolumeInStream.cpp78
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/RarVolumeInStream.h49
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/StdAfx.cpp3
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Rar/StdAfx.h8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/RpmHandler.cpp292
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/SquashfsHandler.cpp2155
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/SwfHandler.cpp706
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/StdAfx.h9
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarHandler.cpp386
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarHandler.h61
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarHandlerOut.cpp122
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarHeader.cpp25
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarHeader.h108
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.cpp207
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarIn.h17
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarItem.h72
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarOut.cpp187
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarOut.h28
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarRegister.cpp18
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarUpdate.cpp139
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Tar/TarUpdate.h34
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Udf/StdAfx.h9
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Udf/UdfHandler.cpp451
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Udf/UdfHandler.h37
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Udf/UdfIn.cpp876
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Udf/UdfIn.h375
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Udf/UdfRegister.cpp13
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/VhdHandler.cpp734
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/StdAfx.h8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/WimHandler.cpp660
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/WimHandler.h77
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/WimHandlerOut.cpp639
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/WimIn.cpp855
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/WimIn.h297
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Wim/WimRegister.cpp18
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/XarHandler.cpp588
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/ZHandler.cpp161
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/StdAfx.h8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipAddCommon.cpp379
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipAddCommon.h56
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipCompressionMode.h42
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.cpp822
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandler.h101
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp531
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHeader.cpp36
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipHeader.h284
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.cpp893
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipIn.h125
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipItem.cpp172
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipItem.h281
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipItemEx.h34
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipOut.cpp289
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipOut.h56
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipRegister.cpp18
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipUpdate.cpp1068
-rw-r--r--src/libs/7zip/win/CPP/7zip/Archive/Zip/ZipUpdate.h58
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/InMemStream.cpp222
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/InMemStream.h284
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/MemBlocks.cpp183
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/MemBlocks.h71
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/OutMemStream.cpp142
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/OutMemStream.h96
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/ProgressMt.cpp53
-rw-r--r--src/libs/7zip/win/CPP/7zip/Common/ProgressMt.h46
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ArjDecoder1.cpp309
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ArjDecoder1.h98
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ArjDecoder2.cpp90
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ArjDecoder2.h59
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Const.h54
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Crc.cpp26
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Crc.h31
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.cpp943
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Decoder.h205
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.cpp895
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Encoder.h245
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BZip2Register.cpp20
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BitlDecoder.cpp24
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BitlDecoder.h141
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BitlEncoder.h57
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BitmDecoder.h66
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/BitmEncoder.h50
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Deflate64Register.cpp20
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateConst.h134
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.cpp353
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateDecoder.h157
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.cpp986
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateEncoder.h211
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DeflateRegister.cpp21
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DllExports.cpp45
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/DllExports2.cpp28
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/HuffmanDecoder.h89
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ImplodeDecoder.cpp219
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ImplodeDecoder.h57
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp89
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ImplodeHuffmanDecoder.h34
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/LzOutWindow.cpp14
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/LzOutWindow.h66
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/LzhDecoder.cpp220
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/LzhDecoder.h106
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Lzx.h61
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Lzx86Converter.cpp90
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Lzx86Converter.h46
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/LzxDecoder.cpp387
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/LzxDecoder.h159
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Mtf8.h193
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdDecoder.cpp167
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdDecoder.h78
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdEncoder.cpp119
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdEncoder.h48
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdRegister.cpp21
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdZip.cpp223
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/PpmdZip.h72
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/QuantumDecoder.cpp175
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/QuantumDecoder.h264
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar1Decoder.cpp480
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar1Decoder.h88
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar2Decoder.cpp391
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar2Decoder.h174
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar3Decoder.cpp897
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar3Decoder.h267
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar3Vm.cpp1091
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/Rar3Vm.h179
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/RarCodecsRegister.cpp26
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ShrinkDecoder.cpp145
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ShrinkDecoder.h38
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ZDecoder.cpp159
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ZDecoder.h42
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ZlibDecoder.cpp89
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ZlibDecoder.h48
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ZlibEncoder.cpp61
-rw-r--r--src/libs/7zip/win/CPP/7zip/Compress/ZlibEncoder.h48
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/7zAes.cpp244
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/7zAes.h117
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/7zAesRegister.cpp18
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/HmacSha1.cpp109
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/HmacSha1.h39
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/MyAes.cpp48
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/MyAes.h38
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp83
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/Pbkdf2HmacSha1.h21
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/RandGen.cpp107
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/RandGen.h21
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/Rar20Crypto.cpp133
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/Rar20Crypto.h50
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/RarAes.cpp134
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/RarAes.h47
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/Sha1.cpp229
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/Sha1.h68
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/StdAfx.h8
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/WzAes.cpp221
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/WzAes.h125
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/ZipCrypto.cpp88
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/ZipCrypto.h56
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/ZipStrong.cpp164
-rw-r--r--src/libs/7zip/win/CPP/7zip/Crypto/ZipStrong.h47
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/CompressCall.cpp246
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/CompressCall.h24
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/CompressCall2.cpp178
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/Update.h4
-rw-r--r--src/libs/7zip/win/CPP/7zip/UI/Common/ZipRegistry.cpp293
-rw-r--r--src/libs/7zip/win/CPP/Common/Lang.cpp130
-rw-r--r--src/libs/7zip/win/CPP/Common/Lang.h28
-rw-r--r--src/libs/7zip/win/CPP/Common/MyMap.cpp140
-rw-r--r--src/libs/7zip/win/CPP/Common/MyMap.h28
-rw-r--r--src/libs/7zip/win/CPP/Common/MyWindows.cpp109
-rw-r--r--src/libs/7zip/win/CPP/Common/MyXml.cpp209
-rw-r--r--src/libs/7zip/win/CPP/Common/MyXml.h40
-rw-r--r--src/libs/7zip/win/CPP/Common/Random.cpp26
-rw-r--r--src/libs/7zip/win/CPP/Common/Random.h16
-rw-r--r--src/libs/7zip/win/CPP/Common/TextConfig.cpp138
-rw-r--r--src/libs/7zip/win/CPP/Common/TextConfig.h22
-rw-r--r--src/libs/7zip/win/CPP/Windows/COM.cpp37
-rw-r--r--src/libs/7zip/win/CPP/Windows/COM.h69
-rw-r--r--src/libs/7zip/win/CPP/Windows/Clipboard.cpp135
-rw-r--r--src/libs/7zip/win/CPP/Windows/Clipboard.h28
-rw-r--r--src/libs/7zip/win/CPP/Windows/CommonDialog.cpp184
-rw-r--r--src/libs/7zip/win/CPP/Windows/CommonDialog.h19
-rw-r--r--src/libs/7zip/win/CPP/Windows/Console.cpp10
-rw-r--r--src/libs/7zip/win/CPP/Windows/Console.h52
-rw-r--r--src/libs/7zip/win/CPP/Windows/FileSystem.cpp126
-rw-r--r--src/libs/7zip/win/CPP/Windows/FileSystem.h51
-rw-r--r--src/libs/7zip/win/CPP/Windows/Memory.cpp36
-rw-r--r--src/libs/7zip/win/CPP/Windows/Memory.h53
-rw-r--r--src/libs/7zip/win/CPP/Windows/Menu.cpp191
-rw-r--r--src/libs/7zip/win/CPP/Windows/Menu.h153
-rw-r--r--src/libs/7zip/win/CPP/Windows/NationalTime.cpp37
-rw-r--r--src/libs/7zip/win/CPP/Windows/NationalTime.h20
-rw-r--r--src/libs/7zip/win/CPP/Windows/Net.cpp380
-rw-r--r--src/libs/7zip/win/CPP/Windows/Net.h87
-rw-r--r--src/libs/7zip/win/CPP/Windows/Process.cpp81
-rw-r--r--src/libs/7zip/win/CPP/Windows/Process.h100
-rw-r--r--src/libs/7zip/win/CPP/Windows/ProcessMessages.cpp22
-rw-r--r--src/libs/7zip/win/CPP/Windows/ProcessMessages.h14
-rw-r--r--src/libs/7zip/win/CPP/Windows/PropVariantUtils.cpp78
-rw-r--r--src/libs/7zip/win/CPP/Windows/PropVariantUtils.h28
-rw-r--r--src/libs/7zip/win/CPP/Windows/ResourceString.cpp64
-rw-r--r--src/libs/7zip/win/CPP/Windows/ResourceString.h22
-rw-r--r--src/libs/7zip/win/CPP/Windows/Security.cpp179
-rw-r--r--src/libs/7zip/win/CPP/Windows/Security.h167
-rw-r--r--src/libs/7zip/win/CPP/Windows/Shell.cpp335
-rw-r--r--src/libs/7zip/win/CPP/Windows/Shell.h93
-rw-r--r--src/libs/7zip/win/CPP/Windows/Window.cpp169
-rw-r--r--src/libs/7zip/win/CPP/Windows/Window.h261
-rw-r--r--src/libs/7zip/win/DOC/License.txt52
-rw-r--r--src/libs/7zip/win/DOC/copying.txt504
-rw-r--r--src/libs/7zip/win/DOC/history.txt456
-rw-r--r--src/libs/7zip/win/DOC/readme.txt181
-rw-r--r--src/libs/7zip/win/DOC/unRarLicense.txt41
-rw-r--r--src/libs/7zip/win/Methods.txt (renamed from src/libs/7zip/win/DOC/Methods.txt)0
-rw-r--r--src/libs/7zip/win/history.txt271
-rw-r--r--src/libs/7zip/win/installer_framework_changes.txt519
-rw-r--r--src/libs/7zip/win/lzma.txt (renamed from src/libs/7zip/win/DOC/lzma.txt)0
-rw-r--r--src/libs/7zip/win/win.pri164
-rw-r--r--src/libs/installer/addqtcreatorarrayvalueoperation.h6
-rw-r--r--src/libs/installer/adminauthorization_win.cpp40
-rw-r--r--src/libs/installer/adminauthorization_x11.cpp2
-rw-r--r--src/libs/installer/binaryformat.cpp107
-rw-r--r--src/libs/installer/binaryformat.h3
-rw-r--r--src/libs/installer/binaryformatengine.cpp6
-rw-r--r--src/libs/installer/binaryformatenginehandler.cpp11
-rw-r--r--src/libs/installer/binaryformatenginehandler.h1
-rw-r--r--src/libs/installer/component.cpp515
-rw-r--r--src/libs/installer/component.h16
-rw-r--r--src/libs/installer/component_p.cpp176
-rw-r--r--src/libs/installer/component_p.h27
-rw-r--r--src/libs/installer/componentmodel.cpp459
-rw-r--r--src/libs/installer/componentmodel.h51
-rw-r--r--src/libs/installer/constants.h1
-rw-r--r--src/libs/installer/consumeoutputoperation.cpp158
-rw-r--r--src/libs/installer/consumeoutputoperation.h65
-rw-r--r--src/libs/installer/createdesktopentryoperation.cpp2
-rw-r--r--src/libs/installer/createshortcutoperation.cpp59
-rw-r--r--src/libs/installer/downloadarchivesjob.cpp25
-rw-r--r--src/libs/installer/downloadarchivesjob.h2
-rw-r--r--src/libs/installer/elevatedexecuteoperation.cpp18
-rw-r--r--src/libs/installer/environmentvariablesoperation.cpp4
-rw-r--r--src/libs/installer/errors.h5
-rw-r--r--src/libs/installer/extractarchiveoperation.cpp13
-rw-r--r--src/libs/installer/extractarchiveoperation.h3
-rw-r--r--src/libs/installer/extractarchiveoperation_p.h24
-rw-r--r--src/libs/installer/fileutils.cpp61
-rw-r--r--src/libs/installer/fileutils.h5
-rw-r--r--src/libs/installer/fsengineclient.cpp34
-rw-r--r--src/libs/installer/fsengineserver.cpp16
-rw-r--r--src/libs/installer/getrepositoriesmetainfojob.cpp25
-rw-r--r--src/libs/installer/getrepositoriesmetainfojob.h6
-rw-r--r--src/libs/installer/getrepositorymetainfojob.cpp135
-rw-r--r--src/libs/installer/getrepositorymetainfojob.h6
-rw-r--r--src/libs/installer/globals.cpp47
-rw-r--r--src/libs/installer/globals.h (renamed from examples/testapp/updateagent.h)29
-rw-r--r--src/libs/installer/graph.h158
-rw-r--r--src/libs/installer/init.cpp91
-rw-r--r--src/libs/installer/installer.pro21
-rw-r--r--src/libs/installer/installiconsoperation.cpp47
-rw-r--r--src/libs/installer/lib7z_facade.cpp117
-rw-r--r--src/libs/installer/lib7z_facade.h92
-rw-r--r--src/libs/installer/link.h2
-rw-r--r--src/libs/installer/macreplaceinstallnamesoperation.cpp3
-rw-r--r--src/libs/installer/macreplaceinstallnamesoperation.h6
-rw-r--r--src/libs/installer/messageboxhandler.cpp167
-rw-r--r--src/libs/installer/messageboxhandler.h4
-rw-r--r--src/libs/installer/packagemanagercore.cpp944
-rw-r--r--src/libs/installer/packagemanagercore.h25
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp210
-rw-r--r--src/libs/installer/packagemanagercore_p.h51
-rw-r--r--src/libs/installer/packagemanagercoredata.cpp6
-rw-r--r--src/libs/installer/packagemanagergui.cpp402
-rw-r--r--src/libs/installer/packagemanagergui.h18
-rw-r--r--src/libs/installer/packagemanagerproxyfactory.h2
-rw-r--r--src/libs/installer/performinstallationform.cpp12
-rw-r--r--src/libs/installer/performinstallationform.h2
-rw-r--r--src/libs/installer/productkeycheck.cpp31
-rw-r--r--src/libs/installer/productkeycheck.h14
-rw-r--r--src/libs/installer/progresscoordinator.cpp47
-rw-r--r--src/libs/installer/progresscoordinator.h6
-rw-r--r--src/libs/installer/qinstallerglobal.h23
-rw-r--r--src/libs/installer/qprocesswrapper.cpp40
-rw-r--r--src/libs/installer/qprocesswrapper.h2
-rw-r--r--src/libs/installer/qsettingswrapper.cpp30
-rw-r--r--src/libs/installer/qtpatch.cpp57
-rw-r--r--src/libs/installer/qtpatch.h1
-rw-r--r--src/libs/installer/qtpatchoperation.cpp186
-rw-r--r--src/libs/installer/qtpatchoperation.h2
-rw-r--r--src/libs/installer/registerqtincreatorqnxoperation.cpp (renamed from src/libs/installer/registerqtvqnxoperation.cpp)2
-rw-r--r--src/libs/installer/registerqtincreatorqnxoperation.h (renamed from src/libs/installer/registerqtvqnxoperation.h)6
-rw-r--r--src/libs/installer/resources/files-to-patch-linux-emb-arm8
-rw-r--r--src/libs/installer/resources/files-to-patch-linux-emb-arm-qt412
-rw-r--r--src/libs/installer/resources/files-to-patch-linux-emb-arm-qt512
-rw-r--r--src/libs/installer/resources/files-to-patch-macx-emb-arm-qt59
-rw-r--r--src/libs/installer/resources/files-to-patch-windows-emb-arm6
-rw-r--r--src/libs/installer/resources/files-to-patch-windows-emb-arm-qt513
-rw-r--r--src/libs/installer/resources/patch_file_lists.qrc3
-rw-r--r--src/libs/installer/scriptengine.cpp416
-rw-r--r--src/libs/installer/scriptengine.h (renamed from examples/testapp/componentselectiondialog.h)62
-rw-r--r--src/libs/installer/settings.cpp160
-rw-r--r--src/libs/installer/settings.h12
-rw-r--r--src/libs/installer/sysinfo_win.cpp224
-rw-r--r--src/libs/installer/utils.cpp34
-rw-r--r--src/libs/installer/utils.h3
-rw-r--r--src/libs/kdtools/environment.cpp41
-rw-r--r--src/libs/kdtools/environment.h41
-rw-r--r--src/libs/kdtools/kdgenericfactory.cpp158
-rw-r--r--src/libs/kdtools/kdgenericfactory.h45
-rw-r--r--src/libs/kdtools/kdjob.cpp45
-rw-r--r--src/libs/kdtools/kdjob.h45
-rw-r--r--src/libs/kdtools/kdlockfile.cpp79
-rw-r--r--src/libs/kdtools/kdlockfile.h45
-rw-r--r--src/libs/kdtools/kdlockfile_p.h45
-rw-r--r--src/libs/kdtools/kdlockfile_unix.cpp45
-rw-r--r--src/libs/kdtools/kdlockfile_win.cpp47
-rw-r--r--src/libs/kdtools/kdrunoncechecker.cpp45
-rw-r--r--src/libs/kdtools/kdrunoncechecker.h45
-rw-r--r--src/libs/kdtools/kdsavefile.cpp115
-rw-r--r--src/libs/kdtools/kdsavefile.h45
-rw-r--r--src/libs/kdtools/kdselfrestarter.cpp51
-rw-r--r--src/libs/kdtools/kdselfrestarter.h47
-rw-r--r--src/libs/kdtools/kdsysinfo.cpp45
-rw-r--r--src/libs/kdtools/kdsysinfo.h45
-rw-r--r--src/libs/kdtools/kdsysinfo_mac.cpp45
-rw-r--r--src/libs/kdtools/kdsysinfo_win.cpp222
-rw-r--r--src/libs/kdtools/kdsysinfo_x11.cpp47
-rw-r--r--src/libs/kdtools/kdtools.pri3
-rw-r--r--src/libs/kdtools/kdtoolsglobal.h45
-rw-r--r--src/libs/kdtools/kdupdater.h57
-rw-r--r--src/libs/kdtools/kdupdaterapplication.cpp92
-rw-r--r--src/libs/kdtools/kdupdaterapplication.h72
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloader.cpp107
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloader.h50
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloader_p.h45
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp59
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloaderfactory.h48
-rw-r--r--src/libs/kdtools/kdupdaterpackagesinfo.cpp98
-rw-r--r--src/libs/kdtools/kdupdaterpackagesinfo.h58
-rw-r--r--src/libs/kdtools/kdupdatersignatureverificationrunnable.cpp137
-rw-r--r--src/libs/kdtools/kdupdatersignatureverificationrunnable.h92
-rw-r--r--src/libs/kdtools/kdupdatertask.cpp45
-rw-r--r--src/libs/kdtools/kdupdatertask.h45
-rw-r--r--src/libs/kdtools/kdupdaterupdate.cpp310
-rw-r--r--src/libs/kdtools/kdupdaterupdate.h102
-rw-r--r--src/libs/kdtools/kdupdaterupdatefinder.cpp399
-rw-r--r--src/libs/kdtools/kdupdaterupdatefinder.h64
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperation.cpp71
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperation.h50
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperationfactory.cpp48
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperationfactory.h45
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperations.cpp584
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperations.h102
-rw-r--r--src/libs/kdtools/kdupdaterupdatesinfo.cpp237
-rw-r--r--src/libs/kdtools/kdupdaterupdatesinfo_p.h85
-rw-r--r--src/libs/kdtools/kdupdaterupdatesinfodata_p.h (renamed from examples/testapp/updatesettingswidget.h)53
-rw-r--r--src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp198
-rw-r--r--src/libs/kdtools/kdupdaterupdatesourcesinfo.h61
-rw-r--r--src/sdk/installerbase.cpp104
-rw-r--r--src/sdk/installerbase.qrc2
-rw-r--r--src/sdk/installerbase_p.cpp97
-rw-r--r--src/sdk/installerbase_p.h2
-rw-r--r--src/sdk/installerbasecommons.cpp25
-rw-r--r--src/sdk/sdk.pro6
-rw-r--r--src/sdk/settingsdialog.cpp67
-rw-r--r--src/sdk/settingsdialog.h10
-rw-r--r--src/sdk/tabcontroller.cpp7
-rw-r--r--src/sdk/translations/de_de.ts1077
-rw-r--r--src/sdk/translations/en_us.ts1078
-rw-r--r--src/sdk/translations/ja_jp.ts2470
-rw-r--r--src/sdk/translations/ru_ru.ts1092
-rw-r--r--src/src.pro2
-rw-r--r--tests/auto/installer/binaryformat/binaryformat.pro5
-rw-r--r--tests/auto/installer/binaryformat/tst_binaryformat.cpp115
-rw-r--r--tests/auto/installer/componentmodel/componentmodel.pro8
-rw-r--r--tests/auto/installer/componentmodel/components.qrc5
-rw-r--r--tests/auto/installer/componentmodel/data/updates.xml132
-rw-r--r--tests/auto/installer/componentmodel/tst_componentmodel.cpp478
-rw-r--r--tests/auto/installer/consumeoutputoperationtest/consumeoutputoperationtest.pro8
-rw-r--r--tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp183
-rw-r--r--tests/auto/installer/copyoperationtest/copyoperationtest.pro6
-rw-r--r--tests/auto/installer/copyoperationtest/tst_copyoperationtest.cpp168
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data.qrc6
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/invalid.7zbin0 -> 25600 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/valid.7zbin0 -> 950 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/extractarchiveoperationtest.pro7
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp (renamed from examples/testapp/updatesettingsdialog.cpp)84
-rw-r--r--tests/auto/installer/installer.pro12
-rw-r--r--tests/auto/installer/lib7zfacade/data.qrc6
-rw-r--r--tests/auto/installer/lib7zfacade/data/invalid.7zbin0 -> 25600 bytes
-rw-r--r--tests/auto/installer/lib7zfacade/data/valid.7zbin0 -> 950 bytes
-rw-r--r--tests/auto/installer/lib7zfacade/lib7zfacade.pro7
-rw-r--r--tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp184
-rw-r--r--tests/auto/installer/messageboxhandler/messageboxhandler.pro6
-rw-r--r--tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp119
-rw-r--r--tests/auto/installer/mkdiroperationtest/tst_mkdiroperationtest.cpp36
-rw-r--r--tests/auto/installer/scriptengine/data/auto-install.qs16
-rw-r--r--tests/auto/installer/scriptengine/data/broken_connect.qs11
-rw-r--r--tests/auto/installer/scriptengine/data/component1.qs48
-rw-r--r--tests/auto/installer/scriptengine/data/component2.qs6
-rw-r--r--tests/auto/installer/scriptengine/scriptengine.pro11
-rw-r--r--tests/auto/installer/scriptengine/scriptengine.qrc8
-rw-r--r--tests/auto/installer/scriptengine/tst_scriptengine.cpp253
-rw-r--r--tests/auto/installer/settings/data/full_config.xml129
-rw-r--r--tests/auto/installer/settings/tst_settings.cpp12
-rw-r--r--tests/auto/installer/solver/solver.pro5
-rw-r--r--tests/auto/installer/solver/tst_solver.cpp134
-rw-r--r--tests/auto/qttest.pri2
-rw-r--r--tests/downloadspeed/downloadspeed.pro4
-rw-r--r--tests/downloadspeed/main.cpp26
-rw-r--r--tests/environmentvariable/environmentvariable.pro3
-rw-r--r--tests/extractarchiveoperationtest/extractarchiveoperationtest.cpp177
-rw-r--r--tests/extractarchiveoperationtest/extractarchiveoperationtest.h66
-rw-r--r--tests/extractarchiveoperationtest/extractarchiveoperationtest.pro15
-rw-r--r--tests/fileengineclient/fileengineclient.pro3
-rw-r--r--tests/fileengineserver/fileengineserver.pro3
-rw-r--r--tests/test-noarchive.7z190
-rw-r--r--tests/test1.7zbin282 -> 0 bytes
-rw-r--r--tests/test2.7zbin629 -> 0 bytes
-rw-r--r--tests/tests.pro8
-rw-r--r--tools/archivegen/archivegen.pro2
-rw-r--r--tools/binarycreator/binarycreator.cpp250
-rw-r--r--tools/binarycreator/binarycreator.pro2
-rw-r--r--tools/common/repositorygen.cpp448
-rw-r--r--tools/common/repositorygen.h20
-rw-r--r--tools/extractbinarydata/extractbinarydata.pro3
-rw-r--r--tools/getrepositorycontent/domnodedebugstreamoperator.cpp (renamed from examples/testapp/main.cpp)26
-rw-r--r--tools/getrepositorycontent/domnodedebugstreamoperator.h (renamed from examples/testapp/updatesettingsdialog.h)29
-rw-r--r--tools/getrepositorycontent/downloader.cpp118
-rw-r--r--tools/getrepositorycontent/downloader.h (renamed from tools/repogenfromonlinerepo/downloadmanager.h)42
-rw-r--r--tools/getrepositorycontent/getrepositorycontent.pro23
-rw-r--r--tools/getrepositorycontent/main.cpp450
-rw-r--r--tools/getrepositorycontent/textprogressbar.cpp (renamed from tools/repogenfromonlinerepo/textprogressbar.cpp)0
-rw-r--r--tools/getrepositorycontent/textprogressbar.h (renamed from tools/repogenfromonlinerepo/textprogressbar.h)0
-rw-r--r--tools/repocompare/repocompare.pro3
-rw-r--r--tools/repogen/repogen.cpp126
-rw-r--r--tools/repogen/repogen.pro2
-rw-r--r--tools/repogenfromonlinerepo/downloadmanager.cpp171
-rw-r--r--tools/repogenfromonlinerepo/main.cpp332
-rw-r--r--tools/repogenfromonlinerepo/repogenfromonlinerepo.pro19
-rw-r--r--tools/tools.pro2
971 files changed, 15706 insertions, 154319 deletions
diff --git a/3RDPARTY b/3RDPARTY
index 485d3aeee..58b055221 100644
--- a/3RDPARTY
+++ b/3RDPARTY
@@ -2,30 +2,16 @@ The Qt Installer Framework sources include third party code:
============================================================
-P7zip
+LZMA SDK
-Sources for p7zip are under src/libs/7zip/unix. The library
-is released under the GNU LGPL with unRAR restriction. See
-src/libs/7zip/unix/DOCS/License.txt for details. The folder
-contains also parts of Wine, which is distributed under the
-LGPL 2.1 or newer.
+Parts of the sources from the LZMA SDK , version 9.20 are
+under src/libs/7zip/unix and src/libs/7z/win.
-The copyright of the 7z is owned by Igor Pavlov, the
-copyright of the original unRAR code is owned by Alexander
-Roshal.
-
-============================================================
-
-7zip
-
-Sources for p7zip are under src/libs/7zip/win.
-
-The library is released under the GNU LGPL with unRAR restriction.
-See src/libs/7zip/win/DOC/License.txt for details.
-
-The copyright of the 7z is owned by Igor Pavlov, the
-copyright of the original unRAR code is owned by Alexander
-Roshal.
+The LZMA SDK is written and placed in the public domain by
+Igor Pavlov. Some code in LZMA SDK is based on public domain
+code from another developers:
+1) PPMd var.H (2001): Dmitry Shkarin
+2) SHA-256: Wei Dai (Crypto++ library)
============================================================
@@ -33,8 +19,8 @@ KD Tools
Sources for the KD Tools library are under src/libs/kdtools.
-The library is licensed under LGPL 2, LGPL 3, and a commercial
-KD Tools license.
+The library is released under the same license as the rest
+of the installer framework (GPL 3.0/LGPL 2.1 with Digia
+exception/Digia Commercial License).
-The copyright is owned by Klaralvdalens
-Datakonsult AB.
+The copyright is owned by Klaralvdalens Datakonsult AB.
diff --git a/Changelog b/Changelog
index 28d58a608..3725b9216 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,58 @@
+1.4.1
+- Added support to pass a query string when downloading archives. (QTIFW-329)
+- Fixed progress display for redirected HTTP Downloads. (QTIFW-267)
+- Add support to repogen to update only newer components. (QTIFW-234)
+- Added more autotests.
+- Improved documentation.
+- Minor bugfixes.
+
+1.4
+- Force updating of Essential components. (QTIFW-38, QTIFW-155)
+- Display release date in Updater and Packagemanager. (QTIFW-25)
+- Fixed a crash in the package manager. (QTIFW-313)
+- Fixed component selection showing wrong package sizes. (QTIFW-302)
+- Better handling of dependencies while updating. (QTIFW-318)
+- Now allows to ignore SSL errors.
+- Implemented dedicated translation settings support.
+- Added exceptionhandler code for connected signals/JS methods.
+- Now properly calculates the file size for symlinks. (QTIFW-137)
+- Fixed downloading when the server redirects.
+- Changed two fatals to warnings.
+- Added errorString to execute operation error output.
+- Implemented configuration interface. (QTIFW-196)
+- Introduced no_app_bundle.pri for Mac.
+- Added a change installer ui example.
+- Added entered/left signals to pages.
+- Forwarded packagemanager core to ProductKeyCheck class.
+- Added installerscriptengine.
+- Replaced the external date and time implementation.
+- Now only uses the basic LZMA SDK (instead of all of 7zip).
+- Forwarded make "check" target to autotests.
+- Added documentation for JS API.
+- Fixed messageboxhandler.
+- Added INSTALL file, cleaned up README.
+- Now sets the subTitle to " " if empty on Linux as well.
+- Now checks for os-release instead of lsb-release on Linux.
+- Added getrepositorycontent tool.
+- Now provides documentation for Vendorprefix parameter.
+- Fixed output of line number in log.
+- Fixed broken update behavior (in the size and description label).
+- Binarycreator now assumes offline installer if there are no repositories. (QTIFW-224)
+- Rewrote copy configuration function. (QTIFW-221)
+- Added banner pixmap to the wizard.
+- Removed previously deprecated Pages config.xml element.
+- Deprecated Icon, introduce replacements for config.xml.
+- Added component model behavior auto test and fix broken model. (QTIFW-84, QTIFW-213)
+- Made CreateShortcut operation a NOOP on non-Windows systems.
+- Added RunProgramArguments to config.xml.
+- Qt5 SDK specific fixes.
+- Minor documentation fixes and additions.
+- Added more autotests.
+- Bugfixes
+- Added Japanese translation.
+- Updated translations
+- Cleaned up the Code.
+
1.3.1
- Fixed missing magic cookie in installer binary on Mac. (QTIFW-322)
- Fixed UNDO of MkDirOperation and CopyOperation.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 000000000..3922b396f
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,69 @@
+How to build
+=====================
+
+The instructions should help you build the Installer Framework from scratch.
+
+
+Get the sources
+---------------------
+
+Use Git to check out the Qt Installer Framework sources that are hosted at:
+
+http://qt.gitorious.org/installer-framework
+
+
+Build Qt
+---------------------
+
+To build an installer, it is advised to use a statically linked Qt. For maximum
+portability we recommend the latest version of the Qt 4.x series. See the Qt
+documentation for the prerequisites and steps to build Qt from sources.
+
+### Windows
+
+Adjust the qmake.conf to have a real stand alone working installer:
+
+- add 'embed_manifest_dll embed_manifest_exe' to CONFIG line
+- replace -MD, -MDd with -MT, -MTD in the CFLAGS lines
+
+'git diff' should show you something like:
+
+--- a/mkspecs/win32-msvc20XX/qmake.conf
++++ b/mkspecs/win32-msvc20XX/qmake.conf
+
+ MAKEFILE_GENERATOR = MSVC.NET
+ TEMPLATE = app
+-CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
++CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target
+ QT += core gui
+ DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT
+ QMAKE_COMPILER_DEFINES += _MSC_VER=1400 WIN32
+ QMAKE_YACCFLAGS = -d
+ QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
+ QMAKE_CFLAGS_WARN_ON = -W3
+ QMAKE_CFLAGS_WARN_OFF = -W0
+-QMAKE_CFLAGS_RELEASE = -O2 -MD
+-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
+-QMAKE_CFLAGS_DEBUG = -Zi -MDd
++QMAKE_CFLAGS_RELEASE = -O2 -MT
++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
++QMAKE_CFLAGS_DEBUG = -Zi -MTd
+ QMAKE_CFLAGS_YACC =
+ QMAKE_CFLAGS_LTCG = -GL
+
+Recommended configure options for Microsoft Windows:
+
+configure.exe -opensource -release -static -no-multimedia -no-declarative -no-phonon -no-dbus -no-opengl -no-qt3support -no-webkit -no-xmlpatterns -nomake examples -nomake demos
+
+### Linux & Mac OS X
+
+Recommended configure options for Linux and Mac OS X:
+
+configure -opensource -release -static -qt-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-phonon -no-dbus -no-opengl -no-qt3support -no-webkit -no-xmlpatterns -no-svg -nomake examples -nomake demos
+
+
+Build the Framework
+---------------------
+
+Run 'qmake && make' (or 'mingw32-make', 'nmake' ...) to build the Qt Installer
+Framework. The documentation can be generated by 'make docs'.
diff --git a/LICENSE.FDL b/LICENSE.FDL
new file mode 100644
index 000000000..938bb8da9
--- /dev/null
+++ b/LICENSE.FDL
@@ -0,0 +1,450 @@
+ GNU Free Documentation License
+ Version 1.3, 3 November 2008
+
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole or
+in part into the MMC, (1) had no cover texts or invariant sections, and
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/README b/README
index aae0cf5e5..d9c9be7d4 100644
--- a/README
+++ b/README
@@ -1,61 +1,28 @@
-These are instructions to create the Installer Framework
-
-== Build ==
-To build an installer, it is advised to use a statically linked Qt.
-At the moment, only building with Qt 4.8.x is supported.
-
-== Qt configuration under Windows ==
-adjust the qmake.conf to have a real stand alone working installer (at the moment we are using msvc2005, but it should work with msvc2008 as well)
-
---- a/mkspecs/win32-msvc20XX/qmake.conf
-+++ b/mkspecs/win32-msvc20XX/qmake.conf
-
- MAKEFILE_GENERATOR = MSVC.NET
- TEMPLATE = app
--CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
-+CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target
- QT += core gui
- DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT
- QMAKE_COMPILER_DEFINES += _MSC_VER=1400 WIN32
- QMAKE_YACCFLAGS = -d
- QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
- QMAKE_CFLAGS_WARN_ON = -W3
- QMAKE_CFLAGS_WARN_OFF = -W0
--QMAKE_CFLAGS_RELEASE = -O2 -MD
--QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
--QMAKE_CFLAGS_DEBUG = -Zi -MDd
-+QMAKE_CFLAGS_RELEASE = -O2 -MT
-+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
-+QMAKE_CFLAGS_DEBUG = -Zi -MTd
- QMAKE_CFLAGS_YACC =
- QMAKE_CFLAGS_LTCG = -GL
-
-Recommended configure options for windows:
-configure.exe -opensource -release -static -no-multimedia -no-declarative -no-phonon -no-dbus -no-opengl -no-qt3support -no-webkit -no-xmlpatterns -nomake examples -nomake demos
-
-Recommended configure options for Linux and MacOS:
-configure -opensource -release -static -qt-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-phonon -no-dbus -no-opengl -no-qt3support -no-webkit -no-xmlpatterns -no-svg -nomake examples -nomake demos
-
-== Create an Installer ==
-
-To create an installer, use bin/binarycreator. The create-test-installer batch files run it for the example project:
-
-in windows;
-cd tests\test-installer
-create-test-installer.bat
-
-in unix;
-cd tests/test-installer
-create-test-installer.sh
-
- NOTE: Under MacOS you have to copy the dir $QTDIR/src/gui/mac/qt_menu.nib to <INSTALLER_APP_DIR>/Resources/qt_menu.nib.
- for example: cp -r ../../qt4/src/gui/mac/qt_menu.nib ./test-installer-offline.app/Contents/Resources
-
-This creates an installer "test-installer-offline"/"test-installer-online" and the components required by the com.nokia.testapp package(examples\testapp\packages\com.nokia.testapp) in the bin folder.
-
-== Create an Archive ==
-To create an 7zip archive named qt-copy.7z that contains the directory qt-copy use:
-
-cd /path/where/qt-copy/is/located
-7z a -t7z -mx=9 -ms=off -l qt-copy.7z qt-copy
+The Qt Installer Framework provides a set of tools and utilities to create
+installers for the supported desktop Qt platforms: Linux, Microsoft Windows, and
+Mac OS X.
+
+Documentation
+--------------------------
+
+The binary packages for the Qt Installer Framework include documentation in the
+doc directory. See http://qt-project.org/wiki/Qt-Installer-Framework for a link
+to online versions.
+
+Notes
+--------------------------
+- To build an installer, it is advised to use a statically linked Qt. See the
+ documentation at
+ http://doc-snapshot.qt-project.org/qtifw-master/ifw-getting-started.html
+- At the moment, only building with Qt 4.8.x is supported.
+
+
+Getting Help
+--------------------------
+
+If you think you found a bug, please report it to
+
+https://bugreports.qt-project.org/browse/QTIFW
+
+General questions are best asked on interest@qt-project.org.
diff --git a/dist/config/config.xml b/dist/config/config.xml
index e2b408e2a..e5bf2ffe6 100644
--- a/dist/config/config.xml
+++ b/dist/config/config.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Installer>
<Name>Qt Installer Framework</Name>
- <Title>Qt Installer Framework 1.3.0</Title>
+ <Title>Qt Installer Framework 1.4.1</Title>
<Version>1.0.0</Version>
<Publisher>Qt Project</Publisher>
<ProductUrl>http://qt-project.org</ProductUrl>
@@ -9,5 +9,5 @@
<UninstallerName>Uninstaller</UninstallerName>
<!-- Tweaked for windows in installscript.qs -->
- <TargetDir>@homeDir@/Qt/QtIFW-1.3.0</TargetDir>
+ <TargetDir>@homeDir@/Qt/QtIFW-1.4.1</TargetDir>
</Installer>
diff --git a/dist/packages/org.qtproject.ifw.binaries/meta/package.xml b/dist/packages/org.qtproject.ifw.binaries/meta/package.xml
index edfb30e7f..ac75cedfa 100644
--- a/dist/packages/org.qtproject.ifw.binaries/meta/package.xml
+++ b/dist/packages/org.qtproject.ifw.binaries/meta/package.xml
@@ -2,7 +2,7 @@
<Package>
<DisplayName>Qt Installer Framework Binaries</DisplayName>
<Description>Installs the binaries, examples and help files.</Description>
- <Version>1.3.0</Version>
- <ReleaseDate>2013-03-21</ReleaseDate>
+ <Version>1.4.1</Version>
+ <ReleaseDate>2013-07-03</ReleaseDate>
<Default>True</Default>
</Package>
diff --git a/dist/packages/org.qtproject.ifw/meta/3RDPARTY b/dist/packages/org.qtproject.ifw/meta/3RDPARTY
new file mode 100644
index 000000000..58b055221
--- /dev/null
+++ b/dist/packages/org.qtproject.ifw/meta/3RDPARTY
@@ -0,0 +1,26 @@
+The Qt Installer Framework sources include third party code:
+
+============================================================
+
+LZMA SDK
+
+Parts of the sources from the LZMA SDK , version 9.20 are
+under src/libs/7zip/unix and src/libs/7z/win.
+
+The LZMA SDK is written and placed in the public domain by
+Igor Pavlov. Some code in LZMA SDK is based on public domain
+code from another developers:
+1) PPMd var.H (2001): Dmitry Shkarin
+2) SHA-256: Wei Dai (Crypto++ library)
+
+============================================================
+
+KD Tools
+
+Sources for the KD Tools library are under src/libs/kdtools.
+
+The library is released under the same license as the rest
+of the installer framework (GPL 3.0/LGPL 2.1 with Digia
+exception/Digia Commercial License).
+
+The copyright is owned by Klaralvdalens Datakonsult AB.
diff --git a/dist/packages/org.qtproject.ifw/meta/package.xml b/dist/packages/org.qtproject.ifw/meta/package.xml
index 8f3e0e814..443930a45 100644
--- a/dist/packages/org.qtproject.ifw/meta/package.xml
+++ b/dist/packages/org.qtproject.ifw/meta/package.xml
@@ -2,11 +2,12 @@
<Package>
<DisplayName>Qt Installer Framework</DisplayName>
<Description>Installs the Qt Installer Framework.</Description>
- <Version>1.3.0</Version>
- <ReleaseDate>2013-03-21</ReleaseDate>
+ <Version>1.4.1</Version>
+ <ReleaseDate>2013-07-03</ReleaseDate>
<Licenses>
<License name="LGPL 2.1" file="LICENSE.LGPL" />
<License name="Digial Qt LGPL Exception 1.1" file="LGPL_EXCEPTION.txt" />
+ <License name="Third Party Code Licenses" file="3RDPARTY" />
</Licenses>
<Script>installscript.qs</Script>
</Package>
diff --git a/doc/config/installerfw-project.qdocconf b/doc/config/installerfw-project.qdocconf
index 3b96a00af..fc0074d8c 100644
--- a/doc/config/installerfw-project.qdocconf
+++ b/doc/config/installerfw-project.qdocconf
@@ -3,6 +3,12 @@ description = "Qt Installer Framework Manual"
headerdirs =
sourcedirs = $SRCDIR
+
+# Contains documentation for JS API
+sources = $SRCDIR/../src/libs/installer/packagemanagercore.cpp \
+ $SRCDIR/../src/libs/installer/component.cpp \
+ $SRCDIR/../src/libs/installer/messageboxhandler.cpp
+
imagedirs = $SRCDIR/images $SRCDIR/templates/images
outputdir = $OUTDIR
exampledirs = $SRCDIR $SRCDIR/examples
@@ -13,7 +19,7 @@ include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf)
include(qt-defines.qdocconf)
-sources.fileextensions = "*.qdoc"
+sources.fileextensions = "*.qdoc *.cpp"
qhp.projects = InstallerFramework
qhp.InstallerFramework.file = ifw.qhp
@@ -34,3 +40,10 @@ qhp.InstallerFramework.subprojects.manual.type = manual
macro.see = "\\sa"
macro.function = "\\fn"
+
+
+# We 'misuse' QML doc commands to generate JS documentation
+# (only works with qdoc from Qt 5)
+
+outputprefixes = QML
+outputprefixes.QML =
diff --git a/doc/examples/config.xml b/doc/examples/config.xml
index c234bab25..daf212711 100644
--- a/doc/examples/config.xml
+++ b/doc/examples/config.xml
@@ -8,6 +8,7 @@
<Logo>logo.png</Logo>
<Watermark>watermark.png</Watermark>
<RunProgram></RunProgram>
+ <RunProgramArguments></RunProgramArguments>
<RunProgramDescription></RunProgramDescription>
<StartMenuDir>Some Application Entry Dir</StartMenuDir>
<UninstallerName>SDKMaintenanceTool</UninstallerName>
diff --git a/doc/installerfw-getting-started.qdoc b/doc/installerfw-getting-started.qdoc
index 84a3c5b5e..1b21ac664 100644
--- a/doc/installerfw-getting-started.qdoc
+++ b/doc/installerfw-getting-started.qdoc
@@ -41,7 +41,7 @@
You can use the Qt Installer Framework to create installers for all
platforms supported by
- \l{http://doc.qt.nokia.com/5.0-snapshot/supported-platforms.html}
+ \l{http://qt-project.org/doc/qt-5.0/qtdoc/platform-details.html}
{desktop Qt}.
The installers have been tested on the following platforms:
diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc
index fbcab3cd4..9cfb94d06 100644
--- a/doc/installerfw.qdoc
+++ b/doc/installerfw.qdoc
@@ -182,7 +182,15 @@
\row
\o Icon
\o Filename for a custom installer icon. The actual file is looked up by attaching
- a '.icns' (Mac OS X), '.ico' (Windows) or '.png' (Unix) suffix.
+ a '.icns' (Mac OS X), '.ico' (Windows) or '.png' (Unix) suffix. Deprecated,
+ use InstallerApplicationIcon and / or InstallerWindowIcon instead.
+ \row
+ \o InstallerApplicationIcon
+ \o Filename for a custom installer icon. The actual file is looked up by attaching
+ a '.icns' (Mac OS X), '.ico' (Windows). No functionality on Unix.
+ \row
+ \o InstallerWindowIcon
+ \o Filename for a custom window icon in PNG format for the Installer application.
\row
\o Logo
\o Filename for a logo used as \a QWizard::LogoPixmap.
@@ -190,13 +198,19 @@
\o Watermark
\o Filename for a watermark used as \a QWizard::WatermarkPixmap.
\row
+ \o Banner
+ \o Filename for a banner used as \a QWizard::BannerPixmap (only used by ModernStyle).
+ \row
\o Background
- \o Filename for an image used as \a QWizard::BackgroundPixmap.
+ \o Filename for an image used as \a QWizard::BackgroundPixmap (only used by MacStyle).
\row
\o RunProgram
\o Command executed after the installer is done if the user accepts
the action.
\row
+ \o RunProgramArguments
+ \o Arguments passed to the program specified in RunProgram.
+ \row
\o RunProgramDescription
\o Text shown next to the check box for running the program after
the installation. Defaults to \gui {Run <Name>}.
@@ -247,9 +261,15 @@
\o TargetConfigurationFile
\o Filename for the configuration file on the target. Default is components.xml.
\row
- \o Pages
- \o Custom strings for labels in the installer pages. Deprecated,
- see \l{Translating Pages} instead.
+ \o Translations
+ \o List of language codes to be used for translating the user interface. To add several language
+ variants, specify several Translation sections that each specify the name of a language
+ variant. Optional. For more information, see \l{Translating Pages}.
+ \row
+ \o UrlQueryString
+ \o This string needs to be in the form "key=value" and will be appended to archive download
+ requests. This can be used to transmit information to the webserver hosting the repository.
+
\endtable
*/
@@ -425,10 +445,11 @@
\row
\o AutoDependOn
\o Opposite of dependencies. Defines that this component should be
- loaded if the specified component is loaded.
+ loaded if all of the specified components are loaded.
\row
\o Virtual
\o Set to \c true to hide the component from the installer.
+ Note that setting this on a root component does not work.
\row
\o SortingPriority
\o Priority of the component in the tree. The tree is sorted from
@@ -469,6 +490,8 @@
\o Default
\o Possible values are: \c true, \c false, and \c script. Set to
\c true to preselect the component in the installer.
+ This takes effect only on components that have no visible
+ child components.
The boolean values are evaluated directly, while \c script is
resolved during runtime. Add the name of the script as a value
of the \c Script setting in this file. For an example script,
@@ -477,7 +500,10 @@
\o Essential
\o Marks the package as essential to force a restart of the
\c UpdateAgent or \c MaintenanceTool. This is relevant for
- updates found with \c UpdateAgent.
+ updates found with \c UpdateAgent. If there are updates available
+ for an essential component, the package manager stays disabled
+ until that component is updated. Newly introduced essential components
+ are automatically installed when running the updater.
\row
\o ForcedInstallation
\o Determines that the package must always be installed. End users
@@ -488,7 +514,11 @@
\row
\o DownloadableArchives
- \o Lists the data files (separated by commas) for an online installer to download. Optional.
+ \o Lists the data files (separated by commas) for an online
+ installer to download.
+ If there is some data inside the component and the package.xml
+ and/or the script has no DownloadableArchives value, the
+ repogen tool registers the found data automatically.
\endtable
\section2 Component Dependencies
@@ -772,12 +802,12 @@
repogen.exe -p <package_directory> -c <config_directory>\<config_file> repository <repository_directory>
- For example, to create a repository that contains only com.nokia.sdk.qt and
- com.nokia.sdk.qtcreator, enter the following
+ For example, to create a repository that contains only org.qt-project.sdk.qt and
+ org.qt-project.sdk.qtcreator, enter the following
command:
\code
- repogen.exe -p packages -c installer-config\config.xml -i com.nokia.sdk.qt,com.nokia.sdk.qtcreator repository
+ repogen.exe -p packages -c installer-config\config.xml -i org.qt-project.sdk.qt,org.qt-project.sdk.qtcreator repository
\endcode
When the repository has been created, upload it to a web server. You must
@@ -834,12 +864,12 @@
\endcode
For example, enter the following command to create an installer binary
- called SDKInstaller.exe that will not contain data for com.nokia.sdk.qt and
- com.nokia.qtcreator, because those packages are downloaded from a remote
+ called SDKInstaller.exe that will not contain data for org.qt-project.sdk.qt and
+ org.qt-project.qtcreator, because those packages are downloaded from a remote
repository:
\code
- binarycreator.exe -p installer-packages -c installer-config\config.xml -e com.nokia.sdk.qt,com.nokia.qtcreator SDKInstaller.exe
+ binarycreator.exe -p installer-packages -c installer-config\config.xml -e org.qt-project.sdk.qt,org.qt-project.qtcreator SDKInstaller.exe
\endcode
\section1 Reducing Installer Size
@@ -886,7 +916,7 @@
Some options have default values, and therefore, you can omit them.
For example, enter the following command to create an installer binary
called SDKInstaller.exe that contains the packages identified by
- com.nokia.sdk and their dependencies:
+ org.qt-project.sdk and their dependencies:
\code
binarycreator.exe --offline-only -c installer-config -p installer-packes SDKInstaller.exe
@@ -976,6 +1006,42 @@
then Updates.xml. The package names include version numbers, and therefore,
end users receive old packages until the new ones are fully uploaded.
+ \section1 Changing Repositories
+
+ To have the current update repository point to other repositories, edit the
+ Updates.xml file in the current repository. You can add, replace, or remove
+ repositories.
+
+ \code
+ <RepositoryUpdate>
+ <Repository action="..." OPTIONS />
+ <Repository action="..." OPTIONS />
+ </RepositoryUpdate>
+ \endcode
+
+ \section2 Adding Repositories
+ To update a repository, add the following code to the RepositoryUpdate section:
+
+ \code
+ <Repository action="add" url="http://www.example.com/repository" name="user" password="password"
+ displayname="Example Repository" />
+ \endcode
+
+ \section2 Removing Repositories
+ To remove a repository, add the following code to the RepositoryUpdate section:
+
+ \code
+ <Repository action="remove" url="http://www.example.com/repository" />
+ \endcode
+
+ \section2 Replacing repositories
+ To replace one repository with another, add the following code to the RepositoryUpdate section:
+
+ \code
+ <Repository action="replace" oldurl="http://www.example.com/repository"
+ newurl="http://www.example.com/newrepository" name="user" password="password"
+ displayname="New Example Repository" />
+ \endcode
*/
/*!
diff --git a/doc/noninteractive.qdoc b/doc/noninteractive.qdoc
index 27c802e78..230aa856b 100644
--- a/doc/noninteractive.qdoc
+++ b/doc/noninteractive.qdoc
@@ -161,7 +161,7 @@
Thus, the \a{Dynamic${ObjectName}Callback()} function is called. Widgets can
be addressed using their object names (from the UI file):
\code
- var page = pageWidgetByObjectName( "DynamicSomePage" )
+ var page = gui.pageWidgetByObjectName( "DynamicSomePage" )
page.myButton.click //direct child of the UI file's widget
page.someFancyWidget.subWidget.setText( "foobar" ) // nested widget
\endcode
diff --git a/doc/operations.qdoc b/doc/operations.qdoc
index b187a20cf..2a29a519d 100644
--- a/doc/operations.qdoc
+++ b/doc/operations.qdoc
@@ -132,13 +132,15 @@
The file is set to use UTF-8 encoding.
\row
\o InstallIcons
- \o "InstallIcons" \a directory
+ \o "InstallIcons" \a directory \a [Vendorprefix]
\o Installs the contents of \a directory into a location, as
specified by freedesktop.org. That is, into
\c {$XDG_DATA_DIRS/icons}, \c {/usr/share/icons}, or
\c {$HOME/.icons}. The files are removed from their initial
location. Make sure to add this operation after the operation
that extracts the files from the archive.
+ If you provide a \a Vendorprefix it replaces all characters up to the
+ first dash (-) in the filename of the icon with this prefix.
\row
\o Extract
\o "Extract" \a archive \a targetdirectory
diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc
index 410e1645a..38fced90e 100644
--- a/doc/scripting.qdoc
+++ b/doc/scripting.qdoc
@@ -57,8 +57,8 @@
}
\endcode
- For more information, see the documentation for \a addWizardPage and
- \a userInterface.
+ For more information, see the documentation for \l QInstaller::addWizardPage and
+ \l Component::userInterface.
\section1 Installer Hooks
@@ -73,13 +73,13 @@
\o Called when the language of the installer changes.
\row
\o \a{Component.prototype.createOperations}
- \o See \a QInstaller::Component::createOperations.
+ \o See \l Component::createOperations.
\row
\o \a{Component.prototype.createOperationsForArchive}
- \o See \a QInstaller::Component::createOperationsForArchive.
+ \o See \l Component::createOperationsForArchive.
\row
\o \a{Component.prototype.createOperationsForPath}
- \o See \a QInstaller::Component::createOperationsForPath.
+ \o See \l Component::createOperationsForPath.
\endtable
\section1 Global Variables
@@ -92,25 +92,22 @@
\o Description
\row
\o installer
- \o Reference to the \a installer of the component
+ \o Reference to the \l QInstaller of the component
\row
\o component
- \o Reference to the \a Component of the component
+ \o Reference to the \l Component of the component
\endtable
- All methods marked with \a Q_INVOKABLE as well as all signals, slots, and
- properties can be used by the script.
-
\section1 Message Boxes
- You can show a \a QMessageBox from within the script by using:
+ You can show a \l QMessageBox from within the script by using:
- \code
- QMessageBox.critical
- QMessageBox.information
- QMessageBox.question
- QMessageBox.warning
- \endcode
+ \list
+ \li \l QMessageBox::critical
+ \li \l QMessageBox::information
+ \li \l QMessageBox::question
+ \li \l QMessageBox::warning
+ \endlist
For your convenience, the values for \a QMessageBox::StandardButton are made
available by using \a QMessageBox.Ok, \a QMessageBox.Open, and so on.
@@ -249,6 +246,12 @@
\row
\o os
\o Current platform: \c "x11", \c "win", or \c "mac".
+ \row
+ \o RootDir
+ \o Root directory of the filesystem.
+ \row
+ \o HomeDir
+ \o Home directory of the current user.
\endtable
The variables can be resolved by calls to \c installer.value(). If embedded
diff --git a/doc/tutorial.qdoc b/doc/tutorial.qdoc
index f4d537e49..1531922c7 100644
--- a/doc/tutorial.qdoc
+++ b/doc/tutorial.qdoc
@@ -188,6 +188,10 @@
\endlist
+ \note You have to either call \c lrelease on the included .ts file before building
+ the installer or add \c --ignore-translations as a parameter to the binarycreator
+ call.
+
The installer is created in the current directory and you can deliver it to
end users.
diff --git a/examples/changeuserinterface/README b/examples/changeuserinterface/README
new file mode 100644
index 000000000..e9ab265c7
--- /dev/null
+++ b/examples/changeuserinterface/README
@@ -0,0 +1,7 @@
+Shows how to change small things in the ui from a component script.
+This shouldn't be used for translations.
+
+Generate installer with
+
+binarycreator --offline-only -c config/config.xml -p packages installer
+
diff --git a/examples/changeuserinterface/config/config.xml b/examples/changeuserinterface/config/config.xml
new file mode 100644
index 000000000..c00f6c705
--- /dev/null
+++ b/examples/changeuserinterface/config/config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Installer>
+ <Name>Change installer UI Example</Name>
+ <Version>1.0.0</Version>
+ <Title>Change installer UI Example</Title>
+ <Publisher>Qt-Project</Publisher>
+ <StartMenuDir>Change installer UI Example</StartMenuDir>
+ <TargetDir>@HomeDir@/IFWChangeInstallerUIExample</TargetDir>
+</Installer>
diff --git a/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/installscript.qs b/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/installscript.qs
new file mode 100644
index 000000000..efa57bb67
--- /dev/null
+++ b/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/installscript.qs
@@ -0,0 +1,52 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
+function Component()
+{
+ gui.pageWidgetByObjectName("LicenseAgreementPage").entered.connect(changeLicenseLabels);
+}
+
+changeLicenseLabels = function()
+{
+ page = gui.pageWidgetByObjectName("LicenseAgreementPage");
+ page.AcceptLicenseLabel.setText("Yes I do!");
+ page.RejectLicenseLabel.setText("No I don't!");
+}
diff --git a/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/license.txt b/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/license.txt
new file mode 100644
index 000000000..61a94dce7
--- /dev/null
+++ b/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/license.txt
@@ -0,0 +1 @@
+The fantastic license, have you heard of the Beer Public License Agreement yet?
diff --git a/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/package.xml b/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/package.xml
new file mode 100644
index 000000000..04f1986d8
--- /dev/null
+++ b/examples/changeuserinterface/packages/org.qtproject.ifw.example.changeuserinterface/meta/package.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>Change UI example</DisplayName>
+ <Description>Change license accept/reject labels text</Description>
+ <ReleaseDate>2013-01-01</ReleaseDate>
+ <Version>1.0.0-1</Version>
+ <Script>installscript.qs</Script>
+ <Licenses>
+ <License name="Beer Public License Agreement" file="license.txt" />
+ </Licenses>
+</Package>
diff --git a/examples/examples.pro b/examples/examples.pro
deleted file mode 100644
index 854677b57..000000000
--- a/examples/examples.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-CONFIG += ordered
-TEMPLATE = subdirs
-
-EXTRASUBDIRS = testapp
-
-
-include(../installerfw.pri)
-
-!isEqual(IFW_SOURCE_TREE, $$IFW_BUILD_TREE) {
- for(SUBDIR, EXTRASUBDIRS) {
- mkdir.commands += $$QMAKE_MKDIR $$SUBDIR $${IFW_NEWLINE}
- }
- QMAKE_EXTRA_TARGETS += mkdir
-}
-
-for(SUBDIR, EXTRASUBDIRS) {
- examples.commands += cd $$SUBDIR && $(QMAKE) -r $$PWD/$$SUBDIR && $(MAKE) $${IFW_NEWLINE}
-}
-!isEqual(IFW_SOURCE_TREE, $$IFW_BUILD_TREE) {
- examples.depends = mkdir
-}
-QMAKE_EXTRA_TARGETS += examples
diff --git a/examples/modifyextract/config/config.xml b/examples/modifyextract/config/config.xml
index bb2c18ce4..2f365dbcc 100644
--- a/examples/modifyextract/config/config.xml
+++ b/examples/modifyextract/config/config.xml
@@ -5,5 +5,5 @@
<Title>Modify extract Installer Example</Title>
<Publisher>Qt-Project</Publisher>
<StartMenuDir>Qt Installer Framework Example</StartMenuDir>
- <TargetDir>@homeDir@/IFWModifyExtractInstallerExample</TargetDir>
+ <TargetDir>@HomeDir@/IFWModifyExtractInstallerExample</TargetDir>
</Installer>
diff --git a/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js
index 59f5ee2bc..0ab19497c 100644
--- a/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js
+++ b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js
@@ -1,3 +1,44 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
function Component()
{
}
diff --git a/examples/quit_installer/config/config.xml b/examples/quit_installer/config/config.xml
index a38254d30..36717025c 100644
--- a/examples/quit_installer/config/config.xml
+++ b/examples/quit_installer/config/config.xml
@@ -5,5 +5,5 @@
<Title>Quit Installer Example</Title>
<Publisher>Qt-Project</Publisher>
<StartMenuDir>Qt Installer Framework Example</StartMenuDir>
- <TargetDir>@homeDir@/IFWQuitInstallerExample</TargetDir>
+ <TargetDir>@HomeDir@/IFWQuitInstallerExample</TargetDir>
</Installer>
diff --git a/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js b/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
index c25c99ad4..5766b3420 100644
--- a/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
+++ b/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
@@ -1,3 +1,44 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
function Component()
{
var result = QMessageBox["question"]("test.quit", "Installer", "Do you want to quit the installer?<br>" +
diff --git a/examples/registerfileextension/config/config.xml b/examples/registerfileextension/config/config.xml
index 6e6db7843..fbc5e3b79 100644
--- a/examples/registerfileextension/config/config.xml
+++ b/examples/registerfileextension/config/config.xml
@@ -5,5 +5,5 @@
<Title>Register File Extension Example</Title>
<Publisher>Qt-Project</Publisher>
<StartMenuDir>Register File Extension Example</StartMenuDir>
- <TargetDir>@homeDir@/IFWRegisterFileExtensionExample</TargetDir>
+ <TargetDir>@HomeDir@/IFWRegisterFileExtensionExample</TargetDir>
</Installer>
diff --git a/examples/registerfileextension/packages/org.qtproject.ifw.example.registerfileextension/meta/installscript.qs b/examples/registerfileextension/packages/org.qtproject.ifw.example.registerfileextension/meta/installscript.qs
index 3adc2083b..ba0fcdc7b 100644
--- a/examples/registerfileextension/packages/org.qtproject.ifw.example.registerfileextension/meta/installscript.qs
+++ b/examples/registerfileextension/packages/org.qtproject.ifw.example.registerfileextension/meta/installscript.qs
@@ -1,3 +1,44 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
function Component()
{
component.loaded.connect(this, my_componentLoaded);
diff --git a/examples/startmenu/config/config.xml b/examples/startmenu/config/config.xml
index 9a06186d3..e95445d1b 100644
--- a/examples/startmenu/config/config.xml
+++ b/examples/startmenu/config/config.xml
@@ -6,5 +6,5 @@
<Publisher>Qt-Project</Publisher>
<!-- Directory name is used in component.xml -->
<StartMenuDir>Qt Installer Framework Example</StartMenuDir>
- <TargetDir>@homeDir@/IFWStartMenuExample</TargetDir>
+ <TargetDir>@HomeDir@/IFWStartMenuExample</TargetDir>
</Installer>
diff --git a/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs b/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs
index d3ed7edec..0e6172a05 100644
--- a/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs
+++ b/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs
@@ -1,3 +1,44 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
function Component()
{
// default constructor
@@ -9,6 +50,8 @@ Component.prototype.createOperations = function()
component.createOperations();
if (installer.value("os") === "win") {
- component.addOperation("CreateShortcut", "@TargetDir@/README.txt", "@StartMenuDir@/README.lnk");
+ component.addOperation("CreateShortcut", "@TargetDir@/README.txt", "@StartMenuDir@/README.lnk",
+ "workingDirectory=@TargetDir@", "iconPath=%SystemRoot%/system32/SHELL32.dll",
+ "iconId=2");
}
}
diff --git a/examples/testapp/components.xml b/examples/testapp/components.xml
deleted file mode 100644
index ce4e15ad5..000000000
--- a/examples/testapp/components.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<Packages>
- <ApplicationName>Test App</ApplicationName>
- <ApplicationVersion>1</ApplicationVersion>
- <Package>
- <Name>Test App</Name>
- <Pixmap></Pixmap>
- <Title></Title>
- <Description></Description>
- <Version>1</Version>
- <LastUpdateDate></LastUpdateDate>
- <InstallDate>2009-12-01</InstallDate>
- </Package>
-</Packages>
diff --git a/examples/testapp/componentselectiondialog.cpp b/examples/testapp/componentselectiondialog.cpp
deleted file mode 100644
index c56ee5413..000000000
--- a/examples/testapp/componentselectiondialog.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Installer Framework.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-**************************************************************************/
-
-#include "componentselectiondialog.h"
-#include "ui_componentselectiondialog.h"
-
-#include <component.h>
-#include <componentmodel.h>
-#include <packagemanagercore.h>
-
-#include <QHeaderView>
-#include <QPushButton>
-
-using namespace QInstaller;
-
-class ComponentSelectionDialog::Private : public QObject
-{
- Q_OBJECT
-
-public:
- Private(ComponentSelectionDialog *qq, PackageManagerCore *core)
- : q(qq),
- m_core(core)
- {
- }
-
- void currentChanged(const QModelIndex &index)
- {
- installBtn->setEnabled(componentModel->hasCheckedComponents());
- const int selectionCount = componentModel->checkedComponents().count();
- installBtn->setText(selectionCount > 1 ? tr("Install %1 Items").arg(selectionCount) :
- selectionCount == 1 ? tr("Install 1 Item") : tr("Install"));
- ui.buttonBox->button(QDialogButtonBox::Cancel)->setText(selectionCount > 0 ? tr("Cancel")
- : tr("Close"));
-
- if (index.isValid()) {
- ui.textBrowser->setHtml(componentModel->data(componentModel->index(index.row(), 0,
- index.parent()), Qt::ToolTipRole).toString());
- } else {
- ui.textBrowser->clear();
- }
- }
-
- void modelReset()
- {
- ui.treeView->header()->resizeSection(0, ui.labelTitle->sizeHint().width() / 1.5);
- ui.treeView->header()->setStretchLastSection(true);
- for (int i = 0; i < ui.treeView->model()->columnCount(); ++i)
- ui.treeView->resizeColumnToContents(i);
-
- bool hasChildren = false;
- const int rowCount = ui.treeView->model()->rowCount();
- for (int row = 0; row < rowCount && !hasChildren; ++row)
- hasChildren = ui.treeView->model()->hasChildren(ui.treeView->model()->index(row, 0));
- ui.treeView->setRootIsDecorated(hasChildren);
- ui.treeView->expandToDepth(0);
- }
-
-private:
- ComponentSelectionDialog *const q;
-
-public:
- Ui::ComponentSelectionDialog ui;
- PackageManagerCore *const m_core;
- ComponentModel *componentModel;
- QPushButton *installBtn;
-
-public Q_SLOTS:
- void selectAll();
- void deselectAll();
-};
-
-void ComponentSelectionDialog::Private::selectAll()
-{
- componentModel->selectAll();
-}
-
-void ComponentSelectionDialog::Private::deselectAll()
-{
- componentModel->deselectAll();
-}
-
-
-// -- ComponentSelectionDialog
-
-ComponentSelectionDialog::ComponentSelectionDialog(PackageManagerCore *core, QWidget *parent)
- : QDialog(parent),
- d(new Private(this, core))
-{
- d->ui.setupUi(this);
- d->ui.icon->setPixmap(windowIcon().pixmap(48, 48));
-
- d->ui.splitter->setStretchFactor(0, 2);
- d->ui.splitter->setStretchFactor(1, 1);
- d->ui.splitter->setCollapsible(0, false);
-
- d->componentModel = new ComponentModel(4, core);
- d->componentModel->setHeaderData(0, Qt::Horizontal, tr("Name"));
- d->componentModel->setHeaderData(1, Qt::Horizontal, tr("Installed Version"));
- d->componentModel->setHeaderData(2, Qt::Horizontal, tr("New Version"));
- d->componentModel->setHeaderData(3, Qt::Horizontal, tr("Size"));
-
- d->ui.treeView->setModel(d->componentModel);
- d->ui.treeView->setAttribute(Qt::WA_MacShowFocusRect, false);
- connect(d->ui.treeView->model(), SIGNAL(modelReset()), this, SLOT(modelReset()));
- connect(d->ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
- this, SLOT(currentChanged(QModelIndex)));
-
- d->ui.labelSubTitle->setAttribute(Qt::WA_MacSmallSize);
- d->ui.labelLicenseBlurb->setAttribute(Qt::WA_MacSmallSize);
- d->ui.textBrowser->setAttribute(Qt::WA_MacShowFocusRect, false);
-
- d->installBtn = d->ui.buttonBox->addButton(tr("Install"), QDialogButtonBox::AcceptRole) ;
- if (!d->ui.buttonBox->button(QDialogButtonBox::Cancel)->icon().isNull())
- d->installBtn->setIcon(style()->standardIcon(QStyle::SP_DialogOkButton));
-
- connect(d->installBtn, SIGNAL(clicked()), this, SIGNAL(requestUpdate()));
- connect(d->ui.selectAll, SIGNAL(clicked()), d, SLOT(selectAll()), Qt::QueuedConnection);
- connect(d->ui.deselectAll, SIGNAL(clicked()), d, SLOT(deselectAll()), Qt::QueuedConnection);
-
- d->ui.treeView->header()->setStretchLastSection(true);
- d->ui.treeView->setCurrentIndex(d->ui.treeView->model()->index(0, 0));
- for (int i = 0; i < d->ui.treeView->model()->columnCount(); ++i)
- d->ui.treeView->resizeColumnToContents(i);
- d->modelReset();
-}
-
-ComponentSelectionDialog::~ComponentSelectionDialog()
-{
- delete d;
-}
-
-void ComponentSelectionDialog::selectAll()
-{
- d->selectAll();
-}
-
-void ComponentSelectionDialog::deselectAll()
-{
- d->deselectAll();
-}
-
-void ComponentSelectionDialog::install()
-{
- emit requestUpdate();
-}
-
-void ComponentSelectionDialog::selectComponent(const QString &id)
-{
- const QModelIndex &idx = d->componentModel->indexFromComponentName(id);
- if (!idx.isValid())
- return;
- d->componentModel->setData(idx, Qt::Checked, Qt::CheckStateRole);
-}
-
-void ComponentSelectionDialog::deselectComponent(const QString &id)
-{
- const QModelIndex &idx = d->componentModel->indexFromComponentName(id);
- if (!idx.isValid())
- return;
- d->componentModel->setData(idx, Qt::Unchecked, Qt::CheckStateRole);
-}
-
-#include "moc_componentselectiondialog.cpp"
-#include "componentselectiondialog.moc"
diff --git a/examples/testapp/componentselectiondialog.ui b/examples/testapp/componentselectiondialog.ui
deleted file mode 100644
index 74f3b3fe4..000000000
--- a/examples/testapp/componentselectiondialog.ui
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ComponentSelectionDialog</class>
- <widget class="QDialog" name="ComponentSelectionDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>656</width>
- <height>409</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Software Update</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0" rowspan="3">
- <widget class="QLabel" name="icon">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="pixmap">
- <pixmap resource="testapp.qrc">:/logo.png</pixmap>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="labelTitle">
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>All available updates are shown below.</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" rowspan="2">
- <widget class="QLabel" name="labelSubTitle">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Installing this software may take some time. If you're not ready to install now, you can choose Software Update from the menu later.</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QSplitter" name="splitter">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QTreeView" name="treeView">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QTextBrowser" name="textBrowser">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0">
- <item>
- <widget class="QPushButton" name="selectAll">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Select All</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deselectAll">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Deselect All</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="labelLicenseBlurb">
- <property name="text">
- <string>Note: Use of this software is subject to the original Software License Agreement(s) that accompanied the software being updated.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources>
- <include location="testapp.qrc"/>
- </resources>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>ComponentSelectionDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/testapp/config.xml b/examples/testapp/config.xml
deleted file mode 100644
index bc00e2c20..000000000
--- a/examples/testapp/config.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<Installer>
- <Name>Test App</Name>
- <Version>1</Version>
- <Title>Test App</Title>
- <Publisher>Nokia</Publisher>
- <ProductUrl>http://qt.nokia.com</ProductUrl>
-
- <!-- @homeDir@ and @rootDir@ are some of the supported vars -->
- <TargetDir>@homeDir@/testinstall</TargetDir>
- <RemoteRepositories>
- <Repository>
- <Url>http://www.kdab.com/~christoph/testapp</Url>
- </Repository>
- </RemoteRepositories>
-</Installer>
diff --git a/examples/testapp/config/config.xml b/examples/testapp/config/config.xml
deleted file mode 100644
index e49ab7337..000000000
--- a/examples/testapp/config/config.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<Installer>
- <Name>Test App</Name>
- <Version>1.0.0</Version>
- <Title>Test App_Hurra</Title>
- <Publisher>Digia</Publisher>
- <ProductUrl>http://qt.digia.com</ProductUrl>
-
- <Icon>qticon</Icon>
- <Watermark>watermark.png</Watermark>
- <UninstallerName>TestAppUninstaller</UninstallerName>
- <RemoteRepositories>
- <Repository>
- <Url>http://www.example.com/repository</Url>
- </Repository>
- </RemoteRepositories>
-
- <!-- @homeDir@ and @rootDir@ are some of the supported vars -->
- <TargetDir>@homeDir@/testinstall</TargetDir>
-</Installer>
diff --git a/examples/testapp/config/license.txt b/examples/testapp/config/license.txt
deleted file mode 100644
index a55990fe3..000000000
--- a/examples/testapp/config/license.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-For individuals and/or legal entities resident in the American Continent (including those resident in Canada, South America, and the United States of America), the applicable licensing terms are specified under the heading "Trolltech Technology Preview License
-Agreement: American Continent".
-
-For individuals and/or legal entities not resident in the American Continent, the applicable licensing terms are specified under the heading "Trolltech Technology Preview License Agreement: Norway".
-
-TROLLTECH TECHNOLOGY PREVIEW LICENSE AGREEMENT: AMERICAN CONTINENT Agreement version 2.0
-IMPORTANT-READ CAREFULLY:
-
-1. This Trolltech Technology Preview License Agreement ("Agreement") is a legal agreement between you (either an individual or a legal entity) and Trolltech, Inc. ("Trolltech"), and pertains to the Trolltech software product(s) accompanying this Agreement, which include(s) computer software and may include "online" or electronic documentation, associated media, and printed materials, including the source code, example programs and the documentation ("Licensed Software").
-
-2. The Licensed Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Trolltech retains all rights not expressly granted. No title, property rights or copyright in the Licensed Software or in any modifications to the Licensed Software shall pass to the Licensee under any circumstances. The Licensed Software is licensed, not sold.
-
-3. By installing, copying, or otherwise using the Licensed Software, Licensee agrees to be bound by the terms of this Agreement. If Licensee does not agree to the terms of this Agreement, Licensee should not install, copy, or otherwise use the Licensed Software.
-
-4. Upon Licensee's acceptance of the terms and conditions of this Agreement, Trolltech grants Licensee the right to use the Licensed Software in the manner provided below.
-
-5. Trolltech grants to Licensee as an individual a personal, non-exclusive, non-transferable license to make and use copies of the Licensed Software for the sole purpose of evaluating and testing the Licensed Software and/or providing feedback to Trolltech. Licensee may install copies of the Licensed Software on an unlimited number of computers provided that Licensee is the only individual using the Licensed Software. If Licensee is an entity, Trolltech grants Licensee the right to designate one, and only one, individual within Licensee's organization who shall have the sole right to use the Licensed Software in the manner provided in this Agreement. Licensee may, at any time, but not more frequently than once every six (6) months, designate another individual to replace the current designated user by notifying Trolltech, so long as there is no more than one (1) designated user at any given time
-
-6. Licensee may not loan, rent, lease, or license the Licensed Software or any copy of it. Licensee may not alter or remove any details of ownership, copyright, trademark or other property right connected with the Licensed Software. Licensee may not modify or distribute the Licensed Software. Licensee may not distribute any software statically or dynamically linked with the Licensed Software.
-
-7. This Licensed Software is time-limited. All rights granted to Licensee in this Agreement will be void three (3) months after Licensee received the Licensed Software.
-
-8. The Licensed Software may provide links to third party libraries or code (collectively "Third Party Libraries") to implement various functions. Third Party Libraries do not comprise part of the Licensed Software. In some cases, access to Third Party Libraries may be included along with the Licensed Software delivery as a convenience for development and testing only. Such source code and libraries as are or may be listed in the ".../src/3rdparty" source tree delivered with the Licensed Software, as may be amended from time to time, do not comprise the Licensed Software. Licensee acknowledges (1) that some Third Party Libraries may require additional licensing of copyright and patents from the owners of such, and (2) that distribution of any of the Licensed Software referencing any portion of a Third Party Library may require appropriate licensing from such third parties.
-
-9. Pre-Release Code, Non-Commercial Use: The Licensed Software contains Pre-release Code that is not at the level of performance and compatibility of a final, generally available, product offering. The Licensed Software may not operate correctly and may be substantially modified prior to the first commercial shipment, if any. Trolltech is not obligated to make this or any later version of the Licensed Software commercially available. The License Software is "Not for Commercial Use" and may only be used for the purposes described in Section 5. You may not use the Licensed Software in a live operating environment where it may be relied upon to perform in the same manner as a commercially released product or with data that has not been sufficiently backed up.
-
-10. WARRANTY DISCLAIMER: THE LICENSED SOFTWARE IS LICENSED TO LICENSEE "AS IS". TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, TROLLTECH ON BEHALF OF ITSELF AND ITS SUPPLIERS, DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT WITH REGARD TO THE LICENSED SOFTWARE.
-
-11. LIMITATION OF LIABILITY: IF, TROLLTECH'S WARRANTY DISCLAIMER NOTWITHSTANDING, TROLLTECH IS HELD LIABLE TO LICENSEE, WHETHER IN CONTRACT, TORT OR ANY OTHER LEGAL THEORY, BASED ON THE LICENSED SOFTWARE, TROLLTECH'S ENTIRE LIABILITY TO LICENSEE AND LICENSEE'S EXCLUSIVE REMEDY SHALL BE, AT TROLLTECH'S OPTION, EITHER (A) RETURN OF THE PRICE LICENSEE PAID FOR THE LICENSED SOFTWARE, OR (B) REPAIR OR REPLACEMENT OF THE LICENSED SOFTWARE, PROVIDED LICENSEE RETURNS TO TROLLTECH ALL COPIES OF THE LICENSED SOFTWARE AS ORIGINALLY DELIVERED TO LICENSEE. TROLLTECH SHALL NOT UNDER ANY CIRCUMSTANCES BE LIABLE TO LICENSEE BASED ON FAILURE OF THE LICENSED SOFTWARE IF THE FAILURE RESULTED FROM ACCIDENT, ABUSE OR MISAPPLICATION, NOR SHALL TROLLTECH UNDER ANY CIRCUMSTANCES BE LIABLE FOR SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY DAMAGES, DAMAGES FOR LOSS OF PROFITS OR INTERRUPTION OF BUSINESS OR FOR LOSS OR CORRUPTION OF DATA. ANY AWARD OF DAMAGES FROM TROLLTECH TO LICENSEE SHALL NOT EXCEED THE TOTAL AMOUNT LICENSEE HAS PAID TO TROLLTECH IN CONNECTION WITH THIS AGREEMENT.
-
-12. Termination: Without prejudice to any other rights, Trolltech may terminate this Agreement if Licensee fails to comply with the terms and conditions of this Agreement. In such event, Licensee must destroy all copies of the Licensed Software and all of its components.
-
-13. Export Restrictions: Licensee agrees not to export or re-export the Licensed Software, any part thereof, or any process or service that is the direct product of the Licensed Software. Licensee may not sell, resell, or otherwise transfer for value, the Licensed Software (the foregoing collectively referred to as the "Restricted Components"), to any country, person, entity or end user subject to U.S. export restrictions. Licensee specifically agrees not to export or re-export any of the Restricted Components (i) to any country to which the U.S. has embargoed or restricted the export of goods or services, which currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria, or to any national of any such country, wherever located, who intends to transmit or transport the Restricted Components back to such country; (ii) to any end-user who Licensee knows or has reason to know will utilize the Restricted Components in the design, development or production of nuclear, chemical or biological weapons; or (iii) to any end-user who has been prohibited from participating in U.S. export transactions by any federal agency of the U.S. government. Licensee warrants and represents that neither the U.S. Commerce Department, Bureau of Export Administration nor any other U.S. federal agency has suspended, revoked or denied Licensee's export privileges.
-
-14. Government End Users: A "U.S. Government End User" shall mean any agency or entity of the government of the United States. The following shall apply if Licensee is a U.S. Government End User. The Licensed Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire the Licensed Software with only those rights set forth herein. The Licensed Software (including related documentation) is provided to U.S. Government End Users: (a) only as a commercial end item; and (b) only pursuant to this Agreement.
-
-15. Compliance with local laws: Licensee shall comply with all applicable laws and regulations relating to the Licensed Software in the United States and in other countries in which Licensee uses or modifies the Licensed Software. Without limiting the generality of the foregoing, Licensee shall not export, re-export, disclose or distribute any of the Licensed Software in violation of any applicable laws or regulations, including the export laws and regulations of the United States, and shall comply with all such laws and regulations.
-
-16. Entire Agreement: This Agreement constitutes the complete agreement between the parties and supersedes all prior or contemporaneous discussions, representations, and proposals, written or oral, with respect to the subject matters discussed herein. No modification of this Agreement will be effective unless contained in a writing executed by an authorized representative of each party. No term or condition contained in Licensee's purchase order will apply unless expressly accepted by Trolltech in writing. If any provision of the Agreement is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in this Agreement shall remain in effect.
-
-17. Governing law, legal venue: This Agreement shall be construed, interpreted and governed by the laws of the State of California, USA. Any action or proceeding arising from or relating to this Agreement shall be brought in a federal court in the Northern District of California or in the State Court in Santa Clara County, California, and each party irrevocably submits to the personal jurisdiction of any such court in any such action or proceeding. The Agreement gives Licensee specific legal rights; Licensee may have others, which vary from state to state and from country to country. Trolltech reserves all rights not specifically granted in this Agreement.
-
-
-
-
-For legal entities and/or individuals residing in any country other than Canada, the United States of America or South America:
-TROLLTECH TECHNOLOGY PREVIEW LICENSE AGREEMENT: NORWAY
-
-Agreement version 2.0
-IMPORTANT-READ CAREFULLY:
-
-1. This Trolltech Technology Preview License Agreement ("Agreement") is a legal agreement between you (either an individual or a legal entity) and Trolltech ASA ("Trolltech"), and pertains to the Trolltech software product(s) accompanying this Agreement, which include(s) computer software and may include "online" or electronic documentation, associated media, and printed materials, including the source code, example programs and the documentation ("Licensed Software").
-
-2. The Licensed Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Trolltech retains all rights not expressly granted. No title, property rights or copyright in the Licensed Software or in any modifications to the Licensed Software shall pass to the Licensee under any circumstances. The Licensed Software is licensed, not sold.
-
-3. By installing, copying, or otherwise using the Licensed Software, Licensee agrees to be bound by the terms of this Agreement. If Licensee does not agree to the terms of this Agreement, Licensee should not install, copy, or otherwise use the Licensed Software.
-
-4. Upon Licensee's acceptance of the terms and conditions of this Agreement, Trolltech grants Licensee the right to use the Licensed Software in the manner provided below.
-
-5. Trolltech grants to Licensee as an individual a personal, non-exclusive, non-transferable license to make and use copies of the Licensed Software for the sole purpose of evaluating and testing the Licensed Software and/or providing feedback to Trolltech. Licensee may install copies of the Licensed Software on an unlimited number of computers provided that Licensee is the only individual using the Licensed Software. If Licensee is an entity, Trolltech grants Licensee the right to designate one, and only one, individual within Licensee's organization who shall have the sole right to use the Licensed Software in the manner provided in this Agreement. Licensee may, at any time, but not more frequently than once every six (6) months, designate another individual to replace the current designated user by notifying Trolltech, so long as there is no more than one (1) designated user at any given time
-
-6. Licensee may not loan, rent, lease, or license the Licensed Software or any copy of it. Licensee may not alter or remove any details of ownership, copyright, trademark or other property right connected with the Licensed Software. Licensee may not modify or distribute the Licensed Software. Licensee may not distribute any software statically or dynamically linked with the Licensed Software.
-
-7. This Licensed Software is time-limited. All rights granted to Licensee in this Agreement will be void three (3) months after Licensee received the Licensed Software.
-
-8. The Licensed Software may provide links to third party libraries or code (collectively "Third Party Libraries") to implement various functions. Third Party Libraries do not comprise part of the Licensed Software. In some cases, access to Third Party Libraries may be included along with the Licensed Software delivery as a convenience for development and testing only. Such source code and libraries as are or may be listed in the ".../src/3rdparty" source tree delivered with the Licensed Software, as may be amended from time to time, do not comprise the Licensed Software. Licensee acknowledges (1) that some Third Party Libraries may require additional licensing of copyright and patents from the owners of such, and (2) that distribution of any of the Licensed Software referencing any portion of a Third Party Library may require appropriate licensing from such third parties.
-
-9. Pre-Release Code, Non-Commercial Use: The Licensed Software contains Pre-release Code that is not at the level of performance and compatibility of a final, generally available, product offering. The Licensed Software may not operate correctly and may be substantially modified prior to the first commercial shipment, if any. Trolltech is not obligated to make this or any later version of the Licensed Software commercially available. The License Software is "Not for Commercial Use" and may only be used for the purposes described in Section 5. You may not use the Licensed Software in a live operating environment where it may be relied upon to perform in the same manner as a commercially released product or with data that has not been sufficiently backed up.
-
-10. WARRANTY DISCLAIMER: THE LICENSED SOFTWARE IS LICENSED TO LICENSEE "AS IS". TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, TROLLTECH ON BEHALF OF ITSELF AND ITS SUPPLIERS, DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT WITH REGARD TO THE LICENSED SOFTWARE.
-
-11. LIMITATION OF LIABILITY: IF, TROLLTECH'S WARRANTY DISCLAIMER NOTWITHSTANDING, TROLLTECH IS HELD LIABLE TO LICENSEE, WHETHER IN CONTRACT, TORT OR ANY OTHER LEGAL THEORY, BASED ON THE LICENSED SOFTWARE, TROLLTECH'S ENTIRE LIABILITY TO LICENSEE AND LICENSEE'S EXCLUSIVE REMEDY SHALL BE, AT TROLLTECH'S OPTION, EITHER (A) RETURN OF THE PRICE LICENSEE PAID FOR THE LICENSED SOFTWARE, OR (B) REPAIR OR REPLACEMENT OF THE LICENSED SOFTWARE, PROVIDED LICENSEE RETURNS TO TROLLTECH ALL COPIES OF THE LICENSED SOFTWARE AS ORIGINALLY DELIVERED TO LICENSEE. TROLLTECH SHALL NOT UNDER ANY CIRCUMSTANCES BE LIABLE TO LICENSEE BASED ON FAILURE OF THE LICENSED SOFTWARE IF THE FAILURE RESULTED FROM ACCIDENT, ABUSE OR MISAPPLICATION, NOR SHALL TROLLTECH UNDER ANY CIRCUMSTANCES BE LIABLE FOR SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY DAMAGES, DAMAGES FOR LOSS OF PROFITS OR INTERRUPTION OF BUSINESS OR FOR LOSS OR CORRUPTION OF DATA. ANY AWARD OF DAMAGES FROM TROLLTECH TO LICENSEE SHALL NOT EXCEED THE TOTAL AMOUNT LICENSEE HAS PAID TO TROLLTECH IN CONNECTION WITH THIS AGREEMENT.
-
-12. Termination: Without prejudice to any other rights, Trolltech may terminate this Agreement if Licensee fails to comply with the terms and conditions of this Agreement. In such event, Licensee must destroy all copies of the Licensed Software and all of its components.
-
-13. Export Restrictions: Licensee agrees not to export or re-export the Licensed Software, any part thereof, or any process or service that is the direct product of the Licensed Software. Licensee may not sell, resell, or otherwise transfer for value, the Licensed Software (the foregoing collectively referred to as the "Restricted Components"), to any country, person, entity or end user subject to U.S. export restrictions. Licensee specifically agrees not to export or re-export any of the Restricted Components (i) to any country to which the U.S. has embargoed or restricted the export of goods or services, which currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria, or to any national of any such country, wherever located, who intends to transmit or transport the Restricted Components back to such country; (ii) to any end-user who Licensee knows or has reason to know will utilize the Restricted Components in the design, development or production of nuclear, chemical or biological weapons; or (iii) to any end-user who has been prohibited from participating in U.S. export transactions by any federal agency of the U.S. government. Licensee warrants and represents that neither the U.S. Commerce Department, Bureau of Export Administration nor any other U.S. federal agency has suspended, revoked or denied Licensee's export privileges.
-
-14. Government End Users: A "U.S. Government End User" shall mean any agency or entity of the government of the United States. The following shall apply if Licensee is a U.S. Government End User. The Licensed Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire the Licensed Software with only those rights set forth herein. The Licensed Software (including related documentation) is provided to U.S. Government End Users: (a) only as a commercial end item; and (b) only pursuant to this Agreement.
-
-15. Compliance with local laws: Licensee shall comply with all applicable laws and regulations relating to the Licensed Software in the United States and in other countries in which Licensee uses or modifies the Licensed Software. Without limiting the generality of the foregoing, Licensee shall not export, re-export, disclose or distribute any of the Licensed Software in violation of any applicable laws or regulations, including the export laws and regulations of the United States, and shall comply with all such laws and regulations.
-
-16. Entire Agreement: This Agreement constitutes the complete agreement between the parties and supersedes all prior or contemporaneous discussions, representations, and proposals, written or oral, with respect to the subject matters discussed herein. No modification of this Agreement will be effective unless contained in a writing executed by an authorized representative of each party. No term or condition contained in Licensee's purchase order will apply unless expressly accepted by Trolltech in writing. If any provision of the Agreement is found void or unenforceable, the remainder will remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in this Agreement shall remain in effect.
-
-17. Governing law, legal venue: This Agreement shall be construed, interpreted and governed by the laws of Norway, the legal venue to be Oslo City Court. Trolltech reserves all rights not specifically granted in this Agreement.
diff --git a/examples/testapp/config/logo.png b/examples/testapp/config/logo.png
deleted file mode 100644
index 8a9562614..000000000
--- a/examples/testapp/config/logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/testapp/config/qticon.icns b/examples/testapp/config/qticon.icns
deleted file mode 100644
index 6291dd397..000000000
--- a/examples/testapp/config/qticon.icns
+++ /dev/null
Binary files differ
diff --git a/examples/testapp/config/qticon.ico b/examples/testapp/config/qticon.ico
deleted file mode 100644
index 9e1b83f1b..000000000
--- a/examples/testapp/config/qticon.ico
+++ /dev/null
Binary files differ
diff --git a/examples/testapp/config/qticon.png b/examples/testapp/config/qticon.png
deleted file mode 100644
index d68b205cd..000000000
--- a/examples/testapp/config/qticon.png
+++ /dev/null
Binary files differ
diff --git a/examples/testapp/config/watermark.png b/examples/testapp/config/watermark.png
deleted file mode 100644
index b07780d9d..000000000
--- a/examples/testapp/config/watermark.png
+++ /dev/null
Binary files differ
diff --git a/examples/testapp/logo.png b/examples/testapp/logo.png
deleted file mode 100644
index 3d5865a60..000000000
--- a/examples/testapp/logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/testapp/mainwindow.cpp b/examples/testapp/mainwindow.cpp
deleted file mode 100644
index 016b568af..000000000
--- a/examples/testapp/mainwindow.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Installer Framework.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-**************************************************************************/
-#include "mainwindow.h"
-
-#include "componentselectiondialog.h"
-#include "updateagent.h"
-#include "updatesettingsdialog.h"
-
-#include <binaryformat.h>
-#include <errors.h>
-#include <updatesettings.h>
-
-#include <kdselfrestarter.h>
-
-#include <QAbstractButton>
-#include <QApplication>
-#include <QLabel>
-#include <QMenuBar>
-#include <QMessageBox>
-#include <QProgressDialog>
-
-using namespace QInstaller;
-using namespace QInstallerCreator;
-
-MainWindow::MainWindow(const QStringList &args, QWidget *parent)
- : QMainWindow(parent)
- , m_dialog(new UpdateSettingsDialog(this))
-{
- m_core.setUpdater();
-
- QMenu *fm = menuBar()->addMenu(QObject::tr("File"));
- fm->addAction(QObject::tr("Check for Updates"), this, SLOT(checkForUpdates()),
- QKeySequence(QLatin1String("Ctrl+U")));
- fm->addAction(QObject::tr("Update Settings"), this, SLOT(editUpdateSettings()));
- fm->addAction(QObject::tr("Quit"), QApplication::instance(), SLOT(quit()),
- QKeySequence(QLatin1String("Ctrl+Q")));
-
- QLabel *label = new QLabel(this);
- label->setWordWrap(true);
- label->setAlignment(Qt::AlignCenter);
- setCentralWidget(label);
- label->setText(QString::fromLatin1("Version: %1\n").arg(m_core.settings().applicationVersion())
- + args.join(QLatin1String(" ")));
-
- UpdateAgent *const agent = new UpdateAgent(this);
- connect(agent, SIGNAL(updatesAvailable()), this, SLOT(updatesAvailable()));
-}
-
-void MainWindow::editUpdateSettings()
-{
- connect(m_dialog, SIGNAL(checkForUpdates()), this, SLOT(checkForUpdates()));
- m_dialog->show();
-}
-
-void MainWindow::checkForUpdates()
-{
- QScopedPointer<BinaryFormatEngineHandler> handler(new BinaryFormatEngineHandler(ComponentIndex()));
- handler->setComponentIndex(QInstallerCreator::ComponentIndex());
-
- UpdateSettings settings;
- try {
- // TODO: check what this should have done
- //m_core.setTemporaryRepositories(settings.repositories());
- settings.setLastCheck(QDateTime::currentDateTime());
-
- if (!m_core.fetchRemotePackagesTree()) {
- settings.setLastResult(tr("Software Update failed."));
- QMessageBox::information(this, tr("Check for Updates"), tr("Failed to retrieve updates!"));
- return;
- }
-
- // no updates for us
- if (m_core.updaterComponents().isEmpty()) {
- QMessageBox::information(this, tr("Check for Updates"), tr("There are currently no updates "
- "available for you."));
- return;
- }
-
- // TODO: fix this, set the target directory to the actual one
- // m_core.setValue(scTargetDir, QFileInfo(updaterapp.packagesInfo()->fileName()).absolutePath());
-
- // this will automatically mark components as to get installed
- ComponentSelectionDialog componentSelection(&m_core, this);
- if (componentSelection.exec() == QDialog::Rejected)
- return;
-
- QProgressDialog dialog(this);
- dialog.setRange(0, 100);
- dialog.show();
- connect(&dialog, SIGNAL(canceled()), &m_core, SLOT(interrupt()));
- connect(&m_core, SIGNAL(installationProgressTextChanged(QString)), &dialog,
- SLOT(setLabelText(QString)));
- connect(&m_core, SIGNAL(installationProgressChanged(int)), &dialog, SLOT(setValue(int)));
- //m_core.installSelectedComponents(); //method doesn't exist anymore
- updatesInstalled();
- } catch (const QInstaller::Error &error) {
- QMessageBox::critical(this, tr("Check for Updates"), tr("Error while installing updates:\n%1")
- .arg(error.message()));
- m_core.rollBackInstallation();
- settings.setLastResult(tr("Software Update failed."));
- } catch (...) {
- QMessageBox::critical(this, tr("Check for Updates"), tr("Unknown error while installing updates."));
- m_core.rollBackInstallation();
- settings.setLastResult(tr("Software Update failed."));
- }
-}
-
-void MainWindow::updatesAvailable()
-{
- QScopedPointer<QMessageBox> box(new QMessageBox(this));
- box->setWindowTitle(tr("Updates Available"));
- box->setText(tr("Software updates are available for your computer. Do you want to install them?"));
- box->setStandardButtons(QMessageBox::Yes|QMessageBox::No);
- box->button(QMessageBox::Yes)->setText(tr("Continue"));
- box->button(QMessageBox::No)->setText(tr("Not Now"));
- box->exec();
-
- if (box && box->clickedButton() == box->button(QMessageBox::Yes))
- checkForUpdates();
-}
-
-void MainWindow::updatesInstalled()
-{
- // only ask that dumb question if a SelfUpdateOperation was executed
- if (!KDSelfRestarter::restartOnQuit()) {
- QMessageBox::information(this, tr("Updates Installed"), tr("Installation complete."));
- return;
- }
-
- QScopedPointer<QMessageBox> box(new QMessageBox(this));
- box->setWindowTitle(tr("Updates Installed"));
- box->setText(tr("Installation complete, you need to restart the application for the changes to take effect."));
- box->setStandardButtons(QMessageBox::Yes|QMessageBox::No);
- box->button(QMessageBox::Yes)->setText(tr("Restart Now"));
- box->button(QMessageBox::No)->setText(tr("Restart Later"));
- box->exec();
- if (!box)
- return;
- if (box->clickedButton() == box->button(QMessageBox::Yes))
- QCoreApplication::quit();
- else
- KDSelfRestarter::setRestartOnQuit(false);
-}
-
diff --git a/examples/testapp/mainwindow.h b/examples/testapp/mainwindow.h
deleted file mode 100644
index 7a0466dd1..000000000
--- a/examples/testapp/mainwindow.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Installer Framework.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-**************************************************************************/
-
-
-#include <packagemanagercore.h>
-#include <settings.h>
-
-#include <QMainWindow>
-
-class UpdateSettingsDialog;
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- explicit MainWindow(const QStringList &args, QWidget *parent = 0);
-
-private Q_SLOTS:
- void editUpdateSettings();
- void checkForUpdates();
- void updatesInstalled();
- void updatesAvailable();
-
-private:
- UpdateSettingsDialog *m_dialog;
-
- QInstaller::Settings m_settings;
- QInstaller::PackageManagerCore m_core;
-};
diff --git a/examples/testapp/packages/com.nokia.testapp.subcomponent.alwaysvisible/meta/package.xml b/examples/testapp/packages/com.nokia.testapp.subcomponent.alwaysvisible/meta/package.xml
deleted file mode 100644
index 5ab9c9fc9..000000000
--- a/examples/testapp/packages/com.nokia.testapp.subcomponent.alwaysvisible/meta/package.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<Package>
- <DisplayName>visible subcomponent</DisplayName>
- <Version>1337</Version>
- <ReleaseDate>2009-12-03</ReleaseDate>
- <Name>com.nokia.testapp.subcomponent.alwaysvisible</Name>
- <Default>true</Default>
-</Package>
diff --git a/examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/installscript.qs b/examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/installscript.qs
deleted file mode 100644
index 7907a268a..000000000
--- a/examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/installscript.qs
+++ /dev/null
@@ -1,4 +0,0 @@
-// constructor
-function Component()
-{
-}
diff --git a/examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/package.xml b/examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/package.xml
deleted file mode 100644
index d60cf21f4..000000000
--- a/examples/testapp/packages/com.nokia.testapp.subcomponent.virtual/meta/package.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<Package>
- <DisplayName>virtual subcomponent</DisplayName>
- <Version>1</Version>
- <ReleaseDate>2009-12-03</ReleaseDate>
- <Name>com.nokia.testapp.subcomponent.virtual</Name>
- <Virtual>true</Virtual>
- <Script>installscript.qs</Script>
-</Package>
diff --git a/examples/testapp/packages/com.nokia.testapp.subcomponent/meta/package.xml b/examples/testapp/packages/com.nokia.testapp.subcomponent/meta/package.xml
deleted file mode 100644
index 8d299684a..000000000
--- a/examples/testapp/packages/com.nokia.testapp.subcomponent/meta/package.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<Package>
- <DisplayName>subcomponents parent</DisplayName>
- <Version>1</Version>
- <ReleaseDate>2009-12-03</ReleaseDate>
- <Name>com.nokia.testapp.subcomponent</Name>
-</Package>
diff --git a/examples/testapp/packages/com.nokia.testapp/meta/installscript.js b/examples/testapp/packages/com.nokia.testapp/meta/installscript.js
deleted file mode 100644
index d1dded25b..000000000
--- a/examples/testapp/packages/com.nokia.testapp/meta/installscript.js
+++ /dev/null
@@ -1,18 +0,0 @@
-function Component()
-{
- if( installer.isUpdater() )
- {
- if( installer.value( "os" ) == "win" )
- component.addDownloadableArchive( "testapp.exe" );
- else
- component.addDownloadableArchive( "testapp.app.7z" );
- }
-}
-
-Component.prototype.createOperationsForArchive = function( archive )
-{
- component.createOperationsForArchive( archive );
-
- if( installer.isUpdater() )
- component.addOperation( "SelfRestart" );
-}
diff --git a/examples/testapp/packages/com.nokia.testapp/meta/package.xml b/examples/testapp/packages/com.nokia.testapp/meta/package.xml
deleted file mode 100644
index 2755d33f2..000000000
--- a/examples/testapp/packages/com.nokia.testapp/meta/package.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<Package>
- <DisplayName>Test App</DisplayName>
- <Description>Installs the complete Nokia SDK.</Description>
- <Version inheritVersionFrom="com.nokia.testapp.subcomponent.alwaysvisible">1</Version>
- <ReleaseDate>2009-12-03</ReleaseDate>
- <Name>com.nokia.testapp</Name>
- <Script>installscript.js</Script>
-</Package>
diff --git a/examples/testapp/testapp.pro b/examples/testapp/testapp.pro
deleted file mode 100644
index 4b2e622df..000000000
--- a/examples/testapp/testapp.pro
+++ /dev/null
@@ -1,49 +0,0 @@
-TEMPLATE = app
-INCLUDEPATH += . ..
-TARGET = testapp
-
-include(../../installerfw.pri)
-
-isEqual(QT_MAJOR_VERSION, 5) {
- QT += widgets
-}
-
-!static {
- warning("You can use this example only with a static build of Qt and IFW!")
-}
-
-DESTDIR = $$IFW_BUILD_TREE/examples/testapp/packages/com.nokia.testapp/data
-
-FORMS += \
- componentselectiondialog.ui \
- updatesettingsdialog.ui \
- updatesettingswidget.ui
-
-HEADERS += mainwindow.h \
- componentselectiondialog.h \
- updatesettingsdialog.h \
- updateagent.h \
- updatesettingswidget.h
-
-SOURCES += main.cpp \
- mainwindow.cpp \
- componentselectiondialog.cpp \
- updatesettingsdialog.cpp \
- updateagent.cpp \
- updatesettingswidget.cpp
-
-RESOURCES += testapp.qrc
-
-macx {
- QMAKE_POST_LINK = ($$IFW_APP_PATH/binarycreator -p $$IFW_SOURCE_TREE/examples/testapp/packages \
- -c $$IFW_SOURCE_TREE/examples/testapp/config/config.xml -t $$IFW_APP_PATH/installerbase \
- TestAppInstaller.app
-} win32: {
- QMAKE_POST_LINK = ($$IFW_APP_PATH/binarycreator.exe -p $$IFW_SOURCE_TREE/examples/testapp/packages \
- -c $$IFW_SOURCE_TREE/examples/testapp/config/config.xml -t $$IFW_APP_PATH/installerbase.exe \
- TestAppInstaller.exe)
-} else {
- QMAKE_POST_LINK = ($$IFW_APP_PATH/binarycreator -p $$IFW_SOURCE_TREE/examples/testapp/packages \
- -c $$IFW_SOURCE_TREE/examples/testapp/config/config.xml -t $$IFW_APP_PATH/installerbase \
- TestAppInstaller)
-}
diff --git a/examples/testapp/testapp.qrc b/examples/testapp/testapp.qrc
deleted file mode 100644
index 89c08ca9e..000000000
--- a/examples/testapp/testapp.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<RCC>
- <qresource prefix="/metadata/installer-config">
- <file>config.xml</file>
- </qresource>
- <qresource>
- <file>logo.png</file>
- </qresource>
-</RCC>
diff --git a/examples/testapp/updateagent.cpp b/examples/testapp/updateagent.cpp
deleted file mode 100644
index 0523f6da7..000000000
--- a/examples/testapp/updateagent.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Installer Framework.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-**************************************************************************/
-#include "updateagent.h"
-
-#include <binaryformatenginehandler.h>
-#include <binaryformat.h>
-#include <errors.h>
-#include <component.h>
-#include <packagemanagercore.h>
-#include <updatesettings.h>
-
-#include <QtCore/QDateTime>
-#include <QtCore/QTimer>
-
-using namespace QInstaller;
-using QInstallerCreator::ComponentIndex;
-using QInstallerCreator::BinaryFormatEngineHandler;
-
-class UpdateAgent::Private
-{
-public:
- Private(UpdateAgent *qq)
- : q(qq)
- {
- connect(&checkTimer, SIGNAL(timeout()), q, SLOT(maybeCheck()));
- checkTimer.start(1000);
- }
-
-private:
- QTimer checkTimer;
- UpdateAgent *const q;
-
-public:
- void maybeCheck()
- {
- checkTimer.stop();
-
- UpdateSettings settings;
- try {
- if (settings.updateInterval() > 0
- && settings.lastCheck().secsTo(QDateTime::currentDateTime()) >= settings.updateInterval()) {
- // update the time we last checked for updates
- settings.setLastCheck(QDateTime::currentDateTime());
-
- QScopedPointer<BinaryFormatEngineHandler> handler;
- handler.reset(new BinaryFormatEngineHandler(ComponentIndex()));
- handler->setComponentIndex(QInstallerCreator::ComponentIndex());
-
- PackageManagerCore core(QInstaller::MagicUpdaterMarker);
- // TODO: check what this should have done
- //core.setTemporaryRepositories(settings.repositories());
- if (!core.fetchRemotePackagesTree())
- throw Error(tr("Software Update failed."));
- settings.setLastResult(tr("Software Update run successfully."));
-
- QList<Component*> components = core.updaterComponents();
- // no updates available
- if (components.isEmpty())
- return;
- emit q->updatesAvailable();
- }
- } catch (...) {
- settings.setLastResult(tr("Software Update failed."));
- return;
- }
- checkTimer.start();
- }
-};
-
-UpdateAgent::UpdateAgent(QObject *parent)
- : QObject(parent),
- d(new Private(this))
-{
-}
-
-UpdateAgent::~UpdateAgent()
-{
- delete d;
-}
-
-#include "moc_updateagent.cpp"
diff --git a/examples/testapp/updatesettingsdialog.ui b/examples/testapp/updatesettingsdialog.ui
deleted file mode 100644
index 0a879257b..000000000
--- a/examples/testapp/updatesettingsdialog.ui
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>UpdateSettingsDialog</class>
- <widget class="QWidget" name="UpdateSettingsDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>447</width>
- <height>312</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Software Update Settings</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="UpdateSettingsWidget" name="widget" native="true"/>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>UpdateSettingsWidget</class>
- <extends>QWidget</extends>
- <header>updatesettingswidget.h</header>
- <container>1</container>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/examples/testapp/updatesettingswidget.cpp b/examples/testapp/updatesettingswidget.cpp
deleted file mode 100644
index b1f36304d..000000000
--- a/examples/testapp/updatesettingswidget.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Installer Framework.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-**************************************************************************/
-#include "updatesettingswidget.h"
-#include "ui_updatesettingswidget.h"
-
-#include <repository.h>
-#include <updatesettings.h>
-
-#include <QDateTime>
-#include <QStringListModel>
-
-using namespace QInstaller;
-
-class UpdateSettingsWidget::Private
-{
-public:
- Private(UpdateSettingsWidget *qq)
- : q(qq),
- initialized(false)
- {
- ui.setupUi(q);
- }
-
- void addUpdateSource()
- {
- const int newRow = model.rowCount();
- if (model.insertRow(newRow))
- ui.treeViewUpdateSources->edit(model.index(newRow, 0));
- }
-
- void removeUpdateSource()
- {
- model.removeRow(ui.treeViewUpdateSources->currentIndex().row());
- }
-
-private:
- UpdateSettingsWidget *const q;
-
-public:
- bool initialized;
- QStringListModel model;
- UpdateSettings settings;
-
- Ui::UpdateSettingsWidget ui;
-};
-
-
-// -- UpdateSettingsWidget
-
-UpdateSettingsWidget::UpdateSettingsWidget(QWidget *parent)
- : QWidget(parent),
- d(new Private(this))
-{
-}
-
-UpdateSettingsWidget::~UpdateSettingsWidget()
-{
- delete d;
-}
-
-void UpdateSettingsWidget::showEvent(QShowEvent *event)
-{
- Q_UNUSED(event)
- if (d->initialized)
- return;
-
- d->ui.checkBoxCheckForUpdates->setChecked(d->settings.updateInterval() > 0);
- d->ui.checkBoxCheckOnlyImportant->setChecked(d->settings.checkOnlyImportantUpdates());
- switch (qAbs(d->settings.updateInterval())) {
- case UpdateSettings::Daily:
- d->ui.comboBoxFrequency->setCurrentIndex(0);
- break;
- case UpdateSettings::Weekly:
- d->ui.comboBoxFrequency->setCurrentIndex(1);
- break;
- case UpdateSettings::Monthly:
- d->ui.comboBoxFrequency->setCurrentIndex(2);
- break;
- }
-
- connect(d->ui.buttonCheckNow, SIGNAL(clicked()), this, SIGNAL(checkForUpdates()));
- connect(d->ui.buttonAddUpdateSource, SIGNAL(clicked()), this, SLOT(addUpdateSource()));
- connect(d->ui.buttonRemoveUpdateSource, SIGNAL(clicked()), this, SLOT(removeUpdateSource()));
-
- QStringList reps;
- foreach (const Repository &repository, d->settings.repositories())
- reps.append(repository.url().toString());
-
- d->model.setStringList(reps);
- d->ui.treeViewUpdateSources->setModel(&d->model);
-
- d->ui.labelLastUpdateResult->clear();
- if (!d->settings.lastResult().isEmpty()) {
- d->ui.labelLastUpdateResult->setText(d->settings.lastResult() + QLatin1Char('\n')
- + d->settings.lastCheck().toString());
- }
- d->initialized = true;
-}
-
-void UpdateSettingsWidget::accept()
-{
- switch(d->ui.comboBoxFrequency->currentIndex()) {
- case 0:
- d->settings.setUpdateInterval(UpdateSettings::Daily);
- break;
- case 1:
- d->settings.setUpdateInterval(UpdateSettings::Weekly);
- break;
- case 2:
- d->settings.setUpdateInterval(UpdateSettings::Monthly);
- break;
- }
-
- if (!d->ui.checkBoxCheckForUpdates->isChecked())
- d->settings.setUpdateInterval(-d->settings.updateInterval());
- d->settings.setCheckOnlyImportantUpdates(d->ui.checkBoxCheckOnlyImportant->isChecked());
-
- QSet<Repository> repositories;
- foreach (const QString &url, d->model.stringList())
- repositories.insert(Repository(QUrl(url), false));
- d->settings.setRepositories(repositories);
-}
-
-#include "moc_updatesettingswidget.cpp"
diff --git a/examples/testapp/updatesettingswidget.ui b/examples/testapp/updatesettingswidget.ui
deleted file mode 100644
index 49525e1b9..000000000
--- a/examples/testapp/updatesettingswidget.ui
+++ /dev/null
@@ -1,286 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>UpdateSettingsWidget</class>
- <widget class="QWidget" name="UpdateSettingsWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>438</width>
- <height>247</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Software Update Settings</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QTabWidget" name="tabWidget">
- <widget class="QWidget" name="tab">
- <attribute name="title">
- <string>Scheduled Check</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>16</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="1" colspan="2">
- <widget class="QCheckBox" name="checkBoxCheckForUpdates">
- <property name="text">
- <string>Check for updates:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QComboBox" name="comboBoxFrequency">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <item>
- <property name="text">
- <string>Daily</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Weekly</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Monthly</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="0" column="4">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>16</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="1">
- <widget class="QWidget" name="widget" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>8</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>8</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="2" colspan="2">
- <widget class="QCheckBox" name="checkBoxCheckOnlyImportant">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Check only for important updates</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>11</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="2">
- <widget class="QPushButton" name="buttonCheckNow">
- <property name="text">
- <string>Check Now</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="labelLastCheck">
- <property name="text">
- <string>Last check:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- </widget>
- </item>
- <item row="1" column="2" colspan="2">
- <widget class="QLabel" name="labelLastUpdateResult">
- <property name="text">
- <string>Software Update ran successfully.
-Monday, 2009 december 16 20.36</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>1</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="4">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>1</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>23</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab_2">
- <attribute name="title">
- <string>Update Sources</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0" colspan="3">
- <widget class="QTreeView" name="treeViewUpdateSources">
- <property name="rootIsDecorated">
- <bool>false</bool>
- </property>
- <property name="headerHidden">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QToolButton" name="buttonAddUpdateSource">
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>25</height>
- </size>
- </property>
- <property name="text">
- <string>+</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QToolButton" name="buttonRemoveUpdateSource">
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>25</height>
- </size>
- </property>
- <property name="text">
- <string>-</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>checkBoxCheckForUpdates</sender>
- <signal>toggled(bool)</signal>
- <receiver>comboBoxFrequency</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>179</x>
- <y>59</y>
- </hint>
- <hint type="destinationlabel">
- <x>293</x>
- <y>61</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>checkBoxCheckForUpdates</sender>
- <signal>toggled(bool)</signal>
- <receiver>checkBoxCheckOnlyImportant</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>135</x>
- <y>64</y>
- </hint>
- <hint type="destinationlabel">
- <x>149</x>
- <y>91</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/tutorial/config/config.xml b/examples/tutorial/config/config.xml
index 235434776..6ffb2e3e8 100644
--- a/examples/tutorial/config/config.xml
+++ b/examples/tutorial/config/config.xml
@@ -5,5 +5,5 @@
<Title>Your application Installer</Title>
<Publisher>Your vendor</Publisher>
<StartMenuDir>Super App</StartMenuDir>
- <TargetDir>@rootDir@InstallationDirectory</TargetDir>
+ <TargetDir>@RootDir@InstallationDirectory</TargetDir>
</Installer>
diff --git a/examples/tutorial/packages/com.vendor.product/meta/installscript.qs b/examples/tutorial/packages/com.vendor.product/meta/installscript.qs
index e857dae4d..c97f991c3 100644
--- a/examples/tutorial/packages/com.vendor.product/meta/installscript.qs
+++ b/examples/tutorial/packages/com.vendor.product/meta/installscript.qs
@@ -1,3 +1,44 @@
+/**************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
function Component()
{
// constructor
diff --git a/installerfw.pri b/installerfw.pri
index f8ba0efb8..0271433cd 100644
--- a/installerfw.pri
+++ b/installerfw.pri
@@ -3,7 +3,7 @@
}
IFW_PRI_INCLUDED = 1
-IFW_VERSION = 1.3.1
+IFW_VERSION = 1.4.1
IFW_REPOSITORY_FORMAT_VERSION = 1.0.0
@@ -39,9 +39,11 @@ IFW_LIB_PATH = $$IFW_BUILD_TREE/lib
RCC = $$cleanPath($$toNativeSeparators($$[QT_INSTALL_BINS]/rcc))
LRELEASE = $$cleanPath($$toNativeSeparators($$[QT_INSTALL_BINS]/lrelease))
+QMAKE_BINARY = $$cleanPath($$toNativeSeparators($$[QT_INSTALL_BINS]/qmake))
win32:RCC = $${RCC}.exe
win32:LRELEASE = $${LRELEASE}.exe
+win32:QMAKE_BINARY = $${QMAKE_BINARY}.exe
win32-g++*:QMAKE_CXXFLAGS += -Wno-attributes
INCLUDEPATH += \
@@ -54,6 +56,9 @@ unix:INCLUDEPATH += $$IFW_SOURCE_TREE/src/libs/7zip/unix/CPP
LIBS += -L$$IFW_LIB_PATH
# The order is important. The linker needs to parse archives in reversed dependency order.
equals(TEMPLATE, app):LIBS += -linstaller
+win32:equals(TEMPLATE, app) {
+ LIBS += -luser32
+}
unix:!macx:LIBS += -lutil
macx:LIBS += -framework Carbon -framework Security
@@ -98,12 +103,15 @@ CONFIG += depend_includepath
GIT_SHA1 = $$system(git rev-list --abbrev-commit -n1 HEAD)
DEFINES += QT_NO_CAST_FROM_ASCII "_GIT_SHA1_=$$GIT_SHA1" IFW_VERSION=$$IFW_VERSION
+DEFINES += IFW_REPOSITORY_FORMAT_VERSION=$$IFW_REPOSITORY_FORMAT_VERSION
static {
LIBS += -l7z
win32-g++*: LIBS += -lmpr -luuid
- macx:equals(TEMPLATE, app):CONFIG -= app_bundle
- win32:exists($$IFW_LIB_PATH/installer.lib):POST_TARGETDEPS += $$IFW_LIB_PATH/installer.lib
- unix:exists($$IFW_LIB_PATH/libinstaller.a):POST_TARGETDEPS += $$IFW_LIB_PATH/libinstaller.a
+ equals(TEMPLATE, app) {
+ win32-msvc*:POST_TARGETDEPS += $$IFW_LIB_PATH/installer.lib $$IFW_LIB_PATH/7z.lib
+ win32-g++*:POST_TARGETDEPS += $$IFW_LIB_PATH/libinstaller.a $$IFW_LIB_PATH/lib7z.a
+ unix:POST_TARGETDEPS += $$IFW_LIB_PATH/libinstaller.a $$IFW_LIB_PATH/lib7z.a
+ }
}
diff --git a/installerfw.pro b/installerfw.pro
index 2f0b653d7..1f17d1dc9 100644
--- a/installerfw.pro
+++ b/installerfw.pro
@@ -1,6 +1,6 @@
CONFIG += ordered
TEMPLATE = subdirs
-SUBDIRS += src examples tests tools
+SUBDIRS += src tests tools
include (installerfw.pri)
include (doc/doc.pri)
diff --git a/no_app_bundle.pri b/no_app_bundle.pri
new file mode 100644
index 000000000..631317193
--- /dev/null
+++ b/no_app_bundle.pri
@@ -0,0 +1,28 @@
+!isEmpty(NO_APP_BUNDLE_PRI_INCLUDED) {
+ error("no_app_bundle.pri already included")
+}
+NO_APP_BUNDLE_PRI_INCLUDED = 1
+
+equals(TEMPLATE, app):CONFIG -= app_bundle
+
+isEqual(QT_MAJOR_VERSION, 4):static:contains(QT, gui) {
+ isEmpty(DESTDIR) {
+ MY_DEST_DIR=$$OUT_PWD
+ } else {
+ MY_DEST_DIR=$$DESTDIR
+ }
+
+ !exists($$(MY_DEST_DIR)/qt_menu.nib) {
+ # try to get the qt_menu.nib path from the environment variable
+ isEmpty(QT_MENU_NIB_DIR): QT_MENU_NIB_DIR = $$(QT_MENU_NIB_DIR)
+
+ # everything which has not the IFW_APP_PATH as target can try to copy it from there
+ exists($$IFW_APP_PATH/qt_menu.nib):QT_MENU_NIB_DIR=$$IFW_APP_PATH/qt_menu.nib
+
+ isEmpty(QT_MENU_NIB_DIR) {
+ warning(Please call qmake with QT_MENU_NIB_DIR=<YOUR_QT_SRC_DIR>/src/gui/mac/qt_menu.nib)
+ } else {
+ system($$QMAKE_COPY -r $$quote($$QT_MENU_NIB_DIR) $$quote($$MY_DEST_DIR))
+ }
+ }
+}
diff --git a/src/libs/7zip/7zip.pri b/src/libs/7zip/7zip.pri
index 22140c372..ded5793f4 100644
--- a/src/libs/7zip/7zip.pri
+++ b/src/libs/7zip/7zip.pri
@@ -1,15 +1,17 @@
win32 {
7ZIP_BASE=$$PWD/win
- INCLUDEPATH += $$7ZIP_BASE/CPP
- DEFINES += WIN_LONG_PATH _UNICODE
+ INCLUDEPATH += $$7ZIP_BASE/C $$7ZIP_BASE/CPP
+ DEFINES += WIN_LONG_PATH _UNICODE _NO_CRYPTO
}
unix {
7ZIP_BASE=$$PWD/unix
- INCLUDEPATH += $$7ZIP_BASE/CPP \
- $$7ZIP_BASE/CPP/myWindows \
+ INCLUDEPATH += \
+ $$7ZIP_BASE/C \
+ $$7ZIP_BASE/CPP \
+ $$7ZIP_BASE/CPP/myWindows \
$$7ZIP_BASE/CPP/include_windows
macx:DEFINES += ENV_MACOSX
- DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE NDEBUG _REENTRANT ENV_UNIX UNICODE _UNICODE
+ DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE NDEBUG _REENTRANT ENV_UNIX UNICODE _UNICODE _NO_CRYPTO
}
diff --git a/src/libs/7zip/7zip.pro b/src/libs/7zip/7zip.pro
index d09cbf9a5..01b69dad2 100644
--- a/src/libs/7zip/7zip.pro
+++ b/src/libs/7zip/7zip.pro
@@ -1,8 +1,7 @@
-include(../../../installerfw.pri)
-
-QT =
+QT = core
TARGET = 7z
TEMPLATE = lib
+include(../../../installerfw.pri)
INCLUDEPATH += . ..
CONFIG += staticlib
DESTDIR = $$IFW_LIB_PATH
diff --git a/src/libs/7zip/installer_framework_changes.txt b/src/libs/7zip/installer_framework_changes.txt
new file mode 100644
index 000000000..6b5839208
--- /dev/null
+++ b/src/libs/7zip/installer_framework_changes.txt
@@ -0,0 +1,54 @@
+There are deleted files and very small changes to get the integration process of new versions very simple.
+--diff-filter=M means "modified" and
+--diff-filter=D means "deleted" files
+
+=== output of: git diff --diff-filter=M ===
+
+diff --git a/CPP/7zip/Common/RegisterArc.h b/CPP/7zip/Common/RegisterArc.h
+index bc2a034..9b8cbd3 100644
+--- a/CPP/7zip/Common/RegisterArc.h
++++ b/CPP/7zip/Common/RegisterArc.h
+@@ -27,6 +27,6 @@ void RegisterArc(const CArcInfo *arcInfo);
+
+ #define REGISTER_ARC(x) struct REGISTER_ARC_NAME(x) { \
+ REGISTER_ARC_NAME(x)() { RegisterArc(&g_ArcInfo); }}; \
+- static REGISTER_ARC_NAME(x) g_RegisterArc;
+-
++ static REGISTER_ARC_NAME(x) g_RegisterArc; \
++ void registerArc##x() { static REGISTER_ARC_NAME(x) g_RegisterArc; }
+ #endif
+diff --git a/CPP/7zip/Common/RegisterCodec.h b/CPP/7zip/Common/RegisterCodec.h
+index 786b4a4..d53c434 100644
+--- a/CPP/7zip/Common/RegisterCodec.h
++++ b/CPP/7zip/Common/RegisterCodec.h
+@@ -22,12 +22,13 @@ void RegisterCodec(const CCodecInfo *codecInfo);
+
+ #define REGISTER_CODEC(x) struct REGISTER_CODEC_NAME(x) { \
+ REGISTER_CODEC_NAME(x)() { RegisterCodec(&g_CodecInfo); }}; \
+- static REGISTER_CODEC_NAME(x) g_RegisterCodec;
++ static REGISTER_CODEC_NAME(x) g_RegisterCodec; \
++ void registerCodec##x() { static REGISTER_CODEC_NAME(x) g_RegisterCodecs; }
+
+ #define REGISTER_CODECS_NAME(x) CRegisterCodecs ## x
+ #define REGISTER_CODECS(x) struct REGISTER_CODECS_NAME(x) { \
+ REGISTER_CODECS_NAME(x)() { for (int i = 0; i < sizeof(g_CodecsInfo) / sizeof(g_CodecsInfo[0]); i++) \
+ RegisterCodec(&g_CodecsInfo[i]); }}; \
+- static REGISTER_CODECS_NAME(x) g_RegisterCodecs;
+-
++ static REGISTER_CODECS_NAME(x) g_RegisterCodecs; \
++ void registerCodec##x() { static REGISTER_CODECS_NAME(x) g_RegisterCodecs; }
+ #endif
+diff --git a/CPP/Common/MyString.h b/CPP/Common/MyString.h
+index eb3c52d..f483e39 100644
+--- a/CPP/Common/MyString.h
++++ b/CPP/Common/MyString.h
+@@ -7,6 +7,8 @@
+
+ #include "MyVector.h"
+
++#include <windows.h>
++
+ template <class T>
+ inline int MyStringLen(const T *s)
+ {
+
diff --git a/src/libs/7zip/unix/DOCS/7zC.txt b/src/libs/7zip/unix/7zC.txt
index 5d5d06d7b..5d5d06d7b 100644
--- a/src/libs/7zip/unix/DOCS/7zC.txt
+++ b/src/libs/7zip/unix/7zC.txt
diff --git a/src/libs/7zip/win/DOC/7zFormat.txt b/src/libs/7zip/unix/7zFormat.txt
index 55b52b1b9..e1cf7380d 100644
--- a/src/libs/7zip/win/DOC/7zFormat.txt
+++ b/src/libs/7zip/unix/7zFormat.txt
@@ -1,5 +1,5 @@
-7z Format description (4.59)
-----------------------------
+7z Format description (2.30 Beta 25)
+-----------------------------------
This file contains description of 7z archive format.
7z archive can contain files compressed with any method.
@@ -126,43 +126,40 @@ UINT64 means real UINT64 encoded with the following scheme:
Property IDs
------------
-0x00 = kEnd
+0x00 = kEnd,
-0x01 = kHeader
+0x01 = kHeader,
-0x02 = kArchiveProperties
+0x02 = kArchiveProperties,
-0x03 = kAdditionalStreamsInfo
-0x04 = kMainStreamsInfo
-0x05 = kFilesInfo
+0x03 = kAdditionalStreamsInfo,
+0x04 = kMainStreamsInfo,
+0x05 = kFilesInfo,
-0x06 = kPackInfo
-0x07 = kUnPackInfo
-0x08 = kSubStreamsInfo
+0x06 = kPackInfo,
+0x07 = kUnPackInfo,
+0x08 = kSubStreamsInfo,
-0x09 = kSize
-0x0A = kCRC
+0x09 = kSize,
+0x0A = kCRC,
-0x0B = kFolder
+0x0B = kFolder,
-0x0C = kCodersUnPackSize
-0x0D = kNumUnPackStream
+0x0C = kCodersUnPackSize,
+0x0D = kNumUnPackStream,
-0x0E = kEmptyStream
-0x0F = kEmptyFile
-0x10 = kAnti
+0x0E = kEmptyStream,
+0x0F = kEmptyFile,
+0x10 = kAnti,
-0x11 = kName
-0x12 = kCTime
-0x13 = kATime
-0x14 = kMTime
-0x15 = kWinAttributes
-0x16 = kComment
+0x11 = kName,
+0x12 = kCreationTime,
+0x13 = kLastAccessTime,
+0x14 = kLastWriteTime,
+0x15 = kWinAttributes,
+0x16 = kComment,
-0x17 = kEncodedHeader
-
-0x18 = kStartPos
-0x19 = kDummy
+0x17 = kEncodedHeader,
7z format headers
@@ -241,19 +238,24 @@ Folder
{
BYTE
{
- 0:3 CodecIdSize
- 4: Is Complex Coder
- 5: There Are Attributes
- 6: Reserved
- 7: There are more alternative methods. (Not used anymore, must be 0).
+ 0:3 DecompressionMethod.IDSize
+ 4:
+ 0 - IsSimple
+ 1 - Is not simple
+ 5:
+ 0 - No Attributes
+ 1 - There Are Attributes
+ 7:
+ 0 - Last Method in Alternative_Method_List
+ 1 - There are more alternative methods
}
- BYTE CodecId[CodecIdSize]
- if (Is Complex Coder)
+ BYTE DecompressionMethod.ID[DecompressionMethod.IDSize]
+ if (!IsSimple)
{
UINT64 NumInStreams;
UINT64 NumOutStreams;
}
- if (There Are Attributes)
+ if (DecompressionMethod[0] != 0)
{
UINT64 PropertiesSize
BYTE Properties[PropertiesSize]
@@ -385,9 +387,9 @@ FilesInfo
for(EmptyStreams)
BIT IsAntiFile
- case kCTime: (0x12)
- case kATime: (0x13)
- case kMTime: (0x14)
+ case kCreationTime: (0x12)
+ case kLastAccessTime: (0x13)
+ case kLastWriteTime: (0x14)
BYTE AllAreDefined
if (AllAreDefined == 0)
{
@@ -399,7 +401,7 @@ FilesInfo
UINT64 DataIndex
[]
for(Definded Items)
- UINT64 Time
+ UINT32 Time
[]
kNames: (0x11)
diff --git a/src/libs/7zip/unix/C/7zCrcT8.c b/src/libs/7zip/unix/C/7zCrcT8.c
deleted file mode 100644
index cd80e262b..000000000
--- a/src/libs/7zip/unix/C/7zCrcT8.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 7zCrcT8.c -- CRC32 calculation with 8 tables
-2008-03-19
-Igor Pavlov
-Public domain */
-
-#include "7zCrc.h"
-
-#define kCrcPoly 0xEDB88320
-#define CRC_NUM_TABLES 8
-
-UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
-
-void MY_FAST_CALL CrcGenerateTable()
-{
- UInt32 i;
- for (i = 0; i < 256; i++)
- {
- UInt32 r = i;
- int j;
- for (j = 0; j < 8; j++)
- r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
- g_CrcTable[i] = r;
- }
- #if CRC_NUM_TABLES > 1
- for (; i < 256 * CRC_NUM_TABLES; i++)
- {
- UInt32 r = g_CrcTable[i - 256];
- g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
- }
- #endif
-}
-
-UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
-
-UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
-{
- return CrcUpdateT8(v, data, size, g_CrcTable);
-}
-
-UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
-{
- return CrcUpdateT8(CRC_INIT_VAL, data, size, g_CrcTable) ^ 0xFFFFFFFF;
-}
diff --git a/src/libs/7zip/unix/C/Aes.c b/src/libs/7zip/unix/C/Aes.c
deleted file mode 100644
index 1bb658793..000000000
--- a/src/libs/7zip/unix/C/Aes.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/* Aes.c -- AES encryption / decryption
-2009-11-23 : Igor Pavlov : Public domain */
-
-#include "Aes.h"
-#include "CpuArch.h"
-
-static UInt32 T[256 * 4];
-static Byte Sbox[256] = {
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16};
-
-void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks);
-void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks);
-void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks);
-
-void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
-void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
-void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
-
-AES_CODE_FUNC g_AesCbc_Encode;
-AES_CODE_FUNC g_AesCbc_Decode;
-AES_CODE_FUNC g_AesCtr_Code;
-
-static UInt32 D[256 * 4];
-static Byte InvS[256];
-
-static Byte Rcon[11] = { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 };
-
-#define xtime(x) ((((x) << 1) ^ (((x) & 0x80) != 0 ? 0x1B : 0)) & 0xFF)
-
-#define Ui32(a0, a1, a2, a3) ((UInt32)(a0) | ((UInt32)(a1) << 8) | ((UInt32)(a2) << 16) | ((UInt32)(a3) << 24))
-
-#define gb0(x) ( (x) & 0xFF)
-#define gb1(x) (((x) >> ( 8)) & 0xFF)
-#define gb2(x) (((x) >> (16)) & 0xFF)
-#define gb3(x) (((x) >> (24)) & 0xFF)
-
-void AesGenTables(void)
-{
- unsigned i;
- for (i = 0; i < 256; i++)
- InvS[Sbox[i]] = (Byte)i;
- for (i = 0; i < 256; i++)
- {
- {
- UInt32 a1 = Sbox[i];
- UInt32 a2 = xtime(a1);
- UInt32 a3 = a2 ^ a1;
- T[ i] = Ui32(a2, a1, a1, a3);
- T[0x100 + i] = Ui32(a3, a2, a1, a1);
- T[0x200 + i] = Ui32(a1, a3, a2, a1);
- T[0x300 + i] = Ui32(a1, a1, a3, a2);
- }
- {
- UInt32 a1 = InvS[i];
- UInt32 a2 = xtime(a1);
- UInt32 a4 = xtime(a2);
- UInt32 a8 = xtime(a4);
- UInt32 a9 = a8 ^ a1;
- UInt32 aB = a8 ^ a2 ^ a1;
- UInt32 aD = a8 ^ a4 ^ a1;
- UInt32 aE = a8 ^ a4 ^ a2;
- D[ i] = Ui32(aE, a9, aD, aB);
- D[0x100 + i] = Ui32(aB, aE, a9, aD);
- D[0x200 + i] = Ui32(aD, aB, aE, a9);
- D[0x300 + i] = Ui32(a9, aD, aB, aE);
- }
- }
- g_AesCbc_Encode = AesCbc_Encode;
- g_AesCbc_Decode = AesCbc_Decode;
- g_AesCtr_Code = AesCtr_Code;
-/* FIXME
- #ifdef MY_CPU_X86_OR_AMD64
- if (CPU_Is_Aes_Supported())
- {
- g_AesCbc_Encode = AesCbc_Encode_Intel;
- g_AesCbc_Decode = AesCbc_Decode_Intel;
- g_AesCtr_Code = AesCtr_Code_Intel;
- }
- #endif
-*/
-}
-
-#define HT(i, x, s) (T + (x << 8))[gb ## x(s[(i + x) & 3])]
-#define HT4(m, i, s, p) m[i] = \
- HT(i, 0, s) ^ \
- HT(i, 1, s) ^ \
- HT(i, 2, s) ^ \
- HT(i, 3, s) ^ w[p + i]
-/* such order (2031) in HT16 is for VC6/K8 speed optimization) */
-#define HT16(m, s, p) \
- HT4(m, 2, s, p); \
- HT4(m, 0, s, p); \
- HT4(m, 3, s, p); \
- HT4(m, 1, s, p); \
-
-#define FT(i, x) Sbox[gb ## x(m[(i + x) & 3])]
-#define FT4(i) dest[i] = Ui32(FT(i, 0), FT(i, 1), FT(i, 2), FT(i, 3)) ^ w[i];
-
-#define HD(i, x, s) (D + (x << 8))[gb ## x(s[(i - x) & 3])]
-#define HD4(m, i, s, p) m[i] = \
- HD(i, 0, s) ^ \
- HD(i, 1, s) ^ \
- HD(i, 2, s) ^ \
- HD(i, 3, s) ^ w[p + i];
-/* such order (0231) in HD16 is for VC6/K8 speed optimization) */
-#define HD16(m, s, p) \
- HD4(m, 0, s, p); \
- HD4(m, 2, s, p); \
- HD4(m, 3, s, p); \
- HD4(m, 1, s, p); \
-
-#define FD(i, x) InvS[gb ## x(m[(i - x) & 3])]
-#define FD4(i) dest[i] = Ui32(FD(i, 0), FD(i, 1), FD(i, 2), FD(i, 3)) ^ w[i];
-
-void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *w, const Byte *key, unsigned keySize)
-{
- unsigned i, wSize;
- wSize = keySize + 28;
- keySize /= 4;
- w[0] = ((UInt32)keySize / 2) + 3;
- w += 4;
-
- for (i = 0; i < keySize; i++, key += 4)
- w[i] = GetUi32(key);
-
- for (; i < wSize; i++)
- {
- UInt32 t = w[i - 1];
- unsigned rem = i % keySize;
- if (rem == 0)
- t = Ui32(Sbox[gb1(t)] ^ Rcon[i / keySize], Sbox[gb2(t)], Sbox[gb3(t)], Sbox[gb0(t)]);
- else if (keySize > 6 && rem == 4)
- t = Ui32(Sbox[gb0(t)], Sbox[gb1(t)], Sbox[gb2(t)], Sbox[gb3(t)]);
- w[i] = w[i - keySize] ^ t;
- }
-}
-
-void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *w, const Byte *key, unsigned keySize)
-{
- unsigned i, num;
- Aes_SetKey_Enc(w, key, keySize);
- num = keySize + 20;
- w += 8;
- for (i = 0; i < num; i++)
- {
- UInt32 r = w[i];
- w[i] =
- D[ Sbox[gb0(r)]] ^
- D[0x100 + Sbox[gb1(r)]] ^
- D[0x200 + Sbox[gb2(r)]] ^
- D[0x300 + Sbox[gb3(r)]];
- }
-}
-
-/* Aes_Encode and Aes_Decode functions work with little-endian words.
- src and dest are pointers to 4 UInt32 words.
- arc and dest can point to same block */
-
-static void Aes_Encode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
-{
- UInt32 s[4];
- UInt32 m[4];
- UInt32 numRounds2 = w[0];
- w += 4;
- s[0] = src[0] ^ w[0];
- s[1] = src[1] ^ w[1];
- s[2] = src[2] ^ w[2];
- s[3] = src[3] ^ w[3];
- w += 4;
- for (;;)
- {
- HT16(m, s, 0);
- if (--numRounds2 == 0)
- break;
- HT16(s, m, 4);
- w += 8;
- }
- w += 4;
- FT4(0); FT4(1); FT4(2); FT4(3);
-}
-
-static void Aes_Decode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
-{
- UInt32 s[4];
- UInt32 m[4];
- UInt32 numRounds2 = w[0];
- w += 4 + numRounds2 * 8;
- s[0] = src[0] ^ w[0];
- s[1] = src[1] ^ w[1];
- s[2] = src[2] ^ w[2];
- s[3] = src[3] ^ w[3];
- for (;;)
- {
- w -= 8;
- HD16(m, s, 4);
- if (--numRounds2 == 0)
- break;
- HD16(s, m, 0);
- }
- FD4(0); FD4(1); FD4(2); FD4(3);
-}
-
-void AesCbc_Init(UInt32 *p, const Byte *iv)
-{
- unsigned i;
- for (i = 0; i < 4; i++)
- p[i] = GetUi32(iv + i * 4);
-}
-
-void MY_FAST_CALL AesCbc_Encode(UInt32 *p, Byte *data, size_t numBlocks)
-{
- for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
- {
- p[0] ^= GetUi32(data);
- p[1] ^= GetUi32(data + 4);
- p[2] ^= GetUi32(data + 8);
- p[3] ^= GetUi32(data + 12);
-
- Aes_Encode(p + 4, p, p);
-
- SetUi32(data, p[0]);
- SetUi32(data + 4, p[1]);
- SetUi32(data + 8, p[2]);
- SetUi32(data + 12, p[3]);
- }
-}
-
-void MY_FAST_CALL AesCbc_Decode(UInt32 *p, Byte *data, size_t numBlocks)
-{
- UInt32 in[4], out[4];
- for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
- {
- in[0] = GetUi32(data);
- in[1] = GetUi32(data + 4);
- in[2] = GetUi32(data + 8);
- in[3] = GetUi32(data + 12);
-
- Aes_Decode(p + 4, out, in);
-
- SetUi32(data, p[0] ^ out[0]);
- SetUi32(data + 4, p[1] ^ out[1]);
- SetUi32(data + 8, p[2] ^ out[2]);
- SetUi32(data + 12, p[3] ^ out[3]);
-
- p[0] = in[0];
- p[1] = in[1];
- p[2] = in[2];
- p[3] = in[3];
- }
-}
-
-void MY_FAST_CALL AesCtr_Code(UInt32 *p, Byte *data, size_t numBlocks)
-{
- for (; numBlocks != 0; numBlocks--)
- {
- UInt32 temp[4];
- Byte buf[16];
- int i;
- if (++p[0] == 0)
- p[1]++;
- Aes_Encode(p + 4, temp, p);
- SetUi32(buf, temp[0]);
- SetUi32(buf + 4, temp[1]);
- SetUi32(buf + 8, temp[2]);
- SetUi32(buf + 12, temp[3]);
- for (i = 0; i < 16; i++)
- *data++ ^= buf[i];
- }
-}
diff --git a/src/libs/7zip/unix/C/Aes.h b/src/libs/7zip/unix/C/Aes.h
deleted file mode 100644
index c9b0677c8..000000000
--- a/src/libs/7zip/unix/C/Aes.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Aes.h -- AES encryption / decryption
-2009-11-23 : Igor Pavlov : Public domain */
-
-#ifndef __AES_H
-#define __AES_H
-
-#include "Types.h"
-
-EXTERN_C_BEGIN
-
-#define AES_BLOCK_SIZE 16
-
-/* Call AesGenTables one time before other AES functions */
-void AesGenTables(void);
-
-/* UInt32 pointers must be 16-byte aligned */
-
-/* 16-byte (4 * 32-bit words) blocks: 1 (IV) + 1 (keyMode) + 15 (AES-256 roundKeys) */
-#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4)
-
-/* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */
-/* keySize = 16 or 24 or 32 (bytes) */
-typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize);
-void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize);
-void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize);
-
-/* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */
-void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */
-/* data - 16-byte aligned pointer to data */
-/* numBlocks - the number of 16-byte blocks in data array */
-typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks);
-extern AES_CODE_FUNC g_AesCbc_Encode;
-extern AES_CODE_FUNC g_AesCbc_Decode;
-extern AES_CODE_FUNC g_AesCtr_Code;
-
-EXTERN_C_END
-
-#endif
diff --git a/src/libs/7zip/unix/C/BwtSort.c b/src/libs/7zip/unix/C/BwtSort.c
deleted file mode 100644
index 207305072..000000000
--- a/src/libs/7zip/unix/C/BwtSort.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/* BwtSort.c -- BWT block sorting
-2008-08-17
-Igor Pavlov
-Public domain */
-
-#include "BwtSort.h"
-#include "Sort.h"
-
-/* #define BLOCK_SORT_USE_HEAP_SORT */
-
-#define NO_INLINE MY_FAST_CALL
-
-/* Don't change it !!! */
-#define kNumHashBytes 2
-#define kNumHashValues (1 << (kNumHashBytes * 8))
-
-/* kNumRefBitsMax must be < (kNumHashBytes * 8) = 16 */
-#define kNumRefBitsMax 12
-
-#define BS_TEMP_SIZE kNumHashValues
-
-#ifdef BLOCK_SORT_EXTERNAL_FLAGS
-
-/* 32 Flags in UInt32 word */
-#define kNumFlagsBits 5
-#define kNumFlagsInWord (1 << kNumFlagsBits)
-#define kFlagsMask (kNumFlagsInWord - 1)
-#define kAllFlags 0xFFFFFFFF
-
-#else
-
-#define kNumBitsMax 20
-#define kIndexMask ((1 << kNumBitsMax) - 1)
-#define kNumExtraBits (32 - kNumBitsMax)
-#define kNumExtra0Bits (kNumExtraBits - 2)
-#define kNumExtra0Mask ((1 << kNumExtra0Bits) - 1)
-
-#define SetFinishedGroupSize(p, size) \
- { *(p) |= ((((size) - 1) & kNumExtra0Mask) << kNumBitsMax); \
- if ((size) > (1 << kNumExtra0Bits)) { \
- *(p) |= 0x40000000; *((p) + 1) |= ((((size) - 1)>> kNumExtra0Bits) << kNumBitsMax); } } \
-
-static void SetGroupSize(UInt32 *p, UInt32 size)
-{
- if (--size == 0)
- return;
- *p |= 0x80000000 | ((size & kNumExtra0Mask) << kNumBitsMax);
- if (size >= (1 << kNumExtra0Bits))
- {
- *p |= 0x40000000;
- p[1] |= ((size >> kNumExtra0Bits) << kNumBitsMax);
- }
-}
-
-#endif
-
-/*
-SortGroup - is recursive Range-Sort function with HeapSort optimization for small blocks
- "range" is not real range. It's only for optimization.
-returns: 1 - if there are groups, 0 - no more groups
-*/
-
-UInt32 NO_INLINE SortGroup(UInt32 BlockSize, UInt32 NumSortedBytes, UInt32 groupOffset, UInt32 groupSize, int NumRefBits, UInt32 *Indices
- #ifndef BLOCK_SORT_USE_HEAP_SORT
- , UInt32 left, UInt32 range
- #endif
- )
-{
- UInt32 *ind2 = Indices + groupOffset;
- UInt32 *Groups;
- if (groupSize <= 1)
- {
- /*
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- SetFinishedGroupSize(ind2, 1);
- #endif
- */
- return 0;
- }
- Groups = Indices + BlockSize + BS_TEMP_SIZE;
- if (groupSize <= ((UInt32)1 << NumRefBits)
- #ifndef BLOCK_SORT_USE_HEAP_SORT
- && groupSize <= range
- #endif
- )
- {
- UInt32 *temp = Indices + BlockSize;
- UInt32 j;
- UInt32 mask, thereAreGroups, group, cg;
- {
- UInt32 gPrev;
- UInt32 gRes = 0;
- {
- UInt32 sp = ind2[0] + NumSortedBytes;
- if (sp >= BlockSize) sp -= BlockSize;
- gPrev = Groups[sp];
- temp[0] = (gPrev << NumRefBits);
- }
-
- for (j = 1; j < groupSize; j++)
- {
- UInt32 sp = ind2[j] + NumSortedBytes;
- UInt32 g;
- if (sp >= BlockSize) sp -= BlockSize;
- g = Groups[sp];
- temp[j] = (g << NumRefBits) | j;
- gRes |= (gPrev ^ g);
- }
- if (gRes == 0)
- {
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- SetGroupSize(ind2, groupSize);
- #endif
- return 1;
- }
- }
-
- HeapSort(temp, groupSize);
- mask = ((1 << NumRefBits) - 1);
- thereAreGroups = 0;
-
- group = groupOffset;
- cg = (temp[0] >> NumRefBits);
- temp[0] = ind2[temp[0] & mask];
-
- {
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- UInt32 *Flags = Groups + BlockSize;
- #else
- UInt32 prevGroupStart = 0;
- #endif
-
- for (j = 1; j < groupSize; j++)
- {
- UInt32 val = temp[j];
- UInt32 cgCur = (val >> NumRefBits);
-
- if (cgCur != cg)
- {
- cg = cgCur;
- group = groupOffset + j;
-
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- {
- UInt32 t = group - 1;
- Flags[t >> kNumFlagsBits] &= ~(1 << (t & kFlagsMask));
- }
- #else
- SetGroupSize(temp + prevGroupStart, j - prevGroupStart);
- prevGroupStart = j;
- #endif
- }
- else
- thereAreGroups = 1;
- {
- UInt32 ind = ind2[val & mask];
- temp[j] = ind;
- Groups[ind] = group;
- }
- }
-
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- SetGroupSize(temp + prevGroupStart, j - prevGroupStart);
- #endif
- }
-
- for (j = 0; j < groupSize; j++)
- ind2[j] = temp[j];
- return thereAreGroups;
- }
-
- /* Check that all strings are in one group (cannot sort) */
- {
- UInt32 group, j;
- UInt32 sp = ind2[0] + NumSortedBytes; if (sp >= BlockSize) sp -= BlockSize;
- group = Groups[sp];
- for (j = 1; j < groupSize; j++)
- {
- sp = ind2[j] + NumSortedBytes; if (sp >= BlockSize) sp -= BlockSize;
- if (Groups[sp] != group)
- break;
- }
- if (j == groupSize)
- {
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- SetGroupSize(ind2, groupSize);
- #endif
- return 1;
- }
- }
-
- #ifndef BLOCK_SORT_USE_HEAP_SORT
- {
- /* ---------- Range Sort ---------- */
- UInt32 i;
- UInt32 mid;
- for (;;)
- {
- UInt32 j;
- if (range <= 1)
- {
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- SetGroupSize(ind2, groupSize);
- #endif
- return 1;
- }
- mid = left + ((range + 1) >> 1);
- j = groupSize;
- i = 0;
- do
- {
- UInt32 sp = ind2[i] + NumSortedBytes; if (sp >= BlockSize) sp -= BlockSize;
- if (Groups[sp] >= mid)
- {
- for (j--; j > i; j--)
- {
- sp = ind2[j] + NumSortedBytes; if (sp >= BlockSize) sp -= BlockSize;
- if (Groups[sp] < mid)
- {
- UInt32 temp = ind2[i]; ind2[i] = ind2[j]; ind2[j] = temp;
- break;
- }
- }
- if (i >= j)
- break;
- }
- }
- while (++i < j);
- if (i == 0)
- {
- range = range - (mid - left);
- left = mid;
- }
- else if (i == groupSize)
- range = (mid - left);
- else
- break;
- }
-
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- {
- UInt32 t = (groupOffset + i - 1);
- UInt32 *Flags = Groups + BlockSize;
- Flags[t >> kNumFlagsBits] &= ~(1 << (t & kFlagsMask));
- }
- #endif
-
- {
- UInt32 j;
- for (j = i; j < groupSize; j++)
- Groups[ind2[j]] = groupOffset + i;
- }
-
- {
- UInt32 res = SortGroup(BlockSize, NumSortedBytes, groupOffset, i, NumRefBits, Indices, left, mid - left);
- return res | SortGroup(BlockSize, NumSortedBytes, groupOffset + i, groupSize - i, NumRefBits, Indices, mid, range - (mid - left));
- }
-
- }
-
- #else
-
- /* ---------- Heap Sort ---------- */
-
- {
- UInt32 j;
- for (j = 0; j < groupSize; j++)
- {
- UInt32 sp = ind2[j] + NumSortedBytes; if (sp >= BlockSize) sp -= BlockSize;
- ind2[j] = sp;
- }
-
- HeapSortRef(ind2, Groups, groupSize);
-
- /* Write Flags */
- {
- UInt32 sp = ind2[0];
- UInt32 group = Groups[sp];
-
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- UInt32 *Flags = Groups + BlockSize;
- #else
- UInt32 prevGroupStart = 0;
- #endif
-
- for (j = 1; j < groupSize; j++)
- {
- sp = ind2[j];
- if (Groups[sp] != group)
- {
- group = Groups[sp];
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- {
- UInt32 t = groupOffset + j - 1;
- Flags[t >> kNumFlagsBits] &= ~(1 << (t & kFlagsMask));
- }
- #else
- SetGroupSize(ind2 + prevGroupStart, j - prevGroupStart);
- prevGroupStart = j;
- #endif
- }
- }
-
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- SetGroupSize(ind2 + prevGroupStart, j - prevGroupStart);
- #endif
- }
- {
- /* Write new Groups values and Check that there are groups */
- UInt32 thereAreGroups = 0;
- for (j = 0; j < groupSize; j++)
- {
- UInt32 group = groupOffset + j;
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- UInt32 subGroupSize = ((ind2[j] & ~0xC0000000) >> kNumBitsMax);
- if ((ind2[j] & 0x40000000) != 0)
- subGroupSize += ((ind2[j + 1] >> kNumBitsMax) << kNumExtra0Bits);
- subGroupSize++;
- for (;;)
- {
- UInt32 original = ind2[j];
- UInt32 sp = original & kIndexMask;
- if (sp < NumSortedBytes) sp += BlockSize; sp -= NumSortedBytes;
- ind2[j] = sp | (original & ~kIndexMask);
- Groups[sp] = group;
- if (--subGroupSize == 0)
- break;
- j++;
- thereAreGroups = 1;
- }
- #else
- UInt32 *Flags = Groups + BlockSize;
- for (;;)
- {
- UInt32 sp = ind2[j]; if (sp < NumSortedBytes) sp += BlockSize; sp -= NumSortedBytes;
- ind2[j] = sp;
- Groups[sp] = group;
- if ((Flags[(groupOffset + j) >> kNumFlagsBits] & (1 << ((groupOffset + j) & kFlagsMask))) == 0)
- break;
- j++;
- thereAreGroups = 1;
- }
- #endif
- }
- return thereAreGroups;
- }
- }
- #endif
-}
-
-/* conditions: blockSize > 0 */
-UInt32 BlockSort(UInt32 *Indices, const Byte *data, UInt32 blockSize)
-{
- UInt32 *counters = Indices + blockSize;
- UInt32 i;
- UInt32 *Groups;
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- UInt32 *Flags;
- #endif
-
- /* Radix-Sort for 2 bytes */
- for (i = 0; i < kNumHashValues; i++)
- counters[i] = 0;
- for (i = 0; i < blockSize - 1; i++)
- counters[((UInt32)data[i] << 8) | data[i + 1]]++;
- counters[((UInt32)data[i] << 8) | data[0]]++;
-
- Groups = counters + BS_TEMP_SIZE;
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- Flags = Groups + blockSize;
- {
- UInt32 numWords = (blockSize + kFlagsMask) >> kNumFlagsBits;
- for (i = 0; i < numWords; i++)
- Flags[i] = kAllFlags;
- }
- #endif
-
- {
- UInt32 sum = 0;
- for (i = 0; i < kNumHashValues; i++)
- {
- UInt32 groupSize = counters[i];
- if (groupSize > 0)
- {
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
- UInt32 t = sum + groupSize - 1;
- Flags[t >> kNumFlagsBits] &= ~(1 << (t & kFlagsMask));
- #endif
- sum += groupSize;
- }
- counters[i] = sum - groupSize;
- }
-
- for (i = 0; i < blockSize - 1; i++)
- Groups[i] = counters[((UInt32)data[i] << 8) | data[i + 1]];
- Groups[i] = counters[((UInt32)data[i] << 8) | data[0]];
-
- for (i = 0; i < blockSize - 1; i++)
- Indices[counters[((UInt32)data[i] << 8) | data[i + 1]]++] = i;
- Indices[counters[((UInt32)data[i] << 8) | data[0]]++] = i;
-
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- {
- UInt32 prev = 0;
- for (i = 0; i < kNumHashValues; i++)
- {
- UInt32 prevGroupSize = counters[i] - prev;
- if (prevGroupSize == 0)
- continue;
- SetGroupSize(Indices + prev, prevGroupSize);
- prev = counters[i];
- }
- }
- #endif
- }
-
- {
- int NumRefBits;
- UInt32 NumSortedBytes;
- for (NumRefBits = 0; ((blockSize - 1) >> NumRefBits) != 0; NumRefBits++);
- NumRefBits = 32 - NumRefBits;
- if (NumRefBits > kNumRefBitsMax)
- NumRefBits = kNumRefBitsMax;
-
- for (NumSortedBytes = kNumHashBytes; ; NumSortedBytes <<= 1)
- {
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- UInt32 finishedGroupSize = 0;
- #endif
- UInt32 newLimit = 0;
- for (i = 0; i < blockSize;)
- {
- UInt32 groupSize;
- #ifdef BLOCK_SORT_EXTERNAL_FLAGS
-
- if ((Flags[i >> kNumFlagsBits] & (1 << (i & kFlagsMask))) == 0)
- {
- i++;
- continue;
- }
- for (groupSize = 1;
- (Flags[(i + groupSize) >> kNumFlagsBits] & (1 << ((i + groupSize) & kFlagsMask))) != 0;
- groupSize++);
-
- groupSize++;
-
- #else
-
- groupSize = ((Indices[i] & ~0xC0000000) >> kNumBitsMax);
- {
- Bool finishedGroup = ((Indices[i] & 0x80000000) == 0);
- if ((Indices[i] & 0x40000000) != 0)
- {
- groupSize += ((Indices[i + 1] >> kNumBitsMax) << kNumExtra0Bits);
- Indices[i + 1] &= kIndexMask;
- }
- Indices[i] &= kIndexMask;
- groupSize++;
- if (finishedGroup || groupSize == 1)
- {
- Indices[i - finishedGroupSize] &= kIndexMask;
- if (finishedGroupSize > 1)
- Indices[i - finishedGroupSize + 1] &= kIndexMask;
- {
- UInt32 newGroupSize = groupSize + finishedGroupSize;
- SetFinishedGroupSize(Indices + i - finishedGroupSize, newGroupSize);
- finishedGroupSize = newGroupSize;
- }
- i += groupSize;
- continue;
- }
- finishedGroupSize = 0;
- }
-
- #endif
-
- if (NumSortedBytes >= blockSize)
- {
- UInt32 j;
- for (j = 0; j < groupSize; j++)
- {
- UInt32 t = (i + j);
- /* Flags[t >> kNumFlagsBits] &= ~(1 << (t & kFlagsMask)); */
- Groups[Indices[t]] = t;
- }
- }
- else
- if (SortGroup(blockSize, NumSortedBytes, i, groupSize, NumRefBits, Indices
- #ifndef BLOCK_SORT_USE_HEAP_SORT
- , 0, blockSize
- #endif
- ) != 0)
- newLimit = i + groupSize;
- i += groupSize;
- }
- if (newLimit == 0)
- break;
- }
- }
- #ifndef BLOCK_SORT_EXTERNAL_FLAGS
- for (i = 0; i < blockSize;)
- {
- UInt32 groupSize = ((Indices[i] & ~0xC0000000) >> kNumBitsMax);
- if ((Indices[i] & 0x40000000) != 0)
- {
- groupSize += ((Indices[i + 1] >> kNumBitsMax) << kNumExtra0Bits);
- Indices[i + 1] &= kIndexMask;
- }
- Indices[i] &= kIndexMask;
- groupSize++;
- i += groupSize;
- }
- #endif
- return Groups[0];
-}
-
diff --git a/src/libs/7zip/unix/C/BwtSort.h b/src/libs/7zip/unix/C/BwtSort.h
deleted file mode 100644
index ce5598f0f..000000000
--- a/src/libs/7zip/unix/C/BwtSort.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* BwtSort.h -- BWT block sorting
-2009-02-07 : Igor Pavlov : Public domain */
-
-#ifndef __BWT_SORT_H
-#define __BWT_SORT_H
-
-#include "Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* use BLOCK_SORT_EXTERNAL_FLAGS if blockSize can be > 1M */
-/* #define BLOCK_SORT_EXTERNAL_FLAGS */
-
-#ifdef BLOCK_SORT_EXTERNAL_FLAGS
-#define BLOCK_SORT_EXTERNAL_SIZE(blockSize) ((((blockSize) + 31) >> 5))
-#else
-#define BLOCK_SORT_EXTERNAL_SIZE(blockSize) 0
-#endif
-
-#define BLOCK_SORT_BUF_SIZE(blockSize) ((blockSize) * 2 + BLOCK_SORT_EXTERNAL_SIZE(blockSize) + (1 << 16))
-
-UInt32 BlockSort(UInt32 *indices, const Byte *data, UInt32 blockSize);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libs/7zip/unix/C/CpuArch.c b/src/libs/7zip/unix/C/CpuArch.c
index 260cc1f45..dffa5bd65 100644
--- a/src/libs/7zip/unix/C/CpuArch.c
+++ b/src/libs/7zip/unix/C/CpuArch.c
@@ -73,9 +73,17 @@ static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
#else
__asm__ __volatile__ (
+ #if defined(MY_CPU_X86) && defined(__PIC__)
+ "mov %%ebx, %%edi;"
+ "cpuid;"
+ "xchgl %%ebx, %%edi;"
+ : "=a" (*a) ,
+ "=D" (*b) , /* edi */
+ #else
"cpuid"
: "=a" (*a) ,
"=b" (*b) ,
+ #endif
"=c" (*c) ,
"=d" (*d)
: "0" (function)) ;
diff --git a/src/libs/7zip/unix/C/HuffEnc.c b/src/libs/7zip/unix/C/HuffEnc.c
deleted file mode 100644
index 561c7e5da..000000000
--- a/src/libs/7zip/unix/C/HuffEnc.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* HuffEnc.c -- functions for Huffman encoding
-2009-09-02 : Igor Pavlov : Public domain */
-
-#include "HuffEnc.h"
-#include "Sort.h"
-
-#define kMaxLen 16
-#define NUM_BITS 10
-#define MASK ((1 << NUM_BITS) - 1)
-
-#define NUM_COUNTERS 64
-
-#define HUFFMAN_SPEED_OPT
-
-void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 numSymbols, UInt32 maxLen)
-{
- UInt32 num = 0;
- /* if (maxLen > 10) maxLen = 10; */
- {
- UInt32 i;
-
- #ifdef HUFFMAN_SPEED_OPT
-
- UInt32 counters[NUM_COUNTERS];
- for (i = 0; i < NUM_COUNTERS; i++)
- counters[i] = 0;
- for (i = 0; i < numSymbols; i++)
- {
- UInt32 freq = freqs[i];
- counters[(freq < NUM_COUNTERS - 1) ? freq : NUM_COUNTERS - 1]++;
- }
-
- for (i = 1; i < NUM_COUNTERS; i++)
- {
- UInt32 temp = counters[i];
- counters[i] = num;
- num += temp;
- }
-
- for (i = 0; i < numSymbols; i++)
- {
- UInt32 freq = freqs[i];
- if (freq == 0)
- lens[i] = 0;
- else
- p[counters[((freq < NUM_COUNTERS - 1) ? freq : NUM_COUNTERS - 1)]++] = i | (freq << NUM_BITS);
- }
- counters[0] = 0;
- HeapSort(p + counters[NUM_COUNTERS - 2], counters[NUM_COUNTERS - 1] - counters[NUM_COUNTERS - 2]);
-
- #else
-
- for (i = 0; i < numSymbols; i++)
- {
- UInt32 freq = freqs[i];
- if (freq == 0)
- lens[i] = 0;
- else
- p[num++] = i | (freq << NUM_BITS);
- }
- HeapSort(p, num);
-
- #endif
- }
-
- if (num < 2)
- {
- unsigned minCode = 0;
- unsigned maxCode = 1;
- if (num == 1)
- {
- maxCode = (unsigned)p[0] & MASK;
- if (maxCode == 0)
- maxCode++;
- }
- p[minCode] = 0;
- p[maxCode] = 1;
- lens[minCode] = lens[maxCode] = 1;
- return;
- }
-
- {
- UInt32 b, e, i;
-
- i = b = e = 0;
- do
- {
- UInt32 n, m, freq;
- n = (i != num && (b == e || (p[i] >> NUM_BITS) <= (p[b] >> NUM_BITS))) ? i++ : b++;
- freq = (p[n] & ~MASK);
- p[n] = (p[n] & MASK) | (e << NUM_BITS);
- m = (i != num && (b == e || (p[i] >> NUM_BITS) <= (p[b] >> NUM_BITS))) ? i++ : b++;
- freq += (p[m] & ~MASK);
- p[m] = (p[m] & MASK) | (e << NUM_BITS);
- p[e] = (p[e] & MASK) | freq;
- e++;
- }
- while (num - e > 1);
-
- {
- UInt32 lenCounters[kMaxLen + 1];
- for (i = 0; i <= kMaxLen; i++)
- lenCounters[i] = 0;
-
- p[--e] &= MASK;
- lenCounters[1] = 2;
- while (e > 0)
- {
- UInt32 len = (p[p[--e] >> NUM_BITS] >> NUM_BITS) + 1;
- p[e] = (p[e] & MASK) | (len << NUM_BITS);
- if (len >= maxLen)
- for (len = maxLen - 1; lenCounters[len] == 0; len--);
- lenCounters[len]--;
- lenCounters[len + 1] += 2;
- }
-
- {
- UInt32 len;
- i = 0;
- for (len = maxLen; len != 0; len--)
- {
- UInt32 num;
- for (num = lenCounters[len]; num != 0; num--)
- lens[p[i++] & MASK] = (Byte)len;
- }
- }
-
- {
- UInt32 nextCodes[kMaxLen + 1];
- {
- UInt32 code = 0;
- UInt32 len;
- for (len = 1; len <= kMaxLen; len++)
- nextCodes[len] = code = (code + lenCounters[len - 1]) << 1;
- }
- /* if (code + lenCounters[kMaxLen] - 1 != (1 << kMaxLen) - 1) throw 1; */
-
- {
- UInt32 i;
- for (i = 0; i < numSymbols; i++)
- p[i] = nextCodes[lens[i]]++;
- }
- }
- }
- }
-}
diff --git a/src/libs/7zip/unix/C/HuffEnc.h b/src/libs/7zip/unix/C/HuffEnc.h
deleted file mode 100644
index 9cf4bfde8..000000000
--- a/src/libs/7zip/unix/C/HuffEnc.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* HuffEnc.h -- Huffman encoding
-2009-02-07 : Igor Pavlov : Public domain */
-
-#ifndef __HUFF_ENC_H
-#define __HUFF_ENC_H
-
-#include "Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-Conditions:
- num <= 1024 = 2 ^ NUM_BITS
- Sum(freqs) < 4M = 2 ^ (32 - NUM_BITS)
- maxLen <= 16 = kMaxLen
- Num_Items(p) >= HUFFMAN_TEMP_SIZE(num)
-*/
-
-void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 num, UInt32 maxLen);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.c b/src/libs/7zip/unix/C/Lzma86Dec.c
index b801dd1ca..b801dd1ca 100644
--- a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.c
+++ b/src/libs/7zip/unix/C/Lzma86Dec.c
diff --git a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.c b/src/libs/7zip/unix/C/Lzma86Enc.c
index efc81ea35..efc81ea35 100644
--- a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.c
+++ b/src/libs/7zip/unix/C/Lzma86Enc.c
diff --git a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.h b/src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.h
deleted file mode 100644
index 138ce1ff7..000000000
--- a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Dec.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Lzma86Dec.h -- LZMA + x86 (BCJ) Filter Decoder
-2009-02-07 : Igor Pavlov : Public domain */
-
-#ifndef __LZMA86_DEC_H
-#define __LZMA86_DEC_H
-
-#include "../Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-Lzma86_GetUnpackSize:
- In:
- src - input data
- srcLen - input data size
- Out:
- unpackSize - size of uncompressed stream
- Return code:
- SZ_OK - OK
- SZ_ERROR_INPUT_EOF - Error in headers
-*/
-
-SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize);
-
-/*
-Lzma86_Decode:
- In:
- dest - output data
- destLen - output data size
- src - input data
- srcLen - input data size
- Out:
- destLen - processed output size
- srcLen - processed input size
- Return code:
- SZ_OK - OK
- SZ_ERROR_DATA - Data error
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_UNSUPPORTED - unsupported file
- SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer
-*/
-
-SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.h b/src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.h
deleted file mode 100644
index 355bf343c..000000000
--- a/src/libs/7zip/unix/C/LzmaUtil/Lzma86Enc.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Lzma86Enc.h -- LZMA + x86 (BCJ) Filter Encoder
-2009-02-07 : Igor Pavlov : Public domain */
-
-#ifndef __LZMA86_ENC_H
-#define __LZMA86_ENC_H
-
-#include "../Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-It's an example for LZMA + x86 Filter use.
-You can use .lzma86 extension, if you write that stream to file.
-.lzma86 header adds one additional byte to standard .lzma header.
-.lzma86 header (14 bytes):
- Offset Size Description
- 0 1 = 0 - no filter,
- = 1 - x86 filter
- 1 1 lc, lp and pb in encoded form
- 2 4 dictSize (little endian)
- 6 8 uncompressed size (little endian)
-
-
-Lzma86_Encode
--------------
-level - compression level: 0 <= level <= 9, the default value for "level" is 5.
-
-
-dictSize - The dictionary size in bytes. The maximum value is
- 128 MB = (1 << 27) bytes for 32-bit version
- 1 GB = (1 << 30) bytes for 64-bit version
- The default value is 16 MB = (1 << 24) bytes, for level = 5.
- It's recommended to use the dictionary that is larger than 4 KB and
- that can be calculated as (1 << N) or (3 << N) sizes.
- For better compression ratio dictSize must be >= inSize.
-
-filterMode:
- SZ_FILTER_NO - no Filter
- SZ_FILTER_YES - x86 Filter
- SZ_FILTER_AUTO - it tries both alternatives to select best.
- Encoder will use 2 or 3 passes:
- 2 passes when FILTER_NO provides better compression.
- 3 passes when FILTER_YES provides better compression.
-
-Lzma86Encode allocates Data with MyAlloc functions.
-RAM Requirements for compressing:
- RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize
- filterMode FilterBlockSize
- SZ_FILTER_NO 0
- SZ_FILTER_YES inSize
- SZ_FILTER_AUTO inSize
-
-
-Return code:
- SZ_OK - OK
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_PARAM - Incorrect paramater
- SZ_ERROR_OUTPUT_EOF - output buffer overflow
- SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
-*/
-
-enum ESzFilterMode
-{
- SZ_FILTER_NO,
- SZ_FILTER_YES,
- SZ_FILTER_AUTO
-};
-
-SRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
- int level, UInt32 dictSize, int filterMode);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libs/7zip/unix/C/Ppmd.h b/src/libs/7zip/unix/C/Ppmd.h
deleted file mode 100644
index 621d92703..000000000
--- a/src/libs/7zip/unix/C/Ppmd.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Ppmd.h -- PPMD codec common code
-2010-03-12 : Igor Pavlov : Public domain
-This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
-
-#ifndef __PPMD_H
-#define __PPMD_H
-
-#include "Types.h"
-#include "CpuArch.h"
-
-EXTERN_C_BEGIN
-
-#ifdef MY_CPU_32BIT
- #define PPMD_32BIT
-#endif
-
-#define PPMD_INT_BITS 7
-#define PPMD_PERIOD_BITS 7
-#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
-
-#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
-#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
-#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
-#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
-
-#define PPMD_N1 4
-#define PPMD_N2 4
-#define PPMD_N3 4
-#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
-#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
-
-#pragma pack(push,1)
-
-/* SEE-contexts for PPM-contexts with masked symbols */
-typedef struct
-{
- UInt16 Summ; /* Freq */
- Byte Shift; /* Speed of Freq change; low Shift is for fast change */
- Byte Count; /* Count to next change of Shift */
-} CPpmd_See;
-
-#define Ppmd_See_Update(p) if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
- { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }
-
-typedef struct
-{
- Byte Symbol;
- Byte Freq;
- UInt16 SuccessorLow;
- UInt16 SuccessorHigh;
-} CPpmd_State;
-
-#pragma pack(pop)
-
-typedef
- #ifdef PPMD_32BIT
- CPpmd_State *
- #else
- UInt32
- #endif
- CPpmd_State_Ref;
-
-typedef
- #ifdef PPMD_32BIT
- void *
- #else
- UInt32
- #endif
- CPpmd_Void_Ref;
-
-typedef
- #ifdef PPMD_32BIT
- Byte *
- #else
- UInt32
- #endif
- CPpmd_Byte_Ref;
-
-#define PPMD_SetAllBitsIn256Bytes(p) \
- { unsigned i; for (i = 0; i < 256 / sizeof(p[0]); i += 8) { \
- p[i+7] = p[i+6] = p[i+5] = p[i+4] = p[i+3] = p[i+2] = p[i+1] = p[i+0] = ~(size_t)0; }}
-
-EXTERN_C_END
-
-#endif
diff --git a/src/libs/7zip/unix/C/Ppmd7.c b/src/libs/7zip/unix/C/Ppmd7.c
deleted file mode 100644
index 060d86d2e..000000000
--- a/src/libs/7zip/unix/C/Ppmd7.c
+++ /dev/null
@@ -1,708 +0,0 @@
-/* Ppmd7.c -- PPMdH codec
-2010-03-12 : Igor Pavlov : Public domain
-This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
-
-#include <memory.h>
-
-#include "Ppmd7.h"
-
-const Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };
-static const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};
-
-#define MAX_FREQ 124
-#define UNIT_SIZE 12
-
-#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
-#define U2I(nu) (p->Units2Indx[(nu) - 1])
-#define I2U(indx) (p->Indx2Units[indx])
-
-#ifdef PPMD_32BIT
- #define REF(ptr) (ptr)
-#else
- #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
-#endif
-
-#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
-
-#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
-#define STATS(ctx) Ppmd7_GetStats(p, ctx)
-#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
-#define SUFFIX(ctx) CTX((ctx)->Suffix)
-
-typedef CPpmd7_Context * CTX_PTR;
-
-struct CPpmd7_Node_;
-
-typedef
- #ifdef PPMD_32BIT
- struct CPpmd7_Node_ *
- #else
- UInt32
- #endif
- CPpmd7_Node_Ref;
-
-typedef struct CPpmd7_Node_
-{
- UInt16 Stamp; /* must be at offset 0 as CPpmd7_Context::NumStats. Stamp=0 means free */
- UInt16 NU;
- CPpmd7_Node_Ref Next; /* must be at offset >= 4 */
- CPpmd7_Node_Ref Prev;
-} CPpmd7_Node;
-
-#ifdef PPMD_32BIT
- #define NODE(ptr) (ptr)
-#else
- #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
-#endif
-
-void Ppmd7_Construct(CPpmd7 *p)
-{
- unsigned i, k, m;
-
- p->Base = 0;
-
- for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
- {
- unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
- do { p->Units2Indx[k++] = (Byte)i; } while(--step);
- p->Indx2Units[i] = (Byte)k;
- }
-
- p->NS2BSIndx[0] = (0 << 1);
- p->NS2BSIndx[1] = (1 << 1);
- memset(p->NS2BSIndx + 2, (2 << 1), 9);
- memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
-
- for (i = 0; i < 3; i++)
- p->NS2Indx[i] = (Byte)i;
- for (m = i, k = 1; i < 256; i++)
- {
- p->NS2Indx[i] = (Byte)m;
- if (--k == 0)
- k = (++m) - 2;
- }
-
- memset(p->HB2Flag, 0, 0x40);
- memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);
-}
-
-void Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->Base);
- p->Size = 0;
- p->Base = 0;
-}
-
-Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc)
-{
- if (p->Base == 0 || p->Size != size)
- {
- Ppmd7_Free(p, alloc);
- p->AlignOffset =
- #ifdef PPMD_32BIT
- (4 - size) & 3;
- #else
- 4 - (size & 3);
- #endif
- if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size
- #ifndef PPMD_32BIT
- + UNIT_SIZE
- #endif
- )) == 0)
- return False;
- p->Size = size;
- }
- return True;
-}
-
-static void InsertNode(CPpmd7 *p, void *node, unsigned indx)
-{
- *((CPpmd_Void_Ref *)node) = p->FreeList[indx];
- p->FreeList[indx] = REF(node);
-}
-
-static void *RemoveNode(CPpmd7 *p, unsigned indx)
-{
- CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]);
- p->FreeList[indx] = *node;
- return node;
-}
-
-static void SplitBlock(CPpmd7 *p, void *ptr, unsigned oldIndx, unsigned newIndx)
-{
- unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
- ptr = (Byte *)ptr + U2B(I2U(newIndx));
- if (I2U(i = U2I(nu)) != nu)
- {
- unsigned k = I2U(--i);
- InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
- }
- InsertNode(p, ptr, i);
-}
-
-static void GlueFreeBlocks(CPpmd7 *p)
-{
- #ifdef PPMD_32BIT
- CPpmd7_Node headItem;
- CPpmd7_Node_Ref head = &headItem;
- #else
- CPpmd7_Node_Ref head = p->AlignOffset + p->Size;
- #endif
-
- CPpmd7_Node_Ref n = head;
- unsigned i;
-
- p->GlueCount = 255;
-
- /* create doubly-linked list of free blocks */
- for (i = 0; i < PPMD_NUM_INDEXES; i++)
- {
- UInt16 nu = I2U(i);
- CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i];
- p->FreeList[i] = 0;
- while (next != 0)
- {
- CPpmd7_Node *node = NODE(next);
- node->Next = n;
- n = NODE(n)->Prev = next;
- next = *(const CPpmd7_Node_Ref *)node;
- node->Stamp = 0;
- node->NU = (UInt16)nu;
- }
- }
- NODE(head)->Stamp = 1;
- NODE(head)->Next = n;
- NODE(n)->Prev = head;
- if (p->LoUnit != p->HiUnit)
- ((CPpmd7_Node *)p->LoUnit)->Stamp = 1;
-
- /* Glue free blocks */
- while (n != head)
- {
- CPpmd7_Node *node = NODE(n);
- UInt32 nu = (UInt32)node->NU;
- for (;;)
- {
- CPpmd7_Node *node2 = NODE(n) + nu;
- nu += node2->NU;
- if (node2->Stamp != 0 || nu >= 0x10000)
- break;
- NODE(node2->Prev)->Next = node2->Next;
- NODE(node2->Next)->Prev = node2->Prev;
- node->NU = (UInt16)nu;
- }
- n = node->Next;
- }
-
- /* Fill lists of free blocks */
- for (n = NODE(head)->Next; n != head;)
- {
- CPpmd7_Node *node = NODE(n);
- unsigned nu;
- CPpmd7_Node_Ref next = node->Next;
- for (nu = node->NU; nu > 128; nu -= 128, node += 128)
- InsertNode(p, node, PPMD_NUM_INDEXES - 1);
- if (I2U(i = U2I(nu)) != nu)
- {
- unsigned k = I2U(--i);
- InsertNode(p, node + k, nu - k - 1);
- }
- InsertNode(p, node, i);
- n = next;
- }
-}
-
-static void *AllocUnitsRare(CPpmd7 *p, unsigned indx)
-{
- unsigned i;
- void *retVal;
- if (p->GlueCount == 0)
- {
- GlueFreeBlocks(p);
- if (p->FreeList[indx] != 0)
- return RemoveNode(p, indx);
- }
- i = indx;
- do
- {
- if (++i == PPMD_NUM_INDEXES)
- {
- UInt32 numBytes = U2B(I2U(indx));
- p->GlueCount--;
- return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
- }
- }
- while (p->FreeList[i] == 0);
- retVal = RemoveNode(p, i);
- SplitBlock(p, retVal, i, indx);
- return retVal;
-}
-
-static void *AllocUnits(CPpmd7 *p, unsigned indx)
-{
- UInt32 numBytes;
- if (p->FreeList[indx] != 0)
- return RemoveNode(p, indx);
- numBytes = U2B(I2U(indx));
- if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
- {
- void *retVal = p->LoUnit;
- p->LoUnit += numBytes;
- return retVal;
- }
- return AllocUnitsRare(p, indx);
-}
-
-#define MyMem12Cpy(dest, src, num) \
- { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
- do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }
-
-static void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
-{
- unsigned i0 = U2I(oldNU);
- unsigned i1 = U2I(newNU);
- if (i0 == i1)
- return oldPtr;
- if (p->FreeList[i1] != 0)
- {
- void *ptr = RemoveNode(p, i1);
- MyMem12Cpy(ptr, oldPtr, newNU);
- InsertNode(p, oldPtr, i0);
- return ptr;
- }
- SplitBlock(p, oldPtr, i0, i1);
- return oldPtr;
-}
-
-#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
-
-static void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)
-{
- (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
- (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
-}
-
-static void RestartModel(CPpmd7 *p)
-{
- unsigned i, k, m;
-
- memset(p->FreeList, 0, sizeof(p->FreeList));
- p->Text = p->Base + p->AlignOffset;
- p->HiUnit = p->Text + p->Size;
- p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
- p->GlueCount = 0;
-
- p->OrderFall = p->MaxOrder;
- p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
- p->PrevSuccess = 0;
-
- p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
- p->MinContext->Suffix = 0;
- p->MinContext->NumStats = 256;
- p->MinContext->SummFreq = 256 + 1;
- p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
- p->LoUnit += U2B(256 / 2);
- p->MinContext->Stats = REF(p->FoundState);
- for (i = 0; i < 256; i++)
- {
- CPpmd_State *s = &p->FoundState[i];
- s->Symbol = (Byte)i;
- s->Freq = 1;
- SetSuccessor(s, 0);
- }
-
- for (i = 0; i < 128; i++)
- for (k = 0; k < 8; k++)
- {
- UInt16 *dest = p->BinSumm[i] + k;
- UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));
- for (m = 0; m < 64; m += 8)
- dest[m] = val;
- }
-
- for (i = 0; i < 25; i++)
- for (k = 0; k < 16; k++)
- {
- CPpmd_See *s = &p->See[i][k];
- s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));
- s->Count = 4;
- }
-}
-
-void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder)
-{
- p->MaxOrder = maxOrder;
- RestartModel(p);
- p->DummySee.Shift = PPMD_PERIOD_BITS;
- p->DummySee.Summ = 0; /* unused */
- p->DummySee.Count = 64; /* unused */
-}
-
-static CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip)
-{
- CPpmd_State upState;
- CTX_PTR c = p->MinContext;
- CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
- CPpmd_State *ps[PPMD7_MAX_ORDER];
- unsigned numPs = 0;
-
- if (!skip)
- ps[numPs++] = p->FoundState;
-
- while (c->Suffix)
- {
- CPpmd_Void_Ref successor;
- CPpmd_State *s;
- c = SUFFIX(c);
- if (c->NumStats != 1)
- {
- for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
- }
- else
- s = ONE_STATE(c);
- successor = SUCCESSOR(s);
- if (successor != upBranch)
- {
- c = CTX(successor);
- if (numPs == 0)
- return c;
- break;
- }
- ps[numPs++] = s;
- }
-
- upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);
- SetSuccessor(&upState, upBranch + 1);
-
- if (c->NumStats == 1)
- upState.Freq = ONE_STATE(c)->Freq;
- else
- {
- UInt32 cf, s0;
- CPpmd_State *s;
- for (s = STATS(c); s->Symbol != upState.Symbol; s++);
- cf = s->Freq - 1;
- s0 = c->SummFreq - c->NumStats - cf;
- upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
- }
-
- do
- {
- /* Create Child */
- CTX_PTR c1; /* = AllocContext(p); */
- if (p->HiUnit != p->LoUnit)
- c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
- else if (p->FreeList[0] != 0)
- c1 = (CTX_PTR)RemoveNode(p, 0);
- else
- {
- c1 = (CTX_PTR)AllocUnitsRare(p, 0);
- if (!c1)
- return NULL;
- }
- c1->NumStats = 1;
- *ONE_STATE(c1) = upState;
- c1->Suffix = REF(c);
- SetSuccessor(ps[--numPs], REF(c1));
- c = c1;
- }
- while (numPs != 0);
-
- return c;
-}
-
-static void SwapStates(CPpmd_State *t1, CPpmd_State *t2)
-{
- CPpmd_State tmp = *t1;
- *t1 = *t2;
- *t2 = tmp;
-}
-
-static void UpdateModel(CPpmd7 *p)
-{
- CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
- CTX_PTR c;
- unsigned s0, ns;
-
- if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
- {
- c = SUFFIX(p->MinContext);
-
- if (c->NumStats == 1)
- {
- CPpmd_State *s = ONE_STATE(c);
- if (s->Freq < 32)
- s->Freq++;
- }
- else
- {
- CPpmd_State *s = STATS(c);
- if (s->Symbol != p->FoundState->Symbol)
- {
- do { s++; } while (s->Symbol != p->FoundState->Symbol);
- if (s[0].Freq >= s[-1].Freq)
- {
- SwapStates(&s[0], &s[-1]);
- s--;
- }
- }
- if (s->Freq < MAX_FREQ - 9)
- {
- s->Freq += 2;
- c->SummFreq += 2;
- }
- }
- }
-
- if (p->OrderFall == 0)
- {
- p->MinContext = p->MaxContext = CreateSuccessors(p, True);
- if (p->MinContext == 0)
- {
- RestartModel(p);
- return;
- }
- SetSuccessor(p->FoundState, REF(p->MinContext));
- return;
- }
-
- *p->Text++ = p->FoundState->Symbol;
- successor = REF(p->Text);
- if (p->Text >= p->UnitsStart)
- {
- RestartModel(p);
- return;
- }
-
- if (fSuccessor)
- {
- if (fSuccessor <= successor)
- {
- CTX_PTR cs = CreateSuccessors(p, False);
- if (cs == NULL)
- {
- RestartModel(p);
- return;
- }
- fSuccessor = REF(cs);
- }
- if (--p->OrderFall == 0)
- {
- successor = fSuccessor;
- p->Text -= (p->MaxContext != p->MinContext);
- }
- }
- else
- {
- SetSuccessor(p->FoundState, successor);
- fSuccessor = REF(p->MinContext);
- }
-
- s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);
-
- for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))
- {
- unsigned ns1;
- UInt32 cf, sf;
- if ((ns1 = c->NumStats) != 1)
- {
- if ((ns1 & 1) == 0)
- {
- /* Expand for one UNIT */
- unsigned oldNU = ns1 >> 1;
- unsigned i = U2I(oldNU);
- if (i != U2I(oldNU + 1))
- {
- void *ptr = AllocUnits(p, i + 1);
- void *oldPtr;
- if (!ptr)
- {
- RestartModel(p);
- return;
- }
- oldPtr = STATS(c);
- MyMem12Cpy(ptr, oldPtr, oldNU);
- InsertNode(p, oldPtr, i);
- c->Stats = STATS_REF(ptr);
- }
- }
- c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));
- }
- else
- {
- CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);
- if (!s)
- {
- RestartModel(p);
- return;
- }
- *s = *ONE_STATE(c);
- c->Stats = REF(s);
- if (s->Freq < MAX_FREQ / 4 - 1)
- s->Freq <<= 1;
- else
- s->Freq = MAX_FREQ - 4;
- c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));
- }
- cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);
- sf = (UInt32)s0 + c->SummFreq;
- if (cf < 6 * sf)
- {
- cf = 1 + (cf > sf) + (cf >= 4 * sf);
- c->SummFreq += 3;
- }
- else
- {
- cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);
- c->SummFreq = (UInt16)(c->SummFreq + cf);
- }
- {
- CPpmd_State *s = STATS(c) + ns1;
- SetSuccessor(s, successor);
- s->Symbol = p->FoundState->Symbol;
- s->Freq = (Byte)cf;
- c->NumStats = (UInt16)(ns1 + 1);
- }
- }
- p->MaxContext = p->MinContext = CTX(fSuccessor);
-}
-
-static void Rescale(CPpmd7 *p)
-{
- unsigned i, adder, sumFreq, escFreq;
- CPpmd_State *stats = STATS(p->MinContext);
- CPpmd_State *s = p->FoundState;
- {
- CPpmd_State tmp = *s;
- for (; s != stats; s--)
- s[0] = s[-1];
- *s = tmp;
- }
- escFreq = p->MinContext->SummFreq - s->Freq;
- s->Freq += 4;
- adder = (p->OrderFall != 0);
- s->Freq = (Byte)((s->Freq + adder) >> 1);
- sumFreq = s->Freq;
-
- i = p->MinContext->NumStats - 1;
- do
- {
- escFreq -= (++s)->Freq;
- s->Freq = (Byte)((s->Freq + adder) >> 1);
- sumFreq += s->Freq;
- if (s[0].Freq > s[-1].Freq)
- {
- CPpmd_State *s1 = s;
- CPpmd_State tmp = *s1;
- do
- s1[0] = s1[-1];
- while (--s1 != stats && tmp.Freq > s1[-1].Freq);
- *s1 = tmp;
- }
- }
- while (--i);
-
- if (s->Freq == 0)
- {
- unsigned numStats = p->MinContext->NumStats;
- unsigned n0, n1;
- do { i++; } while ((--s)->Freq == 0);
- escFreq += i;
- p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i);
- if (p->MinContext->NumStats == 1)
- {
- CPpmd_State tmp = *stats;
- do
- {
- tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));
- escFreq >>= 1;
- }
- while (escFreq > 1);
- InsertNode(p, stats, U2I(((numStats + 1) >> 1)));
- *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
- return;
- }
- n0 = (numStats + 1) >> 1;
- n1 = (p->MinContext->NumStats + 1) >> 1;
- if (n0 != n1)
- p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
- }
- p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
- p->FoundState = STATS(p->MinContext);
-}
-
-CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *escFreq)
-{
- CPpmd_See *see;
- unsigned nonMasked = p->MinContext->NumStats - numMasked;
- if (p->MinContext->NumStats != 256)
- {
- see = p->See[p->NS2Indx[nonMasked - 1]] +
- (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +
- 2 * (p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +
- 4 * (numMasked > nonMasked) +
- p->HiBitsFlag;
- {
- unsigned r = (see->Summ >> see->Shift);
- see->Summ = (UInt16)(see->Summ - r);
- *escFreq = r + (r == 0);
- }
- }
- else
- {
- see = &p->DummySee;
- *escFreq = 1;
- }
- return see;
-}
-
-static void NextContext(CPpmd7 *p)
-{
- CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
- if (p->OrderFall == 0 && (Byte *)c > p->Text)
- p->MinContext = p->MaxContext = c;
- else
- UpdateModel(p);
-}
-
-void Ppmd7_Update1(CPpmd7 *p)
-{
- CPpmd_State *s = p->FoundState;
- s->Freq += 4;
- p->MinContext->SummFreq += 4;
- if (s[0].Freq > s[-1].Freq)
- {
- SwapStates(&s[0], &s[-1]);
- p->FoundState = --s;
- if (s->Freq > MAX_FREQ)
- Rescale(p);
- }
- NextContext(p);
-}
-
-void Ppmd7_Update1_0(CPpmd7 *p)
-{
- p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);
- p->RunLength += p->PrevSuccess;
- p->MinContext->SummFreq += 4;
- if ((p->FoundState->Freq += 4) > MAX_FREQ)
- Rescale(p);
- NextContext(p);
-}
-
-void Ppmd7_UpdateBin(CPpmd7 *p)
-{
- p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
- p->PrevSuccess = 1;
- p->RunLength++;
- NextContext(p);
-}
-
-void Ppmd7_Update2(CPpmd7 *p)
-{
- p->MinContext->SummFreq += 4;
- if ((p->FoundState->Freq += 4) > MAX_FREQ)
- Rescale(p);
- p->RunLength = p->InitRL;
- UpdateModel(p);
-}
diff --git a/src/libs/7zip/unix/C/Ppmd7.h b/src/libs/7zip/unix/C/Ppmd7.h
deleted file mode 100644
index 96521c31f..000000000
--- a/src/libs/7zip/unix/C/Ppmd7.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Ppmd7.h -- PPMdH compression codec
-2010-03-12 : Igor Pavlov : Public domain
-This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
-
-/* This code supports virtual RangeDecoder and includes the implementation
-of RangeCoder from 7z, instead of RangeCoder from original PPMd var.H.
-If you need the compatibility with original PPMd var.H, you can use external RangeDecoder */
-
-#ifndef __PPMD7_H
-#define __PPMD7_H
-
-#include "Ppmd.h"
-
-EXTERN_C_BEGIN
-
-#define PPMD7_MIN_ORDER 2
-#define PPMD7_MAX_ORDER 64
-
-#define PPMD7_MIN_MEM_SIZE (1 << 11)
-#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3)
-
-struct CPpmd7_Context_;
-
-typedef
- #ifdef PPMD_32BIT
- struct CPpmd7_Context_ *
- #else
- UInt32
- #endif
- CPpmd7_Context_Ref;
-
-typedef struct CPpmd7_Context_
-{
- UInt16 NumStats;
- UInt16 SummFreq;
- CPpmd_State_Ref Stats;
- CPpmd7_Context_Ref Suffix;
-} CPpmd7_Context;
-
-#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
-
-typedef struct
-{
- CPpmd7_Context *MinContext, *MaxContext;
- CPpmd_State *FoundState;
- unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, HiBitsFlag;
- Int32 RunLength, InitRL; /* must be 32-bit at least */
-
- UInt32 Size;
- UInt32 GlueCount;
- Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
- UInt32 AlignOffset;
-
- Byte Indx2Units[PPMD_NUM_INDEXES];
- Byte Units2Indx[128];
- CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];
- Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256];
- CPpmd_See DummySee, See[25][16];
- UInt16 BinSumm[128][64];
-} CPpmd7;
-
-void Ppmd7_Construct(CPpmd7 *p);
-Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc);
-void Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc);
-void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder);
-#define Ppmd7_WasAllocated(p) ((p)->Base != NULL)
-
-
-/* ---------- Internal Functions ---------- */
-
-extern const Byte PPMD7_kExpEscape[16];
-
-#ifdef PPMD_32BIT
- #define Ppmd7_GetPtr(p, ptr) (ptr)
- #define Ppmd7_GetContext(p, ptr) (ptr)
- #define Ppmd7_GetStats(p, ctx) ((ctx)->Stats)
-#else
- #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
- #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
- #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
-#endif
-
-void Ppmd7_Update1(CPpmd7 *p);
-void Ppmd7_Update1_0(CPpmd7 *p);
-void Ppmd7_Update2(CPpmd7 *p);
-void Ppmd7_UpdateBin(CPpmd7 *p);
-
-#define Ppmd7_GetBinSumm(p) \
- &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \
- p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \
- (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \
- 2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \
- ((p->RunLength >> 26) & 0x20)]
-
-CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale);
-
-
-/* ---------- Decode ---------- */
-
-typedef struct
-{
- UInt32 (*GetThreshold)(void *p, UInt32 total);
- void (*Decode)(void *p, UInt32 start, UInt32 size);
- UInt32 (*DecodeBit)(void *p, UInt32 size0);
-} IPpmd7_RangeDec;
-
-typedef struct
-{
- IPpmd7_RangeDec p;
- UInt32 Range;
- UInt32 Code;
- IByteIn *Stream;
-} CPpmd7z_RangeDec;
-
-void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p);
-Bool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p);
-#define Ppmd7z_RangeDec_IsFinishedOK(p) ((p)->Code == 0)
-
-int Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc);
-
-
-/* ---------- Encode ---------- */
-
-typedef struct
-{
- UInt64 Low;
- UInt32 Range;
- Byte Cache;
- UInt64 CacheSize;
- IByteOut *Stream;
-} CPpmd7z_RangeEnc;
-
-void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p);
-void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p);
-
-void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol);
-
-EXTERN_C_END
-
-#endif
diff --git a/src/libs/7zip/unix/C/Ppmd7Dec.c b/src/libs/7zip/unix/C/Ppmd7Dec.c
deleted file mode 100644
index 68438d5ce..000000000
--- a/src/libs/7zip/unix/C/Ppmd7Dec.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Ppmd7Dec.c -- PPMdH Decoder
-2010-03-12 : Igor Pavlov : Public domain
-This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
-
-#include "Ppmd7.h"
-
-#define kTopValue (1 << 24)
-
-Bool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p)
-{
- unsigned i;
- p->Code = 0;
- p->Range = 0xFFFFFFFF;
- if (p->Stream->Read((void *)p->Stream) != 0)
- return False;
- for (i = 0; i < 4; i++)
- p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
- return (p->Code < 0xFFFFFFFF);
-}
-
-static UInt32 Range_GetThreshold(void *pp, UInt32 total)
-{
- CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
- return (p->Code) / (p->Range /= total);
-}
-
-static void Range_Normalize(CPpmd7z_RangeDec *p)
-{
- if (p->Range < kTopValue)
- {
- p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
- p->Range <<= 8;
- if (p->Range < kTopValue)
- {
- p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
- p->Range <<= 8;
- }
- }
-}
-
-static void Range_Decode(void *pp, UInt32 start, UInt32 size)
-{
- CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
- p->Code -= start * p->Range;
- p->Range *= size;
- Range_Normalize(p);
-}
-
-static UInt32 Range_DecodeBit(void *pp, UInt32 size0)
-{
- CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
- UInt32 newBound = (p->Range >> 14) * size0;
- UInt32 symbol;
- if (p->Code < newBound)
- {
- symbol = 0;
- p->Range = newBound;
- }
- else
- {
- symbol = 1;
- p->Code -= newBound;
- p->Range -= newBound;
- }
- Range_Normalize(p);
- return symbol;
-}
-
-void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p)
-{
- p->p.GetThreshold = Range_GetThreshold;
- p->p.Decode = Range_Decode;
- p->p.DecodeBit = Range_DecodeBit;
-}
-
-
-#define MASK(sym) ((signed char *)charMask)[sym]
-
-int Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc)
-{
- size_t charMask[256 / sizeof(size_t)];
- if (p->MinContext->NumStats != 1)
- {
- CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
- unsigned i;
- UInt32 count, hiCnt;
- if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
- {
- Byte symbol;
- rc->Decode(rc, 0, s->Freq);
- p->FoundState = s;
- symbol = s->Symbol;
- Ppmd7_Update1_0(p);
- return symbol;
- }
- p->PrevSuccess = 0;
- i = p->MinContext->NumStats - 1;
- do
- {
- if ((hiCnt += (++s)->Freq) > count)
- {
- Byte symbol;
- rc->Decode(rc, hiCnt - s->Freq, s->Freq);
- p->FoundState = s;
- symbol = s->Symbol;
- Ppmd7_Update1(p);
- return symbol;
- }
- }
- while (--i);
- if (count >= p->MinContext->SummFreq)
- return -2;
- p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
- rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(s->Symbol) = 0;
- i = p->MinContext->NumStats - 1;
- do { MASK((--s)->Symbol) = 0; } while (--i);
- }
- else
- {
- UInt16 *prob = Ppmd7_GetBinSumm(p);
- if (rc->DecodeBit(rc, *prob) == 0)
- {
- Byte symbol;
- *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
- symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;
- Ppmd7_UpdateBin(p);
- return symbol;
- }
- *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
- p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;
- p->PrevSuccess = 0;
- }
- for (;;)
- {
- CPpmd_State *ps[256], *s;
- UInt32 freqSum, count, hiCnt;
- CPpmd_See *see;
- unsigned i, num, numMasked = p->MinContext->NumStats;
- do
- {
- p->OrderFall++;
- if (!p->MinContext->Suffix)
- return -1;
- p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
- }
- while (p->MinContext->NumStats == numMasked);
- hiCnt = 0;
- s = Ppmd7_GetStats(p, p->MinContext);
- i = 0;
- num = p->MinContext->NumStats - numMasked;
- do
- {
- int k = (int)(MASK(s->Symbol));
- hiCnt += (s->Freq & k);
- ps[i] = s++;
- i -= k;
- }
- while (i != num);
-
- see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);
- freqSum += hiCnt;
- count = rc->GetThreshold(rc, freqSum);
-
- if (count < hiCnt)
- {
- Byte symbol;
- CPpmd_State **pps = ps;
- for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
- s = *pps;
- rc->Decode(rc, hiCnt - s->Freq, s->Freq);
- Ppmd_See_Update(see);
- p->FoundState = s;
- symbol = s->Symbol;
- Ppmd7_Update2(p);
- return symbol;
- }
- if (count >= freqSum)
- return -2;
- rc->Decode(rc, hiCnt, freqSum - hiCnt);
- see->Summ = (UInt16)(see->Summ + freqSum);
- do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
- }
-}
diff --git a/src/libs/7zip/unix/C/Ppmd7Enc.c b/src/libs/7zip/unix/C/Ppmd7Enc.c
deleted file mode 100644
index 8247757d0..000000000
--- a/src/libs/7zip/unix/C/Ppmd7Enc.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Ppmd7Enc.c -- PPMdH Encoder
-2010-03-12 : Igor Pavlov : Public domain
-This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
-
-#include "Ppmd7.h"
-
-#define kTopValue (1 << 24)
-
-void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p)
-{
- p->Low = 0;
- p->Range = 0xFFFFFFFF;
- p->Cache = 0;
- p->CacheSize = 1;
-}
-
-static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p)
-{
- if ((UInt32)p->Low < (UInt32)0xFF000000 || (unsigned)(p->Low >> 32) != 0)
- {
- Byte temp = p->Cache;
- do
- {
- p->Stream->Write(p->Stream, (Byte)(temp + (Byte)(p->Low >> 32)));
- temp = 0xFF;
- }
- while(--p->CacheSize != 0);
- p->Cache = (Byte)((UInt32)p->Low >> 24);
- }
- p->CacheSize++;
- p->Low = (UInt32)p->Low << 8;
-}
-
-static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total)
-{
- p->Low += start * (p->Range /= total);
- p->Range *= size;
- while (p->Range < kTopValue)
- {
- p->Range <<= 8;
- RangeEnc_ShiftLow(p);
- }
-}
-
-static void RangeEnc_EncodeBit_0(CPpmd7z_RangeEnc *p, UInt32 size0)
-{
- p->Range = (p->Range >> 14) * size0;
- while (p->Range < kTopValue)
- {
- p->Range <<= 8;
- RangeEnc_ShiftLow(p);
- }
-}
-
-static void RangeEnc_EncodeBit_1(CPpmd7z_RangeEnc *p, UInt32 size0)
-{
- UInt32 newBound = (p->Range >> 14) * size0;
- p->Low += newBound;
- p->Range -= newBound;
- while (p->Range < kTopValue)
- {
- p->Range <<= 8;
- RangeEnc_ShiftLow(p);
- }
-}
-
-void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p)
-{
- unsigned i;
- for (i = 0; i < 5; i++)
- RangeEnc_ShiftLow(p);
-}
-
-
-#define MASK(sym) ((signed char *)charMask)[sym]
-
-void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol)
-{
- size_t charMask[256 / sizeof(size_t)];
- if (p->MinContext->NumStats != 1)
- {
- CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
- UInt32 sum;
- unsigned i;
- if (s->Symbol == symbol)
- {
- RangeEnc_Encode(rc, 0, s->Freq, p->MinContext->SummFreq);
- p->FoundState = s;
- Ppmd7_Update1_0(p);
- return;
- }
- p->PrevSuccess = 0;
- sum = s->Freq;
- i = p->MinContext->NumStats - 1;
- do
- {
- if ((++s)->Symbol == symbol)
- {
- RangeEnc_Encode(rc, sum, s->Freq, p->MinContext->SummFreq);
- p->FoundState = s;
- Ppmd7_Update1(p);
- return;
- }
- sum += s->Freq;
- }
- while (--i);
-
- p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(s->Symbol) = 0;
- i = p->MinContext->NumStats - 1;
- do { MASK((--s)->Symbol) = 0; } while (--i);
- RangeEnc_Encode(rc, sum, p->MinContext->SummFreq - sum, p->MinContext->SummFreq);
- }
- else
- {
- UInt16 *prob = Ppmd7_GetBinSumm(p);
- CPpmd_State *s = Ppmd7Context_OneState(p->MinContext);
- if (s->Symbol == symbol)
- {
- RangeEnc_EncodeBit_0(rc, *prob);
- *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
- p->FoundState = s;
- Ppmd7_UpdateBin(p);
- return;
- }
- else
- {
- RangeEnc_EncodeBit_1(rc, *prob);
- *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
- p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(s->Symbol) = 0;
- p->PrevSuccess = 0;
- }
- }
- for (;;)
- {
- UInt32 escFreq;
- CPpmd_See *see;
- CPpmd_State *s;
- UInt32 sum;
- unsigned i, numMasked = p->MinContext->NumStats;
- do
- {
- p->OrderFall++;
- if (!p->MinContext->Suffix)
- return; /* EndMarker (symbol = -1) */
- p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
- }
- while (p->MinContext->NumStats == numMasked);
-
- see = Ppmd7_MakeEscFreq(p, numMasked, &escFreq);
- s = Ppmd7_GetStats(p, p->MinContext);
- sum = 0;
- i = p->MinContext->NumStats;
- do
- {
- int cur = s->Symbol;
- if (cur == symbol)
- {
- UInt32 low = sum;
- CPpmd_State *s1 = s;
- do
- {
- sum += (s->Freq & (int)(MASK(s->Symbol)));
- s++;
- }
- while (--i);
- RangeEnc_Encode(rc, low, s1->Freq, sum + escFreq);
- Ppmd_See_Update(see);
- p->FoundState = s1;
- Ppmd7_Update2(p);
- return;
- }
- sum += (s->Freq & (int)(MASK(cur)));
- MASK(cur) = 0;
- s++;
- }
- while (--i);
-
- RangeEnc_Encode(rc, sum, escFreq, sum + escFreq);
- see->Summ = (UInt16)(see->Summ + sum + escFreq);
- }
-}
diff --git a/src/libs/7zip/unix/C/Ppmd8.c b/src/libs/7zip/unix/C/Ppmd8.c
deleted file mode 100644
index 9187a88ef..000000000
--- a/src/libs/7zip/unix/C/Ppmd8.c
+++ /dev/null
@@ -1,1120 +0,0 @@
-/* Ppmd8.c -- PPMdI codec
-2010-03-24 : Igor Pavlov : Public domain
-This code is based on PPMd var.I (2002): Dmitry Shkarin : Public domain */
-
-#include <memory.h>
-
-#include "Ppmd8.h"
-
-const Byte PPMD8_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };
-static const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};
-
-#define MAX_FREQ 124
-#define UNIT_SIZE 12
-
-#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
-#define U2I(nu) (p->Units2Indx[(nu) - 1])
-#define I2U(indx) (p->Indx2Units[indx])
-
-#ifdef PPMD_32BIT
- #define REF(ptr) (ptr)
-#else
- #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
-#endif
-
-#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
-
-#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
-#define STATS(ctx) Ppmd8_GetStats(p, ctx)
-#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
-#define SUFFIX(ctx) CTX((ctx)->Suffix)
-
-typedef CPpmd8_Context * CTX_PTR;
-
-struct CPpmd8_Node_;
-
-typedef
- #ifdef PPMD_32BIT
- struct CPpmd8_Node_ *
- #else
- UInt32
- #endif
- CPpmd8_Node_Ref;
-
-typedef struct CPpmd8_Node_
-{
- UInt32 Stamp;
- CPpmd8_Node_Ref Next;
- UInt32 NU;
-} CPpmd8_Node;
-
-#ifdef PPMD_32BIT
- #define NODE(ptr) (ptr)
-#else
- #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
-#endif
-
-#define EMPTY_NODE 0xFFFFFFFF
-
-void Ppmd8_Construct(CPpmd8 *p)
-{
- unsigned i, k, m;
-
- p->Base = 0;
-
- for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
- {
- unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
- do { p->Units2Indx[k++] = (Byte)i; } while(--step);
- p->Indx2Units[i] = (Byte)k;
- }
-
- p->NS2BSIndx[0] = (0 << 1);
- p->NS2BSIndx[1] = (1 << 1);
- memset(p->NS2BSIndx + 2, (2 << 1), 9);
- memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
-
- for (i = 0; i < 5; i++)
- p->NS2Indx[i] = (Byte)i;
- for (m = i, k = 1; i < 260; i++)
- {
- p->NS2Indx[i] = (Byte)m;
- if (--k == 0)
- k = (++m) - 4;
- }
-}
-
-void Ppmd8_Free(CPpmd8 *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->Base);
- p->Size = 0;
- p->Base = 0;
-}
-
-Bool Ppmd8_Alloc(CPpmd8 *p, UInt32 size, ISzAlloc *alloc)
-{
- if (p->Base == 0 || p->Size != size)
- {
- Ppmd8_Free(p, alloc);
- p->AlignOffset =
- #ifdef PPMD_32BIT
- (4 - size) & 3;
- #else
- 4 - (size & 3);
- #endif
- if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size)) == 0)
- return False;
- p->Size = size;
- }
- return True;
-}
-
-static void InsertNode(CPpmd8 *p, void *node, unsigned indx)
-{
- ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
- ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
- ((CPpmd8_Node *)node)->NU = I2U(indx);
- p->FreeList[indx] = REF(node);
- p->Stamps[indx]++;
-}
-
-static void *RemoveNode(CPpmd8 *p, unsigned indx)
-{
- CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
- p->FreeList[indx] = node->Next;
- p->Stamps[indx]--;
- return node;
-}
-
-static void SplitBlock(CPpmd8 *p, void *ptr, unsigned oldIndx, unsigned newIndx)
-{
- unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
- ptr = (Byte *)ptr + U2B(I2U(newIndx));
- if (I2U(i = U2I(nu)) != nu)
- {
- unsigned k = I2U(--i);
- InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
- }
- InsertNode(p, ptr, i);
-}
-
-static void GlueFreeBlocks(CPpmd8 *p)
-{
- CPpmd8_Node_Ref head = 0;
- CPpmd8_Node_Ref *prev = &head;
- unsigned i;
-
- p->GlueCount = 1 << 13;
- memset(p->Stamps, 0, sizeof(p->Stamps));
-
- /* Order-0 context is always at top UNIT, so we don't need guard NODE at the end.
- All blocks up to p->LoUnit can be free, so we need guard NODE at LoUnit. */
- if (p->LoUnit != p->HiUnit)
- ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
-
- /* Glue free blocks */
- for (i = 0; i < PPMD_NUM_INDEXES; i++)
- {
- CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
- p->FreeList[i] = 0;
- while (next != 0)
- {
- CPpmd8_Node *node = NODE(next);
- if (node->NU != 0)
- {
- CPpmd8_Node *node2;
- *prev = next;
- prev = &(node->Next);
- while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
- {
- node->NU += node2->NU;
- node2->NU = 0;
- }
- }
- next = node->Next;
- }
- }
- *prev = 0;
-
- /* Fill lists of free blocks */
- while (head != 0)
- {
- CPpmd8_Node *node = NODE(head);
- unsigned nu;
- head = node->Next;
- nu = node->NU;
- if (nu == 0)
- continue;
- for (; nu > 128; nu -= 128, node += 128)
- InsertNode(p, node, PPMD_NUM_INDEXES - 1);
- if (I2U(i = U2I(nu)) != nu)
- {
- unsigned k = I2U(--i);
- InsertNode(p, node + k, nu - k - 1);
- }
- InsertNode(p, node, i);
- }
-}
-
-static void *AllocUnitsRare(CPpmd8 *p, unsigned indx)
-{
- unsigned i;
- void *retVal;
- if (p->GlueCount == 0)
- {
- GlueFreeBlocks(p);
- if (p->FreeList[indx] != 0)
- return RemoveNode(p, indx);
- }
- i = indx;
- do
- {
- if (++i == PPMD_NUM_INDEXES)
- {
- UInt32 numBytes = U2B(I2U(indx));
- p->GlueCount--;
- return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
- }
- }
- while (p->FreeList[i] == 0);
- retVal = RemoveNode(p, i);
- SplitBlock(p, retVal, i, indx);
- return retVal;
-}
-
-static void *AllocUnits(CPpmd8 *p, unsigned indx)
-{
- UInt32 numBytes;
- if (p->FreeList[indx] != 0)
- return RemoveNode(p, indx);
- numBytes = U2B(I2U(indx));
- if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
- {
- void *retVal = p->LoUnit;
- p->LoUnit += numBytes;
- return retVal;
- }
- return AllocUnitsRare(p, indx);
-}
-
-#define MyMem12Cpy(dest, src, num) \
- { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
- do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }
-
-static void *ShrinkUnits(CPpmd8 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
-{
- unsigned i0 = U2I(oldNU);
- unsigned i1 = U2I(newNU);
- if (i0 == i1)
- return oldPtr;
- if (p->FreeList[i1] != 0)
- {
- void *ptr = RemoveNode(p, i1);
- MyMem12Cpy(ptr, oldPtr, newNU);
- InsertNode(p, oldPtr, i0);
- return ptr;
- }
- SplitBlock(p, oldPtr, i0, i1);
- return oldPtr;
-}
-
-static void FreeUnits(CPpmd8 *p, void *ptr, unsigned nu)
-{
- InsertNode(p, ptr, U2I(nu));
-}
-
-static void SpecialFreeUnit(CPpmd8 *p, void *ptr)
-{
- if ((Byte *)ptr != p->UnitsStart)
- InsertNode(p, ptr, 0);
- else
- {
- #ifdef PPMD8_FREEZE_SUPPORT
- *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
- #endif
- p->UnitsStart += UNIT_SIZE;
- }
-}
-
-static void *MoveUnitsUp(CPpmd8 *p, void *oldPtr, unsigned nu)
-{
- unsigned indx = U2I(nu);
- void *ptr;
- if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
- return oldPtr;
- ptr = RemoveNode(p, indx);
- MyMem12Cpy(ptr, oldPtr, nu);
- if ((Byte*)oldPtr != p->UnitsStart)
- InsertNode(p, oldPtr, indx);
- else
- p->UnitsStart += U2B(I2U(indx));
- return ptr;
-}
-
-static void ExpandTextArea(CPpmd8 *p)
-{
- UInt32 count[PPMD_NUM_INDEXES];
- unsigned i;
- memset(count, 0, sizeof(count));
- if (p->LoUnit != p->HiUnit)
- ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
-
- {
- CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
- for (; node->Stamp == EMPTY_NODE; node += node->NU)
- {
- node->Stamp = 0;
- count[U2I(node->NU)]++;
- }
- p->UnitsStart = (Byte *)node;
- }
-
- for (i = 0; i < PPMD_NUM_INDEXES; i++)
- {
- CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
- while (count[i] != 0)
- {
- CPpmd8_Node *node = NODE(*next);
- while (node->Stamp == 0)
- {
- *next = node->Next;
- node = NODE(*next);
- p->Stamps[i]--;
- if (--count[i] == 0)
- break;
- }
- next = &node->Next;
- }
- }
-}
-
-#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
-
-static void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)
-{
- (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
- (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
-}
-
-#define RESET_TEXT(offs) { p->Text = p->Base + p->AlignOffset + (offs); }
-
-static void RestartModel(CPpmd8 *p)
-{
- unsigned i, k, m, r;
-
- memset(p->FreeList, 0, sizeof(p->FreeList));
- memset(p->Stamps, 0, sizeof(p->Stamps));
- RESET_TEXT(0);
- p->HiUnit = p->Text + p->Size;
- p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
- p->GlueCount = 0;
-
- p->OrderFall = p->MaxOrder;
- p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
- p->PrevSuccess = 0;
-
- p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
- p->MinContext->Suffix = 0;
- p->MinContext->NumStats = 255;
- p->MinContext->Flags = 0;
- p->MinContext->SummFreq = 256 + 1;
- p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
- p->LoUnit += U2B(256 / 2);
- p->MinContext->Stats = REF(p->FoundState);
- for (i = 0; i < 256; i++)
- {
- CPpmd_State *s = &p->FoundState[i];
- s->Symbol = (Byte)i;
- s->Freq = 1;
- SetSuccessor(s, 0);
- }
-
- for (i = m = 0; m < 25; m++)
- {
- while (p->NS2Indx[i] == m)
- i++;
- for (k = 0; k < 8; k++)
- {
- UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
- UInt16 *dest = p->BinSumm[m] + k;
- for (r = 0; r < 64; r += 8)
- dest[r] = val;
- }
- }
-
- for (i = m = 0; m < 24; m++)
- {
- while (p->NS2Indx[i + 3] == m + 3)
- i++;
- for (k = 0; k < 32; k++)
- {
- CPpmd_See *s = &p->See[m][k];
- s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
- s->Count = 7;
- }
- }
-}
-
-void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod)
-{
- p->MaxOrder = maxOrder;
- p->RestoreMethod = restoreMethod;
- RestartModel(p);
- p->DummySee.Shift = PPMD_PERIOD_BITS;
- p->DummySee.Summ = 0; /* unused */
- p->DummySee.Count = 64; /* unused */
-}
-
-static void Refresh(CPpmd8 *p, CTX_PTR ctx, unsigned oldNU, unsigned scale)
-{
- unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
- CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
- ctx->Stats = REF(s);
- #ifdef PPMD8_FREEZE_SUPPORT
- /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
- scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
- #endif
- flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
- escFreq = ctx->SummFreq - s->Freq;
- sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
- do
- {
- escFreq -= (++s)->Freq;
- sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
- flags |= 0x08 * (s->Symbol >= 0x40);
- }
- while (--i);
- ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
- ctx->Flags = (Byte)flags;
-}
-
-static void SwapStates(CPpmd_State *t1, CPpmd_State *t2)
-{
- CPpmd_State tmp = *t1;
- *t1 = *t2;
- *t2 = tmp;
-}
-
-static CPpmd_Void_Ref CutOff(CPpmd8 *p, CTX_PTR ctx, unsigned order)
-{
- int i;
- unsigned tmp;
- CPpmd_State *s;
-
- if (!ctx->NumStats)
- {
- s = ONE_STATE(ctx);
- if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
- {
- if (order < p->MaxOrder)
- SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
- else
- SetSuccessor(s, 0);
- if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
- return REF(ctx);
- }
- SpecialFreeUnit(p, ctx);
- return 0;
- }
-
- ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
-
- for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
- if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
- {
- CPpmd_State *s2 = STATS(ctx) + (i--);
- SetSuccessor(s, 0);
- SwapStates(s, s2);
- }
- else if (order < p->MaxOrder)
- SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
- else
- SetSuccessor(s, 0);
-
- if (i != ctx->NumStats && order)
- {
- ctx->NumStats = (Byte)i;
- s = STATS(ctx);
- if (i < 0)
- {
- FreeUnits(p, s, tmp);
- SpecialFreeUnit(p, ctx);
- return 0;
- }
- if (i == 0)
- {
- ctx->Flags = (ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40);
- *ONE_STATE(ctx) = *s;
- FreeUnits(p, s, tmp);
- ONE_STATE(ctx)->Freq = (Byte)((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3;
- }
- else
- Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
- }
- return REF(ctx);
-}
-
-#ifdef PPMD8_FREEZE_SUPPORT
-static CPpmd_Void_Ref RemoveBinContexts(CPpmd8 *p, CTX_PTR ctx, unsigned order)
-{
- CPpmd_State *s;
- if (!ctx->NumStats)
- {
- s = ONE_STATE(ctx);
- if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart && order < p->MaxOrder)
- SetSuccessor(s, RemoveBinContexts(p, CTX(SUCCESSOR(s)), order + 1));
- else
- SetSuccessor(s, 0);
- /* Suffix context can be removed already, since different (high-order)
- Successors may refer to same context. So we check Flags == 0xFF (Stamp == EMPTY_NODE) */
- if (!SUCCESSOR(s) && (!SUFFIX(ctx)->NumStats || SUFFIX(ctx)->Flags == 0xFF))
- {
- FreeUnits(p, ctx, 1);
- return 0;
- }
- else
- return REF(ctx);
- }
-
- for (s = STATS(ctx) + ctx->NumStats; s >= STATS(ctx); s--)
- if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart && order < p->MaxOrder)
- SetSuccessor(s, RemoveBinContexts(p, CTX(SUCCESSOR(s)), order + 1));
- else
- SetSuccessor(s, 0);
-
- return REF(ctx);
-}
-#endif
-
-static UInt32 GetUsedMemory(const CPpmd8 *p)
-{
- UInt32 v = 0;
- unsigned i;
- for (i = 0; i < PPMD_NUM_INDEXES; i++)
- v += p->Stamps[i] * I2U(i);
- return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
-}
-
-#ifdef PPMD8_FREEZE_SUPPORT
- #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1, fSuccessor)
-#else
- #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
-#endif
-
-static void RestoreModel(CPpmd8 *p, CTX_PTR c1
- #ifdef PPMD8_FREEZE_SUPPORT
- , CTX_PTR fSuccessor
- #endif
- )
-{
- CTX_PTR c;
- CPpmd_State *s;
- RESET_TEXT(0);
- for (c = p->MaxContext; c != c1; c = SUFFIX(c))
- if (--(c->NumStats) == 0)
- {
- s = STATS(c);
- c->Flags = (c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40);
- *ONE_STATE(c) = *s;
- SpecialFreeUnit(p, s);
- ONE_STATE(c)->Freq = (ONE_STATE(c)->Freq + 11) >> 3;
- }
- else
- Refresh(p, c, (c->NumStats+3) >> 1, 0);
-
- for (; c != p->MinContext; c = SUFFIX(c))
- if (!c->NumStats)
- ONE_STATE(c)->Freq -= ONE_STATE(c)->Freq >> 1;
- else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
- Refresh(p, c, (c->NumStats + 2) >> 1, 1);
-
- #ifdef PPMD8_FREEZE_SUPPORT
- if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
- {
- p->MaxContext = fSuccessor;
- p->GlueCount += !(p->Stamps[1] & 1);
- }
- else if (p->RestoreMethod == PPMD8_RESTORE_METHOD_FREEZE)
- {
- while (p->MaxContext->Suffix)
- p->MaxContext = SUFFIX(p->MaxContext);
- RemoveBinContexts(p, p->MaxContext, 0);
- p->RestoreMethod++;
- p->GlueCount = 0;
- p->OrderFall = p->MaxOrder;
- }
- else
- #endif
- if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
- RestartModel(p);
- else
- {
- while (p->MaxContext->Suffix)
- p->MaxContext = SUFFIX(p->MaxContext);
- do
- {
- CutOff(p, p->MaxContext, 0);
- ExpandTextArea(p);
- }
- while (GetUsedMemory(p) > 3 * (p->Size >> 2));
- p->GlueCount = 0;
- p->OrderFall = p->MaxOrder;
- }
-}
-
-static CTX_PTR CreateSuccessors(CPpmd8 *p, Bool skip, CPpmd_State *s1, CTX_PTR c)
-{
- CPpmd_State upState;
- Byte flags;
- CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
- /* fixed over Shkarin's code. Maybe it could work without + 1 too. */
- CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
- unsigned numPs = 0;
-
- if (!skip)
- ps[numPs++] = p->FoundState;
-
- while (c->Suffix)
- {
- CPpmd_Void_Ref successor;
- CPpmd_State *s;
- c = SUFFIX(c);
- if (s1)
- {
- s = s1;
- s1 = NULL;
- }
- else if (c->NumStats != 0)
- {
- for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
- if (s->Freq < MAX_FREQ - 9)
- {
- s->Freq++;
- c->SummFreq++;
- }
- }
- else
- {
- s = ONE_STATE(c);
- s->Freq += (!SUFFIX(c)->NumStats & (s->Freq < 24));
- }
- successor = SUCCESSOR(s);
- if (successor != upBranch)
- {
- c = CTX(successor);
- if (numPs == 0)
- return c;
- break;
- }
- ps[numPs++] = s;
- }
-
- upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
- SetSuccessor(&upState, upBranch + 1);
- flags = 0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40);
-
- if (c->NumStats == 0)
- upState.Freq = ONE_STATE(c)->Freq;
- else
- {
- UInt32 cf, s0;
- CPpmd_State *s;
- for (s = STATS(c); s->Symbol != upState.Symbol; s++);
- cf = s->Freq - 1;
- s0 = c->SummFreq - c->NumStats - cf;
- upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
- }
-
- do
- {
- /* Create Child */
- CTX_PTR c1; /* = AllocContext(p); */
- if (p->HiUnit != p->LoUnit)
- c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
- else if (p->FreeList[0] != 0)
- c1 = (CTX_PTR)RemoveNode(p, 0);
- else
- {
- c1 = (CTX_PTR)AllocUnitsRare(p, 0);
- if (!c1)
- return NULL;
- }
- c1->NumStats = 0;
- c1->Flags = flags;
- *ONE_STATE(c1) = upState;
- c1->Suffix = REF(c);
- SetSuccessor(ps[--numPs], REF(c1));
- c = c1;
- }
- while (numPs != 0);
-
- return c;
-}
-
-static CTX_PTR ReduceOrder(CPpmd8 *p, CPpmd_State *s1, CTX_PTR c)
-{
- CPpmd_State *s = NULL;
- CTX_PTR c1 = c;
- CPpmd_Void_Ref upBranch = REF(p->Text);
-
- #ifdef PPMD8_FREEZE_SUPPORT
- /* The BUG in Shkarin's code was fixed: ps could overflow in CUT_OFF mode. */
- CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
- unsigned numPs = 0;
- ps[numPs++] = p->FoundState;
- #endif
-
- SetSuccessor(p->FoundState, upBranch);
- p->OrderFall++;
-
- for (;;)
- {
- if (s1)
- {
- c = SUFFIX(c);
- s = s1;
- s1 = NULL;
- }
- else
- {
- if (!c->Suffix)
- {
- #ifdef PPMD8_FREEZE_SUPPORT
- if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
- {
- do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
- RESET_TEXT(1);
- p->OrderFall = 1;
- }
- #endif
- return c;
- }
- c = SUFFIX(c);
- if (c->NumStats)
- {
- if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
- do { s++; } while (s->Symbol != p->FoundState->Symbol);
- if (s->Freq < MAX_FREQ - 9)
- {
- s->Freq += 2;
- c->SummFreq += 2;
- }
- }
- else
- {
- s = ONE_STATE(c);
- s->Freq += (s->Freq < 32);
- }
- }
- if (SUCCESSOR(s))
- break;
- #ifdef PPMD8_FREEZE_SUPPORT
- ps[numPs++] = s;
- #endif
- SetSuccessor(s, upBranch);
- p->OrderFall++;
- }
-
- #ifdef PPMD8_FREEZE_SUPPORT
- if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
- {
- c = CTX(SUCCESSOR(s));
- do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
- RESET_TEXT(1);
- p->OrderFall = 1;
- return c;
- }
- else
- #endif
- if (SUCCESSOR(s) <= upBranch)
- {
- CTX_PTR successor;
- CPpmd_State *s1 = p->FoundState;
- p->FoundState = s;
-
- successor = CreateSuccessors(p, False, NULL, c);
- if (successor == NULL)
- SetSuccessor(s, 0);
- else
- SetSuccessor(s, REF(successor));
- p->FoundState = s1;
- }
-
- if (p->OrderFall == 1 && c1 == p->MaxContext)
- {
- SetSuccessor(p->FoundState, SUCCESSOR(s));
- p->Text--;
- }
- if (SUCCESSOR(s) == 0)
- return NULL;
- return CTX(SUCCESSOR(s));
-}
-
-static void UpdateModel(CPpmd8 *p)
-{
- CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
- CTX_PTR c;
- unsigned s0, ns, fFreq = p->FoundState->Freq;
- Byte flag, fSymbol = p->FoundState->Symbol;
- CPpmd_State *s = NULL;
-
- if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
- {
- c = SUFFIX(p->MinContext);
-
- if (c->NumStats == 0)
- {
- s = ONE_STATE(c);
- if (s->Freq < 32)
- s->Freq++;
- }
- else
- {
- s = STATS(c);
- if (s->Symbol != p->FoundState->Symbol)
- {
- do { s++; } while (s->Symbol != p->FoundState->Symbol);
- if (s[0].Freq >= s[-1].Freq)
- {
- SwapStates(&s[0], &s[-1]);
- s--;
- }
- }
- if (s->Freq < MAX_FREQ - 9)
- {
- s->Freq += 2;
- c->SummFreq += 2;
- }
- }
- }
-
- c = p->MaxContext;
- if (p->OrderFall == 0 && fSuccessor)
- {
- CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
- if (cs == 0)
- {
- SetSuccessor(p->FoundState, 0);
- RESTORE_MODEL(c, CTX(fSuccessor));
- }
- else
- {
- SetSuccessor(p->FoundState, REF(cs));
- p->MaxContext = cs;
- }
- return;
- }
-
- *p->Text++ = p->FoundState->Symbol;
- successor = REF(p->Text);
- if (p->Text >= p->UnitsStart)
- {
- RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
- return;
- }
-
- if (!fSuccessor)
- {
- CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
- if (cs == NULL)
- {
- RESTORE_MODEL(c, 0);
- return;
- }
- fSuccessor = REF(cs);
- }
- else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
- {
- CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
- if (cs == NULL)
- {
- RESTORE_MODEL(c, 0);
- return;
- }
- fSuccessor = REF(cs);
- }
-
- if (--p->OrderFall == 0)
- {
- successor = fSuccessor;
- p->Text -= (p->MaxContext != p->MinContext);
- }
- #ifdef PPMD8_FREEZE_SUPPORT
- else if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
- {
- successor = fSuccessor;
- RESET_TEXT(0);
- p->OrderFall = 0;
- }
- #endif
-
- s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
- flag = 0x08 * (fSymbol >= 0x40);
-
- for (; c != p->MinContext; c = SUFFIX(c))
- {
- unsigned ns1;
- UInt32 cf, sf;
- if ((ns1 = c->NumStats) != 0)
- {
- if ((ns1 & 1) != 0)
- {
- /* Expand for one UNIT */
- unsigned oldNU = (ns1 + 1) >> 1;
- unsigned i = U2I(oldNU);
- if (i != U2I(oldNU + 1))
- {
- void *ptr = AllocUnits(p, i + 1);
- void *oldPtr;
- if (!ptr)
- {
- RESTORE_MODEL(c, CTX(fSuccessor));
- return;
- }
- oldPtr = STATS(c);
- MyMem12Cpy(ptr, oldPtr, oldNU);
- InsertNode(p, oldPtr, i);
- c->Stats = STATS_REF(ptr);
- }
- }
- c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
- }
- else
- {
- CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);
- if (!s)
- {
- RESTORE_MODEL(c, CTX(fSuccessor));
- return;
- }
- *s = *ONE_STATE(c);
- c->Stats = REF(s);
- if (s->Freq < MAX_FREQ / 4 - 1)
- s->Freq <<= 1;
- else
- s->Freq = MAX_FREQ - 4;
- c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 2));
- }
- cf = 2 * fFreq * (c->SummFreq + 6);
- sf = (UInt32)s0 + c->SummFreq;
- if (cf < 6 * sf)
- {
- cf = 1 + (cf > sf) + (cf >= 4 * sf);
- c->SummFreq += 4;
- }
- else
- {
- cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
- c->SummFreq = (UInt16)(c->SummFreq + cf);
- }
- {
- CPpmd_State *s = STATS(c) + ns1 + 1;
- SetSuccessor(s, successor);
- s->Symbol = fSymbol;
- s->Freq = (Byte)cf;
- c->Flags |= flag;
- c->NumStats = (Byte)(ns1 + 1);
- }
- }
- p->MaxContext = p->MinContext = CTX(fSuccessor);
-}
-
-static void Rescale(CPpmd8 *p)
-{
- unsigned i, adder, sumFreq, escFreq;
- CPpmd_State *stats = STATS(p->MinContext);
- CPpmd_State *s = p->FoundState;
- {
- CPpmd_State tmp = *s;
- for (; s != stats; s--)
- s[0] = s[-1];
- *s = tmp;
- }
- escFreq = p->MinContext->SummFreq - s->Freq;
- s->Freq += 4;
- adder = (p->OrderFall != 0
- #ifdef PPMD8_FREEZE_SUPPORT
- || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
- #endif
- );
- s->Freq = (Byte)((s->Freq + adder) >> 1);
- sumFreq = s->Freq;
-
- i = p->MinContext->NumStats;
- do
- {
- escFreq -= (++s)->Freq;
- s->Freq = (Byte)((s->Freq + adder) >> 1);
- sumFreq += s->Freq;
- if (s[0].Freq > s[-1].Freq)
- {
- CPpmd_State *s1 = s;
- CPpmd_State tmp = *s1;
- do
- s1[0] = s1[-1];
- while (--s1 != stats && tmp.Freq > s1[-1].Freq);
- *s1 = tmp;
- }
- }
- while (--i);
-
- if (s->Freq == 0)
- {
- unsigned numStats = p->MinContext->NumStats;
- unsigned n0, n1;
- do { i++; } while ((--s)->Freq == 0);
- escFreq += i;
- p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
- if (p->MinContext->NumStats == 0)
- {
- CPpmd_State tmp = *stats;
- tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
- if (tmp.Freq > MAX_FREQ / 3)
- tmp.Freq = MAX_FREQ / 3;
- InsertNode(p, stats, U2I((numStats + 2) >> 1));
- p->MinContext->Flags = (p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40);
- *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
- return;
- }
- n0 = (numStats + 2) >> 1;
- n1 = (p->MinContext->NumStats + 2) >> 1;
- if (n0 != n1)
- p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
- p->MinContext->Flags &= ~0x08;
- p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
- i = p->MinContext->NumStats;
- do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
- }
- p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
- p->MinContext->Flags |= 0x4;
- p->FoundState = STATS(p->MinContext);
-}
-
-CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked1, UInt32 *escFreq)
-{
- CPpmd_See *see;
- if (p->MinContext->NumStats != 0xFF)
- {
- see = p->See[p->NS2Indx[p->MinContext->NumStats + 2] - 3] +
- (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
- 2 * (2 * (unsigned)p->MinContext->NumStats <
- ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
- p->MinContext->Flags;
- {
- unsigned r = (see->Summ >> see->Shift);
- see->Summ = (UInt16)(see->Summ - r);
- *escFreq = r + (r == 0);
- }
- }
- else
- {
- see = &p->DummySee;
- *escFreq = 1;
- }
- return see;
-}
-
-static void NextContext(CPpmd8 *p)
-{
- CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
- if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
- p->MinContext = p->MaxContext = c;
- else
- {
- UpdateModel(p);
- p->MinContext = p->MaxContext;
- }
-}
-
-void Ppmd8_Update1(CPpmd8 *p)
-{
- CPpmd_State *s = p->FoundState;
- s->Freq += 4;
- p->MinContext->SummFreq += 4;
- if (s[0].Freq > s[-1].Freq)
- {
- SwapStates(&s[0], &s[-1]);
- p->FoundState = --s;
- if (s->Freq > MAX_FREQ)
- Rescale(p);
- }
- NextContext(p);
-}
-
-void Ppmd8_Update1_0(CPpmd8 *p)
-{
- p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
- p->RunLength += p->PrevSuccess;
- p->MinContext->SummFreq += 4;
- if ((p->FoundState->Freq += 4) > MAX_FREQ)
- Rescale(p);
- NextContext(p);
-}
-
-void Ppmd8_UpdateBin(CPpmd8 *p)
-{
- p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
- p->PrevSuccess = 1;
- p->RunLength++;
- NextContext(p);
-}
-
-void Ppmd8_Update2(CPpmd8 *p)
-{
- p->MinContext->SummFreq += 4;
- if ((p->FoundState->Freq += 4) > MAX_FREQ)
- Rescale(p);
- p->RunLength = p->InitRL;
- UpdateModel(p);
- p->MinContext = p->MaxContext;
-}
-
-/* H->I changes:
- NS2Indx
- GlewCount, and Glue method
- BinSum
- See / EscFreq
- CreateSuccessors updates more suffix contexts
- UpdateModel consts.
- PrevSuccess Update
-*/
diff --git a/src/libs/7zip/unix/C/Ppmd8.h b/src/libs/7zip/unix/C/Ppmd8.h
deleted file mode 100644
index 870dc9dd8..000000000
--- a/src/libs/7zip/unix/C/Ppmd8.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Ppmd8.h -- PPMdI codec
-2010-03-24 : Igor Pavlov : Public domain
-This code is based on:
- PPMd var.I (2002): Dmitry Shkarin : Public domain
- Carryless rangecoder (1999): Dmitry Subbotin : Public domain */
-
-#ifndef __PPMD8_H
-#define __PPMD8_H
-
-#include "Ppmd.h"
-
-EXTERN_C_BEGIN
-
-#define PPMD8_MIN_ORDER 2
-#define PPMD8_MAX_ORDER 16
-
-struct CPpmd8_Context_;
-
-typedef
- #ifdef PPMD_32BIT
- struct CPpmd8_Context_ *
- #else
- UInt32
- #endif
- CPpmd8_Context_Ref;
-
-typedef struct CPpmd8_Context_
-{
- Byte NumStats;
- Byte Flags;
- UInt16 SummFreq;
- CPpmd_State_Ref Stats;
- CPpmd8_Context_Ref Suffix;
-} CPpmd8_Context;
-
-#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
-
-/* The BUG in Shkarin's code for FREEZE mode was fixed, but that fixed
- code is not compatible with original code for some files compressed
- in FREEZE mode. So we disable FREEZE mode support. */
-
-enum
-{
- PPMD8_RESTORE_METHOD_RESTART,
- PPMD8_RESTORE_METHOD_CUT_OFF
- #ifdef PPMD8_FREEZE_SUPPORT
- , PPMD8_RESTORE_METHOD_FREEZE
- #endif
-};
-
-typedef struct
-{
- CPpmd8_Context *MinContext, *MaxContext;
- CPpmd_State *FoundState;
- unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder;
- Int32 RunLength, InitRL; /* must be 32-bit at least */
-
- UInt32 Size;
- UInt32 GlueCount;
- Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
- UInt32 AlignOffset;
- unsigned RestoreMethod;
-
- /* Range Coder */
- UInt32 Range;
- UInt32 Code;
- UInt32 Low;
- union
- {
- IByteIn *In;
- IByteOut *Out;
- } Stream;
-
- Byte Indx2Units[PPMD_NUM_INDEXES];
- Byte Units2Indx[128];
- CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];
- UInt32 Stamps[PPMD_NUM_INDEXES];
-
- Byte NS2BSIndx[256], NS2Indx[260];
- CPpmd_See DummySee, See[24][32];
- UInt16 BinSumm[25][64];
-} CPpmd8;
-
-void Ppmd8_Construct(CPpmd8 *p);
-Bool Ppmd8_Alloc(CPpmd8 *p, UInt32 size, ISzAlloc *alloc);
-void Ppmd8_Free(CPpmd8 *p, ISzAlloc *alloc);
-void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod);
-#define Ppmd8_WasAllocated(p) ((p)->Base != NULL)
-
-
-/* ---------- Internal Functions ---------- */
-
-extern const Byte PPMD8_kExpEscape[16];
-
-#ifdef PPMD_32BIT
- #define Ppmd8_GetPtr(p, ptr) (ptr)
- #define Ppmd8_GetContext(p, ptr) (ptr)
- #define Ppmd8_GetStats(p, ctx) ((ctx)->Stats)
-#else
- #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
- #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
- #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
-#endif
-
-void Ppmd8_Update1(CPpmd8 *p);
-void Ppmd8_Update1_0(CPpmd8 *p);
-void Ppmd8_Update2(CPpmd8 *p);
-void Ppmd8_UpdateBin(CPpmd8 *p);
-
-#define Ppmd8_GetBinSumm(p) \
- &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
- p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
- p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
-
-CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked, UInt32 *scale);
-
-
-/* ---------- Decode ---------- */
-
-Bool Ppmd8_RangeDec_Init(CPpmd8 *p);
-#define Ppmd8_RangeDec_IsFinishedOK(p) ((p)->Code == 0)
-int Ppmd8_DecodeSymbol(CPpmd8 *p); /* returns: -1 as EndMarker, -2 as DataError */
-
-
-/* ---------- Encode ---------- */
-
-#define Ppmd8_RangeEnc_Init(p) { (p)->Low = 0; (p)->Range = 0xFFFFFFFF; }
-void Ppmd8_RangeEnc_FlushData(CPpmd8 *p);
-void Ppmd8_EncodeSymbol(CPpmd8 *p, int symbol); /* symbol = -1 means EndMarker */
-
-EXTERN_C_END
-
-#endif
diff --git a/src/libs/7zip/unix/C/Ppmd8Dec.c b/src/libs/7zip/unix/C/Ppmd8Dec.c
deleted file mode 100644
index c54e02ab2..000000000
--- a/src/libs/7zip/unix/C/Ppmd8Dec.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Ppmd8Dec.c -- PPMdI Decoder
-2010-04-16 : Igor Pavlov : Public domain
-This code is based on:
- PPMd var.I (2002): Dmitry Shkarin : Public domain
- Carryless rangecoder (1999): Dmitry Subbotin : Public domain */
-
-#include "Ppmd8.h"
-
-#define kTop (1 << 24)
-#define kBot (1 << 15)
-
-Bool Ppmd8_RangeDec_Init(CPpmd8 *p)
-{
- unsigned i;
- p->Low = 0;
- p->Range = 0xFFFFFFFF;
- p->Code = 0;
- for (i = 0; i < 4; i++)
- p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
- return (p->Code < 0xFFFFFFFF);
-}
-
-static UInt32 RangeDec_GetThreshold(CPpmd8 *p, UInt32 total)
-{
- return p->Code / (p->Range /= total);
-}
-
-static void RangeDec_Decode(CPpmd8 *p, UInt32 start, UInt32 size)
-{
- start *= p->Range;
- p->Low += start;
- p->Code -= start;
- p->Range *= size;
-
- while ((p->Low ^ (p->Low + p->Range)) < kTop ||
- (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
- {
- p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
- p->Range <<= 8;
- p->Low <<= 8;
- }
-}
-
-#define MASK(sym) ((signed char *)charMask)[sym]
-
-int Ppmd8_DecodeSymbol(CPpmd8 *p)
-{
- size_t charMask[256 / sizeof(size_t)];
- if (p->MinContext->NumStats != 0)
- {
- CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
- unsigned i;
- UInt32 count, hiCnt;
- if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
- {
- Byte symbol;
- RangeDec_Decode(p, 0, s->Freq);
- p->FoundState = s;
- symbol = s->Symbol;
- Ppmd8_Update1_0(p);
- return symbol;
- }
- p->PrevSuccess = 0;
- i = p->MinContext->NumStats;
- do
- {
- if ((hiCnt += (++s)->Freq) > count)
- {
- Byte symbol;
- RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
- p->FoundState = s;
- symbol = s->Symbol;
- Ppmd8_Update1(p);
- return symbol;
- }
- }
- while (--i);
- if (count >= p->MinContext->SummFreq)
- return -2;
- RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(s->Symbol) = 0;
- i = p->MinContext->NumStats;
- do { MASK((--s)->Symbol) = 0; } while (--i);
- }
- else
- {
- UInt16 *prob = Ppmd8_GetBinSumm(p);
- if (((p->Code / (p->Range >>= 14)) < *prob))
- {
- Byte symbol;
- RangeDec_Decode(p, 0, *prob);
- *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
- symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
- Ppmd8_UpdateBin(p);
- return symbol;
- }
- RangeDec_Decode(p, *prob, (1 << 14) - *prob);
- *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
- p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
- p->PrevSuccess = 0;
- }
- for (;;)
- {
- CPpmd_State *ps[256], *s;
- UInt32 freqSum, count, hiCnt;
- CPpmd_See *see;
- unsigned i, num, numMasked = p->MinContext->NumStats;
- do
- {
- p->OrderFall++;
- if (!p->MinContext->Suffix)
- return -1;
- p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
- }
- while (p->MinContext->NumStats == numMasked);
- hiCnt = 0;
- s = Ppmd8_GetStats(p, p->MinContext);
- i = 0;
- num = p->MinContext->NumStats - numMasked;
- do
- {
- int k = (int)(MASK(s->Symbol));
- hiCnt += (s->Freq & k);
- ps[i] = s++;
- i -= k;
- }
- while (i != num);
-
- see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
- freqSum += hiCnt;
- count = RangeDec_GetThreshold(p, freqSum);
-
- if (count < hiCnt)
- {
- Byte symbol;
- CPpmd_State **pps = ps;
- for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
- s = *pps;
- RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
- Ppmd_See_Update(see);
- p->FoundState = s;
- symbol = s->Symbol;
- Ppmd8_Update2(p);
- return symbol;
- }
- if (count >= freqSum)
- return -2;
- RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
- see->Summ = (UInt16)(see->Summ + freqSum);
- do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
- }
-}
diff --git a/src/libs/7zip/unix/C/Ppmd8Enc.c b/src/libs/7zip/unix/C/Ppmd8Enc.c
deleted file mode 100644
index 8da727eb2..000000000
--- a/src/libs/7zip/unix/C/Ppmd8Enc.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Ppmd8Enc.c -- PPMdI Encoder
-2010-04-16 : Igor Pavlov : Public domain
-This code is based on:
- PPMd var.I (2002): Dmitry Shkarin : Public domain
- Carryless rangecoder (1999): Dmitry Subbotin : Public domain */
-
-#include "Ppmd8.h"
-
-#define kTop (1 << 24)
-#define kBot (1 << 15)
-
-void Ppmd8_RangeEnc_FlushData(CPpmd8 *p)
-{
- unsigned i;
- for (i = 0; i < 4; i++, p->Low <<= 8 )
- p->Stream.Out->Write(p->Stream.Out, (Byte)(p->Low >> 24));
-}
-
-static void RangeEnc_Normalize(CPpmd8 *p)
-{
- while ((p->Low ^ (p->Low + p->Range)) < kTop ||
- (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
- {
- p->Stream.Out->Write(p->Stream.Out, (Byte)(p->Low >> 24));
- p->Range <<= 8;
- p->Low <<= 8;
- }
-}
-
-static void RangeEnc_Encode(CPpmd8 *p, UInt32 start, UInt32 size, UInt32 total)
-{
- p->Low += start * (p->Range /= total);
- p->Range *= size;
- RangeEnc_Normalize(p);
-}
-
-static void RangeEnc_EncodeBit_0(CPpmd8 *p, UInt32 size0)
-{
- p->Range >>= 14;
- p->Range *= size0;
- RangeEnc_Normalize(p);
-}
-
-static void RangeEnc_EncodeBit_1(CPpmd8 *p, UInt32 size0)
-{
- p->Low += size0 * (p->Range >>= 14);
- p->Range *= ((1 << 14) - size0);
- RangeEnc_Normalize(p);
-}
-
-
-#define MASK(sym) ((signed char *)charMask)[sym]
-
-void Ppmd8_EncodeSymbol(CPpmd8 *p, int symbol)
-{
- size_t charMask[256 / sizeof(size_t)];
- if (p->MinContext->NumStats != 0)
- {
- CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
- UInt32 sum;
- unsigned i;
- if (s->Symbol == symbol)
- {
- RangeEnc_Encode(p, 0, s->Freq, p->MinContext->SummFreq);
- p->FoundState = s;
- Ppmd8_Update1_0(p);
- return;
- }
- p->PrevSuccess = 0;
- sum = s->Freq;
- i = p->MinContext->NumStats;
- do
- {
- if ((++s)->Symbol == symbol)
- {
- RangeEnc_Encode(p, sum, s->Freq, p->MinContext->SummFreq);
- p->FoundState = s;
- Ppmd8_Update1(p);
- return;
- }
- sum += s->Freq;
- }
- while (--i);
-
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(s->Symbol) = 0;
- i = p->MinContext->NumStats;
- do { MASK((--s)->Symbol) = 0; } while (--i);
- RangeEnc_Encode(p, sum, p->MinContext->SummFreq - sum, p->MinContext->SummFreq);
- }
- else
- {
- UInt16 *prob = Ppmd8_GetBinSumm(p);
- CPpmd_State *s = Ppmd8Context_OneState(p->MinContext);
- if (s->Symbol == symbol)
- {
- RangeEnc_EncodeBit_0(p, *prob);
- *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
- p->FoundState = s;
- Ppmd8_UpdateBin(p);
- return;
- }
- else
- {
- RangeEnc_EncodeBit_1(p, *prob);
- *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
- p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
- PPMD_SetAllBitsIn256Bytes(charMask);
- MASK(s->Symbol) = 0;
- p->PrevSuccess = 0;
- }
- }
- for (;;)
- {
- UInt32 escFreq;
- CPpmd_See *see;
- CPpmd_State *s;
- UInt32 sum;
- unsigned i, numMasked = p->MinContext->NumStats;
- do
- {
- p->OrderFall++;
- if (!p->MinContext->Suffix)
- return; /* EndMarker (symbol = -1) */
- p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
- }
- while (p->MinContext->NumStats == numMasked);
-
- see = Ppmd8_MakeEscFreq(p, numMasked, &escFreq);
- s = Ppmd8_GetStats(p, p->MinContext);
- sum = 0;
- i = p->MinContext->NumStats + 1;
- do
- {
- int cur = s->Symbol;
- if (cur == symbol)
- {
- UInt32 low = sum;
- CPpmd_State *s1 = s;
- do
- {
- sum += (s->Freq & (int)(MASK(s->Symbol)));
- s++;
- }
- while (--i);
- RangeEnc_Encode(p, low, s1->Freq, sum + escFreq);
- Ppmd_See_Update(see);
- p->FoundState = s1;
- Ppmd8_Update2(p);
- return;
- }
- sum += (s->Freq & (int)(MASK(cur)));
- MASK(cur) = 0;
- s++;
- }
- while (--i);
-
- RangeEnc_Encode(p, sum, escFreq, sum + escFreq);
- see->Summ = (UInt16)(see->Summ + sum + escFreq);
- }
-}
diff --git a/src/libs/7zip/unix/C/Sort.c b/src/libs/7zip/unix/C/Sort.c
deleted file mode 100644
index 388d22893..000000000
--- a/src/libs/7zip/unix/C/Sort.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Sort.c -- Sort functions
-2010-09-17 : Igor Pavlov : Public domain */
-
-#include "Sort.h"
-
-#define HeapSortDown(p, k, size, temp) \
- { for (;;) { \
- UInt32 s = (k << 1); \
- if (s > size) break; \
- if (s < size && p[s + 1] > p[s]) s++; \
- if (temp >= p[s]) break; \
- p[k] = p[s]; k = s; \
- } p[k] = temp; }
-
-void HeapSort(UInt32 *p, UInt32 size)
-{
- if (size <= 1)
- return;
- p--;
- {
- UInt32 i = size / 2;
- do
- {
- UInt32 temp = p[i];
- UInt32 k = i;
- HeapSortDown(p, k, size, temp)
- }
- while (--i != 0);
- }
- /*
- do
- {
- UInt32 k = 1;
- UInt32 temp = p[size];
- p[size--] = p[1];
- HeapSortDown(p, k, size, temp)
- }
- while (size > 1);
- */
- while (size > 3)
- {
- UInt32 temp = p[size];
- UInt32 k = (p[3] > p[2]) ? 3 : 2;
- p[size--] = p[1];
- p[1] = p[k];
- HeapSortDown(p, k, size, temp)
- }
- {
- UInt32 temp = p[size];
- p[size] = p[1];
- if (size > 2 && p[2] < temp)
- {
- p[1] = p[2];
- p[2] = temp;
- }
- else
- p[1] = temp;
- }
-}
-
-/*
-#define HeapSortRefDown(p, vals, n, size, temp) \
- { UInt32 k = n; UInt32 val = vals[temp]; for (;;) { \
- UInt32 s = (k << 1); \
- if (s > size) break; \
- if (s < size && vals[p[s + 1]] > vals[p[s]]) s++; \
- if (val >= vals[p[s]]) break; \
- p[k] = p[s]; k = s; \
- } p[k] = temp; }
-
-void HeapSortRef(UInt32 *p, UInt32 *vals, UInt32 size)
-{
- if (size <= 1)
- return;
- p--;
- {
- UInt32 i = size / 2;
- do
- {
- UInt32 temp = p[i];
- HeapSortRefDown(p, vals, i, size, temp);
- }
- while (--i != 0);
- }
- do
- {
- UInt32 temp = p[size];
- p[size--] = p[1];
- HeapSortRefDown(p, vals, 1, size, temp);
- }
- while (size > 1);
-}
-*/
diff --git a/src/libs/7zip/unix/C/Sort.h b/src/libs/7zip/unix/C/Sort.h
deleted file mode 100644
index 65dfc6f6a..000000000
--- a/src/libs/7zip/unix/C/Sort.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Sort.h -- Sort functions
-2009-02-07 : Igor Pavlov : Public domain */
-
-#ifndef __7Z_SORT_H
-#define __7Z_SORT_H
-
-#include "Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void HeapSort(UInt32 *p, UInt32 size);
-/* void HeapSortRef(UInt32 *p, UInt32 *vals, UInt32 size); */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libs/7zip/unix/CPP/7zip/Archive/ApmHandler.cpp b/src/libs/7zip/unix/CPP/7zip/Archive/ApmHandler.cpp
deleted file mode 100644
index a3b5e19b9..000000000
--- a/src/libs/7zip/unix/CPP/7zip/Archive/ApmHandler.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-// ApmHandler.cpp
-
-#include "StdAfx.h"
-
-#include "../../../C/CpuArch.h"
-
-#include "Common/ComTry.h"
-#include "Common/IntToString.h"
-#include "Common/MyString.h"
-
-#include "Windows/PropVariant.h"
-
-#include "../Common/LimitedStreams.h"
-#include "../Common/ProgressUtils.h"
-#include "../Common/RegisterArc.h"
-#include "../Common/StreamUtils.h"
-
-#include "../Compress/CopyCoder.h"
-
-#define Get16(p) GetBe16(p)
-#define Get32(p) GetBe32(p)
-
-using namespace NWindows;
-
-namespace NArchive {
-namespace NApm {
-
-struct CItem
-{
- UInt32 StartBlock;
- UInt32 NumBlocks;
- char Name[32];
- char Type[32];
- /*
- UInt32 DataStartBlock;
- UInt32 NumDataBlocks;
- UInt32 Status;
- UInt32 BootStartBlock;
- UInt32 BootSize;
- UInt32 BootAddr;
- UInt32 BootEntry;
- UInt32 BootChecksum;
- char Processor[16];
- */
-
- bool Parse(const Byte *p, UInt32 &numBlocksInMap)
- {
- if (p[0] != 0x50 || p[1] != 0x4D || p[2] != 0 || p[3] != 0)
- return false;
- numBlocksInMap = Get32(p + 4);
- StartBlock = Get32(p + 8);
- NumBlocks = Get32(p + 0xC);
- memcpy(Name, p + 0x10, 32);
- memcpy(Type, p + 0x30, 32);
- /*
- DataStartBlock = Get32(p + 0x50);
- NumDataBlocks = Get32(p + 0x54);
- Status = Get32(p + 0x58);
- BootStartBlock = Get32(p + 0x5C);
- BootSize = Get32(p + 0x60);
- BootAddr = Get32(p + 0x64);
- if (Get32(p + 0x68) != 0)
- return false;
- BootEntry = Get32(p + 0x6C);
- if (Get32(p + 0x70) != 0)
- return false;
- BootChecksum = Get32(p + 0x74);
- memcpy(Processor, p + 0x78, 16);
- */
- return true;
- }
-};
-
-class CHandler:
- public IInArchive,
- public IInArchiveGetStream,
- public CMyUnknownImp
-{
- CMyComPtr<IInStream> _stream;
- CRecordVector<CItem> _items;
-
- int _blockSizeLog;
- UInt32 _numBlocks;
-
- HRESULT ReadTables(IInStream *stream);
- UInt64 BlocksToBytes(UInt32 i) const { return (UInt64)i << _blockSizeLog; }
- UInt64 GetItemSize(const CItem &item) { return BlocksToBytes(item.NumBlocks); }
-public:
- MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
- INTERFACE_IInArchive(;)
- STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
-};
-
-static inline int GetLog(UInt32 num)
-{
- for (int i = 0; i < 31; i++)
- if (((UInt32)1 << i) == num)
- return i;
- return -1;
-}
-
-HRESULT CHandler::ReadTables(IInStream *stream)
-{
- const UInt32 kSectorSize = 512;
- Byte buf[kSectorSize];
- {
- RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
- if (buf[0] != 0x45 || buf[1] != 0x52)
- return S_FALSE;
- _blockSizeLog = GetLog(Get16(buf + 2));
- if (_blockSizeLog < 9 || _blockSizeLog > 14)
- return S_FALSE;
- _numBlocks = Get32(buf + 4);
- for (int i = 8; i < 16; i++)
- if (buf[i] != 0)
- return S_FALSE;
- }
-
- unsigned numSkips = (unsigned)1 << (_blockSizeLog - 9);
- for (unsigned j = 1; j < numSkips; j++)
- {
- RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
- }
-
- UInt32 numBlocksInMap = 0;
- for (unsigned i = 0;;)
- {
- RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
-
- CItem item;
-
- UInt32 numBlocksInMap2;
- if (!item.Parse(buf, numBlocksInMap2))
- return S_FALSE;
- if (i == 0)
- {
- numBlocksInMap = numBlocksInMap2;
- if (numBlocksInMap > (1 << 8))
- return S_FALSE;
- }
- else if (numBlocksInMap2 != numBlocksInMap)
- return S_FALSE;
-
- UInt32 finish = item.StartBlock + item.NumBlocks;
- if (finish < item.StartBlock)
- return S_FALSE;
- _numBlocks = MyMax(_numBlocks, finish);
-
- _items.Add(item);
- for (unsigned j = 1; j < numSkips; j++)
- {
- RINOK(ReadStream_FALSE(stream, buf, kSectorSize));
- }
- if (++i == numBlocksInMap)
- break;
- }
- return S_OK;
-}
-
-STDMETHODIMP CHandler::Open(IInStream *stream,
- const UInt64 * /* maxCheckStartPosition */,
- IArchiveOpenCallback * /* openArchiveCallback */)
-{
- COM_TRY_BEGIN
- Close();
- RINOK(ReadTables(stream));
- _stream = stream;
- return S_OK;
- COM_TRY_END
-}
-
-STDMETHODIMP CHandler::Close()
-{
- _items.Clear();
- _stream.Release();
- return S_OK;
-}
-
-STATPROPSTG kProps[] =
-{
- { NULL, kpidPath, VT_BSTR},
- { NULL, kpidSize, VT_UI8},
- { NULL, kpidOffset, VT_UI8}
-};
-
-STATPROPSTG kArcProps[] =
-{
- { NULL, kpidClusterSize, VT_UI4},
- { NULL, kpidPhySize, VT_UI8}
-};
-
-IMP_IInArchive_Props
-IMP_IInArchive_ArcProps
-
-static AString GetString(const char *s)
-{
- AString res;
- for (int i = 0; i < 32 && s[i] != 0; i++)
- res += s[i];
- return res;
-}
-
-STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
-{
- COM_TRY_BEGIN
- NCOM::CPropVariant prop;
- switch(propID)
- {
- case kpidMainSubfile:
- {
- int mainIndex = -1;
- for (int i = 0; i < _items.Size(); i++)
- {
- AString s = GetString(_items[i].Type);
- if (s != "Apple_Free" &&
- s != "Apple_partition_map")
- {
- if (mainIndex >= 0)
- {
- mainIndex = -1;
- break;
- }
- mainIndex = i;
- }
- }
- if (mainIndex >= 0)
- prop = (UInt32)mainIndex;
- break;
- }
- case kpidClusterSize: prop = (UInt32)1 << _blockSizeLog; break;
- case kpidPhySize: prop = BlocksToBytes(_numBlocks); break;
- }
- prop.Detach(value);
- return S_OK;
- COM_TRY_END
-}
-
-STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
-{
- *numItems = _items.Size();
- return S_OK;
-}
-
-STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
-{
- COM_TRY_BEGIN
- NCOM::CPropVariant prop;
- const CItem &item = _items[index];
- switch(propID)
- {
- case kpidPath:
- {
- AString s = GetString(item.Name);
- if (s.IsEmpty())
- {
- char s2[32];
- ConvertUInt32ToString(index, s2);
- s = s2;
- }
- AString type = GetString(item.Type);
- if (type == "Apple_HFS")
- type = "hfs";
- if (!type.IsEmpty())
- {
- s += '.';
- s += type;
- }
- prop = s;
- break;
- }
- case kpidSize:
- case kpidPackSize:
- prop = GetItemSize(item);
- break;
- case kpidOffset: prop = BlocksToBytes(item.StartBlock); break;
- }
- prop.Detach(value);
- return S_OK;
- COM_TRY_END
-}
-
-STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
- Int32 testMode, IArchiveExtractCallback *extractCallback)
-{
- COM_TRY_BEGIN
- bool allFilesMode = (numItems == (UInt32)-1);
- if (allFilesMode)
- numItems = _items.Size();
- if (numItems == 0)
- return S_OK;
- UInt64 totalSize = 0;
- UInt32 i;
- for (i = 0; i < numItems; i++)
- totalSize += GetItemSize(_items[allFilesMode ? i : indices[i]]);
- extractCallback->SetTotal(totalSize);
-
- totalSize = 0;
-
- NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder();
- CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec;
-
- CLocalProgress *lps = new CLocalProgress;
- CMyComPtr<ICompressProgressInfo> progress = lps;
- lps->Init(extractCallback, false);
-
- CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
- CMyComPtr<ISequentialInStream> inStream(streamSpec);
- streamSpec->SetStream(_stream);
-
- for (i = 0; i < numItems; i++)
- {
- lps->InSize = totalSize;
- lps->OutSize = totalSize;
- RINOK(lps->SetCur());
- CMyComPtr<ISequentialOutStream> outStream;
- Int32 askMode = testMode ?
- NExtract::NAskMode::kTest :
- NExtract::NAskMode::kExtract;
- Int32 index = allFilesMode ? i : indices[i];
- const CItem &item = _items[index];
-
- RINOK(extractCallback->GetStream(index, &outStream, askMode));
- UInt64 size = GetItemSize(item);
- totalSize += size;
- if (!testMode && !outStream)
- continue;
- RINOK(extractCallback->PrepareOperation(askMode));
-
- RINOK(_stream->Seek(BlocksToBytes(item.StartBlock), STREAM_SEEK_SET, NULL));
- streamSpec->Init(size);
- RINOK(copyCoder->Code(inStream, outStream, NULL, NULL, progress));
- outStream.Release();
- RINOK(extractCallback->SetOperationResult(copyCoderSpec->TotalSize == size ?
- NExtract::NOperationResult::kOK:
- NExtract::NOperationResult::kDataError));
- }
- return S_OK;
- COM_TRY_END
-}
-
-STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
-{
- COM_TRY_BEGIN
- const CItem &item = _items[index];
- return CreateLimitedInStream(_stream, BlocksToBytes(item.StartBlock), GetItemSize(item), stream);
- COM_TRY_END
-}
-
-static IInArchive *CreateArc() { return new CHandler; }
-
-static CArcInfo g_ArcInfo =
- { L"APM", L"", 0, 0xD4, { 0x50, 0x4D, 0, 0, 0, 0, 0 }, 7, false, CreateArc, 0 };
-
-REGISTER_ARC(Apm)
-
-}}
diff --git a/src/libs/7zip/unix/CPP/7zip/Archive/ArjHandler.cpp b/src/libs/7zip/unix/CPP/7zip/Archive/ArjHandler.cpp
deleted file mode 100644
index 4dd686ec0..000000000
--- a/src/libs/7zip/unix/CPP/7zip/Archive/ArjHandler.cpp
+++ /dev/null
@@ -1,798 +0,0 @@
-// ArjHandler.cpp
-
-#include "StdAfx.h"
-
-#include "../../../C/CpuArch.h"
-
-#include "Common/ComTry.h"
-#include "Common/StringConvert.h"
-
-#include "Windows/PropVariant.h"
-#include "Windows/Time.h"
-
-#include "../Common/LimitedStreams.h"
-#include "../Common/ProgressUtils.h"
-#include "../Common/RegisterArc.h"
-#include "../Common/StreamObjects.h"
-#include "../Common/StreamUtils.h"
-
-#include "../Compress/ArjDecoder1.h"
-#include "../Compress/ArjDecoder2.h"
-#include "../Compress/CopyCoder.h"
-
-#include "Common/ItemNameUtils.h"
-#include "Common/OutStreamWithCRC.h"
-
-using namespace NWindows;
-
-#define Get16(p) GetUi16(p)
-#define Get32(p) GetUi32(p)
-
-namespace NArchive {
-namespace NArj {
-
-const int kBlockSizeMin = 30;
-const int kBlockSizeMax = 2600;
-
-namespace NSignature
-{
- const Byte kSig0 = 0x60;
- const Byte kSig1 = 0xEA;
-}
-
-namespace NFileHeader
-{
- namespace NCompressionMethod
- {
- enum
- {
- kStored = 0,
- kCompressed1a = 1,
- kCompressed1b = 2,
- kCompressed1c = 3,
- kCompressed2 = 4,
- kNoDataNoCRC = 8,
- kNoData = 9
- };
- }
-
- namespace NFileType
- {
- enum
- {
- kBinary = 0,
- k7BitText = 1,
- kArchiveHeader = 2,
- kDirectory = 3,
- kVolumeLablel = 4,
- kChapterLabel = 5
- };
- }
-
- namespace NFlags
- {
- const Byte kGarbled = 1;
- const Byte kVolume = 4;
- const Byte kExtFile = 8;
- const Byte kPathSym = 0x10;
- const Byte kBackup = 0x20;
- }
-
- namespace NHostOS
- {
- enum EEnum
- {
- kMSDOS = 0, // filesystem used by MS-DOS, OS/2, Win32
- // pkarj 2.50 (FAT / VFAT / FAT32 file systems)
- kPRIMOS,
- kUnix,
- kAMIGA,
- kMac,
- kOS_2,
- kAPPLE_GS,
- kAtari_ST,
- kNext,
- kVAX_VMS,
- kWIN95
- };
- }
-}
-
-struct CArchiveHeader
-{
- // Byte ArchiverVersion;
- // Byte ExtractVersion;
- Byte HostOS;
- // Byte Flags;
- // Byte SecuryVersion;
- // Byte FileType;
- // Byte Reserved;
- UInt32 CTime;
- UInt32 MTime;
- UInt32 ArchiveSize;
- // UInt32 SecurityEnvelopeFilePosition;
- // UInt16 FilespecPositionInFilename;
- // UInt16 LengthOfSecurityEnvelopeSata;
- // Byte EncryptionVersion;
- // Byte LastChapter;
- AString Name;
- AString Comment;
-
- HRESULT Parse(const Byte *p, unsigned size);
-};
-
-static HRESULT ReadString(const Byte *p, unsigned &size, AString &res)
-{
- AString s;
- for (unsigned i = 0; i < size;)
- {
- char c = (char)p[i++];
- if (c == 0)
- {
- size = i;
- res = s;
- return S_OK;
- }
- s += c;
- }
- return S_FALSE;
-}
-
-HRESULT CArchiveHeader::Parse(const Byte *p, unsigned size)
-{
- if (size < kBlockSizeMin)
- return S_FALSE;
- Byte firstHeaderSize = p[0];
- if (firstHeaderSize > size)
- return S_FALSE;
- // ArchiverVersion = p[1];
- // ExtractVersion = p[2];
- HostOS = p[3];
- // Flags = p[4];
- // SecuryVersion = p[5];
- if (p[6] != NFileHeader::NFileType::kArchiveHeader)
- return S_FALSE;
- // Reserved = p[7];
- CTime = Get32(p + 8);
- MTime = Get32(p + 12);
- ArchiveSize = Get32(p + 16);
- // SecurityEnvelopeFilePosition = Get32(p + 20);
- // UInt16 filespecPositionInFilename = Get16(p + 24);
- // LengthOfSecurityEnvelopeSata = Get16(p + 26);
- // EncryptionVersion = p[28];
- // LastChapter = p[29];
- unsigned pos = firstHeaderSize;
- unsigned size1 = size - pos;
- RINOK(ReadString(p + pos, size1, Name));
- pos += size1;
- size1 = size - pos;
- RINOK(ReadString(p + pos, size1, Comment));
- pos += size1;
- return S_OK;
-}
-
-struct CItem
-{
- AString Name;
- AString Comment;
-
- UInt32 MTime;
- UInt32 PackSize;
- UInt32 Size;
- UInt32 FileCRC;
- UInt32 SplitPos;
-
- Byte Version;
- Byte ExtractVersion;
- Byte HostOS;
- Byte Flags;
- Byte Method;
- Byte FileType;
-
- // UInt16 FilespecPositionInFilename;
- UInt16 FileAccessMode;
- // Byte FirstChapter;
- // Byte LastChapter;
-
- UInt64 DataPosition;
-
- bool IsEncrypted() const { return (Flags & NFileHeader::NFlags::kGarbled) != 0; }
- bool IsDir() const { return (FileType == NFileHeader::NFileType::kDirectory); }
- bool IsSplitAfter() const { return (Flags & NFileHeader::NFlags::kVolume) != 0; }
- bool IsSplitBefore() const { return (Flags & NFileHeader::NFlags::kExtFile) != 0; }
- UInt32 GetWinAttributes() const
- {
- UInt32 winAtrributes;
- switch(HostOS)
- {
- case NFileHeader::NHostOS::kMSDOS:
- case NFileHeader::NHostOS::kWIN95:
- winAtrributes = FileAccessMode;
- break;
- default:
- winAtrributes = 0;
- }
- if (IsDir())
- winAtrributes |= FILE_ATTRIBUTE_DIRECTORY;
- return winAtrributes;
- }
-
- HRESULT Parse(const Byte *p, unsigned size);
-};
-
-HRESULT CItem::Parse(const Byte *p, unsigned size)
-{
- if (size < kBlockSizeMin)
- return S_FALSE;
-
- Byte firstHeaderSize = p[0];
-
- Version = p[1];
- ExtractVersion = p[2];
- HostOS = p[3];
- Flags = p[4];
- Method = p[5];
- FileType = p[6];
- // Reserved = p[7];
- MTime = Get32(p + 8);
- PackSize = Get32(p + 12);
- Size = Get32(p + 16);
- FileCRC = Get32(p + 20);
- // FilespecPositionInFilename = Get16(p + 24);
- FileAccessMode = Get16(p + 26);
- // FirstChapter = p[28];
- // FirstChapter = p[29];
-
- SplitPos = 0;
- if (IsSplitBefore() && firstHeaderSize >= 34)
- SplitPos = Get32(p + 30);
-
- unsigned pos = firstHeaderSize;
- unsigned size1 = size - pos;
- RINOK(ReadString(p + pos, size1, Name));
- pos += size1;
- size1 = size - pos;
- RINOK(ReadString(p + pos, size1, Comment));
- pos += size1;
-
- return S_OK;
-}
-
-struct CInArchiveException
-{
- enum CCauseType
- {
- kUnexpectedEndOfArchive = 0,
- kCRCError,
- kIncorrectArchive
- }
- Cause;
- CInArchiveException(CCauseType cause): Cause(cause) {};
-};
-
-class CInArchive
-{
- UInt32 _blockSize;
- Byte _block[kBlockSizeMax + 4];
-
- HRESULT ReadBlock(bool &filled);
- HRESULT ReadSignatureAndBlock(bool &filled);
- HRESULT SkipExtendedHeaders();
-
- HRESULT SafeReadBytes(void *data, UInt32 size);
-
-public:
- CArchiveHeader Header;
-